:root {
  --bg: #f4eee4;
  --surface: #ffffff;
  --surface-2: #faf6f0;
  --ink: #2b2118;
  --ink-2: #5b4b3c;
  --muted: #968877;
  --border: #e7dccb;
  --accent: #6b4426;        /* 수찾사 갈색 (호두나무) */
  --accent-hover: #54341b;
  --accent-soft: #f5ebdd;
  --ok: #18794e;
  --ok-soft: #eaf5ef;
  --ng: #b42318;
  --ng-soft: #fcefed;
  --gold: #b7791f;
  --gold-soft: #fbf3e4;
  --mark: #d92d20;
  --radius: 16px;
  /* 버튼 크기 기준: 모든 버튼 44px, 보기 버튼만 48px */
  --h-control: 44px;
  --h-choice: 48px;
  --r-control: 10px;
  --shadow: 0 1px 2px rgba(58, 38, 18, .06), 0 8px 24px rgba(58, 38, 18, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
svg.board, select { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

/* ── 상단 바 ── */
.appbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.appbar-inner {
  max-width: 1040px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 34px; height: 34px; flex: none; object-fit: cover; border-radius: 8px; }
.brand-title { font-weight: 800; font-size: 17px; letter-spacing: -0.02em; }
.brand-sub { font-size: 13px; color: var(--muted); }
.meter { width: 180px; flex: none; }
.meter-label { font-size: 12.5px; color: var(--ink-2); text-align: right; margin-bottom: 6px; font-weight: 600; }
.meter-bar { height: 6px; border-radius: 99px; background: #ece2d3; overflow: hidden; }
.meter-bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .4s ease; }

.container { max-width: 1040px; margin: 0 auto; padding: 18px 20px 28px; }

/* ── 홈 ── 하바사 홈과 같은 틀 (머리 띠 · 주 버튼 · 2×2 타일 · 손글씨 문구) */
:root {
  --font-display: "Gowun Batang", "Nanum Myeongjo", "AppleMyungjo", serif;
  --font-hand: "Nanum Pen Script", cursive;
  --kaya: #e2b86c;          /* 비자나무 바둑판 */
  --kaya-soft: #f6ead2;
  --kaya-line: #e3cfa6;
  --slate: #17191c;         /* 흑돌 */
  --shell: #fbfaf7;         /* 백돌 */
}
.brand[role=button] { cursor: pointer; }
.home { max-width: 440px; margin: 0 auto; }
.home.show { display: block; }

.hh { margin: -18px -20px 0; padding: 24px 22px 18px; background: linear-gradient(160deg, var(--kaya-soft) 0%, #f1e2c4 100%);
  border-bottom: 1px solid var(--kaya-line); }
.hh-top { display: flex; align-items: center; gap: 18px; }
.hh-illust { width: 124px; flex: none; padding: 4px 4px 0; border: 0; border-radius: 10px; background: var(--kaya); cursor: pointer;
  box-shadow: 0 3px 10px rgba(61, 42, 18, .18); display: flex; flex-direction: column; align-items: stretch; }
.hh-illust:active { transform: scale(.97); }
.hh-illust-cap { padding: 4px 0 5px; font-size: 11px; font-weight: 700; color: #5c4210; text-align: center; }
.hh-greet { display: flex; flex-direction: column; line-height: 1.5; }
.hh-hello { font-size: 13.5px; font-weight: 500; color: #7a5b28; }
.hh-name { font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.hh-saying { margin-top: 14px; padding: 2px 0 0 12px; border-left: 3px solid #d2a95a; min-height: 3.6em; }
.hh-saying-text { display: block; font-size: 15px; line-height: 1.6; color: #3b3326; word-break: keep-all; }
.hh-saying-ref { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 600; color: #9a6c1f; }

.home-body { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 22px 0 8px; }
.primary-tile { display: flex; align-items: center; gap: 18px; width: 100%; padding: 22px 20px; border: 0; border-radius: 20px;
  background: linear-gradient(135deg, #9c6b3e 0%, var(--accent) 100%); color: #fff; text-align: left; cursor: pointer;
  box-shadow: 0 4px 20px rgba(84, 52, 27, .25); transition: transform .13s, box-shadow .15s; }
.primary-tile:active { transform: scale(.98); }
.pt-icon svg { width: 42px; height: 42px; display: block; }
.pt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pt-label { font-size: 17px; font-weight: 800; }
.pt-sub { margin-top: 2px; font-size: 13px; color: rgba(255, 255, 255, .78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-chev svg { width: 22px; height: 22px; display: block; opacity: .7; stroke-width: 2.5; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 8px 18px;
  border: 0; border-radius: 16px; background: var(--surface); cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .07); transition: transform .13s, box-shadow .15s; }
.tile:active { transform: scale(.97); }
.tile-icon { color: var(--accent); display: flex; }
.tile-icon svg { width: 32px; height: 32px; }
.tile-label { font-size: 14px; font-weight: 700; }
.tile-sub { margin-top: -6px; font-size: 12px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.tile-sub.done { color: var(--ok); }
.tile-badge { position: absolute; top: 12px; right: 12px; width: 10px; height: 10px; border-radius: 50%; background: #e5484d; border: 2px solid var(--surface); }
@media (hover: hover) {
  .primary-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(23, 25, 28, .32); }
  .tile:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 0, 0, .1); }
}
.primary-tile:focus-visible, .tile:focus-visible, .util-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.tagline { margin-top: 10px; text-align: center; font-family: var(--font-hand); font-size: 30px; color: #7a5b28; letter-spacing: .04em; }
.util-row { display: flex; justify-content: center; }
.util-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.util-btn svg { width: 15px; height: 15px; }
.font-sheet { padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.font-sheet-title { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 10px; text-align: center; }
.font-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.font-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; height: 64px; justify-content: center;
  border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.font-opt span { font-weight: 800; color: var(--ink); }
.font-opt.on { border-color: var(--slate); background: var(--surface-2); }

/* 문제집 목록 */
.lib { display: grid; gap: 12px; }
.lib-item { display: flex; align-items: center; gap: 16px; width: 100%; padding: 14px; border: 0; border-radius: 16px; text-align: left;
  background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .07); cursor: pointer; }
.lib-item:active { transform: scale(.99); }
.lib-cover { width: 92px; flex: none; padding: 3px; border-radius: 8px; background: var(--kaya); }
.lib-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.lib-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.lib-meta { font-size: 13px; color: var(--muted); }
.lib-body .bar { margin-top: 4px; }

/* 하위 화면 공통: ‹ 홈 */
.subpage { max-width: 720px; margin: 0 auto; }
.sub-topbar { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.sub-topbar .back { margin: 0; }
.sub-title { font-size: 15px; font-weight: 800; color: var(--ink-2); }
.sub-topbar::after { content: ""; flex: 1; }

/* 놓아보기 화면 */
.free-wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.free-panel { display: grid; gap: 10px; padding: 16px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.free-size { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.free-size .seg.on { background: var(--slate); color: #fff; border-color: var(--slate); }
.free-turn { margin: 0; font-weight: 700; }
@media (max-width: 820px) { .free-wrap { grid-template-columns: minmax(0, 1fr); } }

/* 내 기록 화면 */
.rec-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.rec-stat { padding: 14px 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); text-align: center; }
.rec-stat b { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rec-stat span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.rec-clear { width: 100%; margin-top: 16px; }

.thumb { display: block; width: 100%; height: auto; border-radius: 6px; pointer-events: none; }

@media (max-width: 560px) {
  .hh { margin: -12px -12px 0; padding: 20px 16px 16px; }
  .hh-illust { width: 112px; }
}

/* ── 문제집 안 (단원 목록) ── */
.book { max-width: 720px; margin: 0 auto; }
.back { height: 36px; padding: 0 12px 0 6px; margin: 0 0 10px; border: 0; background: none; cursor: pointer;
  font-size: 14.5px; font-weight: 700; color: var(--accent); }
.book-head { padding: 18px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); margin-bottom: 12px; }
.book-title { margin: 0 0 2px; font-size: 21px; font-weight: 800; }
.book-sub { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); }
.units { display: grid; gap: 8px; }
.unit { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; }
.unit .uno { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; font-weight: 800; color: var(--ink-2); }
.unit.done .uno { background: var(--ok); border-color: var(--ok); color: #fff; }
.unit .ubody { flex: 1; min-width: 0; }
.unit .uname { font-weight: 800; font-size: 15px; }
.unit .umeta { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.unit .bar { height: 5px; }
#study .setbar .back { margin: 0; }

/* ── 문제집·단원 ── */
.setbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: #e9e6df; }
.tab {
  height: 36px; padding: 0 16px; border: 0; border-radius: 9px; cursor: pointer;
  background: transparent; font-size: 14px; font-weight: 700; color: var(--ink-2);
}
.tab.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(58, 38, 18, .12); }
.unit-select {
  height: var(--h-control); min-width: 220px; padding: 0 12px; border-radius: var(--r-control);
  border: 1px solid var(--border); background: var(--surface); font: inherit; font-size: 14px; font-weight: 600; color: var(--ink);
}

/* ── 문제 번호: 한 줄 + 펼치는 번호판 ── */
.pnav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.pn-arrow { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: var(--r-control);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--ink); }
.pn-arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pn-arrow:disabled { opacity: .35; cursor: default; }
.pn-cur { flex: 1; min-width: 0; height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-control); border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.pn-cur small { font-weight: 600; color: var(--muted); }
.pn-caret { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.pn-cur[aria-expanded="true"] .pn-caret { transform: rotate(180deg); }
.pn-st { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10.5px; color: #fff; }
.pn-st.todo { border: 1.5px solid #cdbfab; }
.pn-st.solved { background: var(--ok); }
.pn-st.perfect { background: var(--gold); }
.pgrid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; margin: -4px 0 14px; padding: 12px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.pg { height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); padding: 0; }
.pg.solved { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.pg.perfect { background: var(--gold-soft); border-color: transparent; color: var(--gold); }
.pg.now { background: var(--ink); border-color: var(--ink); color: #fff; }
.pg.reviewed { box-shadow: inset 0 -3px 0 var(--gold); }
@media (max-width: 560px) { .pgrid { gap: 5px; padding: 10px; } .pg { height: 32px; font-size: 12.5px; } }

/* ── (예전) 문제 번호 ── */
.pager { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer;
  transition: border-color .15s, background .15s;
}
@media (hover: hover) { .pill:hover { border-color: #cdbfab; } }
.pill .st { width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; color: #fff; }
.pill.perfect .st { background: var(--gold); }
.pill.solved .st { background: var(--ok); }
.pill.todo .st { border: 1.5px solid #cdbfab; }
.pill.now { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill.now.todo .st { border-color: rgba(255, 255, 255, .5); }

/* ── 화면 ── */
.screen { display: none; }
.screen.show { display: block; }
.layout.show { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 820px) { .layout.show { grid-template-columns: minmax(0, 1fr); gap: 16px; } }

/* ── 바둑판 ── */
.board-frame {
  background: var(--surface); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow);
}
svg.board { display: block; width: 100%; height: auto; border-radius: 10px; user-select: none; }
.gb-grid line { stroke: #3d2a12; stroke-opacity: .85; }
.gb-star { fill: #3d2a12; }
.gb-num { font-size: 17px; font-weight: 700; text-anchor: middle; font-family: "Pretendard", system-ui, sans-serif; }
.gb-num.on-black { fill: #fff; }
.gb-num.on-white { fill: #1d2433; }
.gb-mark { fill: none; stroke: var(--mark); stroke-width: 3; stroke-linejoin: round; }
.gb-letter { cursor: pointer; }
.gb-letter circle { fill: rgba(255, 255, 255, .92); stroke: var(--accent); stroke-width: 2; transition: fill .15s; }
.gb-letter text { font-size: 16px; font-weight: 800; fill: var(--accent); text-anchor: middle; font-family: "Pretendard", system-ui, sans-serif; }
@media (hover: hover) { .gb-letter:hover circle { fill: var(--accent); } }
@media (hover: hover) { .gb-letter:hover text { fill: #fff; } }
.gb-letter.off { cursor: default; opacity: .3; }
.gb-letter.off:hover circle { fill: rgba(255, 255, 255, .92); }
.gb-letter.off:hover text { fill: var(--accent); }
.gb-ghost { opacity: .5; pointer-events: none; }
.gb-cross { stroke: var(--ng); stroke-width: 2.6; stroke-linecap: round; opacity: .8; pointer-events: none; }
.gb-hit rect { cursor: pointer; }
.gb-pop { animation: gb-pop .32s cubic-bezier(.2, .9, .3, 1.2); transform-box: fill-box; transform-origin: center; }
@keyframes gb-pop { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: scale(1); } }

.board-caption { margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center; }
.board-caption #qnum { color: var(--ink-2); font-weight: 700; }
.board-caption .dot { margin: 0 6px; }

/* ── 오른쪽 패널 ── */
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
  display: flex; flex-direction: column; }
.panel > .eyebrow, .panel > .prompt { order: 0; }
#turn-panel, #waiting, #end-panel { order: 1; }
.panel > .timeline { order: 2; margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--border); }
@media (max-width: 820px) { .panel { padding: 20px; } }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--accent); text-transform: uppercase; margin-bottom: 6px; }
.prompt { font-size: 21px; line-height: 1.4; font-weight: 800; letter-spacing: -0.025em; margin: 0 0 6px; }
.sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; }

.choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.choices button {
  height: var(--h-choice); border-radius: var(--r-control); cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--border);
  font-size: 18px; font-weight: 800; color: var(--ink);
  transition: border-color .15s, background .15s, transform .08s;
}
@media (hover: hover) { .choices button:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); } }
.choices button:active:not(:disabled) { transform: scale(.97); background: var(--accent-soft); }
.btn:active { transform: scale(.98); }
.choices button.tried { background: var(--surface-2); color: #c3c0b8; border-style: dashed; cursor: default; text-decoration: line-through; }
.notice { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 1.6;
  background: var(--ng-soft); color: var(--ng); }
.notice.good { background: var(--ok-soft); color: var(--ok); }
.notice:empty { display: none; }
.confirm { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 12px;
  border-radius: 12px; background: var(--accent-soft); }
.confirm span { flex: 1; font-weight: 700; font-size: 14.5px; }
.confirm .btn { flex: none; height: 40px; padding: 0 16px; }
.choices { margin-top: 12px; }

.hint-toggle {
  margin-top: 0; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--accent); font-size: 14px; font-weight: 600;
}
@media (hover: hover) { .hint-toggle:hover { text-decoration: underline; } }
.turn-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.answer-toggle { color: var(--ink-2); }
.verdict.shown { background: var(--accent-soft); }
.verdict.shown .verdict-icon { background: var(--accent); }
.verdict.shown .verdict-title { color: var(--accent); }
.hint-box {
  margin-top: 10px; padding: 14px 16px; border-radius: 12px;
  background: var(--gold-soft); border: 1px solid #f0dfbd; color: #5c4210; line-height: 1.7;
}

/* 한 수씩 주고받기 */

.turn-label { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.waiting { margin: 0; padding: 14px 0; color: var(--muted); font-size: 14px; }

/* 놓아보기 */
#sandbox { order: 1; }
.sandbox { padding: 14px; border-radius: 12px; border: 1.5px solid var(--accent); background: var(--accent-soft); }
.sandbox-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.sandbox-head span { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.sandbox-help { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-2); }
.sandbox-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sandbox-tools .seg { font-size: 13px; padding: 0 4px; }
.sandbox-end { width: 100%; margin-top: 10px; }

/* 선생님 검토 모드 */
.review-badge { margin-left: 6px; padding: 2px 8px; border-radius: 99px; background: var(--gold); color: #fff; font-size: 11.5px; font-weight: 700; vertical-align: 2px; }
.review { margin-top: 16px; padding: 14px; border-radius: 12px; border: 1.5px dashed var(--gold); background: var(--gold-soft); }
.review-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.review-head span { font-size: 12.5px; color: var(--ink-2); }
.review-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.review-tools .seg.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.review-help { margin: 0 0 8px; font-size: 13px; color: #5c4210; }
.review-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rv-chip { height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.rv-chip.ans { border-color: var(--ok); color: var(--ok); }
.rv-chip.removed { text-decoration: line-through; color: var(--ng); border-color: var(--ng); background: var(--ng-soft); }
.rv-chip.added { border-color: var(--gold); color: var(--gold); }
.review-memo { width: 100%; padding: 10px; border-radius: 10px; border: 1px solid var(--border); font: inherit; font-size: 14px; resize: vertical; background: var(--surface); }
.review-actions { display: flex; gap: 8px; margin-top: 8px; }
.review-actions .btn { flex: 1 1 0; }
.gb-plus { stroke: var(--gold); stroke-width: 3.2; stroke-linecap: round; pointer-events: none; }
.pill.reviewed::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-left: 2px; }

/* 판정 */
.verdict { display: flex; gap: 12px; align-items: center; padding: 16px; border-radius: 12px; margin-bottom: 24px; }
.verdict.ok { background: var(--ok-soft); }
.verdict.ng { background: var(--ng-soft); }
.verdict-icon { width: 34px; height: 34px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 17px; }
.verdict.ok .verdict-icon { background: var(--ok); }
.verdict.ng .verdict-icon { background: var(--ng); }
.verdict-title { font-weight: 800; font-size: 16.5px; }
.verdict.ok .verdict-title { color: var(--ok); }
.verdict.ng .verdict-title { color: var(--ng); }
.verdict-sub { font-size: 13.5px; color: var(--ink-2); }

/* 수순 타임라인 */
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.counter { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li {
  position: relative; display: flex; gap: 12px; padding: 8px 10px; border-radius: 10px;
  transition: opacity .25s, background .25s;
}
.timeline li::before {
  content: ""; position: absolute; left: 22px; top: 34px; bottom: -8px; width: 1.5px; background: var(--border);
}
.timeline li:last-child::before { display: none; }
.timeline li.todo { opacity: .28; }
.timeline li.done { opacity: .65; }
.timeline li.now { background: var(--accent-soft); }
.stone-badge {
  position: relative; z-index: 1; flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 800;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.stone-badge.black { background: radial-gradient(circle at 35% 30%, #666, #111 60%); color: #fff; }
.stone-badge.white { background: radial-gradient(circle at 35% 30%, #fff, #e3e0d8); color: var(--ink); border: 1px solid #cdbfab; }
.step-body { line-height: 1.65; padding-top: 1px; }
.step-who { font-weight: 800; margin-right: 6px; }
.tri { color: var(--mark); font-weight: 800; }

/* 수순 넘기기: 같은 크기 버튼 3개 */
.player { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
#j-player { grid-template-columns: repeat(4, 1fr); }
#j-auto.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg {
  height: var(--h-control); border-radius: var(--r-control); cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--ink-2); transition: background .15s, border-color .15s;
}
@media (hover: hover) { .seg:not(.on):hover:not(:disabled) { background: var(--surface-2); border-color: #cdbfab; } }
.seg:disabled { opacity: .4; cursor: default; }
.seg svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* 정리 */
.lesson { margin-top: 16px; padding: 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.lesson-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--accent); margin-bottom: 4px; }
.lesson-title { font-weight: 800; font-size: 16px; margin-bottom: 4px; }
.lesson-title:empty { display: none; }
.lesson-text { margin: 0; color: var(--ink-2); line-height: 1.7; }

/* 버튼 */
/* 나란히 놓인 버튼은 같은 너비 */
.actions { display: flex; gap: 8px; margin-top: 24px; }
.actions .btn { flex: 1 1 0; }
.actions.center { max-width: 400px; margin-left: auto; margin-right: auto; }
.btn {
  height: var(--h-control); padding: 0 16px; border-radius: var(--r-control); cursor: pointer;
  font-size: 15px; font-weight: 700; border: 1.5px solid transparent; transition: background .15s, border-color .15s;
}
.btn.primary { background: var(--accent); color: #fff; }
@media (hover: hover) { .btn.primary:hover { background: var(--accent-hover); } }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }
@media (hover: hover) { .btn.secondary:hover { border-color: #cdbfab; } }

/* 결과 화면 */
.summary { max-width: 520px; margin: 24px auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 28px; text-align: center; }
.summary-big { font-size: 52px; font-weight: 800; letter-spacing: -0.03em; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.summary-detail { margin: 0 0 6px; color: var(--ink-2); }
.summary-msg { margin: 0; color: var(--muted); }

/* 아래 */
.foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.foot-note { font-size: 12px; color: var(--muted); text-align: center; }
.link { background: none; border: 0; padding: 6px 0; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.link:hover:not(:disabled) { color: var(--accent); }
.link:disabled { opacity: .35; cursor: default; }
@media (max-width: 820px) {
  .board-caption { margin-top: 6px; }
}
@media (max-width: 560px) {
  :root { --h-choice: 52px; --radius: 14px; }
  body { font-size: 15px; padding-bottom: env(safe-area-inset-bottom); }
  .appbar-inner { padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
  .container { padding: 12px 12px 24px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-title { font-size: 16px; }
  .brand-sub { display: none; }
  .meter { width: 104px; }
  .meter-label { font-size: 11.5px; margin-bottom: 4px; }

  /* 문제집 탭·단원: 화면 너비에 꽉 차게 */
  .setbar { gap: 8px; margin-bottom: 10px; }
  .tabs { display: flex; width: 100%; }
  .tab { flex: 1 1 0; padding: 0 8px; font-size: 13.5px; }
  .unit-select { width: 100%; min-width: 0; }

  /* 문제 번호: 한 줄로, 옆으로 밀어서 보기 */
  .pager { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px 12px; padding: 2px 12px 6px;
           scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .pager::-webkit-scrollbar { display: none; }
  .pill { flex: none; height: 34px; padding: 0 12px; }

  .layout.show { gap: 12px; }
  .board-frame { padding: 6px; }
  .board-caption { font-size: 12px; }
  .panel { padding: 16px; }
  .eyebrow { display: none; }
  .prompt { font-size: 17.5px; margin-bottom: 10px; }
  .turn-label { margin-bottom: 10px; font-size: 13.5px; }
  .verdict { margin-bottom: 12px; padding: 12px 14px; }
  .lesson { margin-top: 12px; padding: 14px; }
  .actions { margin-top: 16px; flex-wrap: wrap; }
  .actions .btn { flex: 1 1 40%; height: 48px; }
  .timeline li { padding: 6px 4px; }
  .timeline li::before { left: 16px; }
  .step-body { font-size: 14.5px; }

  /* 아래 이동 버튼 */
  .foot { margin-top: 14px; }
  .foot-note { display: none; }
  .link { height: 44px; padding: 0 14px; border-radius: var(--r-control); background: var(--surface); border: 1px solid var(--border); }
  .summary { margin: 8px auto; padding: 28px 18px; }
}

/* 홈·문제집 화면에서는 위쪽 진행 막대 대신 원형 그래프를 씀 */
body[data-screen="home"] .meter, body[data-screen="book"] .meter, body[data-screen="free"] .meter, body[data-screen="records"] .meter { visibility: hidden; }
.book-title { font-family: var(--font-display); font-weight: 700; font-size: 24px; }
.unit .uname { font-size: 15.5px; }

/* 급수 · 연속 학습일 · 오늘의 목표 */
.hh-top { position: relative; }
.hh-greet { flex: 1; min-width: 0; }
.hh-level { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 13px; color: #7a5b28; font-weight: 600; }
.hh-level b { padding: 1px 9px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 800; }
.goal { width: 58px; height: 58px; flex: none; position: relative; }
.goal svg { width: 100%; height: 100%; display: block; transform: rotate(-90deg); }
.goal .track { fill: none; stroke: rgba(122, 91, 40, .18); stroke-width: 6; }
.goal .val { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; }
.goal .goal-text { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.05;
  font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.goal .goal-text small { display: block; font-size: 9.5px; font-weight: 700; color: #7a5b28; }
.rec-level { display: grid; gap: 8px; padding: 18px; margin-bottom: 12px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.rec-level-top { display: flex; align-items: baseline; justify-content: space-between; }
.rec-level-top b { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.rec-level-top span { font-size: 13px; color: var(--muted); }
.rec-level .bar { height: 8px; }
.rec-level p { margin: 0; font-size: 13px; color: var(--ink-2); }
@media (max-width: 560px) { .goal { width: 52px; height: 52px; } }

/* 진행 막대 (단원·급수) */
.bar { display: block; height: 6px; border-radius: 99px; background: #ece2d3; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; }

/* 문제집을 받는 동안 */
.loader { position: fixed; left: 50%; top: calc(72px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 20;
  padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }

/* 놓아보기: 판이 화면 크기에 맞춰 저절로 커지고 작아짐 */
#free.subpage { max-width: 1240px; }
#free .free-wrap { grid-template-columns: auto minmax(300px, 340px); justify-content: center; align-items: start; }
:root { --z: 1; }
#free .board-frame { width: min(calc(100vw / var(--z) - 430px), calc(100vh / var(--z) - 170px), 900px); min-width: 280px; }
#free .free-panel { position: sticky; top: 16px; user-select: none; -webkit-user-select: none; }
@supports (height: 100dvh) {
  #free .board-frame { width: min(calc(100vw / var(--z) - 430px), calc(100dvh / var(--z) - 170px), 900px); }
}
@media (max-width: 820px) {
  #free .free-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  #free .board-frame { width: min(100%, calc(100vh / var(--z) - 300px)); min-width: 0; }
  #free .free-panel { position: static; width: 100%; }
}
@media (max-width: 820px) and (min-aspect-ratio: 1/1) {
  #free .board-frame { width: min(100%, calc(100vh / var(--z) - 200px)); }
}
@media (max-width: 560px) { #free .board-frame { width: 100%; } }

/* 결과 화면 버튼: 주 버튼은 넓게 한 줄, 나머지는 아래 한 줄에 같은 크기 */
#end-panel .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
#end-panel .btn { white-space: nowrap; }
#end-panel .btn.wide { order: -1; flex: 1 0 100%; height: 50px; font-size: 16px; }
#end-panel .btn.sub { flex: 1 1 0; min-width: 0; height: 46px; padding: 0 8px; display: inline-flex; align-items: center;
  justify-content: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
#end-panel .btn.sub svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
#end-panel .btn.sub svg polygon { fill: currentColor; stroke: none; }
@media (hover: hover) { #end-panel .btn.sub:hover { color: var(--accent); border-color: var(--accent); } }

/* 점수 · 아이디 · 순위표 */
.hh-score { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.login-card { padding: 16px; border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .07); }
.login-title { font-weight: 800; font-size: 15px; }
.login-sub { margin: 4px 0 10px; font-size: 13px; color: var(--muted); }
.login-row { display: flex; gap: 8px; }
.login-input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border-radius: var(--r-control); border: 1.5px solid var(--border);
  font: inherit; font-size: 15px; letter-spacing: .04em; background: var(--surface); color: var(--ink); }
.login-input:focus { outline: none; border-color: var(--accent); }
.login-row .btn { flex: none; }
.login-err { margin: 8px 0 0; font-size: 13px; color: var(--ng); }
.login-err:empty { display: none; }
.rec-level .rule { font-size: 12px; color: var(--muted); line-height: 1.6; }
.rank { margin-bottom: 12px; padding: 16px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); display: grid; gap: 6px; }
.rank:empty { display: none; }
.rank-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.rank-head b { font-size: 15px; }
.rank-head span { font-size: 12px; color: var(--ok); font-weight: 700; }
.rank-head span::before { content: "●"; margin-right: 4px; font-size: 9px; vertical-align: 1px; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: 12px; }
.rank-row.me { background: var(--accent-soft); }
.rank-no { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px;
  background: var(--surface-2); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rank-row.top1 .rank-no { background: #e3b341; color: #fff; }
.rank-row.top2 .rank-no { background: #b4a594; color: #fff; }
.rank-row.top3 .rank-no { background: #c08457; color: #fff; }
.rank-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rank-name { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-sub { font-size: 12px; color: var(--muted); }
.rank-score { font-variant-numeric: tabular-nums; font-size: 15px; }
.rank-empty { margin: 0; font-size: 13.5px; color: var(--muted); }
.rec-account { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.rec-account-who { display: grid; gap: 2px; min-width: 0; }
.rec-account-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.rec-account-who b { font-size: 15.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-logout { flex: none; height: 40px; padding: 0 16px; }
.toast { position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 30;
  padding: 10px 18px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 8px 24px rgba(84, 52, 27, .3); pointer-events: none; }
.toast.show { animation: toast-in .25s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .toast.show { animation: none; } }

/* 오늘의 문제: 난이도 목록 */
.lv-date { margin: -4px 0 12px; font-size: 13px; color: var(--muted); }
.lv-list { display: grid; gap: 10px; }
.lv-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 0; border-radius: 16px; text-align: left; cursor: pointer;
  background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .07); }
.lv-item:active { transform: scale(.99); }
.lv-badge { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 15px; }
.lv-item.done .lv-badge { background: var(--ok-soft); color: var(--ok); }
.lv-body { flex: 1; min-width: 0; display: grid; gap: 8px; }
.lv-name { font-weight: 800; font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.lv-rec { padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 800; }
.lv-dots { display: flex; gap: 6px; }
.lv-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--border); }
.lv-dots i.ok { background: var(--ok); }
.lv-dots i.star { background: var(--gold); }
.lv-count { flex: none; font-size: 13.5px; font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lv-item.done .lv-count { color: var(--ok); }
body[data-screen="dailies"] .meter { visibility: hidden; }

/* 휴대폰에서 화면이 흔들리거나 밀리지 않게 */
html, body { overflow-x: clip; max-width: 100%; }
@supports not (overflow-x: clip) { html, body { overflow-x: hidden; } }
body { overscroll-behavior: none; }                    /* 끝에서 튕기거나 당겨서 새로고침되는 움직임 막기 */
.login-input, .unit-select, .review-memo { font-size: 16px; }   /* 아이폰이 입력 칸을 누를 때 확대하지 않게 */
svg.board { touch-action: pan-y; }                    /* 판을 누를 때 좌우로 끌리지 않게 (위아래 스크롤은 됨) */
@media (max-width: 820px) {
  /* "이 자리에 둘까요?"는 화면 아래에 떠 있게 → 내용이 밀리지 않음 */
  .confirm { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 25;
    margin: 0; padding: 12px 14px; background: var(--surface); border: 1.5px solid var(--accent);
    box-shadow: 0 10px 30px rgba(84, 52, 27, .25); }
  .confirm .btn { height: 44px; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}

html, body { touch-action: manipulation; }             /* 두 번 눌러 확대 막기 */
#end-panel .btn.wide { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
#end-panel .btn.wide svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* 홈 타일이 홀수면 마지막 타일은 넓게 */
.tiles .tile:last-child:nth-child(odd) { grid-column: span 2; }

/* 정석 외우기 */
.jstudy { max-width: 1040px; margin: 0 auto; }
.jstudy.show { display: block; }
.j-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; }
.j-modes .seg { font-size: 13.5px; padding: 0 4px; }
.j-modes .seg.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.j-why { margin: 0 0 12px; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.j-status { margin-bottom: 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-weight: 700; font-size: 15px; }
.j-status.ok { background: var(--ok-soft); color: var(--ok); }
.j-status.ng { background: var(--ng-soft); color: var(--ng); }
.j-status:empty { display: none; }
.jstudy .timeline { margin-top: 12px; }
.jstudy .timeline li.hide .step-body span:last-child { filter: blur(4px); }
.lv-item .lv-badge.new { background: var(--surface-2); color: var(--ink-2); }
.lv-item .lv-badge.learn { background: var(--gold-soft); color: var(--gold); }
.lv-item .lv-badge.due { background: var(--ng-soft); color: var(--ng); }
.lv-item .lv-badge.done { background: var(--ok-soft); color: var(--ok); }
body[data-screen="jlist"] .meter, body[data-screen="jstudy"] .meter { visibility: hidden; }

/* 정석 화면: 묶음 제목 */
.lv-sec { margin: 18px 2px 8px; font-size: 15px; font-weight: 800; color: var(--ink); }
.lv-sec:first-of-type { margin-top: 6px; }
.lv-group { margin: 10px 4px 2px; font-size: 12.5px; font-weight: 800; letter-spacing: .04em; color: var(--accent); }

/* 맨 위 띠가 없으므로 휴대폰 상단(노치) 여백은 본문에서 */
body { padding-top: env(safe-area-inset-top, 0px); }

/* 안 보고 두기 결과: 틀린 수 */
.timeline li.miss { background: var(--ng-soft); }
.timeline li.miss .step-who { color: var(--ng); }

/* 정석 결과: 대등 · 흑 좋음 · 백 좋음 */
.j-result { margin: 0 0 8px; padding: 8px 12px; border-radius: 10px; font-size: 14px; line-height: 1.5; background: var(--surface-2); color: var(--ink-2); }
.j-result b { color: var(--ink); }
.j-result.black { background: #ece7e1; } .j-result.black b { color: #1f1a16; }
.j-result.white { background: var(--accent-soft); } .j-result.white b { color: var(--accent); }
.j-result.even b { color: var(--ok); }
.j-chip { display: inline-block; white-space: nowrap; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 800; vertical-align: 1px; }
.j-chip.even { background: var(--ok-soft); color: var(--ok); }
.j-chip.black { background: #2b2118; color: #fff; }
.j-chip.white { background: #fff; color: var(--ink); border: 1px solid var(--border); }

/* 정석 묶음 카드 */
.jgroups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.jgroup { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border: 0; border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow); text-align: left; cursor: pointer; min-width: 0; }
.jgroup:active { transform: scale(.98); }
.jg-name { font-weight: 800; font-size: 15.5px; }
.jg-sub { font-size: 12.5px; color: var(--muted); }
.jg-bar { width: 100%; height: 5px; border-radius: 99px; background: var(--border); overflow: hidden; }
.jg-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.jg-count { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.jg-count.due { color: var(--ng); }
.j-chip.first { margin-left: 0; }

/* ── 정석 강의 ── */
.lz-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; -webkit-overflow-scrolling: touch; }
.lz-tab { flex: none; height: 36px; padding: 0 12px; border: 1.5px solid var(--border); border-radius: 999px; background: var(--surface);
  font-size: 14px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.lz-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.lz-tab.joseki:not(.on) { border-color: var(--ok); color: var(--ok); }
.lz-tab.bad:not(.on) { color: var(--ng); }
.lz-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 16px; }
.lz-chip { padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 800; background: var(--surface-2); color: var(--ink-2); }
.lz-chip.joseki { background: var(--ok-soft); color: var(--ok); }
.lz-chip.bad { background: var(--ng-soft); color: var(--ng); }
.lz-chip.good { background: #ece7e1; color: #2b2118; }
.lz-chip.old { background: var(--gold-soft); color: var(--gold); }
.lz-text { margin: 0 0 10px; font-size: 15.5px; line-height: 1.75; word-break: keep-all; }
.lz-memo { margin: 0 0 10px; padding: 6px 12px; border-left: 3px solid var(--gold); font-family: var(--font-hand); font-size: 21px; color: #7a5b28; }
.lz-choices { display: flex; gap: 10px; margin-bottom: 10px; }
.lz-choices:empty { display: none; }
.lz-choice { flex: 1; height: 48px; font-size: 18px; font-weight: 800; }
#lz-player { grid-template-columns: repeat(4, 1fr); }
#lz-auto.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 강의의 A·B: 그 자리에 둘 쪽 색으로 (흑 = 검은 바탕 흰 글자, 백 = 흰 바탕 검은 글자) */
.gb-letter.stone-b circle { fill: #1f1b18; stroke: #000; stroke-width: 1.5; }
.gb-letter.stone-b text { fill: #fff; }
.gb-letter.stone-w circle { fill: #fbfaf7; stroke: #3a332c; stroke-width: 1.5; }
.gb-letter.stone-w text { fill: #1f1b18; }
@media (hover: hover) { .gb-letter.stone-b:hover circle { fill: #1f1b18; } .gb-letter.stone-b:hover text { fill: #fff; }
  .gb-letter.stone-w:hover circle { fill: #fbfaf7; } .gb-letter.stone-w:hover text { fill: #1f1b18; } }

/* A·B가 처음 나타날 때: 작게 시작해 살짝 커졌다가 제자리로 */
.gb-letter.appear { animation: letter-in .45s ease-out both; }
@keyframes letter-in {
  0% { transform: scale(.3); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .gb-letter.appear { animation: none; } }

/* 강의 버튼: 좁으면 줄을 바꿔 쌓고 글자는 한 줄로 */
#lz-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#lz-actions .btn { flex: 1 1 140px; white-space: nowrap; }

/* 정석 그림: 외워야 할 것 */
.lz-tab.joseki { background: var(--ok-soft); }
.lz-tab.joseki.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.lz-joseki .board-frame { box-shadow: 0 0 0 3px var(--ok), var(--shadow); }
.lz-joseki .panel { box-shadow: inset 0 0 0 2px var(--ok), var(--shadow); }
.lz-head { flex-wrap: wrap; }
.lz-band { flex: 1 0 100%; margin: -2px 0 4px; padding: 6px 12px; border-radius: 10px; background: var(--ok); color: #fff;
  font-size: 14px; font-weight: 800; letter-spacing: .02em; }
#lz-actions .lz-memo-btn { background: var(--ok); }
@media (hover: hover) { #lz-actions .lz-memo-btn:hover { background: #0f5f3c; } }

/* 그림 보기의 수 표시: 버튼 위 오른쪽에 작게 */
.lz-count { margin: 4px 2px -6px; text-align: right; font-size: 13px; font-weight: 700; color: var(--muted); }

/* 놓아보기: 확인하고 두기 */
.free-confirm { display: flex; align-items: center; gap: 12px; margin: 8px 0; padding: 10px; border-radius: 12px; background: var(--accent-soft); }
.free-pad { display: grid; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(2, 40px); gap: 4px; flex: none; }
.free-pad [data-d="up"] { grid-column: 2; grid-row: 1; }
.free-pad [data-d="left"] { grid-column: 1; grid-row: 2; }
.free-pad [data-d="down"] { grid-column: 2; grid-row: 2; }
.free-pad [data-d="right"] { grid-column: 3; grid-row: 2; }
.free-pad .seg { height: 40px; min-height: 0; padding: 0; font-size: 15px; }
.free-confirm-btns { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.free-confirm-btns .btn { width: 100%; }

/* 놓아보기: 접바둑 */
.free-hcap, .free-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; font-weight: 700; font-size: 14.5px; }
.free-row-label { flex: none; min-width: 64px; }
.free-hcap { gap: 10px; }
.free-hcap select { flex: 1; height: 40px; padding: 0 10px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface); font: inherit; font-size: 16px; color: var(--ink); }

/* 두는 방식: 판 크기 버튼과 같은 모양의 둘 중 하나 고르기 */
.free-mode-seg { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.free-mode-seg .seg { height: 40px; font-size: 14.5px; font-weight: 700; }
.free-mode-seg .seg.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* 장면 질문의 A·B·C: 동그라미 없이 글자만 (판 색 테두리로 줄 위에서도 또렷하게) */
.gb-letter.plain circle { fill: transparent; stroke: none; }
.gb-letter.plain text { font-size: 28px; font-weight: 800; fill: #1f1b18; stroke: #dfb46c; stroke-width: 5px; paint-order: stroke; stroke-linejoin: round; }
@media (hover: hover) { .gb-letter.plain:hover circle { fill: transparent; } .gb-letter.plain:hover text { fill: var(--accent); } }
.gb-letter.plain.off { opacity: .35; }
#lz-actions .lz-replay { flex-basis: 100%; }

/* 정석 외우기 끝난 뒤 버튼: 주 버튼은 한 줄 전체, 보조 버튼은 나란히 (글자는 한 줄) */
#j-actions { flex-wrap: wrap; }
#j-actions .btn { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 8px; padding-right: 8px; }
#j-actions .btn.primary { flex-basis: 100%; }

/* 강의 진도: 그림마다 점 (본 그림 ✓) */
.lz-prog { flex: 1 0 100%; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.lz-dot { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--surface);
  font-size: 12.5px; font-weight: 800; color: var(--muted); cursor: pointer; padding: 0; }
.lz-dot.seen { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }
.lz-dot.j { border-color: var(--ok); }
.lz-dot.now { background: var(--accent); border-color: var(--accent); color: #fff; }
.lz-dot.now.j { background: var(--ok); border-color: var(--ok); }
.lz-prog-txt { margin-left: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
#lz-actions .lz-next-do { flex-basis: 100%; }

/* 강의 버튼 정리: 주 버튼 한 줄 전체, 보조 버튼은 나란히 */
#lz-actions .btn.lz-main { flex-basis: 100%; }
#lz-actions .btn.secondary { flex: 1 1 0; }
.lz-head .lz-prog-txt { margin-left: auto; }

/* 강의 진도 초기화 */
.lz-reset { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--border); font-size: 13.5px; color: var(--muted); }
.lz-reset .btn { flex: none; height: 38px; padding: 0 14px; font-size: 14px; }

/* ── 로그인 ── */
.auth-gate { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: linear-gradient(160deg, var(--kaya-soft) 0%, #f1e2c4 100%); overflow-y: auto; }
.auth-card { width: 100%; max-width: 380px; padding: 32px 24px 24px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.auth-mark { width: 64px; height: 64px; border-radius: 16px; }
.auth-title { margin: 12px 0 2px; font-family: var(--font-display); font-size: 28px; }
.auth-sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.auth-form { display: flex; flex-direction: column; text-align: left; }
.auth-label { margin: 10px 0 6px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.auth-input { height: 50px; padding: 0 14px; border: 1.5px solid var(--border); border-radius: 12px; font: inherit; font-size: 17px; background: var(--surface); color: var(--ink); }
.auth-input:focus { outline: none; border-color: var(--accent); }
.auth-btn { margin-top: 18px; height: 52px; font-size: 17px; }
.auth-err { min-height: 1.4em; margin: 10px 0 0; color: var(--ng); font-size: 14px; font-weight: 700; text-align: center; }
.auth-help { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; text-align: center; }
.auth-step { margin: 0 0 6px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 14.5px; font-weight: 700; line-height: 1.5; }
.auth-loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 15px; background: var(--bg); z-index: 90; }

/* 정석 강의 목록: 장 탭 + 10강 묶음 */
.lz-chtabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 2px 0 14px; }
.lz-chtab { height: auto; min-height: 56px; padding: 8px 10px; flex-direction: column; gap: 2px; }
.lz-chtab .lz-chname { font-size: 15px; font-weight: 800; color: var(--ink); }
.lz-chtab .lz-chcount { font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.lz-chtab.on { background: var(--accent); border-color: var(--accent); }
.lz-chtab.on .lz-chname, .lz-chtab.on .lz-chcount { color: #fff; }
.lz-chintro { margin: 0 2px 2px; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.lv-sec.lz-range { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lz-rangecount { font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.lz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.lz-item { padding: 10px 14px; gap: 12px; border-radius: 14px; }
.lz-item .lv-badge { width: 40px; height: 40px; border-radius: 11px; font-size: 14px; }
.lz-item .lv-body { gap: 3px; }
.lz-item .lv-name { font-size: 14.5px; line-height: 1.4; }
.lz-item.lz-next { box-shadow: 0 0 0 2px var(--accent), 0 4px 14px rgba(0, 0, 0, .07); }
.lz-item.lz-next .lv-badge { background: var(--accent); color: #fff; }
@media (max-width: 420px) { .lz-grid { grid-template-columns: 1fr; } }

/* 놓아보기 오른쪽 칸: 설정(이름 위·버튼 아래) → 차례 → 확인 → 도구 */
#free .free-panel { gap: 14px; padding: 18px; }
.free-field { display: grid; gap: 6px; }
.free-label { font-size: 12.5px; font-weight: 700; letter-spacing: .02em; color: var(--muted); }
.free-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.free-seg .seg { height: 38px; border: 0; border-radius: 9px; background: transparent; font-size: 14px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
@media (hover: hover) { .free-seg .seg:not(.on):hover:not(:disabled) { background: rgba(255, 255, 255, .55); } }
.free-seg .seg.on, .free-size .seg.on, .free-mode-seg .seg.on { background: var(--surface); color: var(--accent); border: 0;
  box-shadow: 0 1px 2px rgba(84, 52, 27, .12), 0 2px 8px rgba(84, 52, 27, .10); }
.free-field select { height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); }
.free-status { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); }
.free-stone { width: 26px; height: 26px; flex: none; border-radius: 50%; }
.free-stone.b { background: radial-gradient(circle at 35% 30%, #5a5a5a, #111 70%); }
.free-stone.w { background: radial-gradient(circle at 35% 30%, #fff, #d9d4cc 80%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.free-status-text { display: grid; gap: 1px; }
.free-status-text b { font-size: 16px; color: var(--ink); }
.free-status-text span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
#free .notice:empty { display: none; }
.free-confirm { display: grid; gap: 10px; justify-items: center; margin: 0; padding: 14px; border-radius: 12px; border: 1.5px solid var(--accent); background: var(--accent-soft); }
.free-confirm[hidden] { display: none; }
.free-confirm-help { font-size: 13.5px; font-weight: 600; color: var(--ink-2); text-align: center; line-height: 1.5; }
.free-pad { grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(2, 44px); gap: 6px; }
.free-pad .seg { height: 44px; }
.free-pad .seg svg { width: 20px; height: 20px; }
.free-confirm-btns { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; width: 100%; flex-direction: unset; }
.free-confirm-btns .btn { height: 44px; white-space: nowrap; }
.free-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding-top: 14px; border-top: 1px solid var(--border); }
.free-tools .seg { height: auto; min-height: 58px; padding: 8px 4px; flex-direction: column; gap: 4px; font-size: 12.5px; white-space: nowrap; }
.free-tools .seg svg { width: 18px; height: 18px; }

/* 설정 */
.set-wrap { max-width: 560px; margin: 0 auto; display: grid; gap: 10px; }
.set-profile { display: flex; align-items: center; gap: 14px; padding: 18px; margin-bottom: 8px; border-radius: 16px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .07); }
.set-avatar { width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 21px; font-weight: 800; }
.set-profile-main { display: grid; gap: 3px; min-width: 0; }
.set-profile-main b { font-size: 18px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-profile-main span { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.set-title { margin: 8px 6px 0; font-size: 12.5px; font-weight: 800; letter-spacing: .06em; color: var(--muted); }
.set-card { border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .07); overflow: hidden; }
.set-pad { padding: 16px; display: grid; gap: 12px; }
.set-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0 14px 0 16px; border: 0; background: transparent;
  font: inherit; text-align: left; cursor: pointer; color: var(--ink); }
.set-item + .set-item { border-top: 1px solid var(--border); }
.set-item:hover { background: var(--surface-2); }
.set-ico { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.set-ico svg, .set-chev { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.set-item-name { flex: 1; font-size: 15.5px; font-weight: 700; }
.set-chev { color: var(--muted); }
.set-item.danger { color: var(--ng); }
.set-item.danger .set-ico { background: var(--ng-soft); color: var(--ng); }
.set-field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.set-note { font-size: 12.5px; color: var(--muted); }
.set-pad .font-options { grid-template-columns: repeat(4, 1fr); gap: 0; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.set-pad .font-opt { height: 62px; border: 0; border-radius: 9px; background: transparent; gap: 3px; }
.set-pad .font-opt .fo-a { font-weight: 800; color: var(--ink-2); line-height: 1; }
.set-pad .font-opt .fo-l { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.set-pad .font-opt.on { background: var(--surface); box-shadow: 0 1px 2px rgba(84, 52, 27, .12), 0 2px 8px rgba(84, 52, 27, .10); }
.set-pad .font-opt.on .fo-a, .set-pad .font-opt.on .fo-l { color: var(--accent); }
.set-preview { margin: 0; padding: 12px 14px; border-radius: 10px; border: 1px dashed var(--border); font-size: 15px; line-height: 1.6; color: var(--ink-2); }

/* 가운데 창 (비밀번호 바꾸기 · 로그아웃 확인) */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(40, 26, 14, .45); }
.modal[hidden] { display: none; }
.modal-card { width: min(100%, 380px); display: grid; gap: 12px; padding: 22px 20px 18px; border-radius: 18px; background: var(--surface);
  box-shadow: 0 20px 60px rgba(40, 26, 14, .35); }
.modal-title { margin: 0; font-size: 18px; font-weight: 800; color: var(--ink); }
.modal-sub { margin: -6px 0 2px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.set-input { display: grid; gap: 5px; }
.set-input span { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.set-input input { height: 46px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
  font: inherit; font-size: 17px; letter-spacing: .2em; color: var(--ink); }
.set-input input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.modal-err { margin: 0; min-height: 0; color: var(--ng); font-size: 13.5px; font-weight: 700; }
.modal-err:empty { display: none; }
.modal-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.modal-btns .btn { height: 46px; }
.btn.primary.danger { background: var(--ng); border-color: var(--ng); }
body.modal-open { overflow: hidden; }

/* 놓아보기 v2: 차례 한 줄, 착수 확인은 제목·방향키 한 줄 + 착수/취소 한 줄 */
.free-status { padding: 10px 14px; gap: 10px; }
.free-stone { width: 22px; height: 22px; }
#free-turn { font-size: 15.5px; color: var(--ink); }
.free-turn-sub { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.free-confirm { grid-template-columns: 1fr auto; grid-template-areas: "t pad" "btns btns"; align-items: center; justify-items: stretch;
  gap: 12px; padding: 12px 14px; border: 1px solid var(--border); background: var(--surface-2); }
.free-confirm-title { grid-area: t; align-self: start; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; color: var(--muted); }
.free-pad { grid-area: pad; grid-template-columns: repeat(3, 40px); grid-template-rows: repeat(2, 40px); gap: 4px; }
.free-pad .seg { height: 40px; border-radius: 10px; }
.free-pad .seg svg { width: 18px; height: 18px; }
.free-confirm-btns { grid-area: btns; grid-template-columns: 1fr 1.6fr; gap: 8px; }
.free-confirm-btns .btn { height: 46px; font-size: 15.5px; }

/* 강의 목록 칸의 상태 줄 */
.lz-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; min-width: 0; }
.lz-dots { display: inline-flex; gap: 3px; }
.lz-dots i { width: 14px; height: 5px; border-radius: 3px; background: var(--border); }
.lz-dots i.on { background: var(--accent); }
.lz-item.done .lz-dots i.on { background: var(--ok); }
.lz-meta-label { font-size: 12.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.lz-chip { padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 800; line-height: 1.5; white-space: nowrap; }
.lz-chip.memo { background: var(--gold-soft); color: var(--gold); }
.lz-chip.todo { background: var(--accent-soft); color: var(--accent); }
.lz-chip.new { background: var(--surface-2); color: var(--ink-2); }
.lz-done { width: 26px; height: 26px; flex: none; }
.lz-item.done .lz-done { display: grid; place-items: center; border-radius: 50%; background: var(--ok); }
.lz-done svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }

/* 오늘의 문제: 문제 미리보기 + 난이도 표 */
.dl-item { gap: 16px; padding: 12px 16px 12px 12px; }
.dl-thumb { width: 96px; flex: none; padding: 3px; border-radius: 9px; background: var(--kaya); box-shadow: inset 0 0 0 1px rgba(84, 52, 27, .12); }
.dl-thumb .thumb { aspect-ratio: auto; min-height: 60px; }
.dl-item .lv-name { gap: 8px; }
.dl-level { padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; }
.dl-item.done .dl-level { background: var(--ok-soft); color: var(--ok); }
@media (max-width: 420px) { .dl-thumb { width: 78px; } }

/* 홈 v2: 머리 띠(날짜·설정 / 인사 / 급수 → 내 기록 / 문구) · 이어서 풀기 진행 막대 · 2×2 타일 · 내 기록 한 줄 */
.hh { margin: 0; padding: 18px 20px 16px; border: 1px solid var(--kaya-line); border-radius: 20px; display: grid; gap: 6px; }
.hh-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hh-hello { font-size: 13px; font-weight: 600; color: #7a5b28; }
.hh-gear { width: 38px; height: 38px; margin: -6px -8px -6px 0; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: transparent; color: #7a5b28; cursor: pointer; }
.hh-gear:hover { background: rgba(255, 255, 255, .5); }
.hh-gear svg { width: 21px; height: 21px; }
.hh-name { font-family: inherit; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.hh-rank { justify-self: start; display: inline-flex; align-items: center; gap: 8px; margin-top: 2px; padding: 5px 8px 5px 5px;
  border: 0; border-radius: 999px; background: rgba(255, 255, 255, .6); font: inherit; cursor: pointer; }
.hh-rank:hover { background: rgba(255, 255, 255, .85); }
.hh-rank b { padding: 2px 10px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 800; }
.hh-rank .hh-score { margin: 0; font-size: 13.5px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.hh-streak { font-size: 13px; font-weight: 600; color: #7a5b28; }
.hh-streak::before { content: "·"; margin-right: 8px; color: #b99a63; }
.hh-rank-chev { width: 16px; height: 16px; fill: none; stroke: #9a7a44; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hh-tag { margin-top: 6px; font-family: var(--font-hand); font-size: 21px; line-height: 1.1; color: #8a6a32; letter-spacing: .03em; }
.home-body { padding-top: 14px; }
.pt-progress { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.pt-bar { flex: 1; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.pt-bar span { display: block; height: 100%; border-radius: inherit; background: #fff; }
.pt-count { font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .85); font-variant-numeric: tabular-nums; }
.row-tile { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 0; border-radius: 16px; background: var(--surface);
  text-align: left; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .07); transition: transform .13s, box-shadow .15s; }
.row-tile:active { transform: scale(.98); }
@media (hover: hover) { .row-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 0, 0, .1); } }
.row-tile-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.row-tile-icon svg { width: 22px; height: 22px; }
.row-tile-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row-tile-text .tile-sub { margin: 0; }
.row-tile-chev { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* 책의 표시 (△ ○ □ ×) */
.gb-shape { fill: none; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.gb-shape.on-black { stroke: #fff; }
.gb-shape.on-white { stroke: #1d2433; }
.gb-shape.on-empty { stroke: #1d2433; }
.gb-shape.on-empty.x { stroke: var(--ng); stroke-width: 3; }

/* 입문 연습문제 */
#ipractice .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#ipractice .actions .lz-main { grid-column: 1 / -1; }
.ip-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.ip-kind { font-size: 16px; font-weight: 800; color: var(--ink); }
.ip-count { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.ip-dots { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.ip-dot { width: 14px; height: 14px; padding: 0; border: 0; border-radius: 4px; background: var(--border); cursor: pointer; }
.ip-dot.ok { background: var(--ok); }
.ip-dot.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.ip-prompt { font-size: 16px; font-weight: 600; }
.ip-ox { font-size: 20px; font-weight: 800; }
.lz-memo.lz-intro { padding: 10px 14px; border-left-color: var(--accent); border-radius: 0 10px 10px 0; background: var(--kaya-soft); font-family: inherit; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.lz-tab.lz-practice-tab { border-color: var(--accent); color: var(--accent); font-weight: 800; }
body[data-screen="ipractice"] .meter { visibility: hidden; }

/* 홈: 오늘의 공부 */
.today { display: grid; gap: 10px; padding: 16px; border-radius: 20px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .07); }
.today-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 2px; }
.today-title { font-size: 16px; font-weight: 800; color: var(--ink); }
.today-sum { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.today-list { display: grid; gap: 8px; }
.today-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 12px 12px 12px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); text-align: left; cursor: pointer; font: inherit; color: var(--ink); transition: transform .13s, box-shadow .15s; }
.today-row:active { transform: scale(.98); }
.today-ico { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.today-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.today-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.today-label { font-size: 15px; font-weight: 800; }
.today-sub { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-prog { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.today-bar { flex: 1; height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.today-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.today-count { font-size: 11.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.today-chev { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.today-row.now { border: 0; background: linear-gradient(135deg, #9c6b3e 0%, var(--accent) 100%); color: #fff; box-shadow: 0 4px 16px rgba(84, 52, 27, .25); }
.today-row.now .today-ico { background: rgba(255, 255, 255, .18); color: #fff; }
.today-row.now .today-sub, .today-row.now .today-count { color: rgba(255, 255, 255, .8); }
.today-row.now .today-bar { background: rgba(255, 255, 255, .25); }
.today-row.now .today-bar span { background: #fff; }
.today-row.now .today-chev { stroke: #fff; }
.today-row.complete .today-ico { background: var(--ok-soft); color: var(--ok); }
.today-row.complete .today-bar span { background: var(--ok); }
@media (hover: hover) { .today-row:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0, 0, 0, .08); } .today-row.now:hover { box-shadow: 0 8px 24px rgba(84, 52, 27, .3); } }

/* 위쪽 막대: 화면 맨 위에 붙어 있고, 뒤로 가기(왼쪽) · 화면 이름(가운데) */
.sub-topbar { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px;
  min-height: 52px; margin: -18px -20px 14px; padding: 4px 12px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border); }
.sub-topbar::after { content: none; }
.sub-topbar .sub-title { grid-column: 2; max-width: min(56vw, 520px); font-size: 16px; font-weight: 800; color: var(--ink); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-topbar .back { grid-column: 1; grid-row: 1; justify-self: start; max-width: 100%; }
.back { display: inline-flex; align-items: center; gap: 2px; height: 40px; padding: 0 12px 0 4px; border-radius: 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; font-weight: 700; color: var(--accent); }
.back::before { content: ""; width: 22px; height: 22px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5l-7 7 7 7'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5l-7 7 7 7'/%3E%3C/svg%3E") center / contain no-repeat; }
.back:hover { background: var(--accent-soft); }
@media (max-width: 560px) { .sub-topbar .sub-title { font-size: 15px; } .back { font-size: 13.5px; } }

/* 아래 탭 */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: none; grid-template-columns: repeat(4, 1fr);
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--border); }
body:is([data-screen="home"], [data-screen="lessons"], [data-screen="library"], [data-screen="book"], [data-screen="records"], [data-screen="dailies"], [data-screen="settings"], [data-screen="review"], [data-screen="homework"], [data-screen="teacher"], [data-screen="week"], [data-screen="badges"], [data-screen="rankplan"], [data-screen="notice"]) .tabbar { display: grid; }
body:is([data-screen="home"], [data-screen="lessons"], [data-screen="library"], [data-screen="book"], [data-screen="records"], [data-screen="dailies"], [data-screen="settings"], [data-screen="review"], [data-screen="homework"], [data-screen="teacher"], [data-screen="week"], [data-screen="badges"], [data-screen="rankplan"], [data-screen="notice"]) { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
.tab-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; height: 52px; justify-content: center; border: 0; border-radius: 12px;
  background: transparent; font: inherit; font-size: 11.5px; font-weight: 700; color: var(--muted); cursor: pointer; }
.tab-btn svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tab-btn.on { color: var(--accent); }
.tab-btn.on svg { stroke-width: 2.3; }
@media (hover: hover) { .tab-btn:hover { background: var(--accent-soft); } }
@media (min-width: 821px) { .tabbar { left: 50%; right: auto; bottom: 14px; transform: translateX(-50%); width: 420px; padding: 6px; border: 1px solid var(--border);
  border-radius: 18px; box-shadow: 0 8px 30px rgba(40, 26, 14, .15); } }

/* 내 기록: 강의 · 수읽기 훈련 진행 (한 줄씩, 문제집은 펼치기) */
#rec-units { display: block; }
.rec-sec { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 6px 8px; }
.rec-sec h2 { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .06em; color: var(--muted); }
.rec-sec span { font-size: 12px; color: var(--muted); }
.rec-card { border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .07); overflow: hidden; }
.rec-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "main pct chev" "bar bar bar"; align-items: center;
  column-gap: 10px; row-gap: 10px; padding: 14px 16px; }
.rec-row + .rec-row, .rec-units-list + .rec-row { border-top: 1px solid var(--border); }
.rec-row.tap { cursor: pointer; }
.rec-row.tap:hover { background: var(--surface-2); }
.rec-row-main { grid-area: main; display: grid; gap: 2px; min-width: 0; }
.rec-row-name { font-size: 15px; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-row-sub { font-size: 12.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.rec-row-pct { grid-area: pct; font-size: 15px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.rec-row.complete .rec-row-pct { color: var(--ok); }
.rec-row-bar { grid-area: bar; height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.rec-row-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.rec-row.complete .rec-row-bar span { background: var(--ok); }
.rec-chev { grid-area: chev; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.rec-row.open .rec-chev { transform: rotate(180deg); }
.rec-row:not(.book) { grid-template-areas: "main pct pct" "bar bar bar"; }
.rec-units-list { display: grid; padding: 2px 8px 10px; background: var(--surface-2); border-top: 1px solid var(--border); }
.rec-unit { display: grid; grid-template-columns: minmax(0, 1fr) 72px 48px; align-items: center; gap: 12px; padding: 10px 10px; border: 0; border-radius: 10px;
  background: transparent; font: inherit; text-align: left; cursor: pointer; }
.rec-unit:hover { background: var(--surface); }
.rec-unit-name { font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-unit-bar { height: 4px; border-radius: 99px; background: var(--border); overflow: hidden; }
.rec-unit-bar span { display: block; height: 100%; background: var(--accent); }
.rec-unit.complete .rec-unit-bar span { background: var(--ok); }
.rec-unit-count { font-size: 12.5px; font-weight: 700; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.rec-unit.complete .rec-unit-name { color: var(--ok); }

/* 장면 탭이 많으면(입문 1장 등) 옆으로 밀지 않고 여러 줄로 */
.lz-tabs { flex-wrap: wrap; overflow: visible; padding-bottom: 0; }

/* 강의 첫 화면: 큰 묶음 카드 */
.course-list { display: grid; gap: 10px; }
.course { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border: 0; border-radius: 18px; background: var(--surface);
  text-align: left; font: inherit; color: var(--ink); cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .07); transition: transform .13s, box-shadow .15s; }
.course:active { transform: scale(.99); }
@media (hover: hover) { .course:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, .1); } }
.course-ico { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.course-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.course.first .course-ico { background: var(--accent); color: #fff; }
.course.complete .course-ico { background: var(--ok-soft); color: var(--ok); }
.course-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.course-name { font-size: 17px; font-weight: 800; }
.course-desc { font-size: 13px; color: var(--ink-2); }
.course-meta { margin-top: 4px; font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.course-bar { height: 5px; margin-top: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.course-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.course.complete .course-bar span { background: var(--ok); }
.course-next { margin-top: 6px; font-size: 12.5px; font-weight: 700; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-chev { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* 휴대폰: 착수 확인 칸을 화면 아래에 떠 있게 (판을 누른 뒤 바로 손이 닿는 곳) */
@media (max-width: 820px) {
  #free .free-confirm { position: fixed; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 40; grid-template-columns: 1fr; grid-template-areas: "pad" "btns";
    gap: 8px; padding: 10px; border-radius: 16px; background: var(--surface); box-shadow: 0 10px 34px rgba(40, 26, 14, .28); }
  #free .free-confirm-title { display: none; }
  #free .free-pad { grid-template-columns: repeat(4, 1fr); grid-template-rows: 44px; width: 100%; }
  #free .free-pad [data-d="left"] { grid-column: 1; grid-row: 1; }
  #free .free-pad [data-d="up"] { grid-column: 2; grid-row: 1; }
  #free .free-pad [data-d="down"] { grid-column: 3; grid-row: 1; }
  #free .free-pad [data-d="right"] { grid-column: 4; grid-row: 1; }
  #free .free-confirm-btns .btn { height: 50px; font-size: 16.5px; }
}

/* 홈 머리 띠: 앱 아이콘 + 이름 */
.hh-brand { display: inline-flex; align-items: center; gap: 8px; }
.hh-logo { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 1px 3px rgba(61, 42, 18, .25); }
.hh-brand b { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; color: var(--accent); }
.hh-bar + .hh-hello { margin-top: 8px; }
/* 오늘의 문제 미리보기: 모두 같은 크기 (판 모양이 달라도 가운데 맞춤) */
.dl-thumb { height: 76px; display: grid; place-items: center; }
.dl-thumb .thumb { width: 100%; height: 100%; min-height: 0; }

/* 수읽기 훈련 단원: 다음에 풀 문제 미리보기 */
.unit.unit-prev { gap: 14px; padding: 10px 14px 10px 10px; }
.unit-thumb { position: relative; width: 84px; height: 68px; flex: none; display: grid; place-items: center; padding: 3px; border-radius: 9px;
  background: var(--kaya); box-shadow: inset 0 0 0 1px rgba(84, 52, 27, .12); }
.unit-thumb .thumb { width: 100%; height: 100%; }
.unit.done .unit-thumb .thumb { opacity: .45; }
.unit-check { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; font-weight: 800; color: var(--ok); }

/* 점수 알림(+10점 등): 갈색 버튼과 헷갈리지 않게 밝은 금색 바탕 · 진한 글씨 */
.toast { background: #fff7e3; color: #7a4e12; border: 1.5px solid #e6c27a; box-shadow: 0 8px 24px rgba(84, 52, 27, .22); }

/* 고른 칸은 갈색 바탕 · 흰 글씨로 또렷하게 (놓아보기 판 크기·두는 방식, 설정 글씨 크기) */
.free-seg .seg.on, .free-size .seg.on, .free-mode-seg .seg.on { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(84, 52, 27, .25); }
.set-pad .font-opt.on { background: var(--accent); box-shadow: 0 2px 8px rgba(84, 52, 27, .25); }
.set-pad .font-opt.on .fo-a, .set-pad .font-opt.on .fo-l { color: #fff; }

/* 시작 화면 (불러오는 동안) */
.auth-loading { flex-direction: column; background: radial-gradient(120% 80% at 50% 30%, #fbf3e2 0%, var(--bg) 70%); }
.splash { display: grid; justify-items: center; gap: 6px; padding: 24px; text-align: center; animation: splash-in .5s ease-out both; }
.splash-logo { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 10px 30px rgba(84, 52, 27, .25); margin-bottom: 10px; }
.splash-name { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--accent); }
.splash-tag { font-family: var(--font-hand); font-size: 22px; color: #8a6a32; }
.splash-stones { display: flex; gap: 10px; margin-top: 22px; }
.splash-stones i { width: 14px; height: 14px; border-radius: 50%; animation: splash-stone 1.2s ease-in-out infinite; }
.splash-stones i:nth-child(odd) { background: radial-gradient(circle at 35% 30%, #5a5a5a, #111 70%); }
.splash-stones i:nth-child(even) { background: radial-gradient(circle at 35% 30%, #fff, #d9d4cc 80%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.splash-stones i:nth-child(2) { animation-delay: .15s; }
.splash-stones i:nth-child(3) { animation-delay: .3s; }
.splash-msg { margin: 14px 0 0; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.auth-loading.error .splash-board { display: none; }
.auth-loading.error .splash-msg { color: var(--ng); }
@keyframes splash-stone { 0%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-8px); opacity: 1; } }
@keyframes splash-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .splash, .splash-stones i { animation: none; } }
/* 문제를 받는 동안 위쪽 작은 알림 */
.loader { display: inline-flex; align-items: center; gap: 8px; }
.loader[hidden] { display: none; }
.loader-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: loader-spin .8s linear infinite; }
@keyframes loader-spin { to { transform: rotate(360deg); } }

/* 시작 화면: 작은 바둑판에 흑·백이 한 수씩 놓였다가 다시 처음부터 */
.splash-board { width: 132px; height: 132px; margin-top: 22px; filter: drop-shadow(0 6px 16px rgba(84, 52, 27, .22)); }
.sb-wood { fill: #e2b86c; }
.sb-lines line { stroke: #5c4210; stroke-width: 1.4; opacity: .75; }
.sb-star { fill: #5c4210; }
.ss { opacity: 0; transform-box: fill-box; transform-origin: center; animation-duration: 5.8s; animation-timing-function: ease-out; animation-iteration-count: infinite; }
.ss.b { fill: url(#sp-b); }
.ss.w { fill: url(#sp-w); stroke: rgba(0, 0, 0, .25); stroke-width: 1; }
/* 흑1~흑9가 차례로 놓이고, 다 놓이면 판 전체가 한꺼번에 스르륵 사라진 뒤 다시 처음부터 */
@keyframes ss1 { 0%, 0.00% { opacity: 0; transform: scale(.4); } 4.00% { opacity: 1; transform: scale(1.08); } 7.00% { opacity: 1; transform: scale(1); } 82% { opacity: 1; transform: scale(1); } 92%, 100% { opacity: 0; transform: scale(1); } }
@keyframes ss2 { 0%, 6.90% { opacity: 0; transform: scale(.4); } 10.90% { opacity: 1; transform: scale(1.08); } 13.90% { opacity: 1; transform: scale(1); } 82% { opacity: 1; transform: scale(1); } 92%, 100% { opacity: 0; transform: scale(1); } }
@keyframes ss3 { 0%, 13.79% { opacity: 0; transform: scale(.4); } 17.79% { opacity: 1; transform: scale(1.08); } 20.79% { opacity: 1; transform: scale(1); } 82% { opacity: 1; transform: scale(1); } 92%, 100% { opacity: 0; transform: scale(1); } }
@keyframes ss4 { 0%, 20.69% { opacity: 0; transform: scale(.4); } 24.69% { opacity: 1; transform: scale(1.08); } 27.69% { opacity: 1; transform: scale(1); } 82% { opacity: 1; transform: scale(1); } 92%, 100% { opacity: 0; transform: scale(1); } }
@keyframes ss5 { 0%, 27.59% { opacity: 0; transform: scale(.4); } 31.59% { opacity: 1; transform: scale(1.08); } 34.59% { opacity: 1; transform: scale(1); } 82% { opacity: 1; transform: scale(1); } 92%, 100% { opacity: 0; transform: scale(1); } }
@keyframes ss6 { 0%, 34.48% { opacity: 0; transform: scale(.4); } 38.48% { opacity: 1; transform: scale(1.08); } 41.48% { opacity: 1; transform: scale(1); } 82% { opacity: 1; transform: scale(1); } 92%, 100% { opacity: 0; transform: scale(1); } }
@keyframes ss7 { 0%, 41.38% { opacity: 0; transform: scale(.4); } 45.38% { opacity: 1; transform: scale(1.08); } 48.38% { opacity: 1; transform: scale(1); } 82% { opacity: 1; transform: scale(1); } 92%, 100% { opacity: 0; transform: scale(1); } }
@keyframes ss8 { 0%, 48.28% { opacity: 0; transform: scale(.4); } 52.28% { opacity: 1; transform: scale(1.08); } 55.28% { opacity: 1; transform: scale(1); } 82% { opacity: 1; transform: scale(1); } 92%, 100% { opacity: 0; transform: scale(1); } }
@keyframes ss9 { 0%, 55.17% { opacity: 0; transform: scale(.4); } 59.17% { opacity: 1; transform: scale(1.08); } 62.17% { opacity: 1; transform: scale(1); } 82% { opacity: 1; transform: scale(1); } 92%, 100% { opacity: 0; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .ss { animation: none; opacity: 1; } }
.splash-logo { width: 64px; height: 64px; border-radius: 17px; margin-bottom: 6px; }

/* 고른 칸은 눌린 뒤(휴대폰의 남는 hover)에도 갈색 그대로 */
.free-seg .seg.on, .free-seg .seg.on:hover, .free-seg .seg.on:active { background: var(--accent); color: #fff; }

/* 입문 연습문제: 착수 확인 칸 (놓아보기와 같은 모양) */
#ipractice .free-confirm { margin: 0 0 12px; }
@media (max-width: 820px) {
  #ipractice .free-confirm { position: fixed; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 40; grid-template-columns: 1fr; grid-template-areas: "pad" "btns";
    gap: 8px; margin: 0; padding: 10px; border-radius: 16px; background: var(--surface); box-shadow: 0 10px 34px rgba(40, 26, 14, .28); }
  #ipractice .free-confirm-title { display: none; }
  #ipractice .free-pad { grid-template-columns: repeat(4, 1fr); grid-template-rows: 44px; width: 100%; }
  #ipractice .free-pad [data-d="left"] { grid-column: 1; grid-row: 1; }
  #ipractice .free-pad [data-d="up"] { grid-column: 2; grid-row: 1; }
  #ipractice .free-pad [data-d="down"] { grid-column: 3; grid-row: 1; }
  #ipractice .free-pad [data-d="right"] { grid-column: 4; grid-row: 1; }
  #ipractice .free-confirm-btns .btn { height: 50px; font-size: 16.5px; }
}

/* 홈 머리 띠 맨 아래: [아이콘] 수찾사 : 수(手)를 찾고 싶은 사람들 */
.hh-sign { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #dcc394; min-width: 0; }
.hh-sign .hh-logo { width: 24px; height: 24px; border-radius: 6px; flex: none; }
.hh-sign b { font-size: 15px; font-weight: 800; color: var(--accent); flex: none; }
.hh-sign-colon { color: #b99a63; font-weight: 700; }
.hh-sign .hh-tag { margin: 0; font-size: 19px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 놓아보기: 이어서 두는 판 안내 */
.free-resume { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--kaya-soft); border: 1px solid var(--kaya-line); }
.free-resume[hidden] { display: none; }
.free-resume > span { font-size: 13.5px; color: var(--ink-2); min-width: 0; }
.free-resume b { color: var(--ink); }
.free-resume span span { color: var(--muted); font-variant-numeric: tabular-nums; }
.free-resume .btn { flex: none; height: 36px; padding: 0 14px; font-size: 14px; }

/* 홈: 오늘의 한마디 */
.saying { display: grid; gap: 6px; width: 100%; padding: 14px 16px; border: 1px solid var(--kaya-line); border-radius: 16px; background: var(--surface);
  text-align: left; font: inherit; color: var(--ink); cursor: pointer; border-left: 4px solid var(--gold); }
.saying[hidden] { display: none; }
.saying-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.saying-label { font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--gold); }
.saying-title { font-size: 12px; font-weight: 600; color: var(--muted); }
.saying-line { font-size: 15.5px; font-weight: 800; line-height: 1.45; }
.saying-text { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.saying-card { width: min(100%, 460px); max-height: min(80vh, 640px); grid-template-rows: auto minmax(0, 1fr) auto; }
.saying-list { display: grid; gap: 10px; overflow-y: auto; padding-right: 4px; }
.saying-item { display: grid; gap: 3px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.saying-item.today { background: var(--gold-soft); }
.saying-item-day { font-size: 11.5px; font-weight: 800; color: var(--muted); }
.saying-item b { font-size: 14.5px; }
.saying-item span:last-child { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.modal-btns.one { grid-template-columns: 1fr; }
/* 장면이 7개 이상이면 점 대신 짧은 막대 하나 */
.lz-dots.bar { width: 60px; height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; display: block; }
.lz-dots.bar i { display: block; height: 100%; border-radius: 0; background: var(--accent); }
.lz-meta { flex-wrap: nowrap; }
/* 휴대폰: 긴 화면 이름이 왼쪽 뒤로 가기 글자를 덮지 않게 */
@media (max-width: 560px) {
  .sub-topbar { grid-template-columns: auto minmax(0, 1fr) 40px; }
  .sub-topbar .back { max-width: 34vw; }
  .sub-topbar .sub-title { max-width: none; }
}

/* 오답 노트 · 숙제 · 선생님 화면 · 신고 */
.rv-sum { display: grid; gap: 10px; padding: 18px; border-radius: 18px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .07); margin-bottom: 14px; }
.rv-sum-top { display: flex; align-items: center; gap: 10px; }
.rv-sum-n { font-size: 40px; font-weight: 800; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.rv-sum-unit { font-size: 13px; font-weight: 700; color: var(--ink-2); line-height: 1.3; }
.rv-sum-stats { margin-left: auto; display: flex; gap: 14px; }
.rv-sum-stats span { display: grid; justify-items: center; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.rv-sum-stats b { font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.rv-sum-sub { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.rv-start { display: grid; gap: 8px; }
.rv-start:empty { display: none; }
.rv-start .btn { height: 48px; }
.rv-how { margin: 0; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 12.5px; line-height: 1.55; color: var(--muted); }
#rv-list { display: grid; gap: 8px; }
.rv-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 10px 16px; border: 0; background: transparent; font: inherit; text-align: left; color: var(--ink); cursor: pointer; }
.rv-row + .rv-row { border-top: 1px solid var(--border); }
.rv-row:hover { background: var(--surface-2); }
.rv-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rv-main b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-main span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-steps { display: flex; gap: 3px; flex: none; }
.rv-steps i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.rv-steps i.on { background: var(--ok); }
.rv-when { flex: none; min-width: 52px; text-align: right; font-size: 12.5px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.hw-title { font-size: 19px; font-weight: 800; }
.hw-prog { margin-top: 0; }
.rv-row.complete .rv-main b { color: var(--ok); }
.hw-mark { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; }
.rv-row.complete .hw-mark { background: var(--ok); }
.t-tabs { margin-bottom: 14px; }
#t-rep-n { margin-left: 2px; color: var(--ng); font-weight: 800; }
#t-body { display: grid; gap: 10px; }
.t-member { display: grid; gap: 8px; padding: 14px 16px; border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .07); }
.t-mhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.t-mhead b { font-size: 16px; }
.t-rank { font-size: 12.5px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.t-msub { font-size: 12.5px; color: var(--muted); }
.t-mgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.t-mgrid span { display: grid; justify-items: center; padding: 8px 4px; border-radius: 10px; background: var(--surface-2); }
.t-mgrid b { font-size: 16px; font-variant-numeric: tabular-nums; }
.t-mgrid small { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.t-mhw { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.t-mhw .today-bar { flex: 1; }
.t-mweak { font-size: 12.5px; color: var(--ng); line-height: 1.5; }
.t-memo { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; line-height: 1.5; }
.t-form { display: grid; gap: 12px; padding: 16px; border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .07); }
.t-form input[type=date] { letter-spacing: 0; }
.t-pick, .t-chosen { display: grid; gap: 6px; }
.set-input-label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.t-pick select { height: 42px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font: inherit; font-size: 15px; }
.t-checks { display: grid; gap: 2px; max-height: 220px; overflow-y: auto; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; }
.t-checks label { display: flex; align-items: center; gap: 6px; padding: 5px 2px; font-size: 14px; cursor: pointer; }
.t-checks input { width: 18px; height: 18px; accent-color: var(--accent); }
#hw-chosen { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); }
.t-chip { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 800; }
.report-link { justify-self: start; display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent;
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.report-link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.report-link:hover { background: var(--surface-2); color: var(--ink-2); }
.rep-reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.rep-reason { height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.rep-reason.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.set-input textarea { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font: inherit; font-size: 15px; color: var(--ink); resize: vertical; }

/* 이번 주 공동체 문제 · 배지 · 순위 탭 */
.wk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.wk-range { font-size: 13px; font-weight: 700; color: var(--muted); }
.wk-mine-l { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.wk-mine-l b { font-size: 18px; color: var(--accent); margin-left: 4px; font-variant-numeric: tabular-nums; }
#wk-comm { display: grid; gap: 8px; }
.wk-goal { display: flex; align-items: baseline; justify-content: space-between; }
.wk-goal b { font-size: 16px; }
.wk-goal span { font-size: 14px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.wk-bar { height: 8px; }
.wk-people { display: flex; flex-wrap: wrap; gap: 6px; }
.wk-p { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 12.5px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.wk-p.done { background: var(--ok-soft); color: var(--ok); }
.wk-p.me { box-shadow: inset 0 0 0 1.5px var(--accent); }
.badges .rank-head span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.badge-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 8px; }
.badge { display: grid; justify-items: center; gap: 2px; padding: 10px 2px 8px; border-radius: 12px; background: var(--surface-2); opacity: .55; }
.badge.got { opacity: 1; background: var(--gold-soft); box-shadow: inset 0 0 0 1px #ecd29b; }
.badge-ic { font-size: 22px; line-height: 1.1; }
.badge b { font-size: 12px; }
.badge small { font-size: 10.5px; color: var(--muted); font-weight: 600; }
@media (max-width: 420px) { .badge-row { grid-template-columns: repeat(3, 1fr); } }
.rank-tabs { display: inline-grid; grid-auto-flow: column; padding: 2px; }
.rank-tabs .seg { height: 30px; padding: 0 12px; font-size: 12.5px; }
.badges .rank-head span::before, .rank-head .rank-tabs::before { content: none; }
.rank-head .rank-tabs { color: inherit; }

/* 배지 모음 */
.medal { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; font-size: 22px; background: var(--surface-2); filter: grayscale(1); opacity: .6; }
.medal.got { filter: none; opacity: 1; }
.medal.bronze { background: radial-gradient(circle at 35% 30%, #f6dcc2, #d49a6a); box-shadow: inset 0 0 0 2px #b97a4a; }
.medal.silver { background: radial-gradient(circle at 35% 30%, #f7f7f7, #c6c9cf); box-shadow: inset 0 0 0 2px #9da2ab; }
.medal.gold { background: radial-gradient(circle at 35% 30%, #fff3c4, #e9bf4f); box-shadow: inset 0 0 0 2px #c79a26; }
.medal.platinum { background: radial-gradient(circle at 35% 30%, #eefbff, #a9d6e8); box-shadow: inset 0 0 0 2px #6fa9c2; }
.badge-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.badge-empty { font-size: 13px; color: var(--muted); }
.badge-more { width: 100%; height: 42px; margin-top: 10px; }
.bd-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 18px 4px 8px; }
.bd-sec h2 { margin: 0; font-size: 15px; font-weight: 800; }
.bd-sec span { font-size: 12px; color: var(--muted); text-align: right; }
.bd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.bd-card { display: grid; justify-items: center; align-content: start; gap: 4px; padding: 12px 6px 10px; border-radius: 14px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 10px rgba(0, 0, 0, .06); text-align: center; }
.bd-card b { font-size: 12.5px; line-height: 1.3; }
.bd-card small { font-size: 11px; line-height: 1.35; color: var(--muted); }
.bd-card:not(.got) b { color: var(--muted); }
.bd-prog { display: grid; gap: 2px; width: 100%; padding: 0 6px; }
.bd-prog em { font-style: normal; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 묶음 전체 진도 초기화 */
.course-reset { margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: var(--surface); }

/* 배지 알림: 메달 왼쪽, 글은 세 줄로 가지런히 */
.toast.badge-toast { display: flex; align-items: center; gap: 12px; width: max-content; max-width: min(92vw, 360px); padding: 12px 18px 12px 12px;
  border-radius: 18px; text-align: left; white-space: normal; }
.toast.badge-toast .medal { width: 46px; height: 46px; font-size: 24px; }
.bt-text { display: grid; gap: 1px; min-width: 0; line-height: 1.3; }
.bt-text small { font-size: 11.5px; font-weight: 700; letter-spacing: .02em; color: #9a6c1f; }
.bt-text b { font-size: 16px; font-weight: 800; color: #5a3a0c; }
.bt-text span { font-size: 12.5px; font-weight: 600; color: #7a5b28; }

/* 수읽기·정석 외우기의 착수 확인 칸 (놓아보기·연습문제와 같은 모양) */
#study .free-confirm, #jstudy .free-confirm { margin: 0 0 12px; }
#study .free-confirm[hidden], #jstudy .free-confirm[hidden] { display: none; }
#jstudy .free-pad[hidden] { display: none; }
@media (max-width: 820px) {
  #study .free-confirm, #jstudy .free-confirm { position: fixed; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 40; grid-template-columns: 1fr; grid-template-areas: "pad" "btns";
    gap: 8px; margin: 0; padding: 10px; border-radius: 16px; background: var(--surface); box-shadow: 0 10px 34px rgba(40, 26, 14, .28); }
  #study .free-confirm-title, #jstudy .free-confirm-title { display: none; }
  #study .free-pad, #jstudy .free-pad { grid-template-columns: repeat(4, 1fr); grid-template-rows: 44px; width: 100%; }
  #study .free-pad [data-d="left"], #jstudy .free-pad [data-d="left"] { grid-column: 1; grid-row: 1; }
  #study .free-pad [data-d="up"], #jstudy .free-pad [data-d="up"] { grid-column: 2; grid-row: 1; }
  #study .free-pad [data-d="down"], #jstudy .free-pad [data-d="down"] { grid-column: 3; grid-row: 1; }
  #study .free-pad [data-d="right"], #jstudy .free-pad [data-d="right"] { grid-column: 4; grid-row: 1; }
  #study .free-confirm-btns .btn, #jstudy .free-confirm-btns .btn { height: 50px; font-size: 16.5px; }
}
.place-seg { margin-bottom: 2px; }
.place-note { margin: 0 0 8px; line-height: 1.5; }

/* 강의 목록: 부분별 불 (강의 · 외우기 · 연습) */
.lz-lamps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.lz-lamp { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px 0 7px; border-radius: 999px; background: var(--surface-2);
  font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lz-lamp i { width: 8px; height: 8px; border-radius: 50%; background: #cfc3b1; }
.lz-lamp.on { background: var(--ok-soft); color: var(--ok); }
.lz-lamp.on i { background: var(--ok); box-shadow: 0 0 0 3px rgba(47, 122, 79, .18); }
.lz-lamp.lamp-memo.on { background: var(--gold-soft); color: var(--gold); }
.lz-lamp.lamp-memo.on i { background: var(--gold); box-shadow: 0 0 0 3px rgba(183, 121, 31, .2); }
.lz-lamp.due { background: #fdeee0; color: #b4580f; }
.lz-lamp.due i { background: #e07b2a; box-shadow: 0 0 0 3px rgba(224, 123, 42, .2); }
.lz-lamp.part { color: var(--accent); }
.lz-lamp.part i { background: linear-gradient(90deg, var(--accent) 50%, #cfc3b1 50%); }
.lz-item .lv-body { gap: 4px; }
.lz-lamp.lamp-memo.due { background: #fdeee0; color: #b4580f; } .lz-lamp.lamp-memo.due i { background: #e07b2a; box-shadow: 0 0 0 3px rgba(224, 123, 42, .2); }

/* 정답 판정: 오른쪽 점수 칸 */
.verdict > div:not(.verdict-score) { flex: 1; min-width: 0; }
.verdict-sub { margin-top: 2px; font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.verdict-score { flex: none; display: grid; justify-items: end; gap: 1px; padding-left: 12px; border-left: 1px solid rgba(47, 122, 79, .25); }
.verdict-score b { font-size: 22px; font-weight: 800; color: var(--ok); line-height: 1.1; font-variant-numeric: tabular-nums; }
.verdict-score small { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.verdict-score.star small { color: var(--gold); }
.verdict-score.none b { color: var(--muted); }

/* 내 기록 배지: 메달 옆에 이름과 받은 이유 */
.badge-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.badge-item { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.badge-item .medal { width: 38px; height: 38px; font-size: 19px; }
.badge-item-tx { display: grid; gap: 1px; min-width: 0; }
.badge-item-tx b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-item-tx small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-strip .badge-empty { grid-column: 1 / -1; }

/* 오늘의 한마디 줄바꿈: 낱말 안에서 끊지 않고, 줄마다 따로 */
.saying-line, .saying-text, .saying-item b, .saying-item > span:last-child { word-break: keep-all; overflow-wrap: break-word; }
.say-ln { display: block; }
.saying-line .say-ln + .say-ln { margin-top: 1px; }
.saying-text .say-ln + .say-ln { margin-top: 3px; }

/* 급수 안내 */
.rec-guide { width: 100%; height: 42px; margin-top: 10px; }
.rp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rp-now { font-size: 30px; font-weight: 800; color: var(--accent); letter-spacing: -0.02em; }
.rp-score { font-size: 15px; font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rp-sub { display: grid; gap: 2px; }
.rp-sub b { font-size: 14.5px; }
.rp-sub span { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.rp-ways, .rp-plan { padding: 6px 0; }
.rp-way { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); grid-template-areas: "a b" "a c"; column-gap: 12px; padding: 10px 16px; }
.rp-way + .rp-way { border-top: 1px solid var(--border); }
.rp-way b { grid-area: a; font-size: 14px; word-break: keep-all; }
.rp-way span { grid-area: b; font-size: 13.5px; color: var(--ink); line-height: 1.45; word-break: keep-all; }
.rp-way small { grid-area: c; font-size: 11.5px; color: var(--muted); }
.rp-note { margin: 0; padding: 12px 16px 8px; border-top: 1px dashed var(--border); font-size: 12.5px; line-height: 1.6; color: var(--ink-2); word-break: keep-all; }
.rp-step { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.rp-step + .rp-step { border-top: 1px solid var(--border); }
.rp-n { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 800; }
.rp-step > span:nth-child(2) { flex: 1; min-width: 0; display: grid; gap: 1px; }
.rp-step b { font-size: 14px; }
.rp-step small { font-size: 12px; color: var(--muted); word-break: keep-all; }
.rp-step em { flex: none; font-style: normal; font-size: 12.5px; font-weight: 800; color: var(--ok); white-space: nowrap; }
.rp-table { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rp-row { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 6px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.rp-row b { font-size: 14px; }
.rp-row span { font-size: 11.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.rp-row em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--ok); min-width: 1.6em; text-align: right; }
.rp-row.past b { color: var(--ok); }
.rp-row.now { background: var(--accent); }
.rp-row.now b, .rp-row.now span, .rp-row.now em { color: #fff; }
.rp-row.future b { color: var(--ink-2); }
@media (max-width: 420px) { .rp-table { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.saying { cursor: default; }

/* 공동체 순위: 기준 시각 + 새로고침 */
.rank-upd { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 8px; }
.rank-upd > span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank-refresh { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); font: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.rank-refresh svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.rank-refresh.spin svg { animation: loader-spin .8s linear infinite; }
.rank-refresh:disabled { opacity: .6; }

/* 선생님 화면 v2 */
.t-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.t-sum-c { display: grid; justify-items: center; gap: 1px; padding: 12px 4px; border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 10px rgba(0,0,0,.06); }
.t-sum-c b { font-size: 18px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.t-sum-c small { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.t-sum-c.warn b { color: var(--ng); }
.t-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 2px 0; }
.t-bar > span { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.t-sort { flex: 1; max-width: 260px; }
.t-sort .seg { height: 32px; font-size: 12.5px; }
.t-list { padding: 2px 0; }
.t-row { display: flex; gap: 12px; padding: 12px 14px; }
.t-row + .t-row { border-top: 1px solid var(--border); }
.t-av { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 15px; }
.t-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.t-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.t-top b { font-size: 15px; white-space: nowrap; }
.t-top .t-rank { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.t-pill { flex: none; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.t-pill.ok { background: var(--ok-soft); color: var(--ok); }
.t-pill.mid { background: var(--surface-2); color: var(--ink-2); }
.t-pill.warn { background: var(--ng-soft); color: var(--ng); }
.t-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.t-stats span { display: grid; justify-items: center; padding: 5px 2px; border-radius: 8px; background: var(--surface-2); }
.t-stats small { font-size: 10.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.t-stats b { font-size: 14px; font-variant-numeric: tabular-nums; }
.t-hw { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.t-hw small, .t-weak small { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.t-hw em { font-style: normal; font-size: 12px; font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.t-weak { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.t-weak span { font-size: 12.5px; color: var(--ng); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-hwcur { display: grid; gap: 8px; padding: 14px 16px; border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.07); }
.t-hwcur .t-top b { font-size: 16px; }
.t-hwcur .t-top .t-pill { margin-left: auto; }
.t-form .set-input input { letter-spacing: 0; font-size: 15.5px; }
#t-body > .set-title { margin-top: 6px; }

/* 선생님 화면: 회원 관리 */
.t-tabs { grid-auto-columns: 1fr; }
.t-tabs .seg { font-size: 13px; padding: 0 2px; }
.t-form-title { font-size: 16px; }
.t-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.t-add input { height: 46px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font: inherit; font-size: 16px; color: var(--ink); }
.t-add input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.t-add .btn { height: 46px; padding: 0 20px; }
.t-mrow { align-items: center; }
.t-mrow .t-main { gap: 1px; }
.t-mrow .t-main b { font-size: 15px; }
.t-mrow .t-main small { font-size: 12px; color: var(--muted); }
.t-mact { display: flex; gap: 6px; flex: none; }
.t-mact .btn { height: 34px; padding: 0 10px; font-size: 12.5px; }
.t-del { color: var(--ng); }

/* 잠긴 강의 */
.lz-item.locked { opacity: .62; box-shadow: none; background: var(--surface-2); }
.lz-item.locked .lv-badge { background: transparent; font-size: 18px; }
.lz-item.locked .lv-name { color: var(--muted); }

/* 회원 관리: ⋯ 버튼과 아래 메뉴 */
.t-more { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.t-more svg { width: 20px; height: 20px; fill: currentColor; }
@media (hover: hover) { .t-more:hover { background: var(--surface-2); color: var(--ink); } }
.modal.sheet { align-items: end; padding: 0; }
.sheet-card { width: min(100%, 480px); gap: 4px; padding: 16px 12px calc(12px + env(safe-area-inset-bottom, 0px)); border-radius: 20px 20px 0 0; }
@media (min-width: 821px) { .modal.sheet { align-items: center; padding: 20px; } .sheet-card { border-radius: 18px; } }
.sheet-head { display: grid; gap: 2px; padding: 2px 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.sheet-head b { font-size: 17px; }
.sheet-head span { font-size: 12.5px; color: var(--muted); }
.sheet-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 8px 10px; border: 0; border-radius: 12px; background: transparent; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.sheet-item svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--accent); }
.sheet-item span { display: grid; gap: 1px; font-size: 15px; font-weight: 700; }
.sheet-item small { font-size: 12px; font-weight: 500; color: var(--muted); }
.sheet-item.danger, .sheet-item.danger svg { color: var(--ng); }
.sheet-item[hidden] { display: none; }
@media (hover: hover) { .sheet-item:hover { background: var(--surface-2); } }
.sheet-cancel { height: 46px; margin-top: 6px; }

/* 화면 맨 아래 한 줄: 진도 초기화(왼쪽) · 신고(오른쪽) — 배우기 흐름과 떼어 작게 */
.lz-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); }
.lz-foot .lz-reset { display: contents; }
.lz-foot .lz-reset[hidden] { display: none; }
.foot-link { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent;
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.foot-link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lz-foot > :last-child { margin-left: auto; }
@media (hover: hover) { .foot-link:hover { background: var(--surface-2); color: var(--ink-2); } }

/* 강의 묶음: 필수 정석 먼저 */
.course.locked { background: var(--surface-2); box-shadow: none; }
.course.locked .course-name, .course.locked .course-desc { color: var(--muted); }
.course.locked .course-ico { background: transparent; color: var(--muted); }
.course.locked .course-meta { color: var(--accent); }
.course-first { margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; vertical-align: 2px; }

.lz-lockcard { display: grid; gap: 8px; padding: 16px; margin: 4px 0 14px; border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.07); }
.lz-lockcard b { font-size: 16px; }
.lz-lockcard span { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.lz-lockcard .btn { height: 46px; margin-top: 4px; }
#rename-modal .set-input input { letter-spacing: 0; font-size: 16px; }

/* 정석 외우기 결과 칸 */
.j-status.j-result-box { display: flex; align-items: center; gap: 12px; padding: 14px 16px; font-weight: 400; }
.jr-main { flex: 1; min-width: 0; display: grid; gap: 3px; word-break: keep-all; }
.jr-main b { font-size: 16.5px; font-weight: 800; }
.jr-main span { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.jr-score { flex: none; display: grid; justify-items: end; gap: 1px; padding-left: 12px; border-left: 1px solid rgba(47, 122, 79, .25); }
.jr-score b { font-size: 22px; font-weight: 800; color: var(--ok); line-height: 1.1; font-variant-numeric: tabular-nums; }
.jr-score small { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.j-status.ng .jr-main b { color: var(--ng); }

/* 관리자 화면: 추천 숙제 */
.t-reco { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--accent-soft); border: 1px solid #e3cfb4; }
.t-reco-tx { flex: 1; min-width: 0; display: grid; gap: 2px; }
.t-reco-tx b { font-size: 15px; }
.t-reco-tx small { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; word-break: keep-all; }
.t-reco .btn { flex: none; height: 42px; padding: 0 16px; }
.t-reco-why { display: grid; gap: 6px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px dashed var(--accent); }
.t-reco-why b { font-size: 14px; color: var(--accent); }
.t-reco-why ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; line-height: 1.5; color: var(--ink); word-break: keep-all; }
.t-reco-why small { font-size: 12px; color: var(--muted); }
/* 알림 카드 (진도 초기화 등): 배지 카드와 같은 틀, 둥근 갈색 아이콘 */
.toast.badge-toast .medal.info-ic { background: var(--accent); color: #fff; font-size: 22px; font-weight: 800; }
/* 계정 전환: 다른 계정으로 공부하는 중 띠 · 관리자 화면의 전환 버튼 */
.sw-banner { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(84, 52, 27, .06); }
.sw-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--gold, #c79a26); }
.sw-who { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-back { flex: none; height: 32px; padding: 0 12px; border: 0; border-radius: 99px; background: var(--accent); color: #fff; font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.t-switch { justify-self: end; display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.t-switch svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#teacher .sub-topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
/* 숙제 마감 */
.t-due-note { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.t-due-note.warn { color: #b5531b; }
.hw-closed { margin: 8px 0 0; padding: 9px 12px; border-radius: 10px; background: #fbefe4; color: #8a4316; font-size: 12.5px; font-weight: 600; line-height: 1.5; word-break: keep-all; }
/* 잠긴 문제집 */
.lib-cover { position: relative; }
.lib-item.locked { background: var(--surface-2); box-shadow: none; }
.lib-item.locked .thumb { opacity: .35; filter: grayscale(.6); }
.lib-item.locked .lib-name { color: var(--muted); }
.lib-item.locked .lib-meta { color: var(--accent); font-weight: 700; }
.lib-lock { position: absolute; inset: 0; border-radius: 8px; background: rgba(250, 244, 234, .72); display: grid; place-content: center; justify-items: center; gap: 2px; color: var(--accent); }
.lib-lock svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lib-lock small { font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
/* 공지: 홈 카드 · 공지 화면 · 관리자 공지 탭 */
.notice-card { display: grid; gap: 4px; width: 100%; padding: 13px 16px; border: 1px solid var(--kaya-line); border-left: 4px solid var(--accent); border-radius: 16px;
  background: var(--surface); text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.notice-card[hidden] { display: none; }
.nc-head { display: flex; align-items: center; gap: 6px; }
.nc-label { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 800; color: var(--accent); }
.nc-label svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nc-new { padding: 1px 7px; border-radius: 99px; background: #c0392b; color: #fff; font-size: 10.5px; font-weight: 800; }
.nc-date { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.nc-title { font-size: 15.5px; font-weight: 800; line-height: 1.4; word-break: keep-all; }
.nc-body { font-size: 13px; line-height: 1.55; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; word-break: keep-all; }
.nc-more { font-size: 12px; font-weight: 700; color: var(--accent); }
.nt-item { display: grid; gap: 6px; padding: 16px; margin-bottom: 12px; border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.07); }
.nt-item.pin { border-left: 4px solid var(--accent); }
.nt-head { display: flex; align-items: center; gap: 6px; }
.nt-pin { padding: 1px 8px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; }
.nt-date { font-size: 12px; color: var(--muted); }
.nt-title { margin: 0; font-size: 16.5px; font-weight: 800; line-height: 1.4; word-break: keep-all; }
.nt-body { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--ink); white-space: pre-line; word-break: keep-all; }
.nt-empty { margin: 0; padding: 24px 16px; text-align: center; font-size: 13.5px; color: var(--muted); }
.t-form textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font: inherit; font-size: 15px; line-height: 1.6; resize: vertical; color: var(--ink); }
.t-form textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.nt-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 700; cursor: pointer; }
.nt-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.nt-check small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.nt-row { display: flex; align-items: center; gap: 8px; padding: 12px 14px; }
.nt-row + .nt-row { border-top: 1px solid var(--border); }
.nt-row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.nt-row-main b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-row-main small { font-size: 12px; color: var(--muted); }
.nt-btn { flex: none; height: 34px; padding: 0 12px; font-size: 13px; }
.nt-btn.danger { color: #b3261e; }
/* 공지 알림 켜기 (공지 화면 맨 위) */
.nt-push { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.07); }
.nt-push-ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft, #f3e6d6); color: var(--accent); }
.nt-push-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nt-push-tx { flex: 1; min-width: 0; display: grid; gap: 1px; }
.nt-push-tx b { font-size: 14.5px; }
.nt-push-tx small { font-size: 12px; color: var(--muted); line-height: 1.4; word-break: keep-all; }
.nt-switch { position: relative; width: 50px; height: 30px; flex: none; border: 0; border-radius: 99px; background: #d9cfc2; cursor: pointer; transition: background .2s; }
.nt-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.nt-switch.on { background: var(--accent); }
.nt-switch.on::after { transform: translateX(20px); }
.nt-switch:disabled { opacity: .6; }
.nt-row.sched .nt-row-main small { color: #a36a12; font-weight: 700; }
.t-form input[type=datetime-local] { letter-spacing: 0; }

.turn-label:empty, .rv-sum-sub:empty, .today-sum:empty { display: none; }

/* 한국어는 낱말 중간에서 줄을 바꾸지 않음 */
body { word-break: keep-all; overflow-wrap: break-word; }
.lz-item.locked .lv-badge .lock-ic { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
/* 좁은 화면: 이전 수·다음 수 단추 글자가 두 줄로 나뉘지 않게 */
#j-prev, #j-next, #j-first, #lz-prev, #lz-next { white-space: nowrap; }

/* 홈 맨 위 공지 버튼 */
.hh-tools { display: inline-flex; align-items: center; gap: 2px; }
.hh-bell { position: relative; margin-right: 2px; }
.hh-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #c0392b; box-shadow: 0 0 0 2px #f6e9cf; }
.hh-dot[hidden] { display: none; }
/* 문제집 화면 아래 진도 초기화 */
.book-foot { margin-top: 14px; }
.book-foot .foot-link[hidden] { display: none; }
/* 알림(토스트)은 아래 탭 막대보다 앞, 탭 막대가 있는 화면에서는 그 위로 */
.toast { z-index: 60; }
body:is([data-screen="home"], [data-screen="lessons"], [data-screen="library"], [data-screen="book"], [data-screen="records"], [data-screen="dailies"], [data-screen="settings"], [data-screen="review"], [data-screen="homework"], [data-screen="teacher"], [data-screen="week"], [data-screen="badges"], [data-screen="rankplan"], [data-screen="notice"]) .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 821px) { body:is([data-screen="home"], [data-screen="lessons"], [data-screen="library"], [data-screen="book"], [data-screen="records"], [data-screen="dailies"], [data-screen="settings"], [data-screen="review"], [data-screen="homework"], [data-screen="teacher"], [data-screen="week"], [data-screen="badges"], [data-screen="rankplan"], [data-screen="notice"]) .toast { bottom: 96px; } }
/* 수읽기 훈련: 사활 · 행마 탭 */
.lib-tabs { margin: 0 0 12px; }
.lib-tabs[hidden] { display: none; }
.lib-tabs .seg { height: 40px; font-size: 14.5px; font-weight: 800; }
/* 잠긴 단원 (행마) */
.unit.locked { background: var(--surface-2); box-shadow: none; }
.unit.locked .unit-thumb { position: relative; }
.unit.locked .thumb { opacity: .35; filter: grayscale(.6); }
.unit.locked .uname { color: var(--muted); }
.unit.locked .umeta { color: var(--accent); font-weight: 700; }

/* 공지 사진 */
.notice-card { position: relative; }
.nc-img { position: absolute; top: 12px; right: 12px; width: 54px; height: 54px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.nc-img[hidden] { display: none; }
.notice-card:has(.nc-img:not([hidden])) .nc-title, .notice-card:has(.nc-img:not([hidden])) .nc-body { padding-right: 62px; }
.nt-imgs { display: grid; gap: 8px; margin-top: 4px; }
.nt-imgs img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border); cursor: zoom-in; }
.nt-img-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nt-img-list { display: contents; }
.nt-img-item { position: relative; width: 72px; height: 72px; }
.nt-img-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.nt-img-x { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: #3b3326; color: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.nt-img-add { width: 72px; height: 72px; display: grid; place-content: center; justify-items: center; gap: 2px; border: 1.5px dashed var(--border); border-radius: 10px; color: var(--accent); cursor: pointer; background: var(--surface-2); }
.nt-img-add[hidden] { display: none; }
.nt-img-add svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.nt-img-add small { font-size: 11px; font-weight: 700; }
/* 관리자 화면: 접속 표시 */
.t-online { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.t-online.now { color: #1e8e4e; }
.t-online.now::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #22a55a; box-shadow: 0 0 0 3px rgba(34, 165, 90, .18); }
.t-top { flex-wrap: wrap; row-gap: 4px; }
/* 공지 사진 크게 보기 */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(20, 14, 8, .92); display: flex; }
.lightbox[hidden] { display: none; }
.lb-scroll { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: calc(56px + env(safe-area-inset-top, 0px)) 12px calc(20px + env(safe-area-inset-bottom, 0px)); }
.lb-scroll img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; cursor: zoom-in; }
/* 사진 보기: 손가락으로 확대·이동 (앱이 직접 처리) */
.lightbox { touch-action: none; overscroll-behavior: contain; }
.lb-scroll { overflow: hidden; }
.lb-scroll img { transform-origin: center center; will-change: transform; user-select: none; -webkit-user-drag: none; touch-action: none; }
.lightbox.zoom .lb-scroll img { cursor: grab; }
.lb-close { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: 12px; z-index: 1; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }

/* 공지 목록: 한 줄씩 → 누르면 한 개 보기 */
.nt-rows { padding: 4px 0; }
.nt-line { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 16px; border: 0; background: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.nt-line + .nt-line { border-top: 1px solid var(--border); }
.nt-line-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.nt-line-main b { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-line.unread .nt-line-main b { font-weight: 800; }
.nt-line-main small { font-size: 12px; color: var(--muted); }
.nt-line .set-chev { flex: none; }
.nt-push[hidden], #nt-push[hidden] { display: none; }
/* 관리자 공지 탭: 목록 머리 */
.nt-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.nt-count { font-size: 14px; font-weight: 800; color: var(--ink-2); }
.nt-add { height: 40px; padding: 0 16px; font-size: 14px; }
/* 급수 안내: 접고 펼치는 칸 */
.rp-sec { margin-top: 12px; border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.07); overflow: hidden; }
.rp-sum { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 16px; font-size: 15.5px; font-weight: 800; cursor: pointer; }
.rp-sum::-webkit-details-marker { display: none; }
.rp-sum::after { content: ""; width: 9px; height: 9px; border-right: 2.2px solid var(--muted); border-bottom: 2.2px solid var(--muted); transform: rotate(45deg); margin-right: 4px; transition: transform .2s; }
.rp-sec[open] > .rp-sum::after { transform: rotate(-135deg); }
.rp-sec > .rec-card { box-shadow: none; border-radius: 0; border-top: 1px solid var(--border); margin: 0; }

/* 로그인 화면: 회원가입 요청 */
.auth-join { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.auth-join-btn { border: 0; background: none; padding: 6px 4px; font: inherit; font-size: 13.5px; font-weight: 800; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.auth-back { display: block; margin: 10px auto 0; }
.auth-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.auth-done { text-align: center; display: grid; gap: 10px; }
.auth-done > b { font-size: 18px; }
.auth-done p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); word-break: keep-all; }

/* 새 배지 알림: 누르면 배지 화면 */
.toast.tap { pointer-events: auto; cursor: pointer; }
.toast .bt-chev { flex: none; width: 18px; height: 18px; margin-left: -4px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: .55; }
/* 배지 누르기 */
button.bd-card, button.badge-item { border: 0; font: inherit; color: var(--ink); cursor: pointer; }
button.badge-item { text-align: left; }
.bd-card:active, .badge-item:active { transform: scale(.97); }
.bd-card.focus { box-shadow: 0 0 0 3px var(--accent), 0 2px 10px rgba(0, 0, 0, .08); animation: bd-pulse 1.2s ease-in-out 2; }
@keyframes bd-pulse { 50% { transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .bd-card.focus { animation: none; } }
/* 배지 자세히 */
.bdm-card { justify-items: center; text-align: center; gap: 10px; padding-top: 26px; }
.bdm-medal { width: 76px; height: 76px; font-size: 40px; }
.bdm-group { font-size: 12px; font-weight: 800; letter-spacing: .04em; color: var(--accent); }
.bdm-card .modal-title { margin-top: -6px; font-size: 20px; }
.bdm-how { display: grid; gap: 3px; width: 100%; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.bdm-how small { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.bdm-how b { font-size: 15px; color: var(--ink); }
.bdm-how span { font-size: 12.5px; line-height: 1.5; color: var(--muted); word-break: keep-all; }
.bdm-how span[hidden] { display: none; }
.bdm-state { display: grid; gap: 4px; width: 100%; font-variant-numeric: tabular-nums; }
.bdm-state b { font-size: 15px; color: var(--ink); }
.bdm-state span { font-size: 12.5px; color: var(--muted); }
.bdm-state .today-bar { margin-top: 4px; }
.bdm-state.got b { color: var(--accent); }
.bdm-next { display: grid; gap: 2px; width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: none; font: inherit; text-align: left; color: var(--ink); cursor: pointer; }
.bdm-next[hidden] { display: none; }
.bdm-next small { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.bdm-next span { font-size: 13.5px; }
.bdm-card .modal-btns { width: 100%; }

/* ── 로그인 화면 다듬기 ── */
.auth-gate { background:
    linear-gradient(rgba(122, 82, 40, .07) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(90deg, rgba(122, 82, 40, .07) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(160deg, var(--kaya-soft) 0%, #f1e2c4 100%); }
.auth-card { padding: 30px 24px 24px; border: 1px solid rgba(122, 82, 40, .12); box-shadow: 0 2px 4px rgba(84, 52, 27, .05), 0 18px 48px rgba(84, 52, 27, .14); }
.auth-mark { box-shadow: 0 4px 14px rgba(84, 52, 27, .22); }
.auth-title { margin-top: 14px; letter-spacing: .02em; }
.auth-sub { margin-bottom: 0; font-size: 13.5px; }
.auth-form { padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--border); }
.auth-head { margin: 0 0 6px; font-size: 17px; font-weight: 800; color: var(--ink); }
.auth-label { margin: 12px 0 6px; font-size: 13.5px; }
.auth-input { width: 100%; height: 50px; font-size: 16px; background: var(--surface-2); border-color: transparent; transition: border-color .15s, background .15s, box-shadow .15s; }
.auth-input::placeholder { color: var(--muted); opacity: .75; }
.auth-input:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.auth-pw-wrap { position: relative; }
.auth-pw-wrap .auth-input { padding-right: 50px; }
.auth-eye { position: absolute; top: 0; right: 0; width: 50px; height: 50px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 12px; }
.auth-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.auth-eye.on { color: var(--accent); }
.auth-eye.on svg path { stroke-dasharray: none; }
.auth-err { min-height: 0; margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(192, 57, 43, .08); font-size: 13.5px; line-height: 1.45; }
.auth-err:empty { display: none; }
.auth-btn { margin-top: 20px; height: 52px; font-size: 16.5px; border-radius: 14px; }
.auth-help { margin: 12px 0 0; font-size: 12.5px; }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 22px 0 12px; font-size: 12.5px; color: var(--muted); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-btn2 { height: 48px; font-size: 15px; border-radius: 14px; }
.auth-bar { position: relative; display: flex; align-items: center; justify-content: center; min-height: 36px; margin-bottom: 6px; }
.auth-bar .auth-head { margin: 0; }
.auth-back { position: absolute; left: -8px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 2px; margin: 0; padding: 6px 8px; border: 0; background: none; border-radius: 8px;
  font: inherit; font-size: 13.5px; font-weight: 700; color: var(--accent); cursor: pointer; }
.auth-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.auth-form .auth-head { text-align: center; }
.auth-note { margin: 4px 0 4px; font-size: 13px; line-height: 1.6; color: var(--muted); text-align: center; word-break: keep-all; }
.auth-note b { color: var(--ink); }
.auth-done { justify-items: center; }
.auth-done-ic { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.auth-done-ic svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.auth-done .auth-btn { width: 100%; }
@media (max-height: 640px) { .auth-card { padding-top: 22px; } .auth-mark { width: 52px; height: 52px; } .auth-title { font-size: 24px; margin-top: 8px; } }

/* 글자 알림: 화면 폭을 넉넉히 쓰고, 낱말 중간에서 줄을 바꾸지 않음 */
.toast:not(.badge-toast) { width: max-content; max-width: min(calc(100vw - 32px), 420px); text-align: center; line-height: 1.45;
  word-break: keep-all; overflow-wrap: break-word; text-wrap: balance; border-radius: 16px; padding: 11px 18px; }

/* 필수 정석 마스터: 금빛 카드 */
.course.mastered { background: linear-gradient(135deg, #fff8e6 0%, #fbeec8 100%); box-shadow: inset 0 0 0 1.5px #e3c271, 0 4px 14px rgba(183, 121, 31, .16); }
.course.mastered .course-ico { background: radial-gradient(circle at 35% 30%, #fff3c4, #e9bf4f); color: #8a5a12; box-shadow: inset 0 0 0 2px #c79a26; }
.course.mastered.ess .course-ico svg { fill: currentColor; }   /* 별 아이콘만 채움 */
.course.mastered .course-desc { color: #8a5a12; font-weight: 700; }
.course.mastered .course-bar { background: rgba(199, 154, 38, .18); }
.course.mastered .course-bar span { background: linear-gradient(90deg, #d9a93a, #b7791f); }
.course-master { display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 99px; vertical-align: 2px;
  background: linear-gradient(90deg, #d9a93a, #b7791f); color: #fff; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; }
.lz-mastercard { display: flex; align-items: center; gap: 14px; margin: 4px 0 14px; padding: 16px; border-radius: 16px;
  background: linear-gradient(135deg, #fff8e6 0%, #fbeec8 100%); box-shadow: inset 0 0 0 1.5px #e3c271; }
.lz-master-seal { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #e9bf4f); box-shadow: inset 0 0 0 2px #c79a26, 0 3px 10px rgba(183, 121, 31, .25); color: #8a5a12; }
.lz-master-seal svg { width: 26px; height: 26px; fill: currentColor; }
.lz-master-tx { display: grid; gap: 2px; min-width: 0; }
.lz-master-tx small { font-size: 12px; font-weight: 800; letter-spacing: .04em; color: var(--gold); }
.lz-master-tx b { font-size: 16.5px; color: var(--ink); }
.lz-master-tx span { font-size: 13px; line-height: 1.5; color: var(--ink-2); word-break: keep-all; }

/* 내 기록 배지: 최근 받은 배지 · 다음 목표 */
.badge-sub { margin: 12px 2px 8px; font-size: 12px; font-weight: 800; letter-spacing: .02em; color: var(--muted); }
.badge-new { display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 5px; background: var(--ng, #c0392b); color: #fff; font-style: normal; font-size: 9.5px; font-weight: 800; line-height: 15px; vertical-align: 2px; letter-spacing: .03em; }
.badge-item-tx b { display: flex; align-items: center; min-width: 0; }
.badge-next-list { display: grid; gap: 8px; }
.badge-next { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 12px; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.badge-next:active { transform: scale(.99); }
.badge-next .medal { width: 38px; height: 38px; font-size: 19px; }
.badge-next-tx { flex: 1; min-width: 0; display: grid; gap: 3px; }
.badge-next-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.badge-next-top b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-next-top em { flex: none; font-style: normal; font-size: 12px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.badge-next-tx small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-next .today-bar { margin-top: 2px; }
.badges .badge-more { margin-top: 12px; }

/* 배지 모두 보기: 받은 배지는 등급 색 테두리 · 옅은 바탕 · 오른쪽 위 ✓ · 받은 날 */
.bd-card { position: relative; }
.bd-card.got { box-shadow: inset 0 0 0 1.5px var(--bd-line), 0 2px 10px rgba(0, 0, 0, .06); background: linear-gradient(180deg, var(--bd-soft) 0%, var(--surface) 75%); }
.bd-card.got.bronze { --bd-line: #d9a77d; --bd-soft: #fbefe4; --bd-ink: #9a5f32; }
.bd-card.got.silver { --bd-line: #b9bdc5; --bd-soft: #f2f3f5; --bd-ink: #6b717b; }
.bd-card.got.gold { --bd-line: #e0bb55; --bd-soft: #fdf5dc; --bd-ink: #9a6d10; }
.bd-card.got.platinum { --bd-line: #8fc3d8; --bd-soft: #eaf6fb; --bd-ink: #3f7f99; }
.bd-check { position: absolute; top: 7px; right: 7px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--bd-ink); color: #fff; }
.bd-check svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.bd-got { margin-top: 2px; padding: 1px 8px; border-radius: 99px; background: var(--bd-soft); color: var(--bd-ink); font-size: 10.5px; font-weight: 800; box-shadow: inset 0 0 0 1px var(--bd-line); }
.bd-card:not(.got) { background: var(--surface-2); box-shadow: none; }
.bd-card:not(.got) .medal { opacity: .45; }

/* 설정 맨 아래: 참고 자료 (접어 둠) */
.ref-card { padding: 0; overflow: hidden; }
.ref-sum { list-style: none; cursor: pointer; }
.ref-sum::-webkit-details-marker { display: none; }
.ref-card[open] .ref-sum .set-chev { transform: rotate(90deg); }
.ref-list { display: grid; gap: 2px; padding: 4px 16px 16px; border-top: 1px solid var(--border); }
.ref-sec { margin: 12px 0 4px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; color: var(--accent); }
.ref-item { display: grid; gap: 1px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ref-item b { font-size: 14px; color: var(--ink); word-break: keep-all; }
.ref-item span { font-size: 12.5px; color: var(--ink-2); }
.ref-item small { font-size: 11.5px; color: var(--muted); }
.ref-note { margin: 12px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); word-break: keep-all; }

/* 수찾사 순위: 명패 등급(급수) + 대표 배지 */
.rank-name { display: flex; align-items: center; gap: 5px; min-width: 0; }
.rank-name-tx { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-me { flex: none; padding: 0 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 800; line-height: 17px; }
.rank-medal { flex: none; width: 22px; height: 22px; font-size: 12px; }
.rank-icon { flex: none; font-size: 14px; }
.rank-chip { display: inline-block; margin-right: 2px; padding: 0 7px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); font-size: 11px; font-weight: 800; line-height: 18px; }
.rank-chip.plate-bronze { background: linear-gradient(90deg, #f3d9c2, #e3b48c); color: #7a4620; }
.rank-chip.plate-silver { background: linear-gradient(90deg, #f1f2f4, #cdd1d7); color: #4f5660; }
.rank-chip.plate-gold { background: linear-gradient(90deg, #fbe7a6, #e9bf4f); color: #6e4b06; }
.rank-chip.plate-platinum { background: linear-gradient(90deg, #dff3fb, #9fd0e3); color: #1f5d75; }
.rank-name.plate-bronze .rank-name-tx { color: #8a4f22; }
.rank-name.plate-silver .rank-name-tx { color: #59606b; }
.rank-name.plate-gold .rank-name-tx { background: linear-gradient(90deg, #b7791f, #e2a92e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rank-name.plate-platinum .rank-name-tx { background: linear-gradient(90deg, #2b7a97, #6cc0dd, #2b7a97); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* 내 기록 배지 칸: 대표 배지 */
.badge-show { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px;
  background: var(--surface-2); font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.badge-show-tx { display: grid; gap: 1px; min-width: 0; }
.badge-show-tx b { font-size: 13.5px; }
.badge-show-tx small { font-size: 11.5px; color: var(--muted); }
.badge-show-medals { display: flex; gap: 6px; flex: none; }
.badge-show-medals .medal { width: 34px; height: 34px; font-size: 17px; }
.badge-show-medals .medal.empty { filter: none; opacity: 1; background: none; border: 1.5px dashed var(--border); color: var(--muted); font-size: 16px; font-weight: 700; }
/* 배지 자세히: 대표 배지 버튼 · 모두 보기의 '대표' 표시 */
.bdm-card .bdm-show { width: 100%; height: 46px; }
.bdm-card .bdm-show[hidden] { display: none; }
.bd-card.shown::after { content: "대표"; position: absolute; top: 7px; left: 7px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; line-height: 17px; }

/* 백금 = 최고 등급: 무지갯빛(청록·보라·분홍) + 흐르는 빛 + 반짝임 (은색과 확실히 다르게) */
@keyframes plat-flow { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
@keyframes plat-glint { 0%, 70% { transform: translateX(-120%) skewX(-20deg); } 100% { transform: translateX(220%) skewX(-20deg); } }
@keyframes plat-twinkle { 0%, 100% { opacity: .35; transform: scale(.8) rotate(0deg); } 50% { opacity: 1; transform: scale(1.15) rotate(20deg); } }
.rank-name.plate-platinum .rank-name-tx { background: linear-gradient(90deg, #12a4c9, #7b5cff, #e44fb0, #12a4c9, #7b5cff); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: plat-flow 3.2s linear infinite; font-weight: 900; }
.rank-name.plate-platinum::after { content: "✦"; flex: none; order: 99; font-size: 12px; color: #8f6bff; animation: plat-twinkle 1.8s ease-in-out infinite; }
.rank-chip.plate-platinum { position: relative; overflow: hidden; background: linear-gradient(90deg, #5fd3ef, #9b84ff, #f07ccc, #5fd3ef); background-size: 200% 100%;
  color: #fff; text-shadow: 0 1px 2px rgba(60, 20, 120, .45); box-shadow: 0 0 0 1px rgba(255, 255, 255, .6) inset, 0 2px 8px rgba(123, 92, 255, .35); animation: plat-flow 3.2s linear infinite; }
.rank-chip.plate-platinum::before { content: ""; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85), transparent); animation: plat-glint 2.6s ease-in-out infinite; }
.rank-row:has(.rank-chip.plate-platinum) { background: linear-gradient(90deg, rgba(95, 211, 239, .10), rgba(155, 132, 255, .10), rgba(240, 124, 204, .10)); box-shadow: inset 0 0 0 1.5px rgba(155, 132, 255, .35); }
/* 백금 메달: 무지갯빛 + 빛 번짐 */
.medal.got.platinum { position: relative; overflow: hidden; background: conic-gradient(from 210deg, #c9f3ff, #b9a8ff, #ffc2ea, #c9f3ff, #e6fbff, #c9f3ff);
  box-shadow: inset 0 0 0 2px #8f7cf2, 0 0 10px rgba(143, 124, 242, .45); }
.medal.got.platinum::after { content: ""; position: absolute; inset: 0; width: 45%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .8), transparent); animation: plat-glint 3s ease-in-out infinite; }
.bd-card.got.platinum { --bd-line: #a08cf5; --bd-soft: #f3efff; --bd-ink: #6a4fd8; background: linear-gradient(160deg, #e8f8ff 0%, #f1ecff 45%, #ffeef8 80%, var(--surface) 100%); }
@media (prefers-reduced-motion: reduce) {
  .rank-name.plate-platinum .rank-name-tx, .rank-chip.plate-platinum, .rank-chip.plate-platinum::before, .rank-name.plate-platinum::after, .medal.got.platinum::after { animation: none; }
}

/* 관리자 화면 새로고침 (오른쪽 위) */
#teacher .sub-topbar { grid-template-columns: auto minmax(0, 1fr) auto auto; }
#teacher .sub-topbar .t-refresh { grid-column: 3; grid-row: 1; }
#teacher .sub-topbar .t-switch { grid-column: 4; grid-row: 1; }
.t-refresh { flex: none; background: var(--surface); color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; }

/* 수찾사 순위 1·2·3등: 금·은·동 줄 + 메달 번호 (1등은 왕관과 흐르는 빛) */
#rec-rank .rank-row.top1, #rec-rank .rank-row.top2, #rec-rank .rank-row.top3 { position: relative; overflow: hidden; margin: 2px 0; padding: 12px 12px; }
#rec-rank .rank-row.top1 { background: linear-gradient(100deg, #fff6d6 0%, #fde9a8 55%, #fff3cc 100%); box-shadow: inset 0 0 0 1.5px #e7c45a, 0 4px 14px rgba(199, 154, 38, .22); }
#rec-rank .rank-row.top2 { background: linear-gradient(100deg, #f7f8fa 0%, #e6e9ee 60%, #f4f5f7 100%); box-shadow: inset 0 0 0 1.5px #c3c8d0, 0 3px 10px rgba(120, 128, 140, .16); }
#rec-rank .rank-row.top3 { background: linear-gradient(100deg, #fdf1e6 0%, #f3d8bf 60%, #fbece0 100%); box-shadow: inset 0 0 0 1.5px #d6a57c, 0 3px 10px rgba(160, 100, 50, .16); }
#rec-rank .rank-row.top1::after { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; left: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent); animation: plat-glint 4s ease-in-out infinite; }
#rec-rank .rank-row.top1 .rank-no, #rec-rank .rank-row.top2 .rank-no, #rec-rank .rank-row.top3 .rank-no { position: relative; overflow: visible; width: 34px; height: 34px; font-size: 15px; color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .25); }
#rec-rank .rank-row.top1 .rank-no { background: radial-gradient(circle at 35% 30%, #ffe58a, #d9a11e); box-shadow: inset 0 0 0 2px #b8860b, 0 2px 6px rgba(184, 134, 11, .45); }
#rec-rank .rank-row.top2 .rank-no { background: radial-gradient(circle at 35% 30%, #ffffff, #a9b0ba); box-shadow: inset 0 0 0 2px #8e96a1, 0 2px 6px rgba(110, 118, 130, .4); color: #4d545e; text-shadow: none; }
#rec-rank .rank-row.top3 .rank-no { background: radial-gradient(circle at 35% 30%, #f6caa0, #b8743f); box-shadow: inset 0 0 0 2px #9a5f30, 0 2px 6px rgba(154, 95, 48, .4); }
.rank-crown { position: absolute; top: -11px; left: 50%; width: 20px; height: 13px; transform: translateX(-50%) rotate(-8deg); fill: #f2b705; stroke: #a87400; stroke-width: 1.2; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .2)); }
#rec-rank .rank-row.top1 .rank-score { font-size: 17px; color: #9a6a00; }
#rec-rank .rank-row.top2 .rank-score { font-size: 16px; color: #5d646e; }
#rec-rank .rank-row.top3 .rank-score { font-size: 16px; color: #8a5228; }
#rec-rank .rank-row.top1 .rank-name { font-size: 16px; }
#rec-rank .rank-row.top1 + .rank-row:not(.top2):not(.top3), #rec-rank .rank-row.top3 + .rank-row { margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { #rec-rank .rank-row.top1::after { animation: none; } }

/* 홈 칸: 2×3 (강의 · 수읽기 · 오늘의 문제 · 이번 주 문제 · 오답 노트 · 놓아보기) — 오답 노트는 오늘 복습할 수를 빨간 숫자로 */
.tile-count { position: absolute; top: 10px; right: 10px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: #e5484d; color: #fff;
  font-size: 12px; font-weight: 800; line-height: 22px; text-align: center; box-shadow: 0 0 0 2px var(--surface); font-variant-numeric: tabular-nums; }
.tile-count[hidden] { display: none; }
.tile-sub.due { color: #d13b3f; }

/* 오답 노트: 복습 방식 안내 · 단계와 날짜가 보이는 줄 */
.rv-guide { margin: 0 0 14px; border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .07); overflow: hidden; }
.rv-guide summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; list-style: none; cursor: pointer; }
.rv-guide summary::-webkit-details-marker { display: none; }
.rv-guide summary b { flex: 1; font-size: 14.5px; }
.rv-guide[open] summary .set-chev { transform: rotate(90deg); }
.rv-guide-ic { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 900; }
.rv-guide-body { display: grid; gap: 14px; padding: 0 16px 16px; }
.rv-guide-lead { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); word-break: keep-all; }
/* 단계 수만큼 칸을 나눔 (오답 노트 8단계 · 정석 복습 6단계) · 선은 동그라미 사이만 이음 */
.rv-flow { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; position: relative; max-width: 560px; }
.rv-flow li { position: relative; display: grid; justify-items: center; gap: 4px; }
.rv-flow li:not(:last-child)::after { content: ""; position: absolute; top: 15px; left: 50%; width: 100%; height: 2px; background: var(--border); }
.rv-flow b { position: relative; z-index: 1; }
.rv-flow b { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--ok); color: var(--ok); font-size: 13px; font-weight: 800; }
.rv-flow li.miss b { box-shadow: inset 0 0 0 2px #d13b3f; color: #d13b3f; font-size: 11px; }
.rv-flow li.grad b { background: var(--ok); color: #fff; box-shadow: none; }
.rv-flow small { font-size: 10.5px; line-height: 1.25; color: var(--muted); text-align: center; word-break: keep-all; }
.rv-rules { display: grid; gap: 6px; margin: 0; padding: 12px; border-radius: 12px; background: var(--surface-2); list-style: none; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.rv-rules span { margin-right: 4px; font-size: 9px; vertical-align: 2px; }
.rv-rules .ok { color: var(--ok); } .rv-rules .ng { color: #d13b3f; } .rv-rules .gd { color: var(--gold); }
.rv-side { flex: none; display: grid; justify-items: end; gap: 4px; }
.rv-side .rv-when { min-width: 0; font-size: 12px; color: var(--ink-2); }
.rv-stage { font-size: 10.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 380px) { .rv-flow small { font-size: 9.5px; } .rv-flow b { width: 26px; height: 26px; } .rv-flow li:not(:last-child)::after { top: 13px; } }

/* 오답 노트 한눈에 */
#rv-insight { display: grid; gap: 12px; margin-bottom: 14px; }
#rv-insight:empty { display: none; }
.rv-card { display: grid; gap: 10px; padding: 14px 16px; border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .07); }
.rv-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rv-card-head b { font-size: 15px; }
.rv-card-head span { font-size: 12px; color: var(--muted); }
.rv-card-note { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); word-break: keep-all; }
.rv-log { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rv-log-mk { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 900; }
.rv-log.ok .rv-log-mk { background: var(--ok); } .rv-log.ng .rv-log-mk { background: #d13b3f; }
.rv-log-tx { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-log small { flex: none; font-size: 12px; color: var(--muted); }
.rv-log.ng small { color: #d13b3f; }
.rv-weak { display: grid; gap: 5px; }
.rv-weak-top { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
.rv-weak-top b { min-width: 0; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-weak-top span { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rv-weak-bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.rv-weak-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #e98a5b, #d13b3f); }
.rv-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.rv-day { display: grid; justify-items: center; gap: 2px; padding: 8px 0; border-radius: 12px; background: var(--surface-2); }
.rv-day small { font-size: 10.5px; color: var(--muted); }
.rv-day b { font-size: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rv-day.on { background: var(--accent-soft); }
.rv-day.on b { color: var(--accent); }
.rv-day.is-today.on { background: #fde7e7; } .rv-day.is-today.on b { color: #d13b3f; }
.rv-side .rv-when.is-today { color: #d13b3f; }
button.rv-weak { width: 100%; padding: 6px 8px; margin: 0 -8px; width: calc(100% + 16px); border: 0; border-radius: 10px; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
button.rv-weak:active { background: var(--surface-2); }
.rv-row.rv-done-today { cursor: default; opacity: .62; }
.rv-row.rv-done-today:hover { background: transparent; }
.rv-row.rv-done-today .rv-when { color: var(--ok); }

/* 강의 화면 정리: 그림 탭은 한 줄(가로로 밀기) · 차분한 색 · 굵은 테두리 없이 */
.lz-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; gap: 6px; margin: 0 -2px 12px; padding: 2px 2px 6px; scrollbar-width: none;
}
.lz-tabs.more { -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.lz-tabs::-webkit-scrollbar { display: none; }
.lz-tab { height: 34px; padding: 0 12px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 700; }
.lz-tab.bad:not(.on), .lz-tab.good:not(.on), .lz-tab.old:not(.on) { color: var(--ink-2); }
.lz-tab.joseki:not(.on) { border-color: rgba(22, 122, 74, .35); background: var(--surface); color: var(--ok); }
.lz-tab.on, .lz-tab.joseki.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.lz-tab.lz-practice-tab:not(.on), .lz-tabs .lz-tab:last-child:not(.on):not(.joseki):not(.bad):not(.good) { color: var(--accent); }
.lz-joseki .board-frame { box-shadow: var(--shadow); }
.lz-joseki .panel { box-shadow: var(--shadow); }
.lz-head { flex-wrap: nowrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.lz-head > b { font-size: 17px; flex: none; }
.lz-head .lz-chip { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lz-head .lz-prog-txt { flex: none; margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.lz-band { display: none; }

/* 강의 목록 정리: 기초 / 정석 묶음 · 얇은 카드 · 오른쪽 진행 숫자 */
.course-list { gap: 8px; padding-bottom: 24px; }
.course-sec { display: grid; gap: 2px; margin: 10px 4px 2px; }
.course-sec:first-child { margin-top: 0; }
.course-sec b { font-size: 15px; font-weight: 800; color: var(--ink); }
.course-sec span { font-size: 12.5px; color: var(--muted); }
.course { gap: 12px; padding: 12px 14px; border-radius: 16px; }
.course-ico { width: 42px; height: 42px; border-radius: 12px; }
.course-ico svg { width: 24px; height: 24px; }
.course-body { gap: 2px; }
.course-name { font-size: 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.course-desc { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-meta { margin-top: 2px; font-size: 12px; font-weight: 700; }
.course-bar { height: 4px; margin-top: 6px; }
.course-bar[hidden] { display: none; }
.course-next { margin-top: 4px; font-size: 12px; }
.course-prog { flex: none; font-size: 13px; font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.course-prog[hidden] { display: none; }
.course.complete .course-prog { color: var(--ok); }
.course-first, .course-master { margin-left: 0; }
/* 컴퓨터: 아래 떠 있는 메뉴가 마지막 카드를 가리지 않게 */
@media (min-width: 821px) { #lessons .course-list { padding-bottom: 96px; } }

/* 회독 */
.rd-card { display: grid; gap: 10px; margin: 2px 0 14px; padding: 14px 16px; border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.07); }
.rd-card.done { background: linear-gradient(135deg, #fff8e6 0%, #fbeec8 100%); box-shadow: inset 0 0 0 1.5px #e3c271; }
.rd-top { display: grid; gap: 2px; }
.rd-top b { font-size: 16px; color: var(--ink); }
.rd-top small { font-size: 12.5px; line-height: 1.5; color: var(--muted); word-break: keep-all; }
.rd-card .btn { height: 46px; }
.rd-chip { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 800; line-height: 18px; vertical-align: 2px; margin-left: 6px; white-space: nowrap; }

/* 수읽기 문제집을 모두 풀면: 강의 묶음 마스터와 같은 금빛 카드 */
.lib-item.mastered { background: linear-gradient(135deg, #fff8e6 0%, #fbeec8 100%); box-shadow: inset 0 0 0 1.5px #e3c271, 0 4px 14px rgba(183, 121, 31, .16); }
.lib-item.mastered .bar { background: rgba(199, 154, 38, .18); }
.lib-item.mastered .bar span { background: linear-gradient(90deg, #d9a93a, #b7791f); }
.lib-item.mastered .lib-meta { color: #8a5a12; }
.lib-name .course-master, .course-name .course-master { margin-left: 6px; }
.course.mastered .course-prog { color: #9a6d10; }

/* 질문 · 신고 */
.lz-chip.ask { background: #e7f0fb; color: #2a5d9a; }

/* 순위 불러오는 중: 빙글 도는 표시 + 반짝이는 빈 줄 */
@keyframes rank-shine { 0% { background-position: -200px 0; } 100% { background-position: 400px 0; } }
@keyframes rank-rot { to { transform: rotate(360deg); } }
.rank-loading { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 6px; font-size: 13px; font-weight: 700; color: var(--accent); }
.rank-spin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--accent-soft); border-top-color: var(--accent); animation: rank-rot .8s linear infinite; }
.rank-skel { display: flex; align-items: center; gap: 12px; padding: 12px 10px; }
.rank-skel i, .rank-skel b, .rank-skel small, .rank-skel em { display: block; border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2) 0%, #f1e6d4 40%, var(--surface-2) 80%); background-size: 600px 100%; animation: rank-shine 1.2s linear infinite; }
.rank-skel i { width: 30px; height: 30px; border-radius: 50%; flex: none; }
.rank-skel span { flex: 1; display: grid; gap: 6px; }
.rank-skel b { width: 45%; height: 13px; } .rank-skel small { width: 70%; height: 10px; }
.rank-skel em { width: 50px; height: 14px; flex: none; }
.rank-tabs .seg:disabled { opacity: 1; cursor: default; }
@media (prefers-reduced-motion: reduce) { .rank-skel i, .rank-skel b, .rank-skel small, .rank-skel em, .rank-spin { animation: none; } }
/* 순위의 대표 배지: 누를 수 있게 */
button.rank-medal { border: 0; padding: 0; font: inherit; cursor: pointer; }
button.rank-medal:active { transform: scale(.9); }

/* 문제집: 다 푼 단원 접기 · 지금 풀 단원 */
.unit-done-group { margin-bottom: 10px; border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.06); overflow: hidden; }
.unit-done-group summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; list-style: none; cursor: pointer; }
.unit-done-group summary::-webkit-details-marker { display: none; }
.unit-done-group summary b { font-size: 15px; }
.unit-done-group summary small { flex: 1; font-size: 12.5px; color: var(--muted); }
.unit-done-group[open] summary .set-chev { transform: rotate(90deg); }
.udg-check { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--ok); color: #fff; font-size: 13px; font-weight: 900; }
.unit-done-group .unit { margin: 0 10px 8px; }
.unit.unit-current { box-shadow: inset 0 0 0 2px var(--accent), 0 4px 14px rgba(0,0,0,.08); }
.unit-now { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; vertical-align: 1px; }

/* 안내(경고 아님): 안 보고 두기에서 미리 놓아 둔 수 */
.notice.info { background: var(--surface-2); color: var(--ink-2, var(--ink)); }

/* 정석 복습의 완성 모양: 번호 없는 흐린 돌 (누를 수 있게 이벤트는 아래 칸으로) */
.gb-shadow { opacity: .32; pointer-events: none; animation: gb-shadow-out 6s ease-in-out forwards; }
.gb-shadow.w { opacity: .5; }
/* 5초 동안 보여 준 뒤 1초 동안 서서히 사라짐 (앱의 J_COUNT·J_FADE_MS와 같은 시간) */
@keyframes gb-shadow-out { 0%, 83.3% { opacity: var(--sh-o, .32); } 100% { opacity: 0; } }
/* 정석 복습 카운트다운 */
.notice.counting { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.j-count { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 17px; font-weight: 800; animation: j-count-pop .35s ease-out; }
@keyframes j-count-pop { from { transform: scale(.6); opacity: .3; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .j-count { animation: none; } }
.gb-shadow.w { --sh-o: .5; }

/* ── 홈 정리 (2026-10-23): 오늘의 공부를 한눈에 · 바로 가기 한 줄 · 한마디는 한 줄 ── */
.today-list { gap: 6px; }
.today-row { padding: 9px 12px; gap: 11px; }
.today-ico { width: 32px; height: 32px; border-radius: 10px; }
.today-ico svg { width: 18px; height: 18px; }
.today-label { font-size: 14.5px; }
.today-row > .today-count { flex: none; margin-left: 4px; }
.today-row.now { padding: 13px 14px; }
.today-row.now .today-ico { width: 38px; height: 38px; }
.today-row.complete > .today-count { color: var(--ok); }
.quick { display: grid; gap: 8px; }
.quick-title { font-size: 13px; font-weight: 800; color: var(--muted); padding: 0 2px; }
.quick-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.quick-btn { position: relative; display: grid; justify-items: center; gap: 2px; padding: 12px 6px 10px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; min-width: 0; }
.quick-btn:active { transform: scale(.97); }
.quick-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 2px; }
.quick-label { font-size: 13.5px; font-weight: 800; }
.quick-sub { font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.quick-sub.due { color: #c4372f; font-weight: 800; }
.quick-btn .tile-count { top: 6px; right: 6px; min-width: 19px; height: 19px; font-size: 11px; }
.saying { padding: 12px 14px; gap: 4px; cursor: default; }

/* 불러오기 실패 때 '다시 시도' */
.splash-retry { margin-top: 12px; min-width: 160px; }

/* 설정: 한 칸 안의 두 번째 항목 */
.set-field-head.set-gap { margin-top: 2px; }

/* 공부 알림 시간 고르기 */
.set-remind { width: 100%; margin-top: 4px; }

/* ── 오늘의 공부 완료: 뿌듯하게 ── */
.today-sum.all { padding: 3px 10px; border-radius: 99px; background: var(--gold-soft); color: var(--gold); box-shadow: inset 0 0 0 1px #ecd29b; }
.today.all-done { box-shadow: inset 0 0 0 1.5px #ecd29b, 0 6px 24px rgba(184, 134, 11, .12); }
.today-cel { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(135deg, #fff6df 0%, #fbe7b8 100%); box-shadow: inset 0 0 0 1px #ecd29b; color: #5c4210; }
.today-cel[hidden] { display: none; }
.cel-seal { position: relative; width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f7d77a, #c9971f 75%); box-shadow: 0 3px 10px rgba(184, 134, 11, .35); }
.cel-seal svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.cel-tx { display: grid; gap: 1px; min-width: 0; }
.cel-tx b { font-size: 15px; font-weight: 800; }
.cel-tx small { font-size: 12.5px; font-weight: 600; color: #8a6a32; }
.cs { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 50%; opacity: 0; }
.cs.b { background: radial-gradient(circle at 35% 30%, #5a5a5a, #111 70%); }
.cs.w { background: radial-gradient(circle at 35% 30%, #fff, #d9d4cc 80%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.today-cel.pop { animation: cel-in .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.today-cel.pop .cel-seal { animation: cel-seal .7s .15s cubic-bezier(.2, 1.6, .4, 1) both; }
.today-cel.pop .cs { animation: cel-burst .9s .35s ease-out both; }
@keyframes cel-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes cel-seal { from { transform: scale(.3) rotate(-30deg); } to { transform: none; } }
@keyframes cel-burst { 0% { opacity: 0; transform: rotate(var(--a)) translateX(0) scale(.5); } 25% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateX(30px) scale(1); } }
.today-row.just-done { animation: row-done 1.1s ease-out; }
.today-row.just-done .today-ico { animation: row-done-ico .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes row-done { 0% { box-shadow: 0 0 0 0 rgba(46, 125, 50, .35); } 60% { box-shadow: 0 0 0 8px rgba(46, 125, 50, 0); } 100% { box-shadow: none; } }
@keyframes row-done-ico { from { transform: scale(.5); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .today-cel.pop, .today-cel.pop .cel-seal, .today-cel.pop .cs, .today-row.just-done, .today-row.just-done .today-ico { animation: none; } }

/* 모두 마침 배지: 처음 다 마친 순간에만 톡 + 작은 바둑돌 */
.today-sum.all { position: relative; }
.today-sum.pop { animation: cel-seal .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.today-sum.pop .cs { width: 7px; height: 7px; margin: -3.5px; animation: cel-burst .9s .25s ease-out both; }
@media (prefers-reduced-motion: reduce) { .today-sum.pop, .today-sum.pop .cs { animation: none; } }

/* 완료 ✓: 진한 초록 */
.today-row.complete > .today-count { color: #0b5e2b; font-weight: 800; font-size: 12.5px; }

/* 이번 주 수찾사 문제 카드 (오늘의 공부 밖) */
.week-card { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.week-card:active { transform: scale(.98); }
.week-card .today-count { flex: none; }
.week-card.mine .today-ico { background: var(--ok-soft); color: var(--ok); }
.week-card.mine .today-count { color: #0b5e2b; font-weight: 800; }
.week-card.all { border-color: #ecd29b; background: linear-gradient(135deg, #fff8e6 0%, #fbeccb 100%); }
.week-card.all .today-ico { background: #f3d98a; color: #6b4a0c; }

/* 설정 · 공부: 칸마다 제목 · 항목은 같은 간격 */
.set-group { gap: 14px; }
.set-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.set-card-head b { font-size: 15.5px; font-weight: 800; }
.set-card-head span { font-size: 12px; font-weight: 600; color: var(--muted); }
.set-row { display: grid; gap: 6px; }
.set-row-name { font-size: 13px; font-weight: 700; color: var(--ink-2); padding-left: 2px; }
.set-group .set-note { margin: 0; }
.set-group .set-remind { margin-top: 0; }
.week-card.mine .today-count, .week-card.all .today-count { font-size: 12.5px; }
.week-card.all .today-count { color: #8a5d00; font-weight: 800; }

/* 강의·정석 화면 제목: 길면 두 줄까지 (잘려서 끝까지 못 읽는 일 없게) */
#lz-title, #j-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; font-size: 14.5px; }

/* 배지·축하 알림은 화면 위쪽(제목 줄 아래)에서 내려옴 — 아래쪽 버튼(다음 강의 등)을 가리거나 잘못 눌리지 않게 · 짧은 글 알림은 그대로 아래 */
.toast.badge-toast { top: calc(6px + env(safe-area-inset-top, 0px)); bottom: auto !important; height: auto; padding: 8px 16px 8px 10px; }   /* 탭이 있는 화면의 아래 위치 규칙보다 우선 */
.toast.badge-toast .medal { width: 38px; height: 38px; font-size: 20px; }
.toast.badge-toast.show { animation: toast-down .3s ease-out; }
@keyframes toast-down { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .toast.badge-toast.show { animation: none; } }

/* 오늘의 공부: 남은 양 빨간 숫자 (바로 가기와 같은 모양) */
.today-ico { position: relative; }
.today-left { position: absolute; top: -6px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #e5484d; color: #fff;
  font-size: 10.5px; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); font-variant-numeric: tabular-nums; }
.today-row.now .today-left { box-shadow: 0 0 0 2px #8a5a32; }

/* 오늘의 공부: 다 채운 줄은 진한 초록 테두리 */
.today-row.complete { border: 1.5px solid #2f8a52; background: #f3faf5; }
.week-card.mine { border: 1.5px solid #2f8a52; background: #f3faf5; }
.today-row.complete .today-ico, .week-card.mine .today-ico { background: #d9efe1; color: #1f7a43; }

/* 공부 알림: 스위치 · 시간 · 자주 쓰는 시간 */
.remind-head { align-items: center; }
.remind-box { display: grid; gap: 10px; }
.remind-box[hidden] { display: none; }
.remind-time { position: relative; display: flex; align-items: baseline; justify-content: center; gap: 10px; padding: 14px 16px; border-radius: 14px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); cursor: pointer; }
.remind-time-lb { font-size: 13px; font-weight: 700; color: var(--muted); }
.remind-time-show { font-size: 30px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
/* 진짜 시간 칸은 위에 투명하게 덮어서, 누르면 휴대폰 기본 시간 선택기가 열림 */
.remind-time input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; cursor: pointer; font-size: 16px; }
.remind-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.remind-presets button { padding: 8px 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink-2);
  font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.remind-presets button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.remind-time { flex-wrap: wrap; row-gap: 2px; }
.remind-edit { flex-basis: 100%; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--muted); }

/* 오늘 목표 달성: 오늘의 공부 칸을 은은한 금빛으로 (이번 주 문제를 모두 해냈을 때와 같은 색) */
.today.all-done { background: linear-gradient(135deg, #fff8e6 0%, #fbeccb 100%); box-shadow: inset 0 0 0 1.5px #e6c27a, 0 6px 24px rgba(184, 134, 11, .14); }
.today.all-done .today-row.complete { background: rgba(255, 255, 255, .78); }
.today.all-done .today-sum.all { background: linear-gradient(135deg, #e2b24c 0%, #c18c18 100%); color: #fff; box-shadow: 0 2px 8px rgba(184, 134, 11, .3); }

/* 오늘 목표를 다 채운 뒤 바로 가기: 더 할 수 있는 것 (빨강 대신 갈색) */
.quick-btn .tile-count.more { background: var(--accent); }
.quick-sub.more { color: var(--accent); font-weight: 800; }

/* 정석 복습 완성 모양: 흐린 돌 대신 또렷한 돌 + 금빛 테두리 (앞으로 둘 돌) → 카운트다운 뒤 서서히 사라짐 */
.gb-shadow, .gb-shadow.w { --sh-o: .95; opacity: .95; stroke: #d39a1c; stroke-width: 1.6; }

/* 판 바꿀 때 부드럽게 · 완성 모양 돌은 서서히 나타났다가(0.5초) 카운트다운 뒤 서서히 사라짐 · 놓아야 할 돌은 진한 반투명 + 금빛 테두리 */
#j-board.j-swap { animation: board-swap .32s ease-out; }
@keyframes board-swap { from { opacity: .2; } to { opacity: 1; } }
.gb-shadow { animation-name: gb-shadow-inout; }
.gb-shadow, .gb-shadow.w { --sh-o: .72; }
.gb-shadow.w { --sh-o: .85; }
@keyframes gb-shadow-inout { 0% { opacity: 0; } 9%, 83.3% { opacity: var(--sh-o, .72); } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #j-board.j-swap { animation: none; } }

/* 결과 화면 보조 버튼은 한 줄에 둘씩 (넷이 한 줄이면 '정석 복습으로'가 잘림) */
#j-actions .btn.secondary { flex: 1 1 calc(50% - 6px); }
/* 넓은 화면: 강의 탭은 여러 줄로 (가로로 밀려 양 끝이 잘리지 않게) */
@media (min-width: 821px) { .lz-tabs { flex-wrap: wrap; overflow-x: visible; } }

/* 순위 · 1등 기록 탭: 묶음 제목 · 주마다 1등 줄의 트로피 */
.champ-sub { margin: 14px 2px 6px; }
.rank-no.champ-ic { font-size: 18px; }
.champ-more { width: 100%; margin-top: 8px; }

/* 내 기록: 시작하지 않은 묶음 접기 줄 */
.rec-fold { display: block; width: 100%; padding: 12px 14px; border: 0; border-top: 1px solid var(--border); background: transparent; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 700; text-align: center; cursor: pointer; }

/* 2·3등 왕관: 은관 · 동관 (1등 금관은 기본 색) */
.rank-crown.silver { fill: #b9c3ce; stroke: #66717d; }
.rank-crown.bronze { fill: #d99a6c; stroke: #8a5230; }

/* 순위: 연속 공부 표시(누르면 설명) · 아래 안내 한 줄 */
button.rank-icon { padding: 0 2px; border: 0; background: none; font: inherit; font-size: 14px; line-height: 1; cursor: pointer; }
.rank-legend { margin: 10px 4px 0; font-size: 12px; line-height: 1.6; color: var(--muted); word-break: keep-all; }

/* 연속 공부 표시 창 */
.stk-sub { margin: 2px 0 12px; font-size: 13.5px; color: var(--muted); text-align: center; }
.stk-list { display: grid; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; text-align: left; }
.stk-list li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); opacity: .5; }
.stk-list li.got { opacity: 1; }
.stk-list li.now { border-color: #e2b43c; background: #fff7df; box-shadow: 0 0 0 1px #e2b43c inset; }
.stk-list .stk-ic { flex: none; width: 26px; font-size: 20px; text-align: center; }
.stk-list b { flex: 1; font-size: 14.5px; }
.stk-list small { flex: none; font-size: 12px; font-weight: 800; color: var(--accent); }
.stk-list li.now small { color: #9a6a00; }
.stk-note { margin: 0 0 12px; font-size: 12.5px; line-height: 1.55; color: var(--muted); text-align: center; word-break: keep-all; }
.stk-list, .stk-note, .stk-sub { width: 100%; justify-self: stretch; align-self: stretch; box-sizing: border-box; }

/* 대표 배지 바꾸기 (3개가 다 찼을 때) */
.bdm-swap { display: grid; gap: 10px; width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2, #faf6ef); box-sizing: border-box; }
.bdm-swap > b { font-size: 14px; text-align: center; word-break: keep-all; }
.bdm-swap-row { display: flex; justify-content: center; gap: 10px; }
.bdm-swap-item { display: grid; justify-items: center; gap: 4px; width: 84px; padding: 10px 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font: inherit; cursor: pointer; }
.bdm-swap-item:active, .bdm-swap-item:hover { border-color: var(--accent); }
.bdm-swap-item small { font-size: 11.5px; line-height: 1.3; text-align: center; word-break: keep-all; color: var(--ink-2); }
.bdm-swap-cancel { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.bd-got { white-space: nowrap; }

/* 선생님 화면: 바둑반 표시 */
.t-cls { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; vertical-align: 1px; }

/* 이번 주 수담 나누기 카드 (바둑반) */
.sudam-card { cursor: pointer; }
.sudam-btn { flex: none; height: 36px; padding: 0 16px; font-size: 14px; }
/* 바둑반 칸: 강조된 줄 위의 [했어요] 버튼은 흰 바탕 */
.today-row.now .sudam-btn { background: #fff; color: var(--accent); border-color: #fff; }

/* 바둑반 모두 달성: 내 목표 달성(은은한 금빛)보다 한 단계 위 — 진한 금빛 테두리 · 지나가는 빛 · 짙은 갈색 바탕 금색 글씨 + 왕관 */
.today.class-card.class-all { position: relative; overflow: hidden; background: linear-gradient(135deg, #fff4d6 0%, #f6dc95 55%, #f1cd73 100%);
  box-shadow: inset 0 0 0 2px #c9971f, 0 8px 28px rgba(184, 134, 11, .28); }
.today.class-card.class-all::after { content: ""; position: absolute; inset: -40% auto -40% -60%; width: 45%; transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: cls-shine 3.2s ease-in-out infinite; pointer-events: none; }
@keyframes cls-shine { 0% { left: -60%; } 55%, 100% { left: 130%; } }
.today.class-card.class-all .today-row.complete { background: rgba(255, 255, 255, .82); border-color: #c9971f; }
.today-sum.class-all { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 99px; background: linear-gradient(135deg, #5b3a1c 0%, #3d2611 100%);
  color: #f3c64e; font-weight: 800; box-shadow: 0 2px 10px rgba(61, 38, 17, .35), inset 0 0 0 1px rgba(243, 198, 78, .5); }
.cls-crown { width: 15px; height: 10px; fill: #f3c64e; }
@media (prefers-reduced-motion: reduce) { .today.class-card.class-all::after { animation: none; display: none; } }
.class-rest { color: #d13b3f; font-weight: 800; }
