/* Debate read-along. Navy / orange / yellow identity, Reflex app proportions: one centred column,
   rounded cards, pill buttons, heavy tight headings. */
:root {
  --bg: #f5f6f9; --band: #ffffff; --card: #ffffff; --card-hi: #fff6f3; --line: #dfe3ea; --line-soft: #eceff4;
  --ink: #1b2233; --dim: #5a6273; --muted: #8a91a0;
  --pen: #e8553f; --pen-soft: rgba(232, 85, 63, .10); --pen-line: rgba(232, 85, 63, .45);
  --ko: #b5730f; --ko-dim: #a08454;
  --font: Inter, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --col: 760px;
  --gutter: max(16px, calc((100% - var(--col)) / 2));
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); font-weight: 500; word-break: keep-all; overflow-wrap: break-word; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, .track:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; }
[hidden] { display: none !important; }
* { scrollbar-color: #343b52 transparent; scrollbar-width: thin; }

.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .06); color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap; }
.pill:hover { background: rgba(255, 255, 255, .12); }

/* ---------- home ---------- */
.app-header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 68px; padding: calc(12px + env(safe-area-inset-top)) var(--gutter) 12px; background: rgba(22, 26, 38, .97); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; }
.brand img { border-radius: 11px; box-shadow: 0 6px 16px rgba(0, 0, 0, .35); }
.brand strong { display: block; font-size: 19px; line-height: 1; font-weight: 800; letter-spacing: .06em; }
.brand small { display: block; margin-top: 5px; color: var(--dim); font-size: 10.5px; font-weight: 700; letter-spacing: .22em; }

