/* ALL IN ONE 교실 타이머 — 기획서 v2.0의 색·모서리·글자 규칙을 따른다 */
:root {
  --paper: #fffdf6; --card: #ffffff; --ink: #1f2433; --ink2: #4b5266; --ink3: #7b8296;
  --line: #d9deea; --blue: #3558d4; --blue-soft: #e4ecfb; --sky: #bfe1fb;
  --green: #2f7d5b; --green-soft: #e3f1e8; --red: #c8452f; --red-soft: #fbe7e2; --yellow: #ffe08a; --yellow-soft: #fff3cf;
  --r: 16px; --r-sm: 10px;
  --font: "Pretendard Variable", Pretendard, "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  --num: "Segoe UI", "Pretendard Variable", Pretendard, "Noto Sans KR", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; word-break: keep-all; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1.5px solid var(--line); background: var(--card); border-radius: var(--r-sm); padding: 9px 14px; font-weight: 700; min-height: 42px; transition: background .12s, border-color .12s, transform .06s; }
button:hover { border-color: var(--ink3); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .4; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #8fa8f5; outline-offset: 2px; }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.primary:hover { background: #2a48b8; }
button.ghost { border-color: transparent; background: transparent; color: var(--ink2); font-weight: 600; }
button.ghost:hover { background: rgba(31, 36, 51, .06); }
button.danger { background: var(--red); border-color: var(--red); color: #fff; }
button.big { min-height: 64px; padding: 14px 28px; font-size: 1.15rem; border-radius: 14px; }
button.on { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
input[type=text], input[type=number], input[type=time], input[type=date], select, textarea { border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; padding: 8px 10px; min-height: 42px; }
input[type=number] { width: 4.6em; text-align: right; font-variant-numeric: tabular-nums; }
.eyebrow { font-size: .82rem; font-weight: 700; color: var(--blue); letter-spacing: .02em; }
.empty, .fine { color: var(--ink3); font-size: .92rem; }
.fine { margin-top: 10px; }
.warnmsg { color: var(--red); font-weight: 700; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.unit { display: inline-flex; align-items: center; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.chips .lab, .bellrow .lab { font-weight: 700; color: var(--ink2); min-width: 6.5em; }
.chipbtn { border-radius: 999px; padding: 7px 14px; min-height: 40px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; }
.chipbtn.on { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); font-weight: 700; }
.chipbtn input { min-height: 30px; padding: 2px 6px; }
.card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); padding: 22px; }
.card h2 { font-size: 1.2rem; margin-bottom: 14px; }
.card h3, .sheet h3 { font-size: .95rem; color: var(--blue); margin: 20px 0 8px; }

/* ── 머리띠 ── */
.top { display: flex; align-items: center; gap: 18px; padding: 12px 28px; border-bottom: 1.5px solid var(--ink); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.brand { border: 0; background: none; padding: 0; min-height: 0; font-size: 1.15rem; font-weight: 800; display: flex; gap: 8px; align-items: baseline; }
.brand span { color: var(--blue); letter-spacing: .01em; }
.top nav { display: flex; gap: 4px; }
.top nav button { border: 0; background: none; font-weight: 600; color: var(--ink2); min-height: 40px; }
.top nav button.on { color: var(--ink); background: var(--blue-soft); }
.nowclock { margin-left: auto; font: 800 1.25rem var(--num); font-variant-numeric: tabular-nums; }
.livepill { margin-left: auto; border-radius: 999px; background: var(--ink); color: #fff; border-color: var(--ink); display: flex; gap: 8px; align-items: center; }
.livepill + .nowclock { margin-left: 0; }
.livepill i { width: 9px; height: 9px; border-radius: 50%; background: #7be0a5; }
.livepill b { font-family: var(--num); font-variant-numeric: tabular-nums; }

/* ── 홈 ── */
main { max-width: 1280px; margin: 0 auto; padding: 28px; }
.hero { margin: 8px 0 24px; }
.hero h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); letter-spacing: -.01em; }
.hero p { color: var(--ink2); margin-top: 6px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px; align-items: start; }
.home-grid .today { grid-column: 1 / -1; }
.qrow { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 10px; }
.qbtn { min-height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 14px; border-color: var(--ink); background: #fff; }
.qbtn b { font-size: 1.35rem; }
.qbtn span { font-size: .8rem; color: var(--ink2); font-weight: 600; }
.qbtn.big { background: var(--sky); }
.qbtn:hover { background: var(--yellow-soft); }
.qline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.qline label { font-weight: 700; width: 4.6em; color: var(--ink2); }
.qline input[type=text] { flex: 1; min-width: 8em; }
.tpl { display: grid; gap: 8px; }
.tpl-item { display: flex; gap: 6px; }
.tpl-item button:first-child { flex: 1; text-align: left; }
#paste { width: 100%; min-height: 150px; resize: vertical; line-height: 1.7; margin-bottom: 12px; font-size: 1.02rem; }
.filebtn { display: inline-flex; align-items: center; min-height: 42px; padding: 9px 14px; border-radius: var(--r-sm); cursor: pointer; font-weight: 600; color: var(--ink2); }
.filebtn:hover { background: rgba(31, 36, 51, .06); }
.lesson-list, .today-list, .res-list, .periods, .shorts, .laps, .slist { list-style: none; margin: 0; padding: 0; }
.lesson-item { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.lesson-item b { display: block; }
.lesson-item span { color: var(--ink3); font-size: .9rem; }
.li-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.li-acts button { min-height: 38px; padding: 6px 12px; font-size: .92rem; }
.today-list li { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.today-list li b { font: 800 1.1rem var(--num); font-variant-numeric: tabular-nums; }
.today-list li span { flex: 1; min-width: 10em; }
.today-list li em { font-style: normal; font-weight: 700; font-size: .85rem; padding: 3px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); }
.today-list li.s-missed em, .today-list li.s-skipped em, .today-list li.s-off em { background: #eef0f4; color: var(--ink3); }
.today-list li.s-started em { background: var(--green-soft); color: var(--green); }
.today-list .tm { display: inline-flex; gap: 6px; align-items: center; font-size: .9rem; color: var(--ink2); }
.today-list + .chipbtn { margin: 10px 8px 0 0; }

/* ── 실행안 ── */
.plan-head { margin-bottom: 18px; }
.plan-head .title { display: block; width: 100%; font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; border: 0; border-bottom: 2px solid var(--line); border-radius: 0; padding: 4px 0; background: transparent; margin: 4px 0 8px; }
.plan-head p { color: var(--ink2); }
.plan-list { display: grid; gap: 10px; }
.st-row { background: #fff; border: 1.5px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.st-row.protected { border-color: var(--green); background: linear-gradient(90deg, var(--green-soft), #fff 26%); }
.st-row.blank { border-color: var(--red); background: var(--red-soft); }
.st-main { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.st-main .ord { display: inline-flex; flex-direction: column; gap: 2px; }
.st-main .ord button { min-height: 20px; padding: 0 6px; font-size: .62rem; border: 0; color: var(--ink3); }
.st-main .nm { flex: 1 1 11em; font-weight: 700; font-size: 1.08rem; }
.st-main .dur, .st-main .mn { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.st-main .dur input { font-weight: 800; font-size: 1.05rem; }
.st-main .mn { color: var(--ink2); font-size: .92rem; }
.st-main .mn input { width: 3.8em; }
.tog { border-radius: 999px; min-height: 38px; padding: 6px 14px; font-size: .9rem; }
.tog.on { background: var(--green); border-color: var(--green); color: #fff; }
.st-hint { margin: 8px 0 0 34px; color: var(--ink2); font-size: .92rem; }
.st-detail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0 4px 34px; padding-top: 14px; border-top: 1px dashed var(--line); }
.st-detail label { display: flex; flex-direction: column; gap: 4px; font-size: .86rem; font-weight: 700; color: var(--ink2); }
.st-detail label.wide { grid-column: span 2; }
.st-detail label.memo { grid-column: 1 / -1; }
.st-detail label.check { flex-direction: row; align-items: center; gap: 8px; grid-column: span 2; }
.st-detail input[type=text], .st-detail select, .st-detail textarea { width: 100%; font-weight: 500; color: var(--ink); }
.st-detail .unit input[type=number] { width: 5em; }
.addbtn { margin-top: 10px; border-style: dashed; width: 100%; color: var(--ink2); }
.plan-foot { position: sticky; bottom: 0; margin-top: 20px; padding: 16px 20px; background: #fff; border: 1.5px solid var(--ink); border-radius: var(--r) var(--r) 0 0; display: grid; gap: 12px; box-shadow: 0 -8px 24px rgba(31, 36, 51, .08); }
.bellrow, .acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sum { font-size: 1.08rem; }
.sum em, .p-times .ok, .p-times .over { font-style: normal; font-weight: 700; }
.sum .ok, .p-times .ok { color: var(--green); }
.sum .over, .p-times .over { color: var(--red); }

/* ── 수업 중 ── */
body[data-view=run] { overflow: hidden; }
.run { display: grid; grid-template-columns: minmax(0, 1fr) clamp(340px, 30vw, 440px); height: 100vh; }
.stagewrap { position: relative; padding: 16px; background: #eef1f7; min-width: 0; }
.stagewrap .cv { width: 100%; height: 100%; border-radius: 18px; border: 1.5px solid var(--ink); }
#panel { border-left: 1.5px solid var(--ink); background: var(--paper); overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.p-head h2 { font-size: 1.35rem; line-height: 1.3; }
.p-times { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; color: var(--ink2); font-size: .95rem; }
.p-times b { color: var(--ink); font-family: var(--num); font-variant-numeric: tabular-nums; }
.p-ctl { display: flex; flex-wrap: wrap; gap: 8px; }
.p-ctl.center { justify-content: center; }
.ctl { min-height: 64px; font-size: 1.08rem; border-radius: 14px; border-color: var(--ink); flex: 1 1 28%; }
.ctl.primary { flex: 1 1 100%; font-size: 1.3rem; min-height: 72px; }
.p-ctl.center .ctl { flex: 0 1 auto; }
.ext-row { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.adj { border: 2px solid var(--ink); border-radius: var(--r); background: #fff; padding: 14px; display: grid; gap: 10px; box-shadow: 4px 4px 0 var(--yellow); }
.adj-h { font-weight: 800; font-size: 1.08rem; }
.opt { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; text-align: left; min-height: 64px; padding: 12px 14px; border-radius: 12px; }
.opt b { font-size: 1.02rem; }
.opt span { grid-column: 1; font-weight: 500; font-size: .9rem; color: var(--ink2); }
.opt em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; font: 800 1.1rem var(--num); white-space: nowrap; }
.opt.primary span { color: #dbe4ff; }
.adj-none { color: var(--ink2); font-size: .92rem; }
.adj-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .82rem; color: var(--ink3); }
.adj-foot .chipbtn { min-height: 30px; padding: 3px 10px; font-size: .82rem; }
.kind { border: 1.5px solid var(--line); border-radius: var(--r); background: #fff; padding: 14px; display: grid; gap: 10px; }
.kind h3 { font-size: .95rem; color: var(--blue); }
.krow { display: flex; flex-wrap: wrap; gap: 8px; }
.k { min-height: 64px; flex: 1 1 8em; }
.kinfo { font-size: .9rem; color: var(--ink2); }
.queue { display: flex; flex-wrap: wrap; gap: 6px; }
.q { padding: 4px 12px; border-radius: 999px; border: 1.5px solid var(--line); font-weight: 600; font-size: .9rem; }
.q.cur { background: var(--blue); border-color: var(--blue); color: #fff; }
.q.done { color: var(--ink3); background: #f1f3f7; text-decoration: line-through; }
.q.passed { color: var(--ink3); border-style: dashed; }
.warnbox { background: var(--red-soft); border: 1.5px solid var(--red); border-radius: 12px; padding: 10px 12px; font-size: .92rem; font-weight: 600; }
.warnbox button { min-height: 34px; padding: 4px 10px; margin-left: 6px; }
.savebox { background: var(--yellow-soft); border: 1.5px solid #e9c758; border-radius: 12px; padding: 10px 12px; font-size: .92rem; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.savebox button { white-space: nowrap; min-height: 44px; }
.gtable { width: 100%; border-collapse: collapse; }
.gtable th { text-align: left; padding: 8px 8px 8px 0; white-space: nowrap; }
.gtable td { padding: 8px 0; font-size: .92rem; }
.gtable tr + tr th, .gtable tr + tr td { border-top: 1px solid var(--line); }
.btns { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; align-items: center; }
.glist { display: grid; }
.grow { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; padding: 10px 0; }
.grow + .grow { border-top: 1px solid var(--line); }
.gname { font-weight: 700; white-space: nowrap; }
.gname b { display: block; font: 800 1.15rem var(--num); font-variant-numeric: tabular-nums; }
.grow.s-help .gname { color: var(--red); }
.grow.s-done .gname { color: var(--green); }
.grow select { min-height: 36px; padding: 4px 6px; font-size: .86rem; flex: 1 1 100%; }
button.mini { min-height: 36px; padding: 4px 10px; font-size: .85rem; }
button.mini.help.on { background: var(--red); border-color: var(--red); color: #fff; }
.memo { background: var(--yellow-soft); border-radius: 12px; padding: 10px 12px; }
.memo p { white-space: pre-wrap; margin-top: 2px; }
.slist { display: grid; gap: 4px; }
.sl { display: grid; grid-template-columns: 26px 1fr auto auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; font-size: .94rem; }
.sl .n { width: 24px; height: 24px; border-radius: 50%; background: #e9ecf3; display: grid; place-items: center; font-size: .8rem; font-weight: 800; }
.sl .tm { color: var(--ink2); font-variant-numeric: tabular-nums; }
.sl.cur { background: var(--blue-soft); font-weight: 700; }
.sl.cur .n { background: var(--blue); color: #fff; }
.sl.done { color: var(--ink3); }
.sl.done .n { background: var(--green-soft); color: var(--green); }
.sl .lock { font-style: normal; font-size: .72rem; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-weight: 700; }
.sl .mini { min-height: 30px; padding: 2px 9px; font-size: .78rem; color: var(--ink2); } /* 터치 칠판에는 hover가 없으므로 늘 보인다 */
.p-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 8px; }
.p-tools button { min-height: 48px; font-size: .94rem; }
.boardbar { display: none; }
.run.board-mode { grid-template-columns: 1fr; }
.run.board-mode #panel { display: none; }
.run.board-mode .stagewrap { padding: 0; }
.run.board-mode .stagewrap .cv { border: 0; border-radius: 0; }
.run.board-mode .boardbar { display: flex; gap: 10px; position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); opacity: .28; transition: opacity .2s; padding: 8px; border-radius: 20px; background: rgba(255, 255, 255, .85); }
.run.board-mode .boardbar:hover, .run.board-mode .boardbar:focus-within { opacity: 1; }
.run.board-mode .has-extra .cv-body { padding-bottom: 14cqh; }
.boardbar button { min-width: 96px; min-height: 64px; font-size: 1.05rem; border-color: var(--ink); }

/* ── 학생이 보는 화면 ── */
.cv { position: relative; container-type: size; overflow: hidden; background: var(--cv-plain) center / cover no-repeat; color: var(--cv-ink); font-family: var(--font);
  --cv-ink: #1f2433; --cv-plain: #bfe1fb; --c-fill: #6e8fea; --c-fill2: #6e8fea; --c-empty: #e6ecf8; --c-face: #fff; --c-rim: #1f2433; --chip-bg: #ffe08a; --chip-ink: #1f2433; --row-bg: #fff; }
.cv.theme-sticker { background-image: url(../assets/bg-sticker.png); }
.cv.theme-water { background-image: url(../assets/bg-water.png); --cv-plain: #f8eedb; --c-fill: #5e9e7c; --c-fill2: #86b99a; --c-empty: #efe6d3; --c-rim: #3c4a3f; --chip-bg: #dfeccf; }
.cv.theme-pastel { background-image: url(../assets/bg-pastel.png); --cv-plain: #fbd3d4; --c-fill: #cf4f3c; --c-fill2: #f0a04b; --c-empty: #fff7ea; --c-rim: #5a2c22; --chip-bg: #ffe9a8; }
.cv.theme-board { background: #24334f; --cv-plain: #24334f; --cv-ink: #fff; --c-fill: #bfd0ff; --c-fill2: #bfd0ff; --c-empty: #3b4c70; --c-face: #24334f; --c-rim: #55678f; --chip-bg: #3b4c70; --chip-ink: #fff; --row-bg: rgba(255, 255, 255, .08); }
.cv-chip { position: absolute; top: 5cqh; left: 4.5cqw; z-index: 2; background: var(--chip-bg); color: var(--chip-ink); font-weight: 800; font-size: clamp(11px, 1.9cqw, 40px); padding: .35em 1.2em; border-radius: 999px; }
.cv.is-warn .cv-chip { background: #ffd0a8; color: #1f2433; }
.cv.is-done .cv-chip { background: #d8ecdf; color: #1f2433; }
.cv.is-paused .cv-chip { background: #fff; color: #1f2433; }
.cv-body { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3cqh; padding: 8cqh 4cqw 6cqh; }
.cv-main { display: grid; grid-template-columns: auto auto auto; align-items: center; justify-content: center; column-gap: 3cqw; row-gap: 2.5cqh; max-width: 100%; }
.cv-clock { width: min(27cqw, 56cqh); aspect-ratio: 1; }
.cv-clock svg { display: block; width: 100%; height: 100%; }
.form-blocks .cv-clock { width: min(34cqw, 80cqh); aspect-ratio: 250 / 120; }
.form-bar .cv-main, .form-strip .cv-main { grid-template-columns: auto auto; }
.form-bar .cv-clock, .form-strip .cv-clock { grid-row: 2; grid-column: 1 / -1; width: min(74cqw, 100%); min-width: 60cqw; aspect-ratio: auto; }
.form-digital .cv-clock { display: none; }
.form-digital .cv-main { grid-template-columns: auto auto; }
/* 글자 뒤에는 배경의 바탕색을 한 겹 깔아, 좁은 화면에서도 그림 위에 글자가 얹히지 않게 한다 */
.cv-text { padding: 2cqh 1.5cqw; margin: -2cqh -1.5cqw; border-radius: 3cqmin; background: radial-gradient(ellipse closest-side, color-mix(in srgb, var(--cv-plain) 88%, transparent) 62%, transparent 100%); }
.cv.theme-board .cv-text { background: none; }
.cv-name, .cv-line, .cv-next { max-width: 44cqw; }
.cv-name { font-weight: 800; font-size: clamp(14px, 3.5cqw, 90px); line-height: 1.25; }
.cv-time { font: 800 min(13cqw, 29cqh) / 1.05 var(--num); font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.form-digital .cv-time { font-size: min(20cqw, 42cqh); }
.num-min .cv-time { font-size: min(10cqw, 24cqh); }
.num-hide .cv-time { display: none; }
.cv.is-idle .cv-time { font-size: min(16cqw, 34cqh); }
.cv-line { font-weight: 800; font-size: clamp(13px, 3.1cqw, 80px); margin-top: .5cqh; line-height: 1.3; }
.num-hide .cv-line { font-size: clamp(16px, 5cqw, 120px); margin-top: 1cqh; }
.cv-next { font-weight: 600; font-size: clamp(10px, 1.9cqw, 46px); opacity: .8; margin-top: 1cqh; }
.cv-next i { font-style: normal; }
.cv-pic { height: min(27cqh, 15cqw); width: auto; max-width: 16cqw; object-fit: contain; align-self: end; filter: drop-shadow(0 .5cqmin .8cqmin rgba(31, 36, 51, .18)); }
.cv.theme-board .cv-pic { display: none; } /* 조용한 칠판은 그림 없이 */
.cv.is-paused .cv-clock, .cv.is-paused .cv-time { opacity: .55; }
.ck-rim { fill: var(--c-face); stroke: var(--c-rim); stroke-width: 3; }
.ck-tick { stroke: var(--c-rim); stroke-width: 1.2; stroke-linecap: round; opacity: .75; }
.ck-tick.maj { stroke-width: 2.4; opacity: 1; }
.ck-empty { fill: var(--c-empty); }
.ck-fill { fill: var(--c-fill); }
.ck-hand { stroke: var(--c-rim); stroke-width: 2.4; stroke-linecap: round; }
.ck-pin { fill: var(--c-rim); }
.ck-check { fill: none; stroke: #2f7d5b; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.theme-board .ck-check { stroke: #9be3bd; }
.ck-ring .ck-rim { stroke-width: 2; }
.ck-track { fill: none; stroke: var(--c-empty); stroke-width: 24; }
.ck-arc { fill: none; stroke: var(--c-fill); stroke-width: 24; }
.ck-cell { fill: var(--c-empty); }
.ck-cellfill { fill: color-mix(in srgb, var(--c-fill2) calc(var(--i) * 25%), var(--c-fill)); }
.ck-cellrim { fill: none; stroke: var(--c-rim); stroke-width: 2.2; }
.ck-bar { height: max(10px, 3.2cqh); border-radius: 999px; background: var(--c-empty); border: .35cqmin solid var(--c-rim); overflow: hidden; }
.ck-bar i { display: block; height: 100%; background: var(--c-fill); border-radius: 999px; }
.ck-strip { display: flex; gap: .8cqw; }
.ck-strip .seg { position: relative; height: max(12px, 4.5cqh); border-radius: 1.2cqmin; background: var(--c-empty); border: .3cqmin solid var(--c-rim); margin-bottom: 4.2cqh; min-width: 0; }
.ck-strip .seg i { position: absolute; inset: 0 auto 0 0; background: var(--c-fill); border-radius: inherit; }
.ck-strip .seg.todo i { opacity: .45; }
.ck-strip .seg span { position: absolute; top: calc(100% + .8cqh); left: 0; right: 0; text-align: center; font-size: clamp(9px, 1.5cqw, 34px); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .7; }
.ck-strip .seg.cur span { opacity: 1; }
/* 모둠 표가 함께 나올 때는 시계를 줄이고 아래에 표를 둔다 */
.has-extra .cv-body { gap: 2cqh; padding-top: 12cqh; }
.has-extra .cv-clock { width: min(15cqw, 26cqh); }
.has-extra.form-blocks .cv-clock { width: min(20cqw, 40cqh); }
.has-extra .cv-time { font-size: min(8cqw, 15cqh); }
.has-extra .cv-name { font-size: clamp(12px, 2.6cqw, 60px); }
.has-extra .cv-line { font-size: clamp(11px, 2.2cqw, 50px); }
.cv-rows { display: grid; gap: 1.4cqh; width: min(86cqw, 100%); }
.cv-row { display: grid; grid-template-columns: 1.1fr 2.6em 1.2fr 4.2em 1.2fr 3.6em; align-items: center; column-gap: 2cqw; background: var(--row-bg); border: .35cqmin solid var(--c-rim); border-radius: 2.4cqmin; padding: 1.4cqh 2.6cqw; font-size: clamp(10px, min(2.9cqw, 5.4cqh), 70px); }
.cv-rows.many { grid-template-columns: 1fr 1fr; column-gap: 1.6cqw; width: min(92cqw, 100%); }
.cv-rows.many .cv-row { font-size: clamp(10px, min(2cqw, 4.6cqh), 50px); column-gap: 1cqw; padding: 1.2cqh 1.4cqw; }
.cv-row b { font-weight: 800; }
.cv-row strong { font-weight: 800; color: var(--blue); }
.theme-board .cv-row strong { color: #bfd0ff; }
.cv-row strong.mv { grid-column: 3 / 6; white-space: nowrap; }
.cv-row .lab, .cv-row .arr { font-size: .62em; font-weight: 700; opacity: .7; white-space: nowrap; }
.cv-row .nx { font-weight: 700; }
.cv-row em { font-style: normal; font-size: .58em; font-weight: 800; padding: .2em .8em; border-radius: 999px; }
.cv-row.m-ready em { background: #ffe08a; color: #1f2433; }
.cv-row.m-done em { background: #cfe9d9; color: #1f2433; }
.cv-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(22cqw, 1fr)); gap: 1.6cqh 1.6cqw; width: min(88cqw, 100%); }
.cv-card { background: var(--row-bg); border: .35cqmin solid var(--c-rim); border-radius: 2.4cqmin; padding: 1.6cqh 1.8cqw; display: grid; grid-template-columns: 1fr auto; gap: .4cqh 1cqw; align-items: center; font-size: clamp(10px, min(2.4cqw, 4.6cqh), 60px); }
.cv-card b { font-weight: 800; }
.cv-card .st { justify-self: end; font-size: .62em; font-weight: 800; padding: .2em .8em; border-radius: 999px; background: var(--c-empty); }
.cv-card .gt { font: 800 1.5em / 1.1 var(--num); font-variant-numeric: tabular-nums; }
.cv-card .task { grid-column: 1 / -1; font-size: .72em; font-weight: 700; color: var(--blue); }
.theme-board .cv-card .task { color: #bfd0ff; }
.cv-card.s-done { border-color: #2f7d5b; }
.cv-card.s-done .st { background: #cfe9d9; color: #1f2433; }
.cv-card.s-help { border-color: #c8452f; }
.cv-card.s-help .st { background: #c8452f; color: #fff; }
.cv-card.paused .gt { opacity: .5; }

body.student { overflow: hidden; background: #111; }
body.student .cv { position: fixed; inset: 0; }
.stu-tools { position: fixed; right: 14px; bottom: 14px; display: flex; gap: 8px; opacity: .2; transition: opacity .2s; }
.stu-tools:hover, .stu-tools:focus-within { opacity: 1; }

/* ── 미니 위젯 ── */
.pip-body { margin: 0; height: 100vh; background: #fff; }
.pip-body #widget, .pip-body .wg { height: 100%; }
/* 설치판 위젯 창: 창틀이 없으므로 윗줄을 잡고 옮긴다 */
.desk-widget { overflow: hidden; }
.desk-widget .wg { border: 1.5px solid var(--ink); }
.desk-widget .wg-top { -webkit-app-region: drag; }
.desk-widget button, .desk-widget input { -webkit-app-region: no-drag; }
.miniwin { position: fixed; z-index: 40; width: 320px; border-radius: 16px; border: 1.5px solid var(--ink); box-shadow: 0 10px 30px rgba(31, 36, 51, .25); overflow: hidden; touch-action: none; }
.miniwin.corner-br { right: 20px; bottom: 20px; } .miniwin.corner-bl { left: 20px; bottom: 20px; }
.miniwin.corner-tr { right: 20px; top: 20px; } .miniwin.corner-tl { left: 20px; top: 20px; }
.miniwin.dragging { opacity: .85; }
.wg { background: #fff; color: var(--ink); padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; font-family: var(--font); container-type: inline-size; }
.wg-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; cursor: grab; }
.wg-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-bell { color: var(--ink3); white-space: nowrap; }
.wg-mid { display: flex; align-items: baseline; gap: 10px; flex: 1; min-height: 0; }
.wg-time { font: 800 clamp(30px, 17cqw, 96px) / 1 var(--num); font-variant-numeric: tabular-nums; }
.wg-line { font-size: 13px; font-weight: 700; color: var(--blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg.is-warn .wg-time { color: var(--red); }
.wg.is-done .wg-time { color: var(--green); }
.wg.is-paused .wg-time { opacity: .5; }
.wg-bar { height: 6px; border-radius: 999px; background: #e6ecf8; overflow: hidden; }
.wg-bar i { display: block; height: 100%; background: #6e8fea; border-radius: 999px; }
.wg-btns { display: flex; gap: 6px; }
.wg-btns button { flex: 1; min-height: 44px; padding: 4px 6px; font-size: 14px; white-space: nowrap; }
.wg-btns button.main { background: var(--ink); border-color: var(--ink); color: #fff; flex: 1.4; }
.wg-btns [data-act=wg-menu] { flex: 0 0 40px; }
.wg-menu { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; font-weight: 700; }
.wg-menu button { min-height: 34px; padding: 3px 9px; font-size: 13px; }
.wg-menu .in { display: inline-flex; align-items: center; gap: 4px; }
.wg-menu input { min-height: 34px; width: 3.6em; padding: 2px 6px; }

/* ── 수업 후 ── */
.review h1, .swv h1 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); margin: 4px 0; }
.review > p { color: var(--ink2); }
.rv { width: 100%; border-collapse: collapse; margin: 22px 0; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r); overflow: hidden; }
.rv th, .rv td { padding: 14px 16px; text-align: left; border-top: 1px solid var(--line); white-space: nowrap; }
.rv tr:first-child th, .rv tr:first-child td { border-top: 0; }
.rv .bars { width: 40%; }
.rv .bars i { display: block; height: 10px; border-radius: 999px; margin: 3px 0; min-width: 4px; }
.rv .bars .plan { background: #cfd6e6; }
.rv .bars .act { background: var(--blue); }
.rv .bars .act.over { background: var(--red); }
.rv .bars .act.under { background: var(--green); }
.rv td.over { color: var(--red); font-weight: 800; }
.rv td.under { color: var(--green); font-weight: 800; }
.rv td.same, .rv td.sub { color: var(--ink3); }

/* ── 시간표·예약 ── */
.sched { display: grid; gap: 20px; }
.res { border-top: 1px solid var(--line); padding: 14px 0; display: grid; gap: 10px; }
.res.off { opacity: .55; }
.res-top, .res-mid { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.res-top input[type=text] { flex: 1; min-width: 8em; font-weight: 700; }
.days { display: inline-flex; gap: 4px; }
.day { min-width: 42px; padding: 6px 0; border-radius: 50%; }
.res-lines { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.res-lines label, .ttform label { display: flex; flex-direction: column; gap: 4px; font-size: .86rem; font-weight: 700; color: var(--ink2); }
.res-lines input { font-weight: 500; }
.ttform { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.periods { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.periods li { background: var(--blue-soft); border-radius: 999px; padding: 5px 14px; font-variant-numeric: tabular-nums; }
.shorts li { padding: 6px 0; }

/* ── 스톱워치 ── */
.swv { text-align: center; padding-top: 6vh; }
.sw-time { font: 800 clamp(4rem, 16vw, 13rem) / 1.1 var(--num); font-variant-numeric: tabular-nums; margin: 2vh 0 4vh; }
.swv .ctl { min-width: 150px; }
.laps { max-width: 520px; margin: 28px auto 0; text-align: left; }
.laps li { display: grid; grid-template-columns: 5em 1fr auto; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.laps span { font-weight: 800; }
.laps em { font-style: normal; color: var(--ink3); }

/* ── 설정·알림 ── */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(31, 36, 51, .45); display: flex; justify-content: flex-end; }
.sheet { width: min(560px, 100%); height: 100%; overflow-y: auto; background: var(--paper); border-left: 1.5px solid var(--ink); padding: 22px 24px 40px; }
.sheet-h { display: flex; justify-content: space-between; align-items: center; }
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme { display: grid; gap: 2px; text-align: left; padding: 8px; border-radius: 14px; }
.theme i { display: block; aspect-ratio: 16 / 7; border-radius: 8px; background: center / cover no-repeat; margin-bottom: 4px; }
.theme.t-sticker i { background-image: url(../assets/bg-sticker.png); }
.theme.t-water i { background-image: url(../assets/bg-water.png); }
.theme.t-pastel i { background-image: url(../assets/bg-pastel.png); }
.theme.t-board i { background: #24334f; }
.theme span { font-size: .8rem; font-weight: 500; color: var(--ink3); }
.range { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink2); }
.proposal { position: fixed; z-index: 70; left: 50%; top: 16px; transform: translateX(-50%); width: min(720px, calc(100% - 32px)); background: #fff; border: 2px solid var(--ink); border-radius: var(--r); box-shadow: 4px 4px 0 var(--yellow); padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.proposal > div { flex: 1; min-width: 14em; }
.proposal b { display: block; }
.proposal span { color: var(--ink2); font-size: .94rem; }
.proposal button { min-height: 56px; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; max-width: calc(100% - 32px); }

@media (max-width: 980px) {
  .home-grid { grid-template-columns: 1fr; }
  .run { grid-template-columns: 1fr; grid-template-rows: 52vh 1fr; }
  .run.board-mode { grid-template-rows: 1fr; }
  #panel { border-left: 0; border-top: 1.5px solid var(--ink); }
  .st-detail { grid-template-columns: 1fr 1fr; margin-left: 0; }
  .st-hint { margin-left: 0; }
  .res-lines { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; padding: 10px 16px; }
  main { padding: 18px 16px; }
  .qrow { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
