/* 정태혁 통합과학 lab — 디자인: DESIGN.md (소나무 색, Noto 글꼴)
   틀: 색이 든 벽(사이드바) 위에 흰 종이(시트)를 8px 안쪽에 놓는다. 그림자 없음. */
@font-face {
  font-family: "Noto Sans KR"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/NotoSansKR-var.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Serif KR"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/NotoSerifKR-600.woff2") format("woff2");
}
/* 로고 옆 글씨 (시안 8, Hahmlet) · 장소 세로 이름 (Shippori Mincho): 필요한 글자만 담은 작은 파일 */
@font-face {
  font-family: "Hahmlet Brand"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/Hahmlet-600-brand.woff2") format("woff2");
}
@font-face {
  font-family: "Shippori Place"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/ShipporiMincho-600-place.woff2") format("woff2");
}
:root {
  /* 흰 종이 + 아주 옅은 회색 벽, 포인트는 소나무 초록 하나 (회색은 초록 쪽으로 아주 살짝 기울임) */
  --frame: #f2f3f2; --sheet: #ffffff; --raised: #f4f5f4; --active: #e8eae9;
  --edge: #e1e4e2; --rule: #eceeed; --control: #8b918e;
  --ink: #161917; --muted: #59605c; --faint: #6a716d;
  --accent: #2c6852; --accent-soft: #e3ebe4; --accent-ink: #1d4a3a;
  --font-ui: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-display: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;   /* 제목도 고딕 (로고 글씨만 Hahmlet) */
  /* 기존 템플릿이 쓰는 이름 → 새 색 */
  --bg: var(--raised); --surface: var(--sheet); --text: var(--ink); --border: var(--edge);
  --danger: #b3261e; --danger-soft: #f9e7e4;
  --ok: #2c6852; --ok-soft: #e2ede7;
  --warn: #6e4510; --warn-soft: #f8f0de;
  --radius: 8px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--frame); color: var(--text);
  font-family: var(--font-ui); font-size: 15px; line-height: 1.6;
  word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); color: var(--accent-ink); }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1 { font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.3; letter-spacing: -0.02em; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* ---------- 틀 ---------- */
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 12px 16px 16px; overflow-y: auto; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 0 8px 22px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .logo, .auth-brand .logo { height: 22px; width: auto; display: block; fill: currentColor; }
.brand span, .auth-brand span { font-family: "Hahmlet Brand", var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: -0.02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; color: var(--muted); white-space: nowrap; }
.nav a .count { margin-left: auto; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav a:hover { background: color-mix(in srgb, var(--active) 60%, transparent); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--active); color: var(--accent-ink); font-weight: 600; }
.nav .count { font-size: 12px; font-weight: 600; color: var(--accent-ink); }
.side-foot { margin-top: auto; padding: 20px 8px 0; display: grid; gap: 14px; }
.affil { height: 13px; width: auto; display: block; }
.userbox { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.userbox a { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet { margin: 8px 8px 8px 0; background: var(--sheet); border: 1px solid var(--edge); border-radius: 16px; min-width: 0; }
.container { padding: 28px 32px 64px; max-width: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }

.card { background: var(--sheet); border: 1px solid var(--edge); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat .num { font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums; }
.stat .label { color: var(--muted); font-size: 13px; }

/* 표 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 400; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.inactive td { color: var(--muted); }

/* 폼 */
label { display: block; font-size: 13px; color: var(--ink); font-weight: 500; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search],
select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--control); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit;
}
textarea { min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.field { margin-bottom: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1; min-width: 140px; }
.row > .field.shrink { flex: 0 0 auto; min-width: 0; }
.row > .field.wide { flex: 3; }
.mt { margin-top: 14px; }
.inline-form { display: inline; }
input.score { width: 90px; text-align: right; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--control);
  background: var(--sheet); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.btn:hover { text-decoration: none; background: var(--raised); border-color: var(--ink); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--sheet)); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn.link { border: none; background: none; color: var(--accent-ink); padding: 0; min-height: 0; }

/* 알림/배지 */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-weight: 500; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.error { background: var(--danger-soft); color: var(--danger); }
.flash.inapp { background: var(--accent-soft); color: var(--accent-ink); margin: 0; border-radius: 0;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flash.inapp p { margin: 0; flex: 1 1 200px; }
.notice-box { background: var(--warn-soft); color: var(--warn); padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 12px; font-weight: 500;
  background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap; }
.badge.open { background: var(--warn-soft); color: var(--warn); }
.badge.answered { background: var(--ok-soft); color: var(--ok); }
.badge.gray { background: var(--bg); color: var(--muted); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.tabs a:hover { text-decoration: none; color: var(--text); }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); }
.pagination span.current { background: var(--ink); color: var(--sheet); border-color: var(--ink); }

details > summary { cursor: pointer; color: var(--accent); margin-bottom: 10px; }
.note { background: var(--raised); border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
.answer { background: var(--accent-soft); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
.question-img { max-width: 100%; max-height: 480px; border-radius: 8px; border: 1px solid var(--border); }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 22px; letter-spacing: 1px;
  background: var(--bg); padding: 10px 14px; border-radius: 8px; display: inline-block; }

/* 차트 */
.chart { width: 100%; height: auto; }
.chart .grid-line { stroke: var(--border); }
.chart .line { stroke: var(--accent); fill: none; stroke-width: 2; }
.chart .dot { fill: var(--accent); }
.chart text { fill: var(--muted); font-size: 11px; }

.auth-wrap { max-width: 420px; margin: 0 auto; padding: 8vh 16px 48px; display: grid; gap: 18px; }
.auth-wrap .card { padding: 28px; margin: 0; }
.auth-wrap .card h1 { margin-bottom: 6px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink); }
.auth-brand:hover { text-decoration: none; }
.auth-brand .logo { height: 28px; }
.auth-affil { height: 14px; width: auto; justify-self: center; margin-top: 4px; }
.auth-wrap .btn.primary { width: 100%; min-height: 44px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; padding: 12px 16px 0; overflow: visible; }
  .brand { flex-direction: row; align-items: center; gap: 10px; padding: 4px 0 10px; }
  .brand .logo { height: 18px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 10px; scrollbar-width: none; }
  .nav a { height: 40px; flex: none; }
  .side-foot { margin: 0; padding: 0 0 12px; }
  .side-foot .affil { display: none; }
  .sheet { margin: 0; border-radius: 16px 16px 0 0; }
  .container { padding: 20px 16px 56px; }
}

/* ---------- 질답 · 공지 · 자료 ---------- */
.hidden { display: none !important; }
.center { text-align: center; }
.guide { background: var(--bg); border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
.guide ul { margin: 6px 0 0; padding-left: 18px; }
.followup { border: 1px dashed var(--border); border-radius: 8px; padding: 12px 14px; margin: 0 0 10px 24px; }
.badge.type { background: var(--accent-soft); color: var(--accent); }
.badge.tag-notice { background: var(--bg); color: var(--muted); }
.badge.tag-errata { background: var(--danger-soft); color: var(--danger); }
.badge.tag-schedule { background: var(--ok-soft); color: var(--ok); }
.badge.tag-exam { background: var(--warn-soft); color: var(--warn); }
.badge.tag-material { background: var(--accent-soft); color: var(--accent); }
.file-kind { display: inline-block; min-width: 38px; padding: 1px 6px; border-radius: 4px; font-size: 11px;
  font-weight: 700; text-align: center; color: var(--ink); background: var(--raised); border: 1px solid var(--edge); }
.file-row, .video-row { display: flex; gap: 12px; align-items: center; padding: 10px 4px; color: var(--text);
  border-bottom: 1px solid var(--border); }
.file-row:last-child, .video-row:last-child { border-bottom: none; }
.file-row:hover, .video-row:hover { text-decoration: none; background: var(--bg); }
.file-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.thumb { width: 128px; height: 72px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; background: var(--bg); }
.thumb-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 22px; }
.thumb-drive { background: color-mix(in srgb, #1fa463 16%, var(--sheet)); color: #1a8a53; }
.src-chip { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 8px; }
.src-yt { background: color-mix(in srgb, #e5332a 14%, var(--sheet)); color: #c4271f; }
.src-drive { background: color-mix(in srgb, #1fa463 15%, var(--sheet)); color: #1a8a53; }
.news-card { display: flex; flex-direction: column; gap: 4px; color: var(--text); }
.news-card:hover { text-decoration: none; border-color: var(--accent); }

/* ---------- 접속 기록 ---------- */
.streak { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.week { display: flex; gap: 6px; }
.day { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border); display: flex;
  align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.day.done { background: var(--accent); border-color: var(--accent); color: var(--sheet); }
.day.today { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 미니게임 ---------- */
.game-card { display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.game-card:hover { text-decoration: none; border-color: var(--accent); }
.game-icon { font-size: 15px; font-weight: 700; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.game { min-height: 260px; }
.game-bar { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 14px; }
.strand-wrap { overflow-x: auto; padding-bottom: 6px; }
.strand { display: flex; gap: 4px; margin-bottom: 6px; align-items: center; }
.strand .end { width: 26px; color: var(--muted); font-size: 13px; text-align: center; flex: 0 0 auto; }
.strand .cell { width: 34px; height: 40px; flex: 0 0 auto; border-radius: 2px; border: 1px solid transparent; display: flex; align-items: center;
  justify-content: center; font-weight: 700; background: var(--bg); color: var(--muted); }
.strand .cell.cursor { outline: 2px solid var(--accent); }
.strand .cell.ok { box-shadow: inset 0 -4px 0 var(--ok); }
.strand .cell.wrong { box-shadow: inset 0 -4px 0 var(--danger); }
.base-A { background: #F6C0A8 !important; color: #231F20 !important; border: 1px solid #808080 !important; }
.base-T { background: #BFD9A6 !important; color: #231F20 !important; border: 1px solid #808080 !important; }
.base-G { background: #B9D3EC !important; color: #231F20 !important; border: 1px solid #808080 !important; }
.base-C { background: #D9C6E6 !important; color: #231F20 !important; border: 1px solid #808080 !important; }
.base-pad { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.base { width: 64px; height: 64px; border-radius: 4px; border: none; font-size: 24px; font-weight: 800;
  cursor: pointer; }
.base-back { background: var(--bg); color: var(--text); }
.mc-question { font-size: 17px; font-weight: 600; }
.mc-choices { display: flex; flex-direction: column; gap: 8px; }
.mc-choice { text-align: left; justify-content: flex-start; white-space: normal; padding: 12px 14px; line-height: 1.5; }
.mc-choices.kind-ox .mc-choice, .mc-choices.kind-tf .mc-choice, .mc-choices.kind-pick .mc-choice, .mc-choices.kind-fill .mc-choice { justify-content: center; }
.review-item { border-bottom: 1px solid var(--rule); padding: 8px 0; margin: 0; }
.review-item.wrong b { color: var(--danger); }
@media (max-width: 640px) {
  .strand .cell { width: 26px; height: 34px; }
  .base { width: 56px; height: 56px; }
  .thumb { width: 96px; height: 54px; }
}

.consent { display: flex; gap: 6px; align-items: center; margin-top: 8px; color: var(--text); font-size: 14px; }
.join-code { font-family: ui-monospace, Consolas, monospace; font-size: 22px; letter-spacing: 3px; font-weight: 700; }
.badge.danger { background: var(--danger-soft); color: var(--danger); }

/* 격자 안의 카드는 간격을 격자가 맡는다 */
.grid { margin-bottom: 16px; }
.grid > .card { margin-bottom: 0; }
.page-head form.row { flex-wrap: nowrap; align-items: center; }
.page-head form.row input { width: 260px; }
@media (max-width: 640px) {
  .page-head form.row { width: 100%; }
  .page-head form.row input { width: auto; flex: 1; }
}

/* ---------- 공용: 편집 머리말·패널 ---------- */
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.narrow { max-width: 720px; }
.ed-head { margin: 4px 0 24px; padding-bottom: 18px; border-bottom: 1px solid var(--ink); }
.ed-head h1 { font-size: 28px; margin: 0; }
.ed-head-split { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.ed-lede { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.fine { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 8px 0 0; }
.panel { background: var(--sheet); border-top: 1px solid var(--ink); padding: 14px 0 22px; margin-bottom: 26px; min-width: 0; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sec-head h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.sec-head > span { font-size: 12px; color: var(--muted); }
.quiet-box { border: 1px solid var(--edge); border-radius: 4px; padding: 28px; display: grid; gap: 14px; justify-items: start; }
.quiet-box p { margin: 0; }
.aside-note { display: flex; gap: 12px; align-items: baseline; margin: -8px 0 22px; font-size: 14px; color: var(--ink); }
.aside-note span { font-size: 12px; color: var(--accent-ink); border-bottom: 1px solid var(--accent); white-space: nowrap; }
.text-link { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--control); }
.btn.is-on { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.google-btn { width: 100%; min-height: 44px; margin-top: 12px; }
.signup-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 14px 0; }
.signup-steps li { flex: 1; padding: 8px 6px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); text-align: center; line-height: 1.35; }
.signup-steps li b { display: block; font-family: var(--font-display); font-size: 15px; }
.signup-steps li.is-on { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }
.google-ok { padding: 10px 12px; border-radius: var(--radius); background: var(--ok-soft); color: var(--ink); margin: 10px 0 4px; overflow-wrap: anywhere; }
.account-google { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--rule); display: grid; gap: 10px; justify-items: start; }

/* ---------- 복테&모의 분석: 회차 선택 ---------- */
.pick { display: grid; gap: 4px; min-width: 0; }
.pick label { font-size: 12px; color: var(--muted); margin: 0; font-weight: 400; }
.pick-row { display: flex; gap: 8px; align-items: center; }
.pick select { min-width: 220px; border-width: 0 0 1px; border-radius: 0; background: transparent; padding-left: 0; }

/* ---------- 답안지(OMR)와 성적표 ---------- */
.sheet-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; margin-bottom: 30px; align-items: start; }
.omr, .report { border-top: 1px solid var(--ink); padding-top: 14px; min-width: 0; }
.omr-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.omr-row { display: grid; grid-template-columns: 34px repeat(5, 1fr); align-items: center; border: 0; border-bottom: 1px solid var(--rule); margin: 0; padding: 5px 0; min-width: 0; }
.omr-row legend { float: left; padding: 0; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); width: 34px; }
.omr-row.is-wrong legend { color: var(--danger); font-weight: 700; }
.omr-row legend .pt { display: block; font-size: 10px; line-height: 1.1; letter-spacing: 0; }
.omr-row legend .pt-hi { color: var(--accent-ink); font-weight: 600; }
.omr-row legend .pt-lo { color: var(--faint); }
.report-lines .nums small { font-size: 11px; color: var(--muted); margin-left: 1px; }
.bubble { position: relative; display: grid; place-items: center; margin: 0; cursor: pointer; }
.bubble input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bubble span:first-of-type { width: 26px; height: 32px; border-radius: 13px / 16px; border: 1px solid var(--control); display: grid; place-items: center; font-size: 12px; color: var(--muted); transition: background-color 120ms ease, color 120ms ease; }
.bubble:hover span:first-of-type { border-color: var(--ink); }
.bubble input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
.bubble input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.quick { margin-top: 14px; border-top: 1px dashed var(--edge); padding-top: 10px; }
.quick summary { cursor: pointer; color: var(--ink); font-size: 14px; }
.quick label { margin: 10px 0 6px; color: var(--muted); font-weight: 400; }
.quick-input { font-variant-numeric: tabular-nums; letter-spacing: 0.08em; font-size: 18px; }
.score-only input[type=number] { width: 110px; }
.omr-actions { display: flex; gap: 14px; align-items: center; margin-top: 16px; }
.report-main { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 6px 0 18px; border-bottom: 1px solid var(--rule); }
.report-score .k { display: block; font-size: 12px; color: var(--muted); }
.report-score b { font-family: var(--font-display); font-weight: 600; font-size: 64px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.report-score .of { font-size: 18px; color: var(--muted); margin-left: 6px; }
.report-grade { text-align: right; }
.report-grade .k { display: block; font-size: 12px; color: var(--muted); }
.report-grade b { font-family: var(--font-display); font-weight: 600; font-size: 40px; line-height: 1; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.grade-cell { font-weight: 600; white-space: nowrap; }
.report-lines { margin: 0; }
.report-lines div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.report-lines dt { color: var(--muted); }
.report-lines dd { margin: 0; }
.report-lines .nums { font-variant-numeric: tabular-nums; color: var(--danger); }

/* ---------- 통계 ---------- */
.stats-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
table.ledger th { border-bottom: 1px solid var(--ink); }
table.ledger tr.mine td { background: var(--accent-soft); }
.hbars { width: 100%; max-width: 520px; height: auto; display: block; font-variant-numeric: tabular-nums; }
.hbars .lab { font-size: 12px; fill: var(--muted); }
.hbars .axis { stroke: var(--ink); stroke-width: 1; }
.hbars .hb { fill: #b4c8bd; }
.hbars .hb-me, .hbars .hb-key { fill: var(--accent); }
.hbars .pv { font-size: 12px; fill: var(--ink); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; }
.sw-me { background: var(--accent); }
.item-map { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
.im { position: relative; display: grid; grid-template-rows: auto 1fr; aspect-ratio: 1 / 1.05; padding: 6px 7px; border: 1px solid var(--edge); border-radius: 3px; color: var(--ink); transition: transform 120ms ease, border-color 120ms ease; }
.im:hover { text-decoration: none; border-color: var(--ink); transform: translateY(-1px); }
.im-no { font-size: 11px; color: inherit; opacity: .75; font-variant-numeric: tabular-nums; }
.im-pct { align-self: end; justify-self: end; font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1; font-variant-numeric: tabular-nums; }
.im-pct small { font-size: 11px; font-family: var(--font-ui); font-weight: 400; margin-left: 1px; }
.im-top { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }
.heat-0 { background: var(--sheet); }
.heat-1 { background: #e3ece6; }
.heat-2 { background: #bcd2c5; }
.heat-3 { background: #5f8f7a; color: #fff; }
.heat-4 { background: var(--accent-ink); color: #fff; }
.im.is-sel { outline: 2px solid var(--ink); outline-offset: 2px; }
.im.is-mine::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 4px; height: 2px; background: var(--danger); }
.map-key { list-style: none; padding: 0; margin: 12px 0 0; display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.map-key li { display: inline-flex; align-items: center; gap: 4px; }
.map-key .swatch { border: 1px solid var(--edge); }
.dot-top { width: 6px; height: 6px; border-radius: 50%; background: var(--danger); display: inline-block; }
.mark-mine { width: 14px; height: 2px; background: var(--danger); display: inline-block; }
.choice-panel { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--rule); }
.choice-panel h3 { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.choice-panel h3 span { font-family: var(--font-ui); font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 6px; }

/* ---------- 교재: 코드 입력·꼬리표·서가 ---------- */
.code-form { display: grid; gap: 8px; max-width: 460px; }
.code-form label { margin: 0; }
.code-input { font-size: 22px; letter-spacing: 0.12em; text-transform: uppercase; min-height: 54px; font-variant-numeric: tabular-nums; }
.code-form .btn { justify-self: start; margin-top: 6px; }
.tag-card { position: relative; max-width: 420px; background: var(--sheet); border: 1px solid var(--ink); border-radius: 6px 6px 6px 6px; padding: 22px 24px 18px 52px; }
.tag-hole { position: absolute; left: 18px; top: 24px; width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--ink); background: var(--frame); }
.tag-kind { margin: 0; font-size: 12px; color: var(--muted); }
.tag-title { margin: 4px 0 14px; font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.35; }
.tag-card dl { margin: 0; border-top: 1px dashed var(--control); padding-top: 10px; display: grid; gap: 6px; font-size: 14px; }
.tag-card dl div { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; }
.tag-card dt { color: var(--muted); }
.tag-card dd { margin: 0; }
.shelf { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.shelf li { border: 1px solid var(--edge); border-left: 0; border-right: 0; border-top: 2px solid var(--ink); padding: 14px 2px 16px; display: grid; gap: 4px; }
.shelf li.is-past { opacity: .6; }
.shelf-title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 17px; }

/* ---------- 첫 화면: 편집숍처럼 여백과 사진으로 ---------- */
body.pub, body.no-shell { background: #f2f3f2; }
.no-shell .auth-wrap .card { border-color: #e2dacd; }
.pub-wrap { --paper: #f2f3f2; --photo: #e8eae9; --pub-rule: #d8dcda; --pub-muted: #616864;
  max-width: 1240px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) 40px; color: var(--ink); }
.kicker { margin: 0 0 10px; font-size: 13px; color: var(--pub-muted, var(--muted)); }
.pub-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0; }
.pub-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.pub-brand:hover { text-decoration: none; }
.pub-brand .logo { height: 18px; width: auto; display: block; }
.pub-brand span { font-family: var(--font-display); font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.pub-nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 32px); font-size: 13.5px; }
.pub-nav a { color: var(--ink); }
.pub-login { border-bottom: 1px solid var(--ink); padding-bottom: 1px; }
.pub-nav a:hover { text-decoration: none; color: var(--pub-muted); }

.pub-door { padding: 4px 0 clamp(28px, 4vw, 44px); }
.door-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; max-width: 620px; }
.door-form input { font: inherit; font-size: 15px; min-height: 46px; padding: 0 14px; border: 1px solid var(--edge); border-radius: 0; background: var(--sheet); color: var(--ink); }
.door-form input:focus { outline: none; border-color: var(--ink); }
.door-form .btn.primary { min-width: 96px; }
.door-links { display: flex; gap: 20px; flex-wrap: wrap; margin: 14px 0 0; font-size: 13.5px; }
@media (max-width: 560px) { .door-form { grid-template-columns: minmax(0, 1fr); } }
.book-photo { margin: 0; background: var(--photo); overflow: hidden; }
.book-photo img { display: block; width: 100%; height: auto; }
.pub .btn.primary { border-radius: 0; min-height: 46px; padding: 0 26px; letter-spacing: 0.02em; }

.pub-books { padding: 0 0 clamp(56px, 8vw, 104px); }
.pub-sec { border-top: 1px solid var(--pub-rule); padding: 26px 0 clamp(56px, 8vw, 104px); }
.pub-sec-head { display: grid; grid-template-columns: 180px minmax(0, 1fr); align-items: baseline; margin-bottom: 30px; }
.pub-sec-head .kicker { margin: 0; }
.pub-sec-head h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -0.02em; }
.book-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 3vw, 40px); }
.book-photo { aspect-ratio: 3 / 2; }
.book-photo img { height: 100%; object-fit: cover; transition: transform 600ms cubic-bezier(.2, .7, .2, 1); }
.book-item:hover .book-photo img { transform: scale(1.03); }
.book-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 0 0; border-bottom: 1px solid var(--pub-rule); padding-bottom: 14px; }
.book-name { margin: 0; font-size: 15px; font-weight: 600; }
.book-sub { margin: 0; font-size: 13px; color: var(--pub-muted); }
.book-note { margin: 22px 0 0; font-size: 14px; color: var(--pub-muted); }

.guide-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.guide-list li { border-bottom: 1px solid var(--pub-rule); }
.guide-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 12px; padding: 20px 0; color: var(--ink); }
.guide-list a:hover { text-decoration: none; }
.g-body { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: baseline; }
.g-body b { font-size: 17px; font-weight: 600; }
.g-go { color: var(--pub-muted); transition: transform 200ms ease, color 200ms ease; }
.guide-list a:hover .g-go { transform: translateX(4px); color: var(--ink); }
.pub-wrap .colophon { border-top-color: var(--pub-rule); margin-top: 0; }
.pub-wrap .auth-affil { display: block; justify-self: start; margin: 22px 0 0; opacity: .7; }
@media (max-width: 860px) {
  .pub-sec-head { grid-template-columns: 96px minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .pub-brand span { display: none; }
  .book-list { grid-template-columns: minmax(0, 1fr); }
  .pub-sec-head { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .book-photo img, .g-go { transition: none; }
}

/* ---------- 공지: 장부형 목록 ---------- */
.find { display: flex; gap: 8px; align-items: center; min-width: 0; }
.find input { border-width: 0 0 1px; border-radius: 0; background: transparent; padding-left: 0; min-width: 220px; }
.ledger-list { list-style: none; padding: 0; margin: 0; }
.ledger-list li + li { border-top: 1px solid var(--rule); }
.ledger-list a { display: grid; grid-template-columns: 92px 44px minmax(0, 1fr) auto; gap: 14px; align-items: baseline; padding: 13px 2px; color: var(--ink); }
.ledger-list a:hover { text-decoration: none; background: color-mix(in srgb, var(--active) 35%, transparent); }
.ledger-list time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ll-tag { font-size: 12px; color: var(--accent-ink); }
.ll-title { font-size: 15.5px; min-width: 0; }
.ll-title small { color: var(--muted); font-size: 12px; margin-left: 4px; }
.ll-meta { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ll-empty { padding: 18px 2px; color: var(--muted); }
.pinned-panel .ll-title { font-weight: 600; }
.article h1 { font-size: 26px; margin: 10px 0 4px; }
.article-body { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rule); line-height: 1.8; font-size: 15.5px; }

/* ---------- 맺음말(문의) ---------- */
.colophon { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--ink); font-size: 13px; color: var(--muted); }
.colo-name { margin: 0; font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.colo-body p { margin: 0 0 4px; }
.colo-body b { color: var(--ink); font-weight: 600; margin-right: 6px; }
.auth-wrap .colophon, .home-wrap .colophon { margin-top: 10px; }

@media (max-width: 1000px) {
  .sheet-grid, .stats-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
@media (max-width: 640px) {
  .omr-cols { grid-template-columns: minmax(0, 1fr); }
  .bubble span:first-of-type { width: 30px; height: 36px; border-radius: 15px / 18px; font-size: 13px; }
  .item-map { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .report-score b { font-size: 52px; }
  .ledger-list a { grid-template-columns: 80px minmax(0, 1fr); gap: 4px 10px; }
  .ll-tag { grid-column: 1; grid-row: 2; }
  .ll-meta { grid-column: 2; grid-row: 2; }
  .ll-title { grid-column: 2; grid-row: 1; }
  .find, .find input { width: 100%; min-width: 0; }
  .colophon { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .pick, .pick select { width: 100%; min-width: 0; }
}

/* ---------- 학생 홈 ---------- */
.home-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.home-head .kicker { margin: 0 0 8px; }
.home-actions { display: flex; gap: 10px; align-items: center; }
.today-bar { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding: 18px 0 22px; margin-bottom: 26px; border-bottom: 1px solid var(--rule); }
.today-bar p { margin: 0; }
.today-bar b { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.today-bar .small { color: var(--muted); }
.home-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; gap: 10px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list a, .mini-list .t { color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.mini-list time, .mini-list .m { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mini-list .empty { color: var(--muted); }
.sec-head a { font-size: 12.5px; color: var(--muted); }
.play-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.play-list a { display: grid; gap: 4px; padding: 16px; border: 1px solid var(--edge); border-radius: 4px; color: var(--ink); background: var(--sheet); transition: border-color 150ms ease, transform 150ms ease; }
.play-list a:hover { text-decoration: none; border-color: var(--ink); transform: translateY(-1px); }
.play-list b { font-weight: 600; }
.play-list span { font-size: 12.5px; color: var(--muted); }
@media (max-width: 760px) {
  .home-cols, .play-list { grid-template-columns: minmax(0, 1fr); }
}

.points-box { border: 1px solid var(--edge); border-radius: 4px; padding: 14px 16px 6px; margin: 0 0 16px; }
.points-box legend { padding: 0 6px; font-size: 13px; font-weight: 600; }
.points-box .field { margin-bottom: 8px; }

/* ================= 공부 도구 ================= */
.mb { margin-bottom: 18px; }
.mt-lg { margin-top: 28px; }
.w-0 { width: 0%; }
.w-10 { width: 10%; }
.w-20 { width: 20%; }
.w-30 { width: 30%; }
.w-40 { width: 40%; }
.w-50 { width: 50%; }
.w-60 { width: 60%; }
.w-70 { width: 70%; }
.w-80 { width: 80%; }
.w-90 { width: 90%; }
.w-100 { width: 100%; }
.nav-group { margin: 14px 10px 4px; font-size: 12px; color: var(--faint); }
.prefs { display: flex; flex-wrap: wrap; gap: 6px; }
.pref { font: inherit; font-size: 12px; color: var(--muted); background: transparent; border: 1px solid var(--edge); border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.pref:hover { color: var(--ink); border-color: var(--ink); }
.pref[aria-pressed="true"] { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.pref:disabled { cursor: default; opacity: .7; }

.seg { display: inline-flex; border: 1px solid var(--edge); border-radius: 8px; padding: 3px; gap: 2px; background: var(--sheet); flex-wrap: wrap; }
.seg a { padding: 5px 14px; border-radius: 8px; font-size: 13px; color: var(--muted); }
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg a.is-on { background: var(--ink); color: var(--sheet); }

/* 오늘 한눈에 */
.glance { display: grid; margin-bottom: 30px; border-top: 1px solid var(--rule); }
.gl { display: grid; grid-template-columns: 96px auto minmax(0, 1fr); align-items: baseline; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--rule); color: var(--ink); min-width: 0; }
.gl:hover { text-decoration: none; background: var(--raised); }
.gl-k { font-size: 13px; color: var(--muted); }
.gl b { font-weight: 700; font-size: 16px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.gl b small { font-size: 13px; color: var(--muted); font-weight: 400; }
.gl-s { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 공부 결 진단 */
.quiz-list { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 14px; max-width: 760px; }
.quiz-list fieldset { border: 0; border-top: 1px solid var(--rule); margin: 0; padding: 14px 0 0; }
.quiz-list legend { float: left; width: 100%; padding: 0; margin-bottom: 10px; font-weight: 600; }
.q-no { font-size: 12px; color: var(--muted); font-weight: 400; margin-right: 8px; font-variant-numeric: tabular-nums; }
.choice-pair { clear: both; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice { position: relative; margin: 0; font-weight: 400; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; height: 100%; padding: 12px 14px; border: 1px solid var(--edge); border-radius: 4px; background: var(--sheet); font-size: 14px; transition: border-color 120ms ease, background-color 120ms ease; }
.choice:hover span { border-color: var(--ink); }
.choice input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--sheet); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.axis-strip { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.axis-strip li { display: grid; gap: 2px; padding: 14px 12px; border-left: 1px solid var(--rule); }
.axis-strip li:first-child { border-left: 0; padding-left: 0; }
.ax-letter { font-family: var(--font-display); font-weight: 600; font-size: 22px; color: var(--accent-ink); line-height: 1; }
.tab-row { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--edge); }
.tab-btn { font: inherit; background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; color: var(--muted); cursor: pointer; }
.tab-btn.is-on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.habit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 36px; }
.habit { border-top: 1px solid var(--rule); padding: 14px 0 10px; }
.habit h2 { font-family: var(--font-display); font-size: 17px; display: flex; gap: 8px; align-items: baseline; }
.habit h2 .ax-letter { font-size: 17px; }
.habit ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14.5px; }
.habit li.warn { color: var(--warn); list-style: "! "; }
.unit-list { list-style: none; margin: 0; padding: 0; }
.unit-list li { border-top: 1px solid var(--rule); padding: 16px 0; display: grid; gap: 6px; }
.unit-list h2 { margin: 0; font-family: var(--font-display); font-size: 18px; }
.unit-list p { margin: 0; font-size: 14.5px; }
.u-no { font-family: var(--font-ui); font-size: 12px; color: var(--muted); margin-right: 10px; font-weight: 400; }

/* 오답 노트 */
.reason-bar { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 12px 0 18px; font-size: 13.5px; color: var(--muted); }
.reason-bar b { color: var(--ink); font-weight: 600; }
.wrong-list { list-style: none; margin: 0; padding: 0; }
.wrong-list > li { border-top: 1px solid var(--rule); padding: 12px 0; }
.wrong-list > li.is-done { opacity: .62; }
.wrong-list > li.is-done .w-no { text-decoration: line-through; }
.w-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.w-no { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--danger); }
.w-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { position: relative; margin: 0; font-weight: 400; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: 4px 11px; border: 1px solid var(--edge); border-radius: 8px; font-size: 12.5px; color: var(--muted); cursor: pointer; background: var(--sheet); }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.w-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.w-foot input[type=text] { flex: 1; min-width: 200px; min-height: 34px; border-width: 0 0 1px; border-radius: 0; background: transparent; padding-left: 0; }
.check { display: inline-flex; gap: 6px; align-items: center; margin: 0; font-weight: 400; font-size: 13px; }

/* 개념 카드 */
.deck-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.deck-list li { display: grid; gap: 6px; }
.deck-list li > a:first-child { display: grid; gap: 6px; padding: 18px; border: 1px solid var(--edge); border-top: 2px solid var(--ink); background: var(--sheet); color: var(--ink); }
.deck-list li > a:first-child:hover { text-decoration: none; border-color: var(--ink); }
.deck-list b { font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.deck-meter { display: flex; align-items: center; gap: 8px; }
.dm-bar, .mini-bar { flex: 1; height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; display: inline-block; vertical-align: middle; }
.mini-bar { width: 90px; flex: none; }
.dm-fill, .pg-fill { display: block; height: 100%; background: var(--accent); }
.deck-unsure { color: var(--danger); }
.flash-deck { max-width: 560px; margin: 0 auto; display: grid; gap: 12px; }
.fd-count { text-align: center; margin: 0; }
.fc-face { width: 100%; min-height: 260px; display: grid; place-items: center; gap: 10px; padding: 32px 28px; border: 1px solid var(--ink); border-radius: 6px; background: var(--sheet); color: var(--ink); font: inherit; cursor: pointer; text-align: center; transition: background-color 200ms ease; }
.fc-face.is-back { background: var(--raised); }
.fc-front { font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.4; }
.fc-back { font-size: 16.5px; line-height: 1.7; }
.fc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.fc-actions .btn { width: 100%; min-height: 46px; }
.fd-done { text-align: center; padding: 30px 0; }

/* 플래너 */
.progress { height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; margin: -8px 0 22px; }
.week-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.week-grid > li { border-top: 2px solid var(--edge); padding-top: 10px; min-width: 0; }
.week-grid > li.is-today { border-top-color: var(--ink); }
.week-grid h2 { font-size: 15px; display: flex; gap: 6px; align-items: baseline; margin-bottom: 8px; }
.week-grid h2 small { font-weight: 400; color: var(--muted); font-size: 12px; }
.plan-list { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 2px; }
.plan-list li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 6px; align-items: start; padding: 4px 0; font-size: 13.5px; }
.plan-list form { margin: 0; }
.tick { width: 18px; height: 18px; margin-top: 2px; border: 1px solid var(--control); border-radius: 4px; background: var(--sheet); cursor: pointer; padding: 0; position: relative; }
.tick[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.tick[aria-pressed="true"]::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.plan-list li.is-done .pl-text { color: var(--muted); text-decoration: line-through; }
.pl-text { overflow-wrap: anywhere; }
.x { border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 4px; opacity: 0; }
.plan-list li:hover .x, .x:focus-visible { opacity: 1; }
.plan-add input { min-height: 32px; border-width: 0 0 1px; border-style: dashed; border-radius: 0; background: transparent; padding: 4px 0; font-size: 13px; }

/* 일정 */
.dday { margin: 0; display: grid; justify-items: end; }
.dday span { font-size: 12px; color: var(--muted); }
.dday b { font-family: var(--font-display); font-weight: 600; font-size: 34px; line-height: 1; color: var(--accent-ink); font-variant-numeric: tabular-nums; }

/* 과제 */
.task { border-top: 1px solid var(--rule); padding: 18px 0; }
.task-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.task-head h2 { margin: 0; font-family: var(--font-display); font-size: 18px; }
.task-state { font-size: 12.5px; padding: 2px 10px; border-radius: 8px; border: 1px solid var(--edge); color: var(--muted); white-space: nowrap; }
.task-state.st-checked { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.task-state.st-redo { border-color: var(--danger); color: var(--danger); }
.task-state.st-submitted { border-color: var(--ink); color: var(--ink); }
.task.is-late .task-head h2 { color: var(--danger); }
.task-body { margin: 8px 0; font-size: 14.5px; }
.task-form { margin-top: 10px; }
.check-form { flex-wrap: nowrap; }
.check-form input { min-width: 160px; min-height: 30px; }

/* FAQ */
.faq .mini-list a::before { content: "Q. "; color: var(--accent-ink); font-weight: 600; }

/* 리포트 */
.report-sheet { max-width: 860px; }
.rs-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-bottom: 2px solid var(--ink); padding-bottom: 14px; margin-bottom: 18px; }
.rs-head h1 { margin: 0; }
.rs-head h1 small { font-family: var(--font-ui); font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.rs-sec { margin-bottom: 22px; break-inside: avoid; }
.rs-sec h2 { font-family: var(--font-display); font-size: 16px; border-bottom: 1px solid var(--rule); padding-bottom: 6px; }
.rs-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
table.compact th, table.compact td { padding: 7px 8px; font-size: 13.5px; }
.rs-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.rs-bars li { display: grid; grid-template-columns: 80px 1fr 28px; gap: 10px; align-items: center; }
.rs-bars .mini-bar { width: 100%; }

@media (max-width: 1000px) {
  .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
}
@media (max-width: 640px) {
  .choice-pair, .habit-grid, .rs-cols, .axis-strip { grid-template-columns: minmax(0, 1fr); }
  .axis-strip li { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); }
  .week-grid { grid-template-columns: minmax(0, 1fr); }
  .x { opacity: 1; }
  .check-form { flex-wrap: wrap; }
}

/* 인쇄: 메뉴는 숨기고 종이 한 장처럼 */
@media print {
  .side, .no-print, .colophon, .flash, .tab-row { display: none !important; }
  body, .sheet { background: #fff !important; }
  .shell { display: block; }
  .sheet { margin: 0; border: 0; }
  .container { padding: 0; }
  .tab-panel[hidden] { display: block !important; }
  a { color: inherit; }
}

/* ================= 어두운 화면 ================= */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --frame: #0e100f; --sheet: #161918; --raised: #1e2220; --active: #272c29;
    --edge: #303633; --rule: #252a27; --control: #79807c;
    --ink: #e8ebe9; --muted: #a1a8a4; --faint: #929995;
    --accent: #6fb79a; --accent-soft: #1d3029; --accent-ink: #9fd6bf;
    --danger: #f08a80; --danger-soft: #3a1f1c; --ok: #6fb79a; --ok-soft: #1d3029; --warn: #e3b96d; --warn-soft: #33291a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --frame: #0e100f; --sheet: #161918; --raised: #1e2220; --active: #272c29;
  --edge: #303633; --rule: #252a27; --control: #79807c;
  --ink: #e8ebe9; --muted: #a1a8a4; --faint: #929995;
  --accent: #6fb79a; --accent-soft: #1d3029; --accent-ink: #9fd6bf;
  --danger: #f08a80; --danger-soft: #3a1f1c; --ok: #6fb79a; --ok-soft: #1d3029; --warn: #e3b96d; --warn-soft: #33291a;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.pub, :root:not([data-theme="light"]) body.no-shell { background: #0e100f; }
  :root:not([data-theme="light"]) .pub-wrap { --paper: #0e100f; --photo: #1b1e1d; --pub-rule: #2c312e; --pub-muted: #a9a195; }
  :root:not([data-theme="light"]) .heat-1 { background: #22342c; }
  :root:not([data-theme="light"]) .heat-2 { background: #2e4b3e; }
  :root:not([data-theme="light"]) .heat-3 { background: #3f6e5a; }
  :root:not([data-theme="light"]) .heat-4 { background: #6fb79a; color: #0f0e0b; }
  :root:not([data-theme="light"]) .hbars .hb { fill: #3a4f45; }
  :root:not([data-theme="light"]) .no-shell .auth-wrap .card { border-color: var(--edge); }
}
:root[data-theme="dark"] body.pub, :root[data-theme="dark"] body.no-shell { background: #0e100f; }
:root[data-theme="dark"] .pub-wrap { --paper: #0e100f; --photo: #1b1e1d; --pub-rule: #2c312e; --pub-muted: #a9a195; }
:root[data-theme="dark"] .heat-1 { background: #22342c; }
:root[data-theme="dark"] .heat-2 { background: #2e4b3e; }
:root[data-theme="dark"] .heat-3 { background: #3f6e5a; }
:root[data-theme="dark"] .heat-4 { background: #6fb79a; color: #0f0e0b; }
:root[data-theme="dark"] .hbars .hb { fill: #3a4f45; }
:root[data-theme="dark"] .no-shell .auth-wrap .card { border-color: var(--edge); }
@media print { :root { color-scheme: light; } }
input[type=file] { font: inherit; font-size: 13px; color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-size: 13px; margin-right: 10px; padding: 6px 12px; border: 1px solid var(--control); border-radius: 8px; background: var(--sheet); color: var(--ink); cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: var(--ink); }
@media (max-width: 900px) {
  .nav-group { display: none; }
  .prefs { order: -1; }
}

/* ================= 휴대폰: 아래 탭 + 전체 메뉴 ================= */
.m-top, .m-tabs, .m-menu { display: none; }
@media (max-width: 900px) {
  .side { display: none; }
  .shell { display: block; min-height: 100vh; }
  .m-top { display: flex; position: sticky; top: 0; z-index: 20; justify-content: space-between; align-items: center; gap: 12px;
    padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--frame) 92%, transparent);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--edge); }
  .m-brand { display: flex; align-items: center; gap: 8px; color: var(--ink); }
  .m-brand:hover { text-decoration: none; }
  .m-brand .logo { height: 16px; width: auto; fill: currentColor; }
  .m-brand span { font-family: "Hahmlet Brand", var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: -0.02em; }
  .m-who { font-size: 13px; color: var(--muted); max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sheet { margin: 0; border: 0; border-radius: 0; min-height: calc(100vh - 50px); padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .m-tabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--sheet); border-top: 1px solid var(--edge); }
  .m-tabs a, .m-tabs button { display: grid; justify-items: center; gap: 3px; padding: 6px 0; min-height: 52px; color: var(--muted);
    font: inherit; font-size: 11.5px; background: none; border: 0; border-radius: 10px; cursor: pointer; }
  .m-tabs a:hover { text-decoration: none; }
  .m-tabs .ico { width: 23px; height: 23px; }
  .m-tabs a.active { color: var(--ink); font-weight: 600; }
  .m-tabs a.active .ico { stroke-width: 2.1; }
  .m-tabs button[aria-expanded="true"] { color: var(--ink); }
  .m-menu:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 40; overflow-y: auto; background: var(--frame);
    padding: max(16px, env(safe-area-inset-top)) 16px calc(90px + env(safe-area-inset-bottom)); animation: menu-in 180ms ease-out; }
  body.menu-open { overflow: hidden; }
  .m-menu-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
  .m-menu-head .kicker { margin: 0 0 2px; }
  .m-menu-head b { font-family: var(--font-display); font-size: 20px; }
  .m-close { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--edge); border-radius: 50%; background: var(--sheet); color: var(--ink); cursor: pointer; }
  .m-close .ico { width: 20px; height: 20px; }
  .m-group { margin: 20px 2px 8px; font-size: 13px; color: var(--muted); }
  .m-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .m-grid a { position: relative; display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 82px; padding: 10px 4px;
    background: var(--sheet); border: 1px solid var(--edge); border-radius: 14px; color: var(--ink); font-size: 13px; text-align: center; }
  .m-grid a:hover { text-decoration: none; }
  .m-grid a:active { transform: scale(.97); }
  .m-grid a.active { border-color: var(--ink); font-weight: 600; }
  .m-grid .ico { width: 24px; height: 24px; color: var(--accent-ink); }
  .m-grid em { position: absolute; top: 8px; right: 10px; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: var(--danger); border-radius: 8px; padding: 0 6px; }
  .m-prefs { display: flex; flex-wrap: wrap; gap: 8px; }
  .m-prefs .pref { font-size: 13px; padding: 8px 14px; }
  .m-affil { display: block; height: 13px; margin: 26px auto 0; opacity: .7; }
  .colophon { margin-top: 32px; }
}
@keyframes menu-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .m-menu:not([hidden]) { animation: none; } }
@media print { .m-top, .m-tabs, .m-menu { display: none !important; } }

/* ================= 같이 공부 (산사·목욕탕·바닷가 역·골목 찻집) ================= */
.my-mins { display: flex; gap: 22px; margin: 0; }
.my-mins div { display: grid; gap: 2px; }
.my-mins dt { font-size: 12px; color: var(--muted); }
.my-mins dd { margin: 0; font-weight: 700; font-size: 18px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.my-mins small { font-family: var(--font-ui); font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.place-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.place { display: block; color: var(--ink); border-radius: 6px; overflow: hidden; background: var(--sheet); border: 1px solid var(--edge); transition: transform 200ms ease, border-color 200ms ease; }
.place:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--ink); }
.place .scene { display: block; width: 100%; height: auto; aspect-ratio: 5 / 3; }
.place-body { display: grid; gap: 3px; padding: 14px 16px 16px; }
.place-body b { font-family: var(--font-display); font-weight: 600; font-size: 20px; }
.place-line { font-size: 13.5px; color: var(--muted); }
.place-now { font-size: 12.5px; color: var(--accent-ink); display: inline-flex; align-items: center; gap: 6px; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* 장면 움직임 */
.sc-flicker { animation: sc-flicker 3.2s ease-in-out infinite; }
.sc-delay { animation-delay: -1.4s; }
.sc-fireflies circle { animation: sc-float 6s ease-in-out infinite; }
.sc-fireflies circle:nth-child(2) { animation-delay: -2s; } .sc-fireflies circle:nth-child(3) { animation-delay: -4s; }
.sc-steam { animation: sc-steam 7s ease-in-out infinite; }
.sc-shimmer { animation: sc-shimmer 4s ease-in-out infinite; }
.sc-rain { animation: sc-rain .7s linear infinite; }
@keyframes sc-flicker { 0%, 100% { opacity: .85; } 45% { opacity: 1; } 60% { opacity: .7; } }
@keyframes sc-float { 0%, 100% { transform: translate(0, 0); opacity: .3; } 50% { transform: translate(6px, -10px); opacity: 1; } }
@keyframes sc-steam { 0% { transform: translateY(14px); opacity: .2; } 50% { opacity: .9; } 100% { transform: translateY(-10px); opacity: 0; } }
@keyframes sc-shimmer { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes sc-rain { from { transform: translate(0, -14px); } to { transform: translate(-4px, 0); } }
@media (prefers-reduced-motion: reduce) { .sc-flicker, .sc-fireflies circle, .sc-steam, .sc-shimmer, .sc-rain { animation: none; } }

/* 방 */
.room-stage { position: relative; border-radius: 8px; overflow: hidden; margin: -4px 0 18px; background: #222; }
.stage-scene { display: block; width: 100%; height: clamp(240px, 46vh, 420px); }
.stage-top { position: absolute; inset: 0 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; }
.stage-back, .stage-sound { font: inherit; font-size: 13px; color: #fff; background: rgba(20, 18, 16, .38); border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 8px; padding: 6px 12px; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.stage-back:hover { text-decoration: none; background: rgba(20, 18, 16, .55); }
.stage-sound[aria-pressed="true"] { background: rgba(255, 255, 255, .85); color: #1d1b18; }
.stage-timer { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 18px 18px; color: #fff;
  background: linear-gradient(transparent, rgba(15, 13, 11, .55)); display: grid; justify-items: center; text-align: center; }
.stage-timer p { margin: 0; }
.st-place { font-size: 13px; letter-spacing: .2em; opacity: .85; }
.st-time { font-family: var(--font-display); font-weight: 600; font-size: clamp(56px, 12vw, 88px); line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.st-state { font-size: 13px; opacity: .85; }
.room.is-focus .st-state::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #9fd6bf; margin-right: 6px; vertical-align: 1px; animation: sc-flicker 2s ease-in-out infinite; }
.room-controls { display: grid; justify-items: center; gap: 12px; margin-bottom: 26px; }
.plan-pick { display: flex; gap: 8px; }
.plan-pick .chip span { padding: 7px 16px; font-size: 14px; }
.plan-pick .chip input:disabled + span { opacity: .45; cursor: default; }
.room-buttons .btn.big { min-height: 50px; min-width: 200px; font-size: 16px; border-radius: 8px; }
.room-controls .fine { text-align: center; }
.room-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 32px; }
.here-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.here-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 2px 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.here-list li span { grid-column: 2; font-size: 12.5px; color: var(--muted); }
.here-list b { font-weight: 500; }
.here-list li.is-me b { font-weight: 700; }
.seat { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--control); }
.here-list li.is-focus .seat { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.note-form { display: flex; gap: 8px; margin-bottom: 16px; }
.note-form input { flex: 1; min-width: 0; }
.note-wall { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.note-wall li { position: relative; display: grid; gap: 6px; align-content: space-between; min-height: 96px; padding: 14px 12px 10px; font-size: 14px; }
.note-wall li p { margin: 0; overflow-wrap: anywhere; }
.note-wall li span { font-size: 11.5px; opacity: .75; }
.note-wall .x { position: absolute; top: 4px; right: 4px; opacity: .6; color: inherit; }
.note-wall li.empty-note { min-height: 0; grid-column: 1 / -1; background: none; color: var(--muted); padding: 0; }
/* 산사: 에마(오각 나무판) */
/* 목욕탕: 칠판 */
.wall-sento li { background: #2f3f38; color: #eef1e6; border-radius: 3px; border: 4px solid #8a6a50; font-family: var(--font-display); }
/* 바닷가 역: 줄 노트 */
.wall-eki li { background: #fbf8ef; color: #2d3a55; border: 1px solid #e3ddcc; border-left: 3px double #d7a6a0;
  background-image: repeating-linear-gradient(transparent 0 21px, #dfe6ef 21px 22px); line-height: 22px; }
/* 골목 찻집: 냅킨 */
.wall-kissa li { background: #fffdf8; color: #4a3528; border-radius: 2px; transform: rotate(-1.2deg); border: 1px solid #efe6d8; }
.wall-kissa li:nth-child(even) { transform: rotate(1.4deg); }
@media (max-width: 760px) {
  .place-list, .room-cols { grid-template-columns: minmax(0, 1fr); }
  .room-stage { margin: -20px -16px 16px; border-radius: 0; }
  .room-buttons .btn.big { min-width: 0; width: 100%; }
  .room-buttons { width: 100%; }
}

/* ================= 시간표 ================= */
.tt-week { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.tt-day { min-width: 0; border-top: 2px solid var(--edge); padding-top: 10px; display: grid; gap: 8px; align-content: start; }
.tt-list { display: grid; gap: 8px; min-width: 0; }
.tt-day.is-today { border-top-color: var(--ink); }
.tt-day h2, .tt-day h3 { margin: 0 0 2px; font-size: 15px; font-weight: 600; display: flex; gap: 6px; align-items: baseline; }
.tt-day h2 small { font-size: 11px; font-weight: 600; color: var(--sheet); background: var(--ink); border-radius: 8px; padding: 1px 7px; }
.tt-slot { --tone: #8e877c; position: relative; display: grid; gap: 2px; padding: 10px 12px 10px 14px; border-radius: 8px;
  background: color-mix(in srgb, var(--tone) 17%, var(--sheet)); border: 1px solid color-mix(in srgb, var(--tone) 38%, var(--sheet));
  }
.tone-0 { --tone: #e0708a; }  /* 벚꽃 */
.tone-1 { --tone: #5fa865; }  /* 말차 */
.tone-2 { --tone: #4b8fd6; }  /* 하늘 */
.tone-3 { --tone: #e2ae25; }  /* 유자 */
.tone-4 { --tone: #9673d4; }  /* 등꽃 */
.tone-5 { --tone: #ec8546; }  /* 귤 */
.tone-6 { --tone: #2fa59a; }  /* 청록 바다 */
.tone-7 { --tone: #c9604c; }  /* 벽돌 */
.tt-slot b { color: color-mix(in srgb, var(--tone) 55%, var(--ink)); }
.tt-slot.is-now { box-shadow: 0 0 0 2px var(--ink); }
.tt-slot.is-now::before { content: "지금"; position: absolute; top: 8px; right: 10px; font-size: 11px; font-weight: 700; color: var(--sheet); background: var(--ink); border-radius: 8px; padding: 1px 7px; }
.tt-time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tt-slot b { font-weight: 600; font-size: 14.5px; }
.tt-room { font-size: 12px; color: var(--muted); }
.tt-slot form { position: absolute; top: 4px; right: 4px; margin: 0; }
.tt-slot .x { opacity: .7; }
.tt-empty { margin: 0; font-size: 13px; color: var(--faint); padding: 6px 2px; }
.day-pick { border: 0; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.day-pick legend { padding: 0; margin-bottom: 8px; color: var(--muted); width: 100%; }
.day-pick .chip span { padding: 7px 14px; font-size: 14px; }
@media (max-width: 640px) {
  .tt-week { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .tt-day { grid-template-columns: 34px minmax(0, 1fr); column-gap: 10px; align-items: start; }
  .tt-day h2, .tt-day h3 { flex-direction: column; gap: 4px; padding-top: 10px; }
}

/* ================= 같이 공부 · 3D 산사 ================= */
.in-room3d .container { padding: 0 0 48px; }
.w3-stage { position: relative; height: min(80vh, 780px); min-height: 460px; overflow: hidden; border-radius: 15px 15px 0 0; background: #1b1d22; touch-action: none; user-select: none; -webkit-user-select: none; }
.w3-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.w3-canvas:active { cursor: grabbing; }
.w3-below { padding: 26px 32px 0; }
.w3-vignette { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.4s ease;
  background: radial-gradient(ellipse at 50% 55%, transparent 35%, rgba(12, 10, 8, .55) 100%); }
.w3-stage.is-focus .w3-vignette { opacity: 1; }
.w3-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; pointer-events: none; }
.w3-top > * { pointer-events: auto; }
.w3-pill { font: inherit; font-size: 13px; color: #1d1b18; background: rgba(255, 252, 246, .72); border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 8px; padding: 7px 14px; cursor: pointer; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); white-space: nowrap; }
.w3-pill:hover { text-decoration: none; background: rgba(255, 252, 246, .9); }
.w3-pill[aria-pressed="true"] { background: #1d1b18; color: #fff; border-color: #1d1b18; }
.w3-place { margin: 0; display: grid; justify-items: center; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .45); line-height: 1.25; }
.w3-place b { font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: .08em; }
.w3-place span { font-size: 12px; opacity: .9; }
.w3-whisper { position: absolute; left: 50%; top: 74px; transform: translate(-50%, 6px); margin: 0; width: max-content; max-width: min(92%, 560px); text-align: center;
  font-family: var(--font-display); font-size: clamp(15px, 2.2vw, 18px); line-height: 1.5; color: #fff; text-wrap: balance;
  padding: 8px 16px; border-radius: 14px; background: rgba(22, 24, 22, .58); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .6s ease, transform .6s ease; pointer-events: none; }
.w3-whisper:empty { display: none; }
.w3-stage.is-focus .w3-whisper { top: 122px; }
.w3-whisper.is-on { opacity: 1; transform: translate(-50%, 0); }
.w3-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: grid; justify-items: center; gap: 10px; padding: 0 12px 14px; pointer-events: none; }
.w3-bottom > * { pointer-events: auto; }
.w3-plans { display: flex; gap: 6px; }
.w3-chip { position: relative; margin: 0; }
.w3-chip input { position: absolute; opacity: 0; }
.w3-chip span { display: inline-block; padding: 6px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; color: #1d1b18;
  background: rgba(255, 252, 246, .72); border: 1px solid rgba(255, 255, 255, .6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.w3-chip input:checked + span { background: #1d1b18; color: #fff; border-color: #1d1b18; }
.w3-chip input:focus-visible + span { outline: 2px solid #fff; outline-offset: 2px; }
.w3-actions { display: flex; gap: 2px; padding: 6px; border-radius: 20px; background: rgba(28, 26, 22, .5); border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.w3-act { display: grid; justify-items: center; gap: 3px; min-width: 62px; padding: 8px 10px 6px; border: 0; border-radius: 14px; background: none; color: #fff; font: inherit; font-size: 12px; cursor: pointer; transition: background-color .15s ease, transform .1s ease; }
.w3-act svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.w3-act:hover { background: rgba(255, 255, 255, .12); }
.w3-act:active { transform: scale(.95); }
.w3-act.is-primary { background: rgba(255, 252, 246, .92); color: #1d1b18; }
.w3-act:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.w3-hint { margin: 0; font-size: 12px; color: rgba(255, 255, 255, .88); text-shadow: 0 1px 6px rgba(0, 0, 0, .55); text-align: center; pointer-events: none !important; }
.w3-enter { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(18, 16, 14, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.w3-enter[hidden] { display: none; }
.w3-enter-card { max-width: 360px; text-align: center; display: grid; gap: 8px; justify-items: center; padding: 28px 26px 22px; border-radius: 18px; background: var(--sheet); color: var(--ink); }
.w3-enter-card h1 { margin: 0; font-size: 30px; }
.w3-enter-card p { margin: 0; color: var(--muted); }
.w3-enter-card .btn.big { min-height: 50px; padding: 0 30px; border-radius: 8px; margin-top: 10px; font-size: 16px; }
.w3-fallback { position: absolute; inset: auto 16px 16px; color: #fff; }
.w3-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.w3-colors p { margin: 0 6px 0 0; }
.w3-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--sheet); box-shadow: 0 0 0 1px var(--edge); cursor: pointer; padding: 0; }
.w3-swatch.is-on { box-shadow: 0 0 0 2px var(--ink); }
.sw-0 { background: #e8805c; } .sw-1 { background: #e6a23c; } .sw-2 { background: #7cb87a; } .sw-3 { background: #5fa3c9; }
.sw-4 { background: #9b86d1; } .sw-5 { background: #d97aa0; } .sw-6 { background: #8c7a6b; } .sw-7 { background: #4f9e94; }
@media (max-width: 900px) {
  .in-room3d .container { padding: 0 0 calc(80px + env(safe-area-inset-bottom)); }
  .w3-stage { height: calc(100dvh - 50px - 70px - env(safe-area-inset-bottom)); min-height: 420px; border-radius: 0; }
  .w3-below { padding: 20px 16px 0; }
  .w3-act { min-width: 54px; padding: 8px 6px 6px; font-size: 11px; }
  .w3-whisper { top: 66px; }
}
@media (prefers-reduced-motion: reduce) { .w3-whisper, .w3-vignette { transition: none; } }

/* ---------- 같이 공부 · 터줏대감 순위와 친구 ---------- */
.rooms-side { display: grid; gap: 8px; justify-items: end; }
.rooms-links a { color: var(--accent-ink); font-weight: 600; }
.place-king { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.place .place-king b, .place-king b { color: var(--ink); font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; letter-spacing: 0; }
.crown { width: 16px; height: 16px; flex: none; fill: #e2ae25; stroke: #a87a10; stroke-width: 1.2; stroke-linejoin: round; }
.seg-wide { margin: 4px 0 10px; }
.rank-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-row { display: grid; grid-template-columns: 28px 12px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.rank-row:last-child { border-bottom: 0; }
.rank-no { font-family: var(--font-display); font-weight: 600; font-size: 17px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank-row.is-king .rank-no .crown { width: 22px; height: 22px; }
.rank-row.is-king .rank-nick { font-weight: 700; }
.rank-row.is-me { background: var(--accent-soft); border-radius: 10px; padding-left: 6px; padding-right: 6px; border-bottom-color: transparent; }
.rank-nick { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rank-nick small { font-weight: 400; color: var(--muted); }
.rank-m { font-variant-numeric: tabular-nums; font-size: 13.5px; color: var(--accent-ink); white-space: nowrap; }
.rank-dot { width: 12px; height: 12px; border-radius: 50%; display: block; }
.rank-row form { justify-self: end; }
.rank-row.is-me .rank-m { grid-column: 4 / 6; justify-self: end; }
.rank-compact .rank-row { padding: 7px 0; grid-template-columns: 24px 10px minmax(0, 1fr) auto auto; }
.rank-compact .rank-no { font-size: 15px; }
.rank-compact .rank-dot { width: 10px; height: 10px; }
.w3-rank { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); }
.w3-rank .sec-head { margin-bottom: 4px; }
.follow-btn { min-width: 64px; }
.follow-btn.is-on { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.friend-search { display: flex; gap: 8px; margin: 4px 0 16px; max-width: 520px; }
.friend-search input { flex: 1; min-width: 0; }
.friend-list { list-style: none; margin: 0; padding: 0; }
.friend-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.friend-row:last-child { border-bottom: 0; }
.friend-body { display: grid; min-width: 0; }
.friend-body .small { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .rooms-side { justify-items: start; }
}
.here-tag { font-size: 12px; font-weight: 400; color: var(--muted); }
.here-tag::before { content: "· "; }

/* ---------- 플래너 ---------- */
.p-head { margin-bottom: 14px; }
.p-head h1 { font-size: 28px; }
.p-seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--raised); border-radius: 12px; padding: 3px; max-width: 420px; margin-bottom: 14px; }
.p-seg a { text-align: center; padding: 8px 0; border-radius: 9px; font-size: 14px; color: var(--muted); }
.p-seg a:hover { text-decoration: none; color: var(--ink); }
.p-seg a.is-on { background: var(--sheet); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.p-week { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 520px; }
.p-week a { display: grid; justify-items: center; gap: 1px; padding: 6px 0 8px; border-radius: 12px; color: var(--faint); font-size: 11.5px; }
.p-week a:hover { text-decoration: none; background: var(--raised); }
.p-week b { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--ink); line-height: 1.2; }
.p-week a.is-today b { color: var(--accent); }
.p-week a.is-on { background: var(--ink); color: #d8d2c8; }
.p-week a.is-on b { color: #fff; }
.p-dots { display: flex; gap: 2px; height: 5px; margin-top: 3px; }
.p-dots s { width: 5px; height: 5px; border-radius: 50%; background: #c9c0b2; }
.p-dots s.f { background: var(--accent); }
.p-week a.is-on .p-dots s { background: #6e675d; } .p-week a.is-on .p-dots s.f { background: #9fd3b8; }
.p-autos { display: grid; gap: 5px; margin-bottom: 14px; }
.p-auto { margin: 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.p-auto i { font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 5px; background: var(--raised); color: var(--faint); }
.p-carry { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 13.5px; margin-bottom: 14px; }
.p-prog { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.p-bar { height: 4px; border-radius: 2px; background: var(--raised); margin: 7px 0 4px; overflow: hidden; }
.p-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }
.p-list { list-style: none; margin: 0; padding: 0; }
.p-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.p-item form { margin: 0; }
.p-check { width: 24px; height: 24px; border-radius: 50%; border: 1.6px solid #b9b0a2; background: transparent; padding: 0; cursor: pointer; display: grid; place-items: center; transition: background .15s, border-color .15s, transform .1s; }
.p-check:active { transform: scale(.9); }
.p-item.is-done .p-check { background: var(--accent); border-color: var(--accent); }
.p-item.is-done .p-check::after { content: ""; width: 10px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.p-body { min-width: 0; font-size: 15.5px; }
.p-item.is-done .p-body { color: var(--faint); text-decoration: line-through; text-decoration-color: #c9c0b2; }
.p-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 2px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.p-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--tone); }
.p-more { position: relative; }
.p-more summary { list-style: none; cursor: pointer; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--faint); font-size: 18px; line-height: 1; }
.p-more summary::-webkit-details-marker { display: none; }
.p-more[open] summary { background: var(--raised); }
.p-menu { position: absolute; right: 0; top: 32px; z-index: 5; background: var(--sheet); border: 1px solid var(--edge); border-radius: 12px; padding: 4px; min-width: 150px; box-shadow: 0 8px 24px rgba(40, 30, 20, .12); }
.p-menu form { margin: 0; }
.p-menu button { width: 100%; text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 8px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.p-menu button:hover { background: var(--raised); }
.p-menu button.danger { color: var(--danger); }
.p-empty { padding: 26px 0; text-align: center; }
.p-empty p { margin: 0 0 4px; }
.p-add { position: sticky; bottom: 0; background: var(--sheet); padding: 12px 0 10px; margin-top: 14px; border-top: 1px solid var(--rule); max-width: 640px; }
.p-field { display: flex; align-items: center; height: 46px; border: 1px solid var(--edge); border-radius: 12px; background: #fff; padding: 0 6px 0 14px; }
.p-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.p-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; padding: 0; height: 100%; }
.p-field button { width: 34px; height: 34px; border-radius: 9px; border: 0; background: var(--ink); color: var(--sheet); font-size: 20px; line-height: 1; cursor: pointer; flex: none; }
.p-chips { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.p-chips::-webkit-scrollbar { display: none; }
.p-chips label { cursor: pointer; flex: none; position: relative; }
.p-chips input { width: 1px; height: 1px; }
.p-chips input { position: absolute; opacity: 0; pointer-events: none; }
.p-chips { gap: 4px; }
.p-chips label { padding: 0 9px; border: 1px solid var(--edge); border-radius: 6px; height: 28px; }
.p-chips label:has(input:checked) { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.p-chips label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.p-wday { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.p-wday.is-today { background: var(--raised); border-radius: 8px; padding-left: 10px; padding-right: 10px; border-bottom-color: transparent; }
.p-wday-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.p-wday-head a { color: var(--ink); font-size: 14px; }
.p-wday-head b { font-family: var(--font-display); font-size: 19px; margin-right: 2px; }
.p-tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 6px; color: #fff; background: var(--tone, #8a8276); margin: 0 4px 4px 0; }
.p-tag.is-due { background: #c9604c; }
.p-compact .p-item { padding: 6px 0; border-bottom: 0; grid-template-columns: 24px minmax(0, 1fr) auto; }
.p-compact .p-check { width: 20px; height: 20px; }
.p-compact .p-item.is-done .p-check::after { width: 8px; height: 4px; }
.p-compact .p-body { font-size: 14.5px; }
@media (max-width: 720px) {
  .p-add { bottom: calc(64px + env(safe-area-inset-bottom)); }
}
.w3-chat { display: flex; gap: 6px; width: min(420px, 100%); pointer-events: auto; }
.w3-chat[hidden] { display: none; }
.w3-chat input { flex: 1; min-width: 0; height: 42px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .5); background: rgba(255, 252, 246, .92); padding: 0 16px; font: inherit; font-size: 16px; color: #1d1b18; }
.w3-chat input:focus { outline: 2px solid #2c6852; outline-offset: 1px; }
.w3-chat button { height: 42px; padding: 0 16px; border-radius: 8px; border: 0; background: #1d1b18; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.w3-chat button:disabled { opacity: .5; }

/* 장소 카드: 여행 포스터 (3D 장면 + 크림색 액자 + 세로 일본어 이름) */
.poster { position: relative; display: block; padding: 0; background: var(--raised); aspect-ratio: 16 / 10; overflow: hidden; }
.poster img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; filter: saturate(.92) contrast(.97); transition: transform 600ms cubic-bezier(.2, .7, .2, 1); }
.place:hover .poster img { transform: scale(1.03); }
.poster-jp { position: absolute; right: 18px; top: 16px; writing-mode: vertical-rl; font-family: "Shippori Place", var(--font-display); font-weight: 600;
  font-size: clamp(22px, 3vw, 30px); letter-spacing: .12em; color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, .45); }
.poster-en { position: absolute; left: 20px; bottom: 16px; font-size: 10px; font-weight: 600; letter-spacing: .32em; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
@media (prefers-reduced-motion: reduce) { .place:hover .poster img { transform: none; } }

/* ---------- 과제: 답 입력·채점·분석 ---------- */
.tk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tk-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--edge); border-radius: var(--radius); background: var(--sheet); color: var(--ink); }
.tk-row:hover { text-decoration: none; border-color: var(--accent); }
.tk-row.is-late { border-color: var(--danger-soft); }
.tk-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tk-score { font-family: var(--font-display); font-size: 15px; color: var(--muted); } .tk-score b { font-size: 22px; color: var(--accent-ink); }
.tk-go { font-size: 13px; font-weight: 600; color: #fff; background: var(--ink); padding: 6px 12px; border-radius: 8px; }
.omr { list-style: none; margin: 10px 0 18px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px 22px; }
.omr li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.omr-no { width: 26px; text-align: right; font-family: var(--font-display); font-weight: 600; color: var(--muted); }
.omr-choices { display: flex; gap: 6px; }
.omr-choices label { position: relative; cursor: pointer; }
.omr-choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.omr-choices span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid #b9b0a2; font-size: 14px; color: var(--muted); transition: background .12s, color .12s; }
.omr-choices input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.omr-choices input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.omr-text { width: 120px; }
.tk-result { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; margin-bottom: 16px; }
.tk-score-big { display: grid; justify-items: start; padding: 2px 0; }
.tk-score-big b { font-size: 40px; font-weight: 700; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.tk-score-big span { color: var(--muted); } .tk-score-big em { font-style: normal; font-size: 13px; margin-top: 4px; color: var(--accent-ink); font-weight: 600; }
.tk-findings ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.tk-findings ul { gap: 0; }
.tk-findings li { padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; }
.tk-findings li::before { content: attr(data-k); display: inline-block; min-width: 64px; margin-right: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.tk-findings .fd-weak::before { color: var(--danger); }
.tk-units { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tk-units li { display: grid; grid-template-columns: 140px 1fr 56px; align-items: center; gap: 10px; font-size: 13.5px; }
.tk-units b { text-align: right; font-variant-numeric: tabular-nums; }
.tk-bar { height: 8px; border-radius: 4px; background: var(--raised); overflow: hidden; } .tk-bar i { display: block; height: 100%; background: var(--accent); }
.w-0 { width: 2%; } .w-10 { width: 10%; } .w-20 { width: 20%; } .w-30 { width: 30%; } .w-40 { width: 40%; } .w-50 { width: 50%; }
.w-60 { width: 60%; } .w-70 { width: 70%; } .w-80 { width: 80%; } .w-90 { width: 90%; } .w-100 { width: 100%; }
.tk-wrong { list-style: none; margin: 0; padding: 0; } .tk-wrong li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.tk-wrong p { margin: 0 0 6px; }
.tk-mine { color: var(--danger); font-weight: 600; } .tk-key { color: var(--accent-ink); font-weight: 700; }
.tk-sol { font-size: 14px; color: var(--ink); background: var(--raised); padding: 10px 12px; border-radius: 10px; line-height: 1.7; }
.tk-key-table input { width: 64px; } .tk-sol-cell { max-width: 280px; }
@media (max-width: 720px) {
  .tk-result { grid-template-columns: 1fr; }
  .tk-units li { grid-template-columns: 110px 1fr 46px; }
  .omr { grid-template-columns: 1fr; }
}
/* 3D 화면 가운데 카드 (오늘의 운세) */
.w3-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%); z-index: 6; width: min(360px, calc(100% - 32px));
  background: var(--sheet); color: var(--ink); border-radius: 18px; padding: 20px 20px 16px; box-shadow: 0 18px 50px rgba(20, 14, 8, .35);
  animation: w3-card-in 260ms cubic-bezier(.2, .8, .2, 1); }
@keyframes w3-card-in { from { opacity: 0; transform: translate(-50%, -48%) scale(.96); } }
@media (prefers-reduced-motion: reduce) { .w3-card { animation: none; } }
.w3-card-body { display: grid; gap: 10px; }
.w3-card-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 14px; }
/* 오늘의 운세: 신사에 어울리는 종이 쪽지 (위에 얇은 주홍 띠, 가운데 정렬, 상자 없이) */
.w3-card.is-fortune { background: #fbf7ee; color: #3a3129; border-top: 4px solid #b8432f; border-radius: 6px 6px 14px 14px; padding: 22px 22px 16px; text-align: center; width: min(320px, calc(100% - 32px)); }
.w3-card.is-fortune .w3-card-body { gap: 8px; justify-items: center; }
.w3-card.is-fortune .w3-card-actions { justify-content: center; }
.w3-card.is-fortune .btn { background: transparent; border-color: #d8ccb6; color: #3a3129; }
.w3-card.is-fortune .btn.primary { background: #3a3129; border-color: #3a3129; color: #fbf7ee; }
.ft-kicker { margin: 0; font-size: 12px; letter-spacing: .18em; color: #9a8467; }
.ft-luck { margin: 0; font-family: "Noto Serif KR", serif; font-size: 28px; font-weight: 600; letter-spacing: .02em; line-height: 1.25; }
.ft-luck.l-great { color: #a8551a; } .ft-luck.l-good { color: #9b3f4f; } .ft-luck.l-ok { color: #4f6b46; } .ft-luck.l-low { color: #6b5a86; }
.ft-rule { width: 28px; height: 1px; background: #d8ccb6; border: 0; margin: 4px 0; }
.ft-text { margin: 0; font-size: 14.5px; line-height: 1.75; color: #3a3129; word-break: keep-all; }
.ft-charm-line { display: inline-flex; align-items: center; gap: 7px; margin-top: 4px; font-size: 12.5px; color: #85745f; }
.ft-again { margin: 0; font-size: 12px; color: #9a8467; }
.ft-charm { width: 9px; height: 12px; border-radius: 2px; flex: none; }
.ft-charm.c-0 { background: #e2ae25; } .ft-charm.c-1 { background: #e0708a; } .ft-charm.c-2 { background: #4b8fd6; } .ft-charm.c-3 { background: #5fa865; } .ft-charm.c-4 { background: #9673d4; }
.dash-sum { margin: 0 0 18px; color: var(--muted); font-variant-numeric: tabular-nums; }
.todo-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.todo { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px; border: 1px solid var(--edge); border-radius: 10px;
        color: var(--muted); text-decoration: none; background: var(--raised); }
.todo b { font-size: 1.5rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.todo.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.todo.is-on b { color: var(--accent-ink); }
@media (max-width: 560px) { .todo-row { grid-template-columns: 1fr; } }
.dash-sum b { color: var(--ink); font-weight: 700; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ================= 안쪽(로그인 후): 어두운 틀 위에 흰 종이 — 바깥 교재 페이지와 다른 '내 공간' ================= */
:root { --rail: #161917; --rail-2: #202422; --rail-edge: #323834; --rail-ink: #eef0ef; --rail-muted: #9aa29e; --rail-faint: #6f7773; }
body.has-shell { background: var(--rail); }
.side { color: var(--rail-ink); }
.side .brand { color: var(--rail-ink); }
.side .nav a { color: var(--rail-muted); }
.side .nav a:hover { background: var(--rail-2); color: var(--rail-ink); }
.side .nav a.active { background: var(--accent); color: #fff; }
.side .nav-group { color: var(--rail-faint); }
.side .pref { color: var(--rail-muted); border-color: var(--rail-edge); }
.side .pref:hover { color: var(--rail-ink); border-color: var(--rail-ink); }
.side .userbox a { color: var(--rail-ink); }
.side .btn.small { background: transparent; color: var(--rail-ink); border-color: var(--rail-edge); }
.side .btn.small:hover { background: var(--rail-2); border-color: var(--rail-ink); }
.side .affil { filter: brightness(0) invert(1); opacity: .55; }
.has-shell .sheet { border-color: transparent; }
@media (max-width: 900px) {
  .m-top { background: var(--rail); border-bottom-color: var(--rail); }
  .m-brand { color: var(--rail-ink); }
  .m-who { color: var(--rail-muted); }
  .has-shell .sheet { border-radius: 14px 14px 0 0; }
  .m-tabs { background: var(--rail); border-top-color: var(--rail); }
  .m-tabs a, .m-tabs button { color: var(--rail-faint); }
  .m-tabs a.active, .m-tabs button[aria-expanded="true"] { color: var(--rail-ink); }
}

/* 입장 연출: 누르면 화면이 어두워지고(0.34초), 안쪽 첫 화면에서 어둠이 걷히며 종이가 올라온다 */
html.entering::after { content: ""; position: fixed; inset: 0; z-index: 9999; background: var(--rail); animation: door-close 340ms cubic-bezier(.4, 0, .2, 1) forwards; }
html.entering body > main { transition: transform 340ms cubic-bezier(.4, 0, .2, 1); transform: scale(.985); }
@keyframes door-close { from { opacity: 0; } to { opacity: 1; } }
body.entered::after { content: ""; position: fixed; inset: 0; z-index: 9999; background: var(--rail); pointer-events: none; animation: door-open 420ms 60ms cubic-bezier(.2, .7, .2, 1) both; }
body.entered .sheet { animation: sheet-rise 620ms 80ms cubic-bezier(.2, .7, .2, 1) both; }
body.entered .side .nav { animation: rail-in 520ms 160ms cubic-bezier(.2, .7, .2, 1) both; }
@keyframes door-open { from { opacity: 1; } to { opacity: 0; } }
@keyframes sheet-rise { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rail-in { from { transform: translateX(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  html.entering::after, body.entered::after { animation: none; display: none; }
  body.entered .sheet, body.entered .side .nav, html.entering body > main { animation: none; transition: none; transform: none; }
}

/* 폼 오류: 어느 칸이 문제인지 그 자리에서 */
.form-err { margin: 0 0 14px; padding: 10px 14px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: 14px; }
.field-err { margin: 6px 0 0; color: var(--danger); font-size: 13px; }
.has-err input, .has-err select, .has-err textarea { border-color: var(--danger) !important; }
.photo-field.has-err input[type=file]::file-selector-button { border-color: var(--danger); color: var(--danger); }
.photo-preview { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 8px; border: 1px solid var(--edge); border-radius: 8px; background: var(--raised); }
.photo-preview[hidden] { display: none; }
.photo-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--sheet); }
.photo-preview span { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-note { margin: 8px 0 0; }

/* 질답: 이번 주 많이 본 질문 */
.best-list { list-style: none; margin: 0; padding: 0; }
.best-list li { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule); }
.best-list li:first-child { border-top: 0; }
.best-list a { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; color: var(--ink); }
.best-list a b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.best-no { flex: none; width: 1.2em; font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 700; }
.best-meta { flex: none; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 조교·선생님 캡션: 본명 앞 작은 표시 */
.cap { display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-ink); font-size: 11.5px; font-weight: 600; line-height: 1.6; vertical-align: 1px; letter-spacing: 0; }
.side .cap, .m-top .cap { background: var(--accent); color: #fff; }

/* 객관식: 한 문제씩 바로 채점 */
.mc-choice:disabled { opacity: 1; cursor: default; }
.mc-choice.is-picked { border-color: var(--ink); }
.mc-choice.is-right { border-color: var(--ok); background: var(--ok-soft); color: var(--accent-ink); font-weight: 600; }
.mc-choice.is-wrong { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.mc-feedback { margin-top: 14px; padding: 12px 14px; border-radius: 8px; border-left: 3px solid var(--ok); background: var(--ok-soft); }
.mc-feedback.wrong { border-left-color: var(--danger); background: var(--danger-soft); }
.mc-feedback b { display: block; }
.mc-feedback p { margin: 6px 0 12px; font-size: 14px; color: var(--ink); }
.mc-feedback .btn { margin-top: 2px; }

/* 왼쪽 메뉴가 길어 스크롤해도 맨 위 로고는 그대로 */
@media (min-width: 901px) {
  .side .brand { position: sticky; top: -20px; z-index: 2; margin: -20px -12px 0 -16px; padding: 20px 20px 22px 24px; background: var(--rail); }
}

/* ================= 내 시간표 (에브리타임식 격자) ================= */
.tt-head-side { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.tt-import { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 14px; border-radius: 8px; background: var(--raised); font-size: 14px; }
.tt-grid { display: grid; grid-template-rows: 30px; grid-auto-rows: 8px; border: 1px solid var(--edge); border-radius: 10px; overflow: hidden; background: var(--sheet); user-select: none; }
.tt-cols-1 { grid-template-columns: 34px repeat(1, minmax(0, 1fr)); }
.tt-cols-2 { grid-template-columns: 34px repeat(2, minmax(0, 1fr)); }
.tt-cols-3 { grid-template-columns: 34px repeat(3, minmax(0, 1fr)); }
.tt-cols-4 { grid-template-columns: 34px repeat(4, minmax(0, 1fr)); }
.tt-cols-5 { grid-template-columns: 34px repeat(5, minmax(0, 1fr)); }
.tt-cols-6 { grid-template-columns: 34px repeat(6, minmax(0, 1fr)); }
.tt-cols-7 { grid-template-columns: 34px repeat(7, minmax(0, 1fr)); }
.tt-c1 { grid-column: 2; }
.tt-c2 { grid-column: 3; }
.tt-c3 { grid-column: 4; }
.tt-c4 { grid-column: 5; }
.tt-c5 { grid-column: 6; }
.tt-c6 { grid-column: 7; }
.tt-c7 { grid-column: 8; }
.tt-r1 { grid-row-start: 2; }
.tt-r2 { grid-row-start: 3; }
.tt-r3 { grid-row-start: 4; }
.tt-r4 { grid-row-start: 5; }
.tt-r5 { grid-row-start: 6; }
.tt-r6 { grid-row-start: 7; }
.tt-r7 { grid-row-start: 8; }
.tt-r8 { grid-row-start: 9; }
.tt-r9 { grid-row-start: 10; }
.tt-r10 { grid-row-start: 11; }
.tt-r11 { grid-row-start: 12; }
.tt-r12 { grid-row-start: 13; }
.tt-r13 { grid-row-start: 14; }
.tt-r14 { grid-row-start: 15; }
.tt-r15 { grid-row-start: 16; }
.tt-r16 { grid-row-start: 17; }
.tt-r17 { grid-row-start: 18; }
.tt-r18 { grid-row-start: 19; }
.tt-r19 { grid-row-start: 20; }
.tt-r20 { grid-row-start: 21; }
.tt-r21 { grid-row-start: 22; }
.tt-r22 { grid-row-start: 23; }
.tt-r23 { grid-row-start: 24; }
.tt-r24 { grid-row-start: 25; }
.tt-r25 { grid-row-start: 26; }
.tt-r26 { grid-row-start: 27; }
.tt-r27 { grid-row-start: 28; }
.tt-r28 { grid-row-start: 29; }
.tt-r29 { grid-row-start: 30; }
.tt-r30 { grid-row-start: 31; }
.tt-r31 { grid-row-start: 32; }
.tt-r32 { grid-row-start: 33; }
.tt-r33 { grid-row-start: 34; }
.tt-r34 { grid-row-start: 35; }
.tt-r35 { grid-row-start: 36; }
.tt-r36 { grid-row-start: 37; }
.tt-r37 { grid-row-start: 38; }
.tt-r38 { grid-row-start: 39; }
.tt-r39 { grid-row-start: 40; }
.tt-r40 { grid-row-start: 41; }
.tt-r41 { grid-row-start: 42; }
.tt-r42 { grid-row-start: 43; }
.tt-r43 { grid-row-start: 44; }
.tt-r44 { grid-row-start: 45; }
.tt-r45 { grid-row-start: 46; }
.tt-r46 { grid-row-start: 47; }
.tt-r47 { grid-row-start: 48; }
.tt-r48 { grid-row-start: 49; }
.tt-r49 { grid-row-start: 50; }
.tt-r50 { grid-row-start: 51; }
.tt-r51 { grid-row-start: 52; }
.tt-r52 { grid-row-start: 53; }
.tt-r53 { grid-row-start: 54; }
.tt-r54 { grid-row-start: 55; }
.tt-r55 { grid-row-start: 56; }
.tt-r56 { grid-row-start: 57; }
.tt-r57 { grid-row-start: 58; }
.tt-r58 { grid-row-start: 59; }
.tt-r59 { grid-row-start: 60; }
.tt-r60 { grid-row-start: 61; }
.tt-r61 { grid-row-start: 62; }
.tt-r62 { grid-row-start: 63; }
.tt-r63 { grid-row-start: 64; }
.tt-r64 { grid-row-start: 65; }
.tt-r65 { grid-row-start: 66; }
.tt-r66 { grid-row-start: 67; }
.tt-r67 { grid-row-start: 68; }
.tt-r68 { grid-row-start: 69; }
.tt-r69 { grid-row-start: 70; }
.tt-r70 { grid-row-start: 71; }
.tt-r71 { grid-row-start: 72; }
.tt-r72 { grid-row-start: 73; }
.tt-r73 { grid-row-start: 74; }
.tt-r74 { grid-row-start: 75; }
.tt-r75 { grid-row-start: 76; }
.tt-r76 { grid-row-start: 77; }
.tt-r77 { grid-row-start: 78; }
.tt-r78 { grid-row-start: 79; }
.tt-r79 { grid-row-start: 80; }
.tt-r80 { grid-row-start: 81; }
.tt-r81 { grid-row-start: 82; }
.tt-r82 { grid-row-start: 83; }
.tt-r83 { grid-row-start: 84; }
.tt-r84 { grid-row-start: 85; }
.tt-r85 { grid-row-start: 86; }
.tt-r86 { grid-row-start: 87; }
.tt-r87 { grid-row-start: 88; }
.tt-r88 { grid-row-start: 89; }
.tt-r89 { grid-row-start: 90; }
.tt-r90 { grid-row-start: 91; }
.tt-r91 { grid-row-start: 92; }
.tt-r92 { grid-row-start: 93; }
.tt-r93 { grid-row-start: 94; }
.tt-r94 { grid-row-start: 95; }
.tt-r95 { grid-row-start: 96; }
.tt-r96 { grid-row-start: 97; }
.tt-r97 { grid-row-start: 98; }
.tt-r98 { grid-row-start: 99; }
.tt-r99 { grid-row-start: 100; }
.tt-r100 { grid-row-start: 101; }
.tt-r101 { grid-row-start: 102; }
.tt-r102 { grid-row-start: 103; }
.tt-r103 { grid-row-start: 104; }
.tt-sp1 { grid-row-end: span 1; }
.tt-sp2 { grid-row-end: span 2; }
.tt-sp3 { grid-row-end: span 3; }
.tt-sp4 { grid-row-end: span 4; }
.tt-sp5 { grid-row-end: span 5; }
.tt-sp6 { grid-row-end: span 6; }
.tt-sp7 { grid-row-end: span 7; }
.tt-sp8 { grid-row-end: span 8; }
.tt-sp9 { grid-row-end: span 9; }
.tt-sp10 { grid-row-end: span 10; }
.tt-sp11 { grid-row-end: span 11; }
.tt-sp12 { grid-row-end: span 12; }
.tt-sp13 { grid-row-end: span 13; }
.tt-sp14 { grid-row-end: span 14; }
.tt-sp15 { grid-row-end: span 15; }
.tt-sp16 { grid-row-end: span 16; }
.tt-sp17 { grid-row-end: span 17; }
.tt-sp18 { grid-row-end: span 18; }
.tt-sp19 { grid-row-end: span 19; }
.tt-sp20 { grid-row-end: span 20; }
.tt-sp21 { grid-row-end: span 21; }
.tt-sp22 { grid-row-end: span 22; }
.tt-sp23 { grid-row-end: span 23; }
.tt-sp24 { grid-row-end: span 24; }
.tt-sp25 { grid-row-end: span 25; }
.tt-sp26 { grid-row-end: span 26; }
.tt-sp27 { grid-row-end: span 27; }
.tt-sp28 { grid-row-end: span 28; }
.tt-sp29 { grid-row-end: span 29; }
.tt-sp30 { grid-row-end: span 30; }
.tt-sp31 { grid-row-end: span 31; }
.tt-sp32 { grid-row-end: span 32; }
.tt-sp33 { grid-row-end: span 33; }
.tt-sp34 { grid-row-end: span 34; }
.tt-sp35 { grid-row-end: span 35; }
.tt-sp36 { grid-row-end: span 36; }
.tt-sp37 { grid-row-end: span 37; }
.tt-sp38 { grid-row-end: span 38; }
.tt-sp39 { grid-row-end: span 39; }
.tt-sp40 { grid-row-end: span 40; }
.tt-sp41 { grid-row-end: span 41; }
.tt-sp42 { grid-row-end: span 42; }
.tt-sp43 { grid-row-end: span 43; }
.tt-sp44 { grid-row-end: span 44; }
.tt-sp45 { grid-row-end: span 45; }
.tt-sp46 { grid-row-end: span 46; }
.tt-sp47 { grid-row-end: span 47; }
.tt-sp48 { grid-row-end: span 48; }
.tt-sp49 { grid-row-end: span 49; }
.tt-sp50 { grid-row-end: span 50; }
.tt-sp51 { grid-row-end: span 51; }
.tt-sp52 { grid-row-end: span 52; }
.tt-sp53 { grid-row-end: span 53; }
.tt-sp54 { grid-row-end: span 54; }
.tt-sp55 { grid-row-end: span 55; }
.tt-sp56 { grid-row-end: span 56; }
.tt-sp57 { grid-row-end: span 57; }
.tt-sp58 { grid-row-end: span 58; }
.tt-sp59 { grid-row-end: span 59; }
.tt-sp60 { grid-row-end: span 60; }
.tt-sp61 { grid-row-end: span 61; }
.tt-sp62 { grid-row-end: span 62; }
.tt-sp63 { grid-row-end: span 63; }
.tt-sp64 { grid-row-end: span 64; }
.tt-sp65 { grid-row-end: span 65; }
.tt-sp66 { grid-row-end: span 66; }
.tt-sp67 { grid-row-end: span 67; }
.tt-sp68 { grid-row-end: span 68; }
.tt-sp69 { grid-row-end: span 69; }
.tt-sp70 { grid-row-end: span 70; }
.tt-sp71 { grid-row-end: span 71; }
.tt-sp72 { grid-row-end: span 72; }
.tt-sp73 { grid-row-end: span 73; }
.tt-sp74 { grid-row-end: span 74; }
.tt-sp75 { grid-row-end: span 75; }
.tt-sp76 { grid-row-end: span 76; }
.tt-sp77 { grid-row-end: span 77; }
.tt-sp78 { grid-row-end: span 78; }
.tt-sp79 { grid-row-end: span 79; }
.tt-sp80 { grid-row-end: span 80; }
.tt-sp81 { grid-row-end: span 81; }
.tt-sp82 { grid-row-end: span 82; }
.tt-sp83 { grid-row-end: span 83; }
.tt-sp84 { grid-row-end: span 84; }
.tt-sp85 { grid-row-end: span 85; }
.tt-sp86 { grid-row-end: span 86; }
.tt-sp87 { grid-row-end: span 87; }
.tt-sp88 { grid-row-end: span 88; }
.tt-sp89 { grid-row-end: span 89; }
.tt-sp90 { grid-row-end: span 90; }
.tt-sp91 { grid-row-end: span 91; }
.tt-sp92 { grid-row-end: span 92; }
.tt-sp93 { grid-row-end: span 93; }
.tt-sp94 { grid-row-end: span 94; }
.tt-sp95 { grid-row-end: span 95; }
.tt-sp96 { grid-row-end: span 96; }
.tt-sp97 { grid-row-end: span 97; }
.tt-sp98 { grid-row-end: span 98; }
.tt-sp99 { grid-row-end: span 99; }
.tt-sp100 { grid-row-end: span 100; }
.tt-sp101 { grid-row-end: span 101; }
.tt-sp102 { grid-row-end: span 102; }
.tt-sp103 { grid-row-end: span 103; }
.tt-corner { grid-column: 1; grid-row: 1; border-bottom: 1px solid var(--edge); }
.tt-dayhead { grid-row: 1; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--edge); border-left: 1px solid var(--rule); }
.tt-dayhead.is-today { color: var(--accent-ink); background: var(--accent-soft); }
.tt-hour { grid-column: 1; grid-row-end: span 6; font-size: 11px; color: var(--faint); text-align: right; padding: 2px 6px 0 0; font-variant-numeric: tabular-nums; border-top: 1px solid var(--rule); }
.tt-col { z-index: 0; margin: 0; padding: 0; border: 0; border-left: 1px solid var(--rule); cursor: cell; font: inherit;
  background: repeating-linear-gradient(to bottom, var(--rule) 0 1px, transparent 1px 24px, color-mix(in srgb, var(--rule) 55%, transparent) 24px 25px, transparent 25px 48px); }
.tt-col.is-today { background-color: color-mix(in srgb, var(--accent-soft) 35%, transparent); }
.tt-col:hover { background-color: color-mix(in srgb, var(--raised) 70%, transparent); }
.tt-block { z-index: 1; margin: 1px 2px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 4px 6px; overflow: hidden; text-align: left; cursor: pointer; font: inherit;
  border: 0; border-left: 3px solid var(--tone); border-radius: 6px; background: color-mix(in srgb, var(--tone) 20%, var(--sheet)); color: var(--ink); }
.tt-block b { font-size: 12.5px; font-weight: 600; line-height: 1.25; word-break: keep-all; overflow-wrap: anywhere; }
.tt-block span { font-size: 11px; color: var(--muted); line-height: 1.3; font-variant-numeric: tabular-nums; }
.tt-block.is-short { justify-content: center; padding-block: 0; }
.tt-block.is-short b { font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; max-width: 100%; }
.tt-block.is-now { box-shadow: inset 0 0 0 2px var(--tone); }
.tt-block:hover { background: color-mix(in srgb, var(--tone) 30%, var(--sheet)); }
.tt-sheet { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(15, 17, 16, .45); }
.tt-sheet[hidden] { display: none; }
.tt-form { width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--sheet); border-radius: 14px; padding: 18px 18px 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.tt-form-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tt-form-head h2 { margin: 0; font-size: 17px; }
.tt-days { display: flex; gap: 6px; flex-wrap: wrap; }
.tt-tones { display: flex; gap: 8px; flex-wrap: wrap; }
.tt-tone { width: 28px; height: 28px; border-radius: 50%; background: var(--tone); cursor: pointer; position: relative; }
.tt-tone input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tt-tone:has(input:checked) { box-shadow: 0 0 0 2px var(--sheet), 0 0 0 4px var(--ink); }
.tt-form-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; }
.tt-form-actions .btn.primary { margin-left: auto; }
body.tt-open { overflow: hidden; }
@media (max-width: 560px) { .tt-grid { grid-auto-rows: 7px; } .tt-col { background: repeating-linear-gradient(to bottom, var(--rule) 0 1px, transparent 1px 21px, color-mix(in srgb, var(--rule) 55%, transparent) 21px 22px, transparent 22px 42px); } .tt-block { padding: 3px 4px; } .tt-block b { font-size: 11.5px; } .tt-block span { display: none; } }
.tt-form input:not([type]), .tt-form input[type=text], .tt-form input[type=time] { width: 100%; min-height: 40px; }

/* ================= 미니 Quiz ================= */
.qz-sec { margin-bottom: 34px; }
.qz-voca { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.qz-today, .qz-review { display: grid; gap: 6px; align-content: start; padding: 18px 20px; border-radius: 12px; color: var(--ink); text-decoration: none; transition: transform 150ms ease, box-shadow 150ms ease; }
.qz-today { background: var(--rail); color: var(--rail-ink); }
.qz-today:hover, .qz-review:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0, 0, 0, .12); }
.qz-review { background: var(--accent-soft); color: var(--accent-ink); }
.qz-review.is-empty { background: var(--raised); color: var(--muted); }
.qz-k { font-size: 13px; font-weight: 600; opacity: .8; }
.qz-today b, .qz-review b { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; }
.qz-review b small { font-size: 15px; font-weight: 600; margin-left: 2px; }
.qz-s { font-size: 13px; opacity: .85; }
.qz-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .16); overflow: hidden; margin-top: 4px; }
.qz-fill { display: block; height: 100%; background: #9fd6bf; border-radius: inherit; }
.qz-topics, .qz-extra { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.qz-extra { margin-top: 10px; }
.qz-topics a, .qz-extra a { display: grid; gap: 4px; height: 100%; padding: 14px 16px; border: 1px solid var(--edge); border-radius: 10px; color: var(--ink); background: var(--sheet); transition: border-color 150ms ease, transform 150ms ease; }
.qz-topics a:hover, .qz-extra a:hover { text-decoration: none; border-color: var(--ink); transform: translateY(-1px); }
.qz-topics b, .qz-extra b { font-size: 15.5px; font-weight: 600; }
.qz-topics span, .qz-extra span { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.qz-topics em, .qz-extra em { font-style: normal; font-size: 12px; color: var(--accent-ink); font-weight: 600; }
.qz-extra a { background: var(--raised); }
@media (max-width: 640px) { .qz-voca { grid-template-columns: minmax(0, 1fr); } }
/* 영단어 카드 */
.voca-grid { list-style: none; margin: 0 0 26px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.voca-card { width: 100%; min-height: 78px; display: grid; gap: 4px; align-content: center; padding: 12px 14px; text-align: left; font: inherit; cursor: pointer;
  border: 1px solid var(--edge); border-radius: 10px; background: var(--sheet); color: var(--ink); transition: border-color 150ms ease, background 150ms ease; }
.voca-card:hover { border-color: var(--ink); }
.voca-card b { font-size: 17px; font-weight: 700; letter-spacing: .01em; }
.voca-card span { font-size: 13.5px; color: var(--muted); filter: blur(5px); opacity: .55; transition: filter 180ms ease, opacity 180ms ease; user-select: none; }
.voca-card[aria-pressed="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, var(--edge)); }
.voca-card[aria-pressed="true"] span { filter: none; opacity: 1; color: var(--accent-ink); user-select: auto; }
.voca-quiz-h { font-size: 18px; margin: 0 0 12px; }
.voca-quiz-h small { font-size: 13px; font-weight: 400; }
@media (prefers-reduced-motion: reduce) { .voca-card span { transition: none; } }
.qz-p0 { width: 0%; }
.qz-p1 { width: 5%; }
.qz-p2 { width: 10%; }
.qz-p3 { width: 15%; }
.qz-p4 { width: 20%; }
.qz-p5 { width: 25%; }
.qz-p6 { width: 30%; }
.qz-p7 { width: 35%; }
.qz-p8 { width: 40%; }
.qz-p9 { width: 45%; }
.qz-p10 { width: 50%; }
.qz-p11 { width: 55%; }
.qz-p12 { width: 60%; }
.qz-p13 { width: 65%; }
.qz-p14 { width: 70%; }
.qz-p15 { width: 75%; }
.qz-p16 { width: 80%; }
.qz-p17 { width: 85%; }
.qz-p18 { width: 90%; }
.qz-p19 { width: 95%; }
.qz-p20 { width: 100%; }
#mc-game[data-game^="vocab"] .mc-question { font-size: 24px; font-weight: 700; letter-spacing: .01em; }

/* 3D: 사진 찍기 */
.w3-top-r { display: flex; gap: 8px; }
.w3-stage.is-flash::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: .85; pointer-events: none; animation: w3-flash 260ms ease-out forwards; z-index: 9; }
@keyframes w3-flash { to { opacity: 0; } }
.w3-photo { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(10, 12, 11, .62); }
.w3-photo[hidden] { display: none; }
.w3-photo-card { width: min(860px, 100%); background: var(--sheet); border-radius: 14px; padding: 12px; box-shadow: 0 24px 70px rgba(0, 0, 0, .4); animation: w3-card-in 220ms cubic-bezier(.2, .8, .2, 1); }
.w3-photo-card img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; border-radius: 8px; background: #111; }
.w3-photo-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
@media (prefers-reduced-motion: reduce) { .w3-stage.is-flash::after, .w3-photo-card { animation: none; } }
.codes-table { max-height: 360px; overflow: auto; margin-top: 12px; }
.codes-table code { font-size: 13.5px; letter-spacing: .04em; }

/* 내 성적 표: 좁은 화면에서도 시험 이름·점수가 글자 중간에서 끊기지 않게 */
.score-table td, .score-table th { white-space: nowrap; overflow-wrap: normal; }
@media (max-width: 480px) { .score-table .st-subj { display: none; } }

/* 회원가입: 칸 아래 안내·인라인 에러·비밀번호 강도 */
.field-hint { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.signup-form input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-soft); }
.signup-form input[aria-invalid="true"]:focus { outline-color: var(--danger); }
.signup-form input[type="checkbox"][aria-invalid="true"] { outline: 2px solid var(--danger); outline-offset: 2px; }
.pw-meter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.pw-meter i { height: 4px; border-radius: 4px; background: var(--edge); transition: background-color .2s ease; }
.pw-meter[data-lvl="1"] i:nth-child(1) { background: var(--danger); }
.pw-meter[data-lvl="2"] i:nth-child(-n+2) { background: #c98a14; }
.pw-meter[data-lvl="3"] i { background: var(--ok); }
.field-hint.pw-1 { color: var(--danger); } .field-hint.pw-2 { color: #8a5a00; } .field-hint.pw-3 { color: var(--ok); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .pw-meter i { transition: none; } }

/* ---- 소도시 명상 화면 위 요소: 잘 보이게 (밝은 눈밭·하늘 위에서도) ---- */
.w3-stage::before, .w3-stage::after { content: ""; position: absolute; left: 0; right: 0; pointer-events: none; z-index: 0; }
.w3-stage::before { top: 0; height: 130px; background: linear-gradient(180deg, rgba(14, 16, 14, .42), rgba(14, 16, 14, 0)); }
.w3-stage::after { bottom: 0; height: 190px; background: linear-gradient(0deg, rgba(14, 16, 14, .5), rgba(14, 16, 14, 0)); }
.w3-top, .w3-bottom, .w3-whisper, .w3-hud, .w3-enter { z-index: 1; }
.w3-place { text-shadow: 0 1px 3px rgba(0, 0, 0, .7), 0 0 14px rgba(0, 0, 0, .45); }
.w3-hint { text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.w3-hint:empty { display: none; }
/* 집중 타이머: 화면 위 하나만 */
.w3-hud { position: absolute; left: 50%; top: 66px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 7px 18px 7px 9px;
  border-radius: 999px; background: rgba(20, 24, 22, .82); color: #fff; pointer-events: none; }
.w3-hud[hidden] { display: none; }
.w3-hud svg { width: 34px; height: 34px; }
.w3-hud circle { fill: none; stroke-width: 4; }
.w3-hud-bg { stroke: rgba(255, 255, 255, .18); }
.w3-hud-fg { stroke: #9fd6bf; stroke-linecap: round; transition: stroke-dasharray .5s linear; }
.w3-hud b { font-family: var(--font-display); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em; line-height: 1; }
/* 집중 시작: 앉으면 가장 먼저 보이는 큰 버튼 */
.w3-plans { align-items: center; padding: 5px; border-radius: 12px; background: rgba(28, 26, 22, .5); }
.w3-plans[hidden] { display: none; }
.w3-plans .w3-chip span { border: 0; background: transparent; color: #fff; padding: 7px 14px; backdrop-filter: none; -webkit-backdrop-filter: none; }
.w3-plans .w3-chip input:checked + span { background: #fff; color: #1d1b18; font-weight: 700; }
.w3-cta { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: min(420px, 100%); min-height: 56px; padding: 0 22px;
  border: 0; border-radius: 16px; background: #2c6852; color: #fff; font: inherit; cursor: pointer;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 10px 26px -8px rgba(0, 0, 0, .6); transition: transform .12s ease, background-color .15s ease; }
.w3-cta[hidden] { display: none; }
.w3-cta svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.w3-cta b { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.w3-cta span { font-size: 14px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .2); font-variant-numeric: tabular-nums; }
.w3-cta:hover { background: #245844; }
.w3-cta:active { transform: scale(.97); }
.w3-cta:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.w3-cta::after { content: ""; position: absolute; inset: -3px; border-radius: 19px; border: 2px solid #fff; opacity: 0; animation: w3-cta-pulse 2.4s ease-out infinite; pointer-events: none; }
@keyframes w3-cta-pulse { 0% { opacity: .7; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.06, 1.28); } }
.w3-act.is-armed { background: #c4553b; color: #fff; }
@media (prefers-reduced-motion: reduce) { .w3-cta::after { animation: none; } .w3-hud-fg { transition: none; } }
@media (max-width: 900px) { .w3-hud { top: 60px; } .w3-stage.is-focus .w3-whisper { top: 114px; } }
.w3-stage.is-flash::after { height: auto; }

/* ---- 조교 시스템 연동: 학생코드 연결, 시험 성적, 시험 오답 분석, 출결 ---- */
.sys-link { border: 1px solid var(--accent-soft); }
.sys-link h2 { margin: 0 0 4px; font-size: 16px; }
.sys-link-form { display: flex; gap: 8px; margin-top: 10px; }
.sys-link-form input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.sec-title { font-size: 15px; margin: 22px 0 10px; }
.ss-list { list-style: none; margin: 0; padding: 0; }
.ss-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--rule); }
.ss-row:first-child { border-top: 0; }
.ss-main { display: grid; gap: 2px; min-width: 0; }
.ss-main b { font-weight: 600; }
.ss-num { display: grid; justify-items: end; gap: 2px; text-align: right; }
.ss-score b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ss-score small { color: var(--muted); }
.ss-up { color: var(--ok); font-weight: 600; } .ss-down { color: var(--danger); font-weight: 600; }
.ss-bar { grid-column: 1 / -1; position: relative; height: 6px; border-radius: 6px; background: var(--rule); overflow: visible; }
.ss-bar .pg-fill { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
.ss-avg { position: absolute; top: -3px; bottom: -3px; left: 0; border-right: 2px solid var(--ink); pointer-events: none; }
.sys-wrong { margin-bottom: 22px; }
.sw-exam h3 { margin: 0; font-size: 15px; }
.sw-list { list-style: none; margin: 0; padding: 0; }
.sw-item { padding: 12px 0; border-top: 1px solid var(--rule); display: grid; gap: 6px; }
.sw-item:first-child { border-top: 0; }
.sw-item.is-done .w-no { color: var(--ok); }
.sw-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.sw-text { margin: 0; line-height: 1.6; }
.sw-redo { display: flex; align-items: center; gap: 6px; }
.chip-btn { font: inherit; font-size: 13px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--edge); background: var(--surface); color: var(--text); cursor: pointer; }
.chip-btn.is-on { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); font-weight: 600; }
.chip-btn.is-on.bad { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.att-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.att-sum div { background: var(--surface); border: 1px solid var(--edge); border-radius: 10px; padding: 10px; display: grid; justify-items: center; }
.att-sum b { font-size: 22px; font-variant-numeric: tabular-nums; } .att-sum span { font-size: 12px; color: var(--muted); }
.att-list { list-style: none; margin: 0; padding: 0; }
.att-list li { display: grid; grid-template-columns: 52px 1fr auto auto; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--rule); }
.att-list li:first-child { border-top: 0; }
.att-list time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.att-tag { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 6px; background: var(--bg); color: var(--muted); justify-self: start; }
.att-tag.att-1 { background: var(--ok-soft); color: var(--ok); } .att-tag.att-2, .att-tag.att-3 { background: var(--warn-soft); color: var(--warn); } .att-tag.att-4 { background: var(--danger-soft); color: var(--danger); }
.att-sum .att-1 b { color: var(--ok); } .att-sum .att-2 b, .att-sum .att-3 b { color: var(--warn); } .att-sum .att-4 b { color: var(--danger); }
.rs-sub { margin: 4px 0 6px; }
.rs-type { font-size: 18px; font-weight: 700; margin: 2px 0 6px; }
.rs-coach { background: var(--accent-soft); color: var(--accent-ink); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; line-height: 1.6; }
.rs-bars-sm li { font-size: 12.5px; }
.pg-fill.is-low { background: var(--danger); }
.sys-token input { width: 100%; font-family: ui-monospace, Menlo, monospace; }
.steps-list { padding-left: 18px; line-height: 1.8; }
.code-block { white-space: pre; overflow-x: auto; font-size: 12px; line-height: 1.55; background: var(--raised); border: 1px solid var(--edge); border-radius: 8px; padding: 12px; }
.att-list.att-3 li { grid-template-columns: 52px auto 1fr; }
.att-list.att-3 li > span:last-child { text-align: right; }
@media (max-width: 480px) { .att-list li { grid-template-columns: 44px 1fr auto auto; gap: 8px; } .att-list.att-3 li { grid-template-columns: 44px auto 1fr; } }
.nowrap { white-space: nowrap; }
.rs-bars li { grid-template-columns: 80px 1fr auto; }
.rs-bars li > b { white-space: nowrap; min-width: 2.4em; text-align: right; }
.row > .grow { flex: 1; min-width: 0; }
/* 교재 구매 */
.shop-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.shop-item { background: var(--surface); border: 1px solid var(--edge); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.shop-item img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: var(--raised); }
.shop-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.shop-meta div { display: grid; gap: 1px; min-width: 0; }
.shop-meta b { font-size: 16px; font-weight: 700; }
.shop-meta span { font-size: 13px; color: var(--muted); }
.shop-meta .btn { flex: none; }
.shop-wait { font-size: 13px; color: var(--muted); padding: 6px 12px; border: 1px dashed var(--edge); border-radius: 8px; }
/* 가입: 단과 / 재종 고르기 */
.track-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 4px; }
.track-box { display: grid; gap: 4px; align-content: start; padding: 22px 18px; min-height: 140px; border: 1.5px solid var(--edge); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s ease, background-color .15s ease; }
.track-box:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.track-box:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.track-box b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.track-box span { font-size: 14px; color: var(--muted); }
.track-box em { margin-top: auto; padding-top: 14px; font-style: normal; font-size: 13px; font-weight: 600; color: var(--accent-ink); }
.track-now { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 2px; font-size: 14px; }
/* 반 만들기: 단과/재종 고르기 */
.seg-pick { display: inline-flex; border: 1px solid var(--edge); border-radius: 8px; padding: 3px; gap: 2px; background: var(--sheet); }
.seg-pick label { position: relative; margin: 0; }
.seg-pick input { position: absolute; opacity: 0; }
.seg-pick span { display: inline-block; padding: 6px 14px; border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg-pick input:checked + span { background: var(--ink); color: var(--sheet); font-weight: 600; }
.seg-pick input:focus-visible + span { outline: 2px solid var(--accent); }

/* ---- Quiz 개편: 모드 카드, 문제 형식(O/X·철자), 스피드 O/X, 짝 맞추기, RNA ---- */
.qz-voca { margin-bottom: 30px; }
.qz-modes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.qz-modes a { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto auto; column-gap: 12px; row-gap: 2px; align-items: center; padding: 16px; border: 1px solid var(--edge); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; transition: transform 150ms ease, border-color 150ms ease; }
.qz-modes a:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--accent); }
.qz-modes b { font-size: 15.5px; }
.qz-modes span:not(.qz-ico) { grid-column: 2; font-size: 13px; color: var(--muted); }
.qz-modes em { grid-column: 2; font-style: normal; font-size: 12px; font-weight: 700; color: var(--accent); }
.qz-ico { grid-row: 1 / span 3; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 15px; font-weight: 800; color: #fff; }
.qi-match { background: #7b5cc4; } .qi-match::after { content: "⇄"; font-size: 20px; }
.qi-speed { background: #e0644a; } .qi-speed::after { content: "O X"; letter-spacing: .02em; }
.qi-mix { background: #2c6852; } .qi-mix::after { content: "Aa"; }
.qi-calc { background: #3a8fd1; } .qi-calc::after { content: "%"; font-size: 19px; }
.qi-dna { background: #e0a127; } .qi-dna::after { content: "AT"; }
.qi-rna { background: #2a9d9a; } .qi-rna::after { content: "AU"; }
/* 문제 머리: 단원 표시 · 안내 · 본문 · 보조 */
.mc-question { display: grid; gap: 4px; margin: 6px 0 14px; }
.mc-tag { justify-self: start; font-size: 11.5px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
.mc-prompt { font-size: 13px; font-weight: 500; color: var(--muted); }
.mc-main { font-size: 18px; font-weight: 700; line-height: 1.45; }
.kind-mc .mc-main, .kind-ox .mc-main { font-size: 30px; letter-spacing: -.01em; }
.kind-spell .mc-main, .kind-rev .mc-main { font-size: 22px; }
.mc-sub { font-size: 20px; font-weight: 600; color: var(--accent-ink); padding: 10px 12px; border-radius: 10px; background: var(--raised); }
.mc-choices.kind-ox { flex-direction: row; }
.mc-choices.kind-ox .mc-choice { flex: 1; text-align: center; font-size: 18px; font-weight: 700; padding: 18px 10px; }
.mc-choice.ox-o:not(.is-right):not(.is-wrong) { color: #2f6fb3; } .mc-choice.ox-x:not(.is-right):not(.is-wrong) { color: #c4553b; }
/* 철자 맞추기 */
.mc-choices.kind-spell { gap: 14px; }
.sp-slots { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-slot { width: 38px; height: 46px; border-radius: 8px; border: 1.5px solid var(--edge); display: grid; place-items: center; font-size: 22px; font-weight: 700; text-transform: lowercase; font-family: ui-monospace, Menlo, monospace; }
.sp-slot.is-on { border-color: var(--ink); }
.sp-slot.is-hint { color: var(--faint); border-style: dashed; }
.sp-slots.is-right .sp-slot { border-color: var(--ok); background: var(--ok-soft); color: var(--accent-ink); }
.sp-slots.is-wrong .sp-slot { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.sp-tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-tile { width: 46px; height: 46px; border-radius: 10px; border: 0; background: var(--ink); color: var(--sheet); font-size: 20px; font-weight: 700; cursor: pointer; font-family: ui-monospace, Menlo, monospace; transition: transform .1s ease, opacity .15s ease; }
.sp-tile:active { transform: scale(.94); }
.sp-tile:disabled { opacity: .18; cursor: default; }
.sp-ctl { display: flex; gap: 8px; }
/* 스피드 O/X */
.sp-start { display: grid; justify-items: center; gap: 10px; padding: 28px 0; }
.sp-bar { display: flex; align-items: baseline; gap: 14px; }
.sp-time { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 2ch; }
.sp-score b { font-size: 20px; }
.sp-combo { margin-left: auto; font-weight: 800; color: #e0644a; }
.sp-track { height: 6px; border-radius: 6px; background: var(--rule); overflow: hidden; margin: 6px 0 16px; }
.sp-track i { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: inherit; }
.sp-card { border: 2px solid var(--edge); border-radius: 16px; padding: 22px 18px; text-align: center; display: grid; gap: 8px; min-height: 170px; align-content: center; transition: border-color .12s ease, background-color .12s ease; }
.sp-card.is-ok { border-color: var(--ok); background: var(--ok-soft); }
.sp-card.is-no { border-color: var(--danger); background: var(--danger-soft); animation: sp-shake .3s ease; }
.sp-tag { margin: 0; font-size: 12px; color: var(--muted); }
.sp-q { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.4; }
.sp-a { margin: 0; font-size: 19px; font-weight: 600; color: var(--accent-ink); }
.sp-pad { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.sp-btn { height: 72px; border-radius: 16px; border: 0; font-size: 32px; font-weight: 900; color: #fff; cursor: pointer; transition: transform .08s ease; }
.sp-btn:active { transform: scale(.96); }
.sp-o { background: #2f6fb3; } .sp-x { background: #c4553b; }
@keyframes sp-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
/* 짝 맞추기 */
.mt-board { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.mt-col { display: grid; gap: 8px; align-content: start; }
.mt-item { min-height: 52px; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--edge); background: var(--surface); color: var(--ink); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; text-align: center; transition: border-color .12s ease, background-color .12s ease, opacity .2s ease; }
.mt-col:first-child .mt-item { font-size: 17px; }
.mt-item.is-sel { border-color: var(--ink); background: var(--raised); }
.mt-item.is-done { border-color: var(--ok); background: var(--ok-soft); color: var(--accent-ink); opacity: .55; cursor: default; }
.mt-item.is-bad { border-color: var(--danger); background: var(--danger-soft); animation: sp-shake .3s ease; }
/* RNA 염기 U, 가닥 이름 */
.base-U { background: #F3E3A0 !important; color: #231F20 !important; border: 1px solid #808080 !important; }
.strand-label { margin: 8px 0 4px; font-size: 12px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .sp-card.is-no, .mt-item.is-bad { animation: none; } }
@media (max-width: 560px) { .kind-mc .mc-main, .kind-ox .mc-main { font-size: 26px; } .sp-slot { width: 32px; height: 42px; font-size: 19px; } .sp-tile { width: 42px; height: 42px; } }

/* ---------- Quiz 형식: 빈칸 · 듣기 · 계산 · 분류 · 순서 · 카드 뒤집기 ---------- */
.kind-fill .mc-main, .kind-sort .mc-main, .kind-order .mc-main, .kind-num .mc-main { font-size: 18px; }
.mc-blank { display: inline-block; min-width: 4.5em; margin: 0 4px; padding: 0 8px; border-bottom: 2px solid var(--ink); text-align: center; color: var(--accent-ink); }
.mc-blank.is-right { border-color: var(--ok); background: var(--ok-soft); }
.mc-blank.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.mc-choices.kind-fill { flex-direction: row; flex-wrap: wrap; }
.mc-choices.kind-fill .mc-choice { flex: 1 1 calc(50% - 8px); text-align: center; font-weight: 600; }

.kind-listen .mc-main { font-size: 30px; }
.mc-main.is-hidden-word { color: var(--faint); letter-spacing: .2em; }
.mc-say { font-size: 14px; font-weight: 600; justify-self: start; padding: 8px 14px 8px 36px; position: relative; }
.mc-say::before { content: ""; position: absolute; left: 14px; top: 50%; translate: 0 -50%; border-left: 11px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }

.nm-row { display: flex; align-items: center; gap: 10px; }
.nm-input { width: 9em; font: inherit; font-size: 22px; font-weight: 700; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--edge); background: var(--surface); color: var(--ink); font-variant-numeric: tabular-nums; }
.nm-input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.nm-unit { font-size: 16px; font-weight: 600; color: var(--muted); margin-right: auto; white-space: nowrap; }
.nm-input { min-width: 0; flex: 0 1 9em; }
.nm-row.is-right .nm-input { border-color: var(--ok); background: var(--ok-soft); color: var(--accent-ink); }
.nm-row.is-wrong .nm-input { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }

.mc-choices.kind-sort, .mc-choices.kind-order { gap: 12px; }
.so-list { display: grid; gap: 6px; }
.so-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 10px; background: var(--raised); border: 1.5px solid transparent; }
.so-list.is-long .so-row { grid-template-columns: 1fr; }
.so-row { padding-top: 6px; padding-bottom: 6px; }
.so-item { font-weight: 600; font-size: 15px; }
.so-segs { display: flex; flex-wrap: wrap; gap: 4px; }
.so-seg { font: inherit; font-size: 13px; font-weight: 600; padding: 7px 10px; border-radius: 8px; border: 1.5px solid var(--edge); background: var(--surface); color: var(--muted); cursor: pointer; }
.so-seg.is-on { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.so-seg:disabled { cursor: default; }
.so-row.is-right { border-color: var(--ok); background: var(--ok-soft); }
.so-row.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.so-row.is-wrong .so-seg.is-on { background: var(--danger); border-color: var(--danger); }
.so-row.is-wrong .so-seg.is-answer { border-color: var(--ok); color: var(--accent-ink); background: var(--surface); }

.or-slots { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: or; }
.or-slot { counter-increment: or; display: grid; grid-template-columns: 26px 1fr; align-items: center; gap: 8px; min-height: 44px; }
.or-slot::before { content: counter(or); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--raised); color: var(--muted); }
.or-slot.is-empty::after { content: ""; height: 40px; border-radius: 10px; border: 1.5px dashed var(--edge); }
.or-placed { font: inherit; font-size: 15px; font-weight: 600; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--ink); background: var(--surface); color: var(--ink); cursor: pointer; }
.or-slots.is-done .or-placed { cursor: default; }
.or-slot.is-right .or-placed { border-color: var(--ok); background: var(--ok-soft); color: var(--accent-ink); }
.or-slot.is-wrong .or-placed { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.or-slot.is-right::before { background: var(--ok); color: #fff; } .or-slot.is-wrong::before { background: var(--danger); color: #fff; }
.or-pool { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; border-top: 1px solid var(--edge); }
.or-chip { font: inherit; font-size: 14px; font-weight: 600; padding: 9px 12px; border-radius: 999px; border: 1.5px solid var(--edge); background: var(--surface); color: var(--ink); cursor: pointer; transition: opacity .15s ease; }
.or-chip:disabled { opacity: .25; cursor: default; }
.mc-choices.kind-sort > .btn, .mc-choices.kind-order > .btn { justify-self: start; align-self: flex-start; }

.mm-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.mm-card { position: relative; aspect-ratio: 4 / 3; border: 0; padding: 0; border-radius: 12px; background: none; cursor: pointer; font: inherit; }
.mm-back, .mm-face { position: absolute; inset: 0; border-radius: 12px; display: grid; place-items: center; padding: 6px; transition: transform .28s cubic-bezier(.2, .7, .3, 1), opacity .2s ease; backface-visibility: hidden; }
.mm-back { background: var(--ink); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.06) 0 6px, transparent 6px 12px); }
.mm-face { background: var(--surface); border: 1.5px solid var(--edge); color: var(--ink); font-size: 13.5px; font-weight: 600; line-height: 1.3; transform: rotateY(180deg); word-break: keep-all; text-align: center; }
.mm-card.is-en .mm-face { font-size: 16px; font-weight: 700; }
.mm-card.is-up .mm-back { transform: rotateY(180deg); }
.mm-card.is-up .mm-face { transform: rotateY(0); }
.mm-card.is-match .mm-face { border-color: var(--ok); background: var(--ok-soft); color: var(--accent-ink); }
.mm-card.is-match { cursor: default; }
.mm-words { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 4px; }
.mm-words li { display: flex; gap: 10px; font-size: 14px; } .mm-words b { min-width: 7em; }
@media (max-width: 560px) { .mm-board { grid-template-columns: repeat(3, 1fr); } .mm-card { aspect-ratio: 1 / 1; } .nm-input { width: 7em; } }
@media (prefers-reduced-motion: reduce) { .mm-back, .mm-face { transition: none; } }
.qi-mem { background: #c2802b; } .qi-mem::after { content: "▦"; font-size: 20px; }

.mc-choices .is-spent { display: none; }
@media (max-width: 560px) { .so-seg { padding: 7px 8px; } }

/* ---------- 통과 Quiz: O/X 진술 · ㄱㄴㄷ 보기 · TOPIC 목록 ---------- */
.kind-tf .mc-main, .kind-pick .mc-main { font-size: 18px; line-height: 1.55; }
.mc-choices.kind-tf { flex-direction: row; }
.mc-choices.kind-tf .mc-choice { flex: 1; text-align: center; font-size: 26px; font-weight: 800; padding: 14px 10px; }
.pk-lines { list-style: none; margin: 6px 0 0; padding: 12px 14px; border: 1px solid var(--edge); border-radius: 10px; display: grid; gap: 8px; background: var(--raised); }
.pk-lines li { display: grid; grid-template-columns: 22px 1fr; gap: 4px; font-size: 15px; font-weight: 500; line-height: 1.5; }
.pk-lines b { font-weight: 700; }
.mc-choices.kind-pick { flex-direction: row; flex-wrap: wrap; }
.mc-choices.kind-pick .mc-choice { flex: 1 1 calc(33% - 8px); min-width: 92px; text-align: center; }
.mc-feedback p + p { margin-top: -6px; }
.qz-tlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
.qz-tlist > li > a { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--edge); border-radius: 10px; color: var(--ink); background: var(--sheet); transition: border-color 150ms ease; }
.qz-tlist > li > a:hover { text-decoration: none; border-color: var(--ink); }
.qz-no { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.qz-tlist b { font-size: 15px; font-weight: 600; }
.qz-tlist em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--accent-ink); }

/* ---------- TOPIC 목록의 게임 · 개념 게임 화면 ---------- */
.qz-tlist li.has-game { display: grid; gap: 4px; }
.qz-games { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px 4px 46px; }
.qz-games a { display: inline-block; white-space: nowrap; font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--edge); background: var(--raised); color: var(--ink); }
.qz-games a:hover { text-decoration: none; border-color: var(--ink); }
.qz-games em { font-style: normal; color: var(--accent-ink); }
.pl-q { font-size: 16px; font-weight: 600; line-height: 1.55; margin: 4px 0 12px; }
.pl-eq { font-size: 22px; font-weight: 700; text-align: center; padding: 16px 8px; margin: 4px 0 14px; border-radius: 10px; background: var(--raised); letter-spacing: .01em; }
.pl-beakers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pl-step { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pl-ml { min-width: 64px; text-align: center; font-size: 18px; font-variant-numeric: tabular-nums; }
.pl-step .btn.primary { margin-left: auto; }
.pl-pick { display: grid; gap: 6px; margin-bottom: 12px; }
.pl-pick-k { font-size: 13px; font-weight: 700; color: var(--muted); }
.pl-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-opts .so-seg { font-size: 16px; padding: 10px 16px; }
.so-seg.is-answer { border-color: var(--ok); background: var(--ok-soft); color: var(--accent-ink); }
.so-seg.is-bad { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.pl-game .is-spent { display: none; }
.pl-shellwrap { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: center; }
.pl-shells { display: grid; gap: 6px; }
.pl-srow { display: grid; grid-template-columns: 1fr 34px 28px 34px; align-items: center; gap: 6px; font-size: 14px; }
.pl-srow b { text-align: center; font-size: 17px; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .pl-shellwrap { grid-template-columns: 1fr; justify-items: center; } .pl-shells { width: 100%; } .pl-eq { font-size: 18px; } }

/* ---------- 그림 글꼴: SDIJ 일러 폰트 v1.1 (통합과학 Regular·Italic) — 퀴즈 그림 안의 모든 글자 ---------- */
@font-face { font-family: "SDIJ Sci"; src: url("fonts/sdij/SDIJIntSci_illust-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "SDIJ Sci"; src: url("fonts/sdij/SDIJIntSci_illust-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
.pl-svg, .pl-svg text, .pl-cap, .pl-legend, .pl-plus, .rx-fig, .rx-fig *, .pl-atom-key, .pl-q-fig,
.strand .cell, .strand-label, .base, .base-pad .base { font-family: "SDIJ Sci", serif !important; font-weight: 400 !important; font-synthesis: none; }

/* ---------- 개념 게임 그림: 개념서 그림체 (단색 면, 얇은 선, 그라데이션·그림자 없음) ---------- */
.pl-svg { display: block; width: 100%; height: auto; overflow: visible; font-family: inherit; }
.pl-beakers { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 6px; }
.pl-plus { align-self: center; margin-top: -30px; font-size: 22px; font-weight: 400; color: #231F20; }
.pl-fig { margin: 0; display: grid; gap: 4px; }
.pl-cap { display: grid; gap: 3px; justify-items: center; text-align: center; }
.pl-cap-t { font-size: 13.5px; color: #000; -webkit-text-stroke: .25px #000; word-break: keep-all; }
.pl-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 10px; font-size: 13px; color: #000; -webkit-text-stroke: .25px #000; font-variant-numeric: tabular-nums; }
.pl-key { display: inline-flex; align-items: center; gap: 4px; }
.pl-key i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 1px solid #808080; }
.pl-glass { fill: none; stroke: #231F20; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.pl-ion { stroke: #808080; stroke-width: .9; }
.pl-ion-t { fill: #000; stroke: #000; stroke-width: .35px; paint-order: stroke; pointer-events: none; }
.pl-pt.pt-in { animation: pl-fade .35s ease both; }
@keyframes pl-fade { from { opacity: 0; } to { opacity: 1; } }
.pl-after { display: grid; justify-items: center; gap: 4px; margin-top: 8px; }
.pl-after .pl-fig { width: min(100%, 300px); }
.pl-arrow { width: 22px; height: 28px; }
.pl-arr-l { stroke: #E79AA3; stroke-width: 2.2; }
.pl-arr-h { fill: #E79AA3; }
.rx-fig { position: relative; text-align: center; overflow: hidden; padding: 46px 6px; margin: 4px 0 14px; border: 1px solid #DCDDDD; border-radius: 6px; background: #fff; }
.rx-eq { --k: 1; display: inline-flex; align-items: flex-start; justify-content: center; flex-wrap: nowrap; gap: calc(10px * var(--k)); white-space: nowrap; }
.rx-sp { display: grid; justify-items: center; gap: 2px; }
.rx-f { font-size: calc(22px * var(--k)); color: #2F4F7F; line-height: 1.2; }
.rx-n { font-size: calc(12.5px * var(--k)); color: #000; -webkit-text-stroke: .2px #000; }
.rx-op { font-size: calc(20px * var(--k)); color: #231F20; line-height: 1.3; }
.rx-to { padding: 0 4px; }
.rx-over { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.rx-lab { font-size: 12.5px; }
.so-seg.is-answer { border-color: var(--ok); background: var(--ok-soft); color: var(--accent-ink); }
.so-seg.is-bad { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.pl-shell { fill: none; stroke: #231F20; stroke-width: 1; }
.pl-shell.is-empty { stroke: #B5B6B6; stroke-dasharray: 3 3; }
.pl-nuc-t { fill: #000; stroke: #000; stroke-width: .3px; paint-order: stroke; font-size: 9.5px; }
.pl-atom-fig { display: grid; justify-items: center; gap: 6px; }
.pl-atom { width: 210px; }
.pl-atom-key { display: flex; gap: 12px; margin: 0; font-size: 13px; color: #000; }
.pl-atom-key span { display: inline-flex; align-items: center; gap: 4px; }
.pl-atom-key i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pl-left { margin: 8px 0 0; }
@media (prefers-reduced-motion: reduce) { .pl-pt.pt-in { animation: none; } }
@media (max-width: 560px) { .pl-atom { width: 220px; } }
.rx-f sub, .rx-f sup, .pl-key sub, .pl-key sup { font-size: .62em; line-height: 0; }
.rx-f sub, .pl-key sub { vertical-align: -.28em; }
.rx-f sup, .pl-key sup { vertical-align: .55em; }

/* ---------- 2026-11 수정 묶음: 검색창·선택 상자 여백, 문의는 늘 맨 아래, 게임 칸 같은 크기 ---------- */
.find input { padding-left: 12px; }
select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23808080' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px; }
.pick select { padding-right: 34px; background-position: right 8px center; }
main.sheet { display: flex; flex-direction: column; min-height: calc(100vh - 16px); }
main.sheet > .colophon { margin-top: auto; padding-top: 16px; }
main.sheet > .colophon { min-height: 0; }
main.sheet > :nth-last-child(2) { margin-bottom: 48px; }
.qz-modes { grid-auto-rows: 1fr; }
.qz-modes li { display: flex; }
.qz-modes a { flex: 1; align-content: center; }
.home-core { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.home-shop { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin-top: 16px; padding: 16px 18px; border: 1px solid var(--edge); border-radius: 12px; color: var(--ink); background: var(--surface); }
.home-shop:hover { text-decoration: none; border-color: var(--ink); }
.home-shop b { font-size: 16px; } .home-shop span { color: var(--muted); font-size: 13px; }
.backbar { display: flex; align-items: center; justify-content: space-between; margin: -6px 0 14px; }
.back-link, .home-link { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); padding: 6px 8px 6px 2px; border-radius: 8px; }
.back-link svg { width: 18px; height: 18px; }
.back-link:hover, .home-link:hover { color: var(--ink); text-decoration: none; }
.photo-thumbs { display: flex; gap: 6px; }
.photo-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--edge); }
.q-photos { display: grid; gap: 10px; }
.mc-resume { margin: 0 0 10px; font-weight: 600; }
.mc-resume-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.mc-feedback.is-auto .btn { opacity: .55; }
.cast-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cast-list a { display: grid; grid-template-columns: 136px 1fr; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--edge); border-radius: 12px; color: var(--ink); background: var(--surface); }
.cast-list a:hover { text-decoration: none; border-color: var(--ink); }
.cast-thumb { width: 136px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; display: grid; place-items: center; background: var(--raised); color: var(--muted); font-size: 13px; }
.cast-meta { display: grid; gap: 3px; min-width: 0; }
.cast-meta b { font-size: 15.5px; } .cast-meta time { font-size: 12px; color: var(--muted); }
.cast-sum { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cast-video { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; margin-bottom: 18px; }
.cast-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cast-body { font-size: 16px; line-height: 1.8; max-width: 680px; }
@media (max-width: 560px) { .cast-list a { grid-template-columns: 104px 1fr; } .cast-thumb { width: 104px; } }
.mock-review { margin: 0 0 22px; padding: 16px 18px; border: 1px solid var(--edge); border-left: 3px solid var(--ink); border-radius: 10px; background: var(--surface); }
.mock-review h2 { margin: 0 0 8px; font-size: 16px; }
.mock-review h2 span { font-size: 12.5px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.mock-review .pre { font-size: 15px; line-height: 1.75; }
.review-form { margin-bottom: 16px; }
/* 학생 메뉴: 묶음은 접어 두고, 지금 보는 화면이 든 묶음만 펼친다 */
.nav-fold > summary, .m-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.nav-fold > summary::-webkit-details-marker, .m-fold > summary::-webkit-details-marker { display: none; }
.nav-fold > summary::after, .m-fold > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform 160ms ease; margin-right: 4px; }
.nav-fold[open] > summary::after, .m-fold[open] > summary::after { transform: rotate(45deg); }
.side .nav-fold > summary.nav-group { margin: 6px 0 2px; padding: 9px 10px; border-radius: 8px; font-size: 13px; color: var(--rail-muted); }
.side .nav-fold > summary.nav-group:hover { background: var(--rail-2); color: var(--rail-ink); }
.side .nav-fold:first-of-type > summary.nav-group { margin-top: 14px; }
.m-fold > summary.m-group { padding: 6px 2px; }
.m-fold:not([open]) > .m-grid { display: none; }
/* 1:1 첨삭 */
.fb-sec { margin: 34px 0 10px; }
.fb-state { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; vertical-align: middle; }
.fb-state.is-wait { background: var(--danger-soft); color: var(--danger); }
.fb-state.is-done { background: var(--ok-soft); color: var(--accent-ink); }
h1 .fb-state { font-size: 13px; margin-left: 6px; }
.fb-thread { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fb-msg { padding: 14px 16px; border: 1px solid var(--edge); border-radius: 10px; background: var(--surface); }
.fb-msg.is-staff { border-left: 3px solid var(--accent); }
.fb-who { margin: 0 0 6px; display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
.fb-who time { font-size: 12.5px; color: var(--muted); }
.fb-msg .pre { font-size: 15px; line-height: 1.7; }
.fb-msg .q-photos { margin-top: 10px; }
.fb-form { max-width: 680px; }
.fb-facts { margin: 0 0 22px; max-width: 680px; }
.side .nav .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #d9534f; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; }
/* 내 공부 */
.my-card { border: 1px solid var(--edge); border-radius: 14px; background: var(--sheet); padding: 22px 22px 18px; margin-bottom: 30px; }
.my-who b { display: block; font-size: 20px; }
.my-who span { font-size: 13.5px; color: var(--muted); }
.my-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 22px 0 0; text-align: center; }
.my-stats dt { font-size: 13.5px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.my-stats dd { margin: 4px 0 0; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.my-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.my-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico-time { background: #ece6f7; color: #6b52b3; } .ico-solve { background: #e2f1e6; color: #2f7a46; } .ico-fire { background: #fbe5e3; color: #b23a2e; }
.my-sec { margin: 0 0 34px; }
.my-sec .sec-head form { margin: 0; }
.my-rank { list-style: none; margin: 0; padding: 6px 0; border: 1px solid var(--edge); border-radius: 14px; background: var(--sheet); }
.my-rank li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 11px 18px; font-size: 15.5px; }
.my-rank li.empty { display: block; color: var(--muted); }
.my-rank .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.my-rank li.mine { margin: 6px 10px 4px; border-radius: 10px; background: var(--accent-soft); }
.my-rank li.is-me b { color: var(--accent-ink); }
.medal { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted); border: 1px solid var(--edge); }
.medal-1 { background: #f4cf4a; border-color: #d9ad1f; color: #6b5205; }
.medal-2 { background: #d5dbe1; border-color: #aeb7c0; color: #46505a; }
.medal-3 { background: #e3b083; border-color: #c48a58; color: #5e3816; }
.day-chart { width: 100%; max-width: 620px; height: auto; display: block; font-variant-numeric: tabular-nums; }
.dc-grid { stroke: var(--rule); stroke-width: 1; }
.dc-tick { font-size: 11px; fill: var(--muted); text-anchor: end; }
.dc-x { font-size: 11.5px; fill: var(--muted); text-anchor: middle; }
.day-chart, .dc-legend { --c-focus: var(--accent); --c-quiz: color-mix(in srgb, var(--accent) 55%, var(--sheet)); --c-vocab: color-mix(in srgb, var(--accent) 25%, var(--sheet)); }
.dc-focus { fill: var(--c-focus); } .dc-quiz { fill: var(--c-quiz); } .dc-vocab { fill: var(--c-vocab); }
.dc-avg { fill: none; stroke: #b9bcc2; stroke-width: 2.5; }
.dc-avg-dot { fill: #b9bcc2; }
.dc-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.dc-legend li { display: flex; align-items: center; gap: 6px; }
.dc-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.dc-key.dc-focus { background: var(--c-focus); } .dc-key.dc-quiz { background: var(--c-quiz); } .dc-key.dc-vocab { background: var(--c-vocab); }
.dc-key.dc-line { height: 3px; border-radius: 2px; background: #b9bcc2; }
.prog { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.prog th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 8px 6px; border-bottom: 1px solid var(--rule); }
.prog td { padding: 9px 6px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.prog td:first-child { width: 42%; } .prog td:nth-child(2) { width: 34%; }
.prog td.num, .prog th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.prog form { margin: 0; }
.prog a { color: var(--ink); }
.pbar { width: 100%; height: 10px; display: block; }
.pb-bg { fill: var(--rule); } .pb-fg { fill: var(--accent); }
@media (max-width: 560px) { .my-stats dd { font-size: 19px; } .prog td:first-child { width: auto; } .prog { font-size: 13.5px; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ico-time { background: #2c2740; color: #b7a5ea; } :root:not([data-theme="light"]) .ico-solve { background: #1f3326; color: #8fd0a2; } :root:not([data-theme="light"]) .ico-fire { background: #3a2220; color: #f09a8f; } }
:root[data-theme="dark"] .ico-time { background: #2c2740; color: #b7a5ea; } :root[data-theme="dark"] .ico-solve { background: #1f3326; color: #8fd0a2; } :root[data-theme="dark"] .ico-fire { background: #3a2220; color: #f09a8f; }
/* 복테&모의 분석: 강사가 올린 OMR 결과 (보기 전용) */
.omr.is-view .omr-row { grid-template-columns: 34px repeat(5, 1fr); }
.omr-row .legend { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); width: 34px; }
.omr-row.is-wrong .legend { color: var(--danger); font-weight: 700; }
.omr-row .legend .pt { display: block; font-size: 10px; line-height: 1.1; }
.bubble-v { justify-self: center; width: 26px; height: 32px; border-radius: 13px / 16px; border: 1px solid var(--edge); display: grid; place-items: center; font-size: 12px; color: var(--faint); }
.bubble-v.is-mine { background: var(--ink); border-color: var(--ink); color: var(--sheet); font-weight: 700; }
.omr-row.is-wrong .bubble-v.is-mine { background: var(--danger); border-color: var(--danger); color: #fff; }
.bubble-v.is-key { border: 2px solid var(--ok); color: var(--ok); font-weight: 700; }
.omr-legend { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; color: var(--muted); }
.omr-legend .bubble-v { width: 18px; height: 22px; font-size: 10px; }
.omr-legend .bubble-v.is-mine { margin-left: 0; } .omr-legend .bubble-v.is-key { margin-left: 10px; }
/* 복테·모의고사 회차 격자, OMR 반영 결과, 학부모 문자 */
.round-grid { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; }
.round-grid a { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border: 1px solid var(--edge); border-radius: 8px; color: var(--muted); font-variant-numeric: tabular-nums; }
.round-grid a b { font-size: 15px; color: var(--ink); }
.round-grid a span { font-size: 11.5px; }
.round-grid a.has { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.round-grid a:hover { text-decoration: none; border-color: var(--ink); }
.omr-log { border-top: 1px solid var(--rule); padding-top: 10px; }
.omr-warn { color: var(--warn, #a86b00); }
.omr-rows { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.omr-rows li { padding: 6px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 160px 1fr; gap: 8px; }
.omr-rows li.is-error { color: var(--danger); }
.omr-rows li span { color: var(--muted); }
.w-num { width: 80px; }
.sms-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sms-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.sms-head .btn { margin-left: auto; }
.sms-text { white-space: pre-wrap; font: inherit; font-size: 14px; line-height: 1.65; margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; }
.wa-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.wa-item { border: 1px solid var(--edge); border-radius: 10px; padding: 12px 14px; background: var(--sheet); }
.wa-item h3 { margin: 0 0 6px; font-size: 15px; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.wa-item h3 .badge { font-size: 11.5px; }
.wa-item p { margin: 4px 0 0; font-size: 14px; line-height: 1.6; }
.wa-item .muted { font-size: 13px; }
.learn-card { border: 1px solid var(--edge); border-left: 3px solid var(--accent); border-radius: 10px; padding: 14px 16px; background: var(--sheet); margin: 0 0 22px; }
.learn-card h2 { margin: 0 0 6px; font-size: 16px; }
.learn-card p { margin: 4px 0 0; font-size: 14px; line-height: 1.6; }
.wa-sec { margin: 30px 0 10px; }
.ta-note { margin-top: 10px; display: grid; gap: 6px; }
.ta-note textarea { min-height: 54px; }
.ta-note .btn { justify-self: start; }
/* 시험 평가 (학생 화면) */
.ev-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 4px 0 12px; }
.ev-facts div { display: flex; gap: 8px; align-items: baseline; }
.ev-facts dt { font-size: 13px; color: var(--muted); }
.ev-facts dd { margin: 0; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ev-dots { display: inline-flex; gap: 3px; }
.ev-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--rule); }
.ev-dots i.on { background: var(--ink); }
/* 학습상담: 조교 고르기, 평가 */
.ta-pick { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ta-pick legend { font-size: 14px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.ta-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--edge); border-radius: 10px; background: var(--sheet); cursor: pointer; }
.ta-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ta-card input { margin-top: 3px; accent-color: var(--accent); }
.ta-card span { display: flex; flex-direction: column; gap: 3px; }
.ta-card b { font-size: 15px; }
.ta-card small { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.ta-card .ta-stat { font-variant-numeric: tabular-nums; }
.rate-form { text-align: center; }
.rate-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
/* 숙제 · 수업 기록 · 첨삭 */
.hw-list, .lesson-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hw-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--edge); border-radius: 10px; background: var(--sheet); color: var(--ink); }
.hw-row:hover { text-decoration: none; border-color: var(--ink); }
.hw-main { display: flex; flex-direction: column; gap: 3px; }
.hw-state { font-size: 13px; font-weight: 600; white-space: nowrap; }
.hw-row.is-done .hw-state { color: var(--accent-ink); } .hw-row.is-todo .hw-state { color: var(--danger); } .hw-row.is-wait .hw-state, .hw-row.is-late .hw-state { color: var(--muted); }
.hw-steps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hw-steps li { border: 1px solid var(--edge); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; color: var(--muted); }
.hw-steps li b { font-size: 14px; }
.hw-steps li span { font-size: 12.5px; }
.hw-steps li.on { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }
.hw-steps li.now { border-style: dashed; }
.hw-score { font-size: 15px; margin: 0 0 12px; } .hw-score b { font-size: 26px; }
.hw-marks { list-style: none; margin: 0 0 16px; padding: 0; border-top: 1px solid var(--rule); }
.hw-marks li { display: grid; grid-template-columns: 34px 46px 1fr; gap: 8px; align-items: baseline; padding: 9px 2px; border-bottom: 1px solid var(--rule); font-size: 14.5px; }
.hw-no { font-variant-numeric: tabular-nums; color: var(--muted); }
.hw-marks .is-o .hw-v { color: var(--ok); font-weight: 700; } .hw-marks .is-x .hw-v { color: var(--danger); font-weight: 700; } .hw-marks .is-n .hw-v { color: var(--muted); }
.lesson-head { margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.review-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.review-photos { display: grid; gap: 10px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.review-photos img { width: 100%; border: 1px solid var(--edge); border-radius: 8px; }
.mark-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mark-table th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--rule); }
.mark-table td { padding: 5px 4px; border-bottom: 1px solid var(--rule); }
.mark-table input[type=text], .mark-table select { width: 100%; min-width: 0; }
.ox { display: inline-flex; margin-right: 4px; cursor: pointer; }
.ox input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ox span { width: 30px; height: 30px; border: 1px solid var(--control); border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.ox input:checked + span { background: var(--ok); border-color: var(--ok); color: #fff; }
.ox.ox-x input:checked + span { background: var(--danger); border-color: var(--danger); }
.ox.ox-x { display: inline-flex; }
.ox input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 860px) { .review-grid { grid-template-columns: 1fr; } .review-photos { position: static; max-height: none; } }
/* 학부모 리포트 (로그인 없는 단독 화면) */
body.parent-page { background: var(--frame); }
.pr-wrap { max-width: 520px; margin: 0 auto; padding: 22px 16px 40px; }
.pr-head h1 { margin: 4px 0 16px; font-size: 24px; } .pr-head h1 span { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.pr-card { background: var(--sheet); border: 1px solid var(--edge); border-radius: 14px; padding: 16px 18px; margin-bottom: 12px; }
.pr-card h2 { font-size: 14px; margin: 0 0 10px; color: var(--muted); font-weight: 600; }
.pr-card p { margin: 4px 0; font-size: 14.5px; line-height: 1.65; }
.pr-big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pr-big span { font-size: 14px; color: var(--muted); width: 100%; }
.pr-big b { font-size: 40px; line-height: 1; } .pr-big b small { font-size: 18px; }
.pr-big em { font-style: normal; font-weight: 700; font-size: 14px; } .pr-big em.up { color: var(--ok); } .pr-big em.down { color: var(--danger); }
.pr-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 0; }
.pr-tiles div { background: var(--surface); border-radius: 10px; padding: 10px; text-align: center; }
.pr-tiles dt { font-size: 12px; color: var(--muted); } .pr-tiles dd { margin: 2px 0 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pr-chart { width: 100%; height: auto; display: block; }
.pr-axis { stroke: var(--rule); } .pr-line { fill: none; stroke: var(--accent); stroke-width: 2.5; } .pr-dot { fill: var(--accent); }
.pr-val { font-size: 11px; fill: var(--ink); text-anchor: middle; font-weight: 600; } .pr-lab { font-size: 10.5px; fill: var(--muted); text-anchor: middle; }
.pr-exams, .pr-units, .pr-why, .pr-att { list-style: none; margin: 0; padding: 0; }
.pr-exams li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.pr-exams li > span:first-child small { display: block; color: var(--muted); font-size: 12px; }
.pr-exams li b small { font-size: 13px; color: var(--muted); font-weight: 500; } .pr-exams li b { font-size: 17px; text-align: right; white-space: nowrap; }
.pr-exams li .small { grid-column: 2; text-align: right; }
.pr-units li { display: grid; grid-template-columns: 110px 1fr 44px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13.5px; }
.pr-units svg { width: 100%; height: 8px; } .pr-units b { text-align: right; font-variant-numeric: tabular-nums; }
.pr-units li.weak .pb-fg { fill: var(--warn, #c9842b); } .pr-units li.weak b { color: var(--warn, #a86b00); }
.pr-why li { display: grid; grid-template-columns: 46px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 14px; line-height: 1.55; }
.pr-no { font-weight: 700; color: var(--danger); }
.pr-att li { display: grid; grid-template-columns: 56px 50px 1fr; gap: 8px; padding: 5px 0; font-size: 13.5px; }
.pr-foot { margin-top: 18px; }
/* 취약 단원 (학생 분석 화면) */
.unit-sec { margin: 26px 0 0; }
.unit-bars { list-style: none; margin: 0; padding: 0; }
.unit-bars li { display: grid; grid-template-columns: 130px 1fr 46px; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; }
.unit-bars svg { width: 100%; height: 8px; } .unit-bars b { text-align: right; font-variant-numeric: tabular-nums; }
.unit-bars li.weak b { color: var(--warn, #a86b00); } .unit-bars li.weak .pb-fg { fill: var(--warn, #c9842b); }
.weak-card { margin-top: 12px; padding: 14px 16px; border: 1px solid var(--warn, #c9842b); border-radius: 12px; background: var(--warn-soft, #fff4e3); }
.weak-card p { margin: 4px 0; font-size: 14px; }
.weak-card .row { margin-top: 8px; gap: 8px; }
.paper-sec { margin: 30px 0 0; }
.ta-mark { margin-top: 8px !important; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); font-size: 14px; }
.ta-mark b { color: var(--accent-ink); margin-right: 4px; }

/* 접는 표 제목: summary 안의 h2 는 한 줄로 */
summary h2.inline { display: inline; margin: 0; }

/* 사진 크게 보기 */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .82); display: flex; align-items: center; justify-content: center; padding: 12px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; }