.library { padding: 28px var(--gutter) 56px; }
.hero { position: relative; overflow: hidden; padding: 30px 32px 30px; border-radius: 24px;
  background: linear-gradient(125deg, #1b2134 0%, #232c45 60%, #2c3757 100%); border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0, 0, 0, .3); }
.hero:after { content: ""; position: absolute; right: -70px; bottom: -95px; width: 240px; height: 240px; border-radius: 50%;
  border: 42px solid rgba(240, 100, 79, .2); pointer-events: none; }
.studio { position: relative; color: #ff9a7f; font-size: 11px; letter-spacing: .21em; font-weight: 800; }
.hero h1 { position: relative; margin: 10px 0 0; font-size: clamp(27px, 3.6vw, 36px); line-height: 1.16; font-weight: 800; letter-spacing: -.035em; }
.hero p { position: relative; margin: 8px 0 0; color: var(--dim); font-size: 14.5px; line-height: 1.55; }

/* book cards */
.books { display: grid; gap: 12px; margin-top: 16px; }
.book { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 20px;
  min-height: 120px; padding: 22px 24px 22px 76px; border-radius: 20px; background: var(--card); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; transition: border-color .18s, transform .18s, background .18s; }
a.book:hover { border-color: var(--pen-line); background: var(--card-hi); transform: translateY(-2px); }
.book-n { position: absolute; left: 24px; top: 24px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px;
  background: var(--pen-soft); border: 1px solid var(--pen-line); color: var(--pen); font-size: 15px; font-weight: 800; }
.book h2 { margin: 0 0 5px; font-size: 23px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.book p { margin: 0; color: var(--dim); font-size: 14.5px; line-height: 1.55; }
.open { justify-self: end; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--pen); color: var(--pen); font-size: 13px; font-weight: 800; white-space: nowrap; }
.book.locked { opacity: .5; }
.book.locked .open { border-color: var(--muted); color: var(--muted); }

/* unit panel */
.units { margin-top: 16px; padding: 20px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); }
.units-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 2px 14px; }
.units-head h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.units-head span { color: var(--muted); font-size: 13px; font-weight: 600; }
.unit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.unit { display: block; min-height: 84px; padding: 14px 15px; border-radius: 14px; background: var(--band); border: 1px solid var(--line-soft);
  color: var(--ink); text-decoration: none; transition: border-color .15s, background .15s; }
.unit:hover { border-color: var(--pen-line); background: var(--card-hi); }
.unit span { display: block; margin-bottom: 6px; color: var(--pen); font-size: 12px; font-weight: 800; letter-spacing: .05em; }
.unit strong { display: block; font-size: 15px; line-height: 1.38; font-weight: 700; }
.copyright { margin: 26px 4px 0; color: var(--muted); font-size: 12px; line-height: 1.55; text-align: center; }

/* ---------- player ---------- */
.player { height: 100dvh; display: flex; flex-direction: column; }
.stage { flex: 0 0 auto; padding: calc(12px + env(safe-area-inset-top)) var(--gutter) 0; background: var(--band); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); position: relative; z-index: 2; }
.stage-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; min-height: 40px; }
.stage-top .pill { justify-self: start; }
.kicker { color: #ff9a7f; font-size: 11.5px; font-weight: 800; letter-spacing: .16em; white-space: nowrap; }
.title { margin: 8px 0 0; padding-bottom: 14px; text-align: center; font-size: clamp(20px, 2.4vw, 26px); line-height: 1.25; font-weight: 800; letter-spacing: -.025em; }
.tabs { display: flex; justify-content: center; gap: 8px; padding: 0 0 14px; }
.tabs button { min-height: 36px; padding: 7px 18px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22); background: transparent; color: var(--dim); font-size: 14px; font-weight: 700; }
.tabs button:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.tabs button.on { background: #fff; border-color: #fff; color: #161a26; }

.list { flex: 1 1 auto; overflow-y: auto; padding: 16px var(--gutter) 42vh; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
.line { padding: 14px 18px 15px; border-radius: 18px; cursor: pointer; border: 1px solid transparent; transition: background .2s, border-color .2s; }
.line + .line { margin-top: 6px; }
.line:hover { background: rgba(255, 255, 255, .025); }
.line.cur { background: var(--card); border-color: var(--line); box-shadow: 0 10px 26px rgba(0, 0, 0, .28); }
.en { font-size: 19px; line-height: 1.6; color: var(--dim); font-weight: 600; letter-spacing: -.01em; }
.line.cur .en { color: var(--ink); font-weight: 700; }
.w { padding: 1px 3px; margin: 0 -3px; border-radius: 6px; transition: box-shadow .08s; }
.w.on { box-shadow: inset 0 0 0 2px var(--pen); }
.w.kv { text-decoration: underline dotted var(--ko); text-underline-offset: 5px; text-decoration-thickness: 2px; }
.w.gl { text-decoration: underline dotted rgba(255, 255, 255, .28); text-underline-offset: 5px; text-decoration-thickness: 1.5px; }
.kr { margin-top: 5px; word-break: keep-all; overflow-wrap: anywhere; font-family: "Noto Sans KR", var(--font); font-size: 15.5px; line-height: 1.65; color: var(--ko-dim); }
.line.cur .kr { color: var(--ko); }
.hide-ko .kr { display: none; }

/* dock: Reflex-style pill player + toggles */
.dock { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: var(--band); border-top: 1px solid var(--line-soft); }
.player-bar { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 6px 16px 6px 6px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.ctl { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--dim); font-size: 14px; }
.ctl:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.ctl.play { width: 44px; height: 44px; background: var(--pen); color: #fff; font-size: 16px; }
.ctl.play:hover { background: #ff7560; }
.track { position: relative; flex: 1 1 auto; min-width: 40px; height: 8px; margin-left: 8px; border-radius: 99px; background: #2e3549; cursor: pointer; touch-action: none; }
.fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 99px; background: var(--pen); }
.time { flex: 0 0 auto; min-width: 74px; text-align: right; color: var(--dim); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.toggles { flex: 0 0 auto; display: flex; gap: 6px; }
.toggle { min-height: 38px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--dim); font-size: 13px; font-weight: 700; white-space: nowrap; }
.toggle:hover { color: #fff; }
.toggle.on { border-color: var(--ko); color: var(--ko); background: rgba(242, 200, 121, .08); }
.speeds { display: flex; padding: 3px; gap: 2px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); }
.speeds button { min-height: 30px; padding: 4px 11px; border: 0; border-radius: 999px; background: none; color: var(--dim); font: inherit; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; }
.speeds button:hover { color: #fff; }
.speeds button.on { background: var(--ko); color: #1a1508; }

/* ---------- vocabulary ---------- */
.study { flex: 1 1 auto; overflow-y: auto; padding: 18px var(--gutter) 40px; }
.study-note { margin: 0 2px 4px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.study h3 { display: flex; align-items: baseline; gap: 8px; margin: 22px 2px 10px; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.study h3 small { color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: 0; }
.vgrid { display: grid; gap: 10px; }
.card { padding: 16px 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); cursor: pointer; transition: border-color .15s; }
.card:hover { border-color: var(--pen-line); }
.card-word { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.card-def { margin-top: 6px; color: var(--dim); font-size: 14.5px; line-height: 1.55; }
.card-ko { margin-top: 8px; color: var(--ko); font-family: "Noto Sans KR", var(--font); font-size: 15px; line-height: 1.55; font-weight: 700; }
.gloss { border-radius: 18px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.g-row { display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr); gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.g-row:last-child { border-bottom: 0; }
.g-row:hover { background: var(--card-hi); }
.g-en { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.g-ko { color: var(--ko); font-family: "Noto Sans KR", var(--font); font-size: 14.5px; line-height: 1.55; }
.g-ko small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.empty { padding: 14px 18px; color: var(--muted); font-size: 14px; }

.pop { position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .55); }
.pop-card { position: relative; width: 100%; max-width: var(--col); padding: 24px 24px calc(20px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: var(--band); border-top: 3px solid var(--pen); }
.pop-close { position: absolute; right: 14px; top: 12px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 18px; }
.pop-close:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.pop-word { font-size: 27px; font-weight: 800; letter-spacing: -.02em; }
.pop-label { margin-top: 12px; color: var(--pen); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.pop-def { margin-top: 4px; font-size: 16px; line-height: 1.55; }
.pop-ko { margin-top: 10px; color: var(--ko); font-family: "Noto Sans KR", var(--font); font-size: 18px; font-weight: 700; line-height: 1.5; }
.pop-note { margin-top: 8px; color: var(--dim); font-size: 14px; line-height: 1.6; }
.draft { display: inline-block; vertical-align: middle; margin-left: 4px; padding: 1px 6px; border: 1px solid var(--muted); border-radius: 6px; color: var(--muted); font-size: 11px; font-weight: 600; }
.pop-play { width: 100%; height: 46px; margin-top: 18px; border: 0; border-radius: 999px; background: var(--pen); color: #fff; font-size: 15px; font-weight: 800; }

/* ---------- Q&A ---------- */
.qa-card { padding: 16px 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.qa-card + .qa-card { margin-top: 10px; }
.qa-q { display: flex; gap: 12px; align-items: baseline; font-size: 17px; line-height: 1.5; font-weight: 700; }
.qa-n { flex: 0 0 auto; min-width: 26px; color: var(--pen); font-size: 13px; font-weight: 800; letter-spacing: .04em; }
.qa-ko { margin: 6px 0 0 38px; color: var(--ko-dim); font-family: "Noto Sans KR", var(--font); font-size: 14.5px; line-height: 1.6; word-break: keep-all; }
.qa-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0 38px; }
.qa-btn { min-height: 34px; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--band); color: var(--dim); font-size: 13px; font-weight: 700; }
.qa-btn:hover { color: #fff; border-color: rgba(255, 255, 255, .3); }
.qa-btn.open { border-color: var(--pen-line); color: var(--pen); }
.qa-ans { margin: 12px 0 0 38px; padding: 12px 14px; border-radius: 14px; background: var(--band); border-left: 3px solid var(--ko); }
.qa-ans-en { font-size: 16px; line-height: 1.55; font-weight: 600; }
.qa-ans-ko { margin-top: 6px; color: var(--ko); font-family: "Noto Sans KR", var(--font); font-size: 14.5px; line-height: 1.6; word-break: keep-all; }
.motion { padding: 18px 20px; border-radius: 18px; background: linear-gradient(125deg, #1f2538, #262f4a); border: 1px solid var(--pen-line); }
.motion-k { color: #ff9a7f; font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.motion-q { margin-top: 8px; font-size: 19px; line-height: 1.45; font-weight: 800; letter-spacing: -.01em; }
.motion-ko { margin-top: 6px; color: var(--ko); font-family: "Noto Sans KR", var(--font); font-size: 15px; line-height: 1.6; word-break: keep-all; }
.motion .qa-actions { margin-left: 0; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.side { padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.side-h { margin: 0 2px 10px; font-size: 13px; font-weight: 800; letter-spacing: .06em; }
.side.for .side-h { color: #6fcf97; }
.side.against .side-h { color: var(--pen); }
.pt { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--band); }
.pt + .pt { margin-top: 8px; }
.pt:hover { border-color: rgba(255, 255, 255, .25); }
.side.for .pt { border-left: 3px solid #6fcf97; }
.side.against .pt { border-left: 3px solid var(--pen); }
.pt-en { display: block; font-size: 14.5px; line-height: 1.5; font-weight: 600; color: var(--ink); }
.pt-ko { display: block; margin-top: 4px; color: var(--ko-dim); font-family: "Noto Sans KR", var(--font); font-size: 13px; line-height: 1.55; word-break: keep-all; }
@media (max-width: 600px) {
  .qa-card { padding: 14px 15px; }
  .qa-q { font-size: 16px; gap: 10px; }
  .qa-ko, .qa-actions, .qa-ans { margin-left: 0; }
  .motion { padding: 16px; }
  .motion-q { font-size: 17.5px; }
  .sides { grid-template-columns: 1fr; }
}

/* ---------- phone ---------- */
@media (max-width: 600px) {
  .app-header { min-height: 62px; }
  .brand img { width: 34px; height: 34px; }
  .brand strong { font-size: 17px; }
  .library { padding-top: 18px; }
  .hero { padding: 24px 22px; border-radius: 20px; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 13.5px; }
  .hero:after { right: -110px; bottom: -130px; width: 220px; height: 220px; border-width: 36px; }
  .book { grid-template-columns: 1fr; row-gap: 12px; min-height: 0; padding: 18px 18px 18px 64px; border-radius: 18px; }
  .book-n { left: 17px; top: 19px; width: 31px; height: 31px; font-size: 14px; }
  .book h2 { font-size: 21px; }
  .book p { font-size: 13.5px; }
  .open { justify-self: start; padding: 6px 13px; font-size: 12.5px; }
  .units { padding: 14px; border-radius: 18px; }
  .unit-grid { grid-template-columns: 1fr; gap: 8px; }
  .unit { min-height: 0; display: flex; align-items: baseline; gap: 12px; padding: 13px 14px; }
  .unit span { margin: 0; min-width: 52px; white-space: nowrap; }

  .stage-top { grid-template-columns: auto 1fr; }
  .stage-top .kicker { justify-self: end; font-size: 10.5px; letter-spacing: .12em; }
  .stage-spacer { display: none; }
  .pill { min-height: 34px; padding: 6px 12px; font-size: 13px; }
  .title { font-size: 20px; padding-bottom: 12px; margin-top: 6px; }
  .tabs { padding-bottom: 12px; }
  .tabs button { flex: 1 1 0; max-width: 160px; min-height: 34px; padding: 6px 12px; font-size: 13.5px; }
  .list { padding-top: 12px; }
  .line { padding: 12px 14px 13px; border-radius: 16px; }
  .en { font-size: 17px; line-height: 1.58; }
  .kr { font-size: 14.5px; }
  .dock { flex-direction: column; align-items: stretch; gap: 8px; padding-top: 8px; }
  .player-bar { padding-right: 14px; }
  .time { min-width: 0; font-size: 12px; }
  .toggles { justify-content: space-between; }
  .toggle { flex: 1 1 0; min-height: 36px; padding: 6px 8px; font-size: 12.5px; }
  .speeds { flex: 0 0 auto; }
  .speeds button { min-height: 28px; padding: 4px 8px; font-size: 12.5px; }
  .g-row { grid-template-columns: minmax(96px, 36%) minmax(0, 1fr); padding: 11px 15px; gap: 12px; }
  .card { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *:before, *:after { scroll-behavior: auto !important; transition: none !important; } }

/* ---------- Business English additions ---------- */
.title small { display: block; margin-top: 4px; color: var(--ko); font-family: "Noto Sans KR", var(--font); font-size: 14.5px; font-weight: 700; letter-spacing: 0; }
.levels { display: flex; justify-content: center; gap: 2px; width: max-content; margin: 0 auto 12px; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); }
.levels button { min-height: 30px; padding: 4px 16px; border: 0; border-radius: 999px; background: none; color: var(--dim); font-size: 13px; font-weight: 700; }
.levels button:hover { color: #fff; }
.levels button.on { background: var(--pen); color: #fff; }
.scene { margin: 0 0 12px; padding: 12px 16px; border-radius: 14px; background: rgba(242, 200, 121, .07); border-left: 3px solid var(--ko);
  color: var(--ko); font-family: "Noto Sans KR", var(--font); font-size: 14.5px; line-height: 1.6; }
.unit span { letter-spacing: 0; }
.pop-btns { display: flex; gap: 8px; margin-top: 18px; }
.pop-btns .pop-play { margin-top: 0; }
.pop-play.alt { background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.pop-note { font-style: italic; }

/* ---------- light theme overrides (Business English is brighter than Debate) ---------- */
* { scrollbar-color: #c9ceda transparent; }
.app-header { background: rgba(255, 255, 255, .96); box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(27, 34, 51, .05); }
.brand { color: var(--ink); }
.brand img { box-shadow: 0 4px 10px rgba(27, 34, 51, .15); }
.pill { border-color: var(--line); background: #fff; color: var(--ink); }
.pill:hover { background: var(--bg); }
.hero { background: linear-gradient(125deg, #fff 0%, #fff4ef 60%, #ffe7de 100%); box-shadow: 0 10px 28px rgba(27, 34, 51, .06); }
.hero:after { border-color: rgba(232, 85, 63, .14); }
.studio, .kicker { color: var(--pen); }
.units { box-shadow: 0 4px 14px rgba(27, 34, 51, .04); }
.unit { background: var(--bg); }
.unit:hover { background: var(--card-hi); }
.stage { box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(27, 34, 51, .05); }
.tabs button { border-color: var(--line); }
.tabs button:hover { color: var(--ink); background: var(--bg); }
.tabs button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.line:hover { background: rgba(27, 34, 51, .03); }
.line.cur { box-shadow: 0 8px 22px rgba(27, 34, 51, .08); }
.scene { background: #fff8ec; }
.levels button:hover, .toggle:hover, .speeds button:hover { color: var(--ink); }
.ctl:hover { color: var(--ink); background: var(--bg); }
.ctl.play:hover { background: #f06a55; }
.track { background: #e4e7ee; }
.speeds button.on { background: #f6d58f; color: #3b2a05; }
.toggle.on { background: #fff8ec; }
.pop { background: rgba(27, 34, 51, .35); }
.pop-close:hover { background: var(--bg); color: var(--ink); }
.pop-card { box-shadow: 0 -8px 30px rgba(27, 34, 51, .12); }
.qa-btn:hover { color: var(--ink); border-color: #b9c0cc; }
.qa-ans, .pt { background: var(--bg); }

/* ---------- first page: six group tiles ---------- */
.groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.group { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 20px 18px; border-radius: 20px; background: var(--card); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; box-shadow: 0 4px 14px rgba(27, 34, 51, .04); transition: border-color .18s, transform .18s, background .18s; }
.group:hover { border-color: var(--pen-line); background: var(--card-hi); transform: translateY(-2px); }
.group-ic { font-size: 26px; line-height: 1; }
.group strong { margin-top: 6px; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.group small { color: var(--muted); font-size: 13px; font-weight: 600; }
@media (max-width: 600px) { .groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .group { padding: 16px 15px; } }

/* ---------- levels in the top row, Korean toggle ---------- */
.stage-top .levels { justify-self: end; margin: 0; }
.levels button { padding: 4px 13px; white-space: nowrap; }
.hide-ko .qa-ans-ko { display: none; }
@media (max-width: 600px) {
  .stage-top { grid-template-columns: auto 1fr; }
  .stage-top .kicker { display: none; }
  .levels button { padding: 4px 9px; font-size: 12.5px; }
}

/* ---------- conversation: who is speaking ---------- */
.who { display: inline-block; margin-bottom: 4px; padding: 1px 8px; border-radius: 999px; font-family: "Noto Sans KR", var(--font); font-size: 11.5px; font-weight: 800; }
.line.me .who, .sp.me .who { background: var(--pen-soft); color: var(--pen); }
.line.you .who, .sp.you .who { background: #e8eefb; color: #3a5bb0; }
.line.you { margin-left: 0; background: #f2f5fb; }
.line.you .en { font-size: 17px; }
.line.you.cur { background: #eef2fb; border-color: #d3dcf0; }
.line.me { margin-left: 28px; }
@media (max-width: 600px) { .line.me { margin-left: 14px; } .line.you .en { font-size: 15.5px; } }

/* ---------- 말하기 ---------- */
.speak-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 2px 12px; }
.speak-head p { margin: 0; color: var(--dim); font-size: 14px; }
.sp { display: block; width: 100%; text-align: left; padding: 14px 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); }
.sp + .sp { margin-top: 8px; }
.sp.you { background: #f2f5fb; border-color: transparent; }
.sp.me { margin-left: 28px; width: calc(100% - 28px); border-style: dashed; }
.sp.me.shown { border-style: solid; border-color: var(--pen-line); }
.sp-en { display: block; font-size: 17px; line-height: 1.55; font-weight: 700; color: var(--ink); }
.sp.you .sp-en { font-size: 16px; font-weight: 600; }
.sp-ko { display: block; margin-top: 3px; color: var(--ko); font-family: "Noto Sans KR", var(--font); font-size: 15px; line-height: 1.6; font-weight: 700; }
.sp.you .sp-ko { color: var(--ko-dim); font-size: 13.5px; font-weight: 500; }
.sp.me .sp-ko { margin: 0 0 6px; font-size: 16.5px; }
.sp-tap { display: block; margin-top: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
@media (max-width: 600px) { .sp.me { margin-left: 14px; width: calc(100% - 14px); } }

/* eight groups: four per row on wide screens */
@media (min-width: 761px) { .groups { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tabs button { padding-left: 15px; padding-right: 15px; }

/* the Korean of a word's example sentence */
.card-ex-ko { margin-top: 2px; color: var(--ko-dim); font-family: "Noto Sans KR", var(--font); font-size: 13.5px; line-height: 1.55; }
.hide-ko .card-ex-ko { display: none; }

/* word pop-up: centred card on wide screens so the window's bottom edge never cuts it; bottom sheet stays on phones */
.pop-card { max-height: calc(100dvh - 24px); overflow-y: auto; }
@media (min-width: 601px) {
  .pop { align-items: center; padding: 24px; }
  .pop-card { max-width: 560px; border-radius: 24px; border-top: 0; border: 1px solid var(--line); padding: 26px 26px 24px; box-shadow: 0 20px 60px rgba(27, 34, 51, .22); }
}
