/* =====================================================================
   StudyEnglish — 디자인 체계
   · 50대 학습자 기준: 본문 19px 이상, 누르는 곳 48px 이상, 높은 대비
   · 따뜻한 미색 바탕 + 깊은 남색 포인트, 테두리 대신 부드러운 그림자
   ===================================================================== */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #f1eee7;
  --text: #16181d;
  --muted: #6d6a64;
  --faint: #a29e96;
  --line: #e7e3da;

  --accent: #1f4fa8;
  --accent-strong: #163a7e;
  --accent-soft: #e6edf9;
  --accent-text: #ffffff;
  --hero-from: #1d4597;
  --hero-to: #122a5c;

  --ok: #2d7a46;   --ok-soft: #e4f2e8;
  --warn: #a06a00; --warn-soft: #fbf1d9;
  --bad: #b3392c;  --bad-soft: #fbe6e3;
  --mark: #ffe9a3;

  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(22, 24, 29, .04), 0 8px 24px rgba(22, 24, 29, .06);
  --shadow-lg: 0 2px 6px rgba(22, 24, 29, .06), 0 18px 40px rgba(22, 24, 29, .12);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
          "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121316; --surface: #1c1e23; --surface-2: #25282e; --text: #f2f1ee; --muted: #a9a59d;
    --faint: #6f6c66; --line: #2e3138;
    --accent: #7aa5ff; --accent-strong: #a3c0ff; --accent-soft: #1d2b47; --accent-text: #0c1426;
    --hero-from: #22437f; --hero-to: #151f3a;
    --ok: #7fcf98; --ok-soft: #173023; --warn: #f0c46a; --warn-soft: #33290f;
    --bad: #f39a8e; --bad-soft: #3a1c19; --mark: #5a4a12;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  --bg: #121316; --surface: #1c1e23; --surface-2: #25282e; --text: #f2f1ee; --muted: #a9a59d;
  --faint: #6f6c66; --line: #2e3138;
  --accent: #7aa5ff; --accent-strong: #a3c0ff; --accent-soft: #1d2b47; --accent-text: #0c1426;
  --hero-from: #22437f; --hero-to: #151f3a;
  --ok: #7fcf98; --ok-soft: #173023; --warn: #f0c46a; --warn-soft: #33290f;
  --bad: #f39a8e; --bad-soft: #3a1c19; --mark: #5a4a12;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .4);
}

/* ---------- 기본 ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 19px/1.6 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { letter-spacing: -0.025em; line-height: 1.3; }
h1 { font-size: 27px; font-weight: 700; margin: 0 0 6px; }
h2 { font-size: 21px; font-weight: 700; margin: 0; }
a { color: var(--accent); }
b { font-weight: 700; }
small { font-size: 15px; }
code { font: 14px/1.4 ui-monospace, "SF Mono", Consolas, monospace; color: var(--muted); overflow-wrap: anywhere; }
mark { background: var(--mark); color: inherit; padding: 0 3px; border-radius: 5px; }
button { font: inherit; letter-spacing: inherit; cursor: pointer; color: inherit; }
button:disabled { opacity: .45; cursor: default; }
.ico { width: 22px; height: 22px; flex: none; }

.wrap { max-width: 600px; margin: 0 auto; padding: 12px 16px 56px; }
.sub { color: var(--muted); margin: 0 0 8px; }
.small { font-size: 16px; }
.page-title { font-size: 30px; margin: 14px 4px 18px; }

/* ---------- 상단 ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 60px; padding: 0 12px 0 20px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}
@supports not (background: color-mix(in srgb, red, blue)) { .top { background: var(--bg); } }
.top-date { color: var(--muted); font-size: 16px; font-weight: 600; }
.top-back {
  display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin-left: -8px; padding-right: 8px;
  color: var(--text); font-size: 17px; font-weight: 600; text-decoration: none;
}

.menu { position: relative; }
.menu summary {
  list-style: none; display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 12px 0 16px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow); cursor: pointer;
  font-size: 16px; font-weight: 600;
}
.menu summary::-webkit-details-marker { display: none; }
.menu-user { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu[open] summary { background: var(--surface-2); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 8px;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.menu-panel a, .menu-panel button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 0 14px;
  border: 0; border-radius: 12px; background: none; color: var(--text);
  font-size: 17px; font-weight: 500; text-decoration: none; text-align: left;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); }
.menu-panel .ico { color: var(--muted); }
.menu-panel form { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--line); }
.menu-panel form button { color: var(--bad); }
.menu-panel form .ico { color: var(--bad); }

/* ---------- 카드 ---------- */
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 20px; margin-bottom: 14px;
}
.card-title { font-size: 18px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.body { margin: 0; }

/* ---------- 버튼 ---------- */
.btn, .btn-main, .btn-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 58px; padding: 0 24px; border: 0; border-radius: var(--radius-sm);
  font-size: 19px; font-weight: 700; text-decoration: none; transition: transform .08s, background .15s;
}
.btn:active, .btn-main:active, .btn-link:active { transform: scale(.98); }
.btn-main { background: var(--accent); color: var(--accent-text); }
.btn-main:hover { background: var(--accent-strong); }
.btn-link, .btn-secondary { background: var(--accent-soft); color: var(--accent); }
.btn-block { display: flex; width: 100%; }
.btn-quiet {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-size: 16px; font-weight: 600;
}
.btn-quiet.on { background: var(--accent); color: var(--accent-text); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* 고르기 버튼 묶음 */
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--surface-2); }
.seg button {
  min-width: 56px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); font-size: 17px; font-weight: 600;
}
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* ---------- 알림 ---------- */
.msg { padding: 14px 16px; border-radius: var(--radius-sm); margin: 12px 0 0; font-size: 17px; }
.msg.ok   { background: var(--ok-soft);   color: var(--ok); }
.msg.err  { background: var(--bad-soft);  color: var(--bad); }
.msg.warn { background: var(--warn-soft); color: var(--warn); }
.msg ul { margin: 6px 0 0; padding-left: 20px; }
.toast {
  position: fixed; left: 16px; right: 16px; bottom: 24px; z-index: 30; max-width: 568px; margin: 0 auto;
  padding: 14px 18px; border-radius: 16px; background: var(--text); color: var(--bg);
  box-shadow: var(--shadow-lg); font-size: 17px;
}
.saved { text-align: center; color: var(--ok); font-weight: 600; }

/* ---------- 로그인 ---------- */
.login { margin-top: 8vh; padding: 32px 24px; }
.login-logo { display: block; width: 64px; height: 64px; border-radius: 16px; margin: 0 0 18px; }
.login form { display: flex; flex-direction: column; }
label { font-weight: 600; font-size: 17px; margin: 18px 0 8px; }
input[type="text"], input[type="password"] {
  font: inherit; font-size: 20px; min-height: 58px; padding: 0 16px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--text);
}
input:focus-visible, select:focus-visible { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.login .btn-main { margin-top: 26px; }

/* ---------- 첫 화면 ---------- */
.install { margin-bottom: 14px; }
.install p { margin: 0; padding: 14px 18px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); font-size: 17px; }

.hero {
  position: relative; overflow: hidden;
  margin: 6px 0 14px; padding: 26px 22px 22px; border-radius: 26px;
  background: linear-gradient(145deg, var(--hero-from), var(--hero-to));
  color: #fff; box-shadow: var(--shadow-lg);
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .14), transparent 70%); pointer-events: none;
}
.hero-label { margin: 0; font-size: 16px; font-weight: 600; opacity: .75; }
.hero-nums { display: flex; gap: 28px; margin: 10px 0 22px; }
.hero-nums div { display: flex; flex-direction: column; }
.hero-num { font-size: 52px; line-height: 1; font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.hero-unit { margin-top: 6px; font-size: 16px; opacity: .8; }
.hero-done { margin: 10px 0 20px; font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.btn-hero { background: #fff; color: var(--hero-to); font-size: 20px; min-height: 60px; }
.btn-hero-ghost { background: rgba(255, 255, 255, .14); color: #fff; }
.hero-foot { margin-top: 22px; }
.hero-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.hero-bar span { display: block; height: 100%; border-radius: 3px; background: #fff; }
.hero-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 15px; opacity: .8; font-variant-numeric: tabular-nums; }

.tile {
  display: flex; align-items: center; gap: 16px; padding: 18px 18px 18px 20px; margin-bottom: 14px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  color: var(--text); text-decoration: none;
}
.tile:active { transform: scale(.99); }
.tile-icon {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px;
  background: var(--accent-soft); color: var(--accent);
}
.tile-icon .ico { width: 28px; height: 28px; }
.tile-text { flex: 1; display: flex; flex-direction: column; }
.tile-text b { font-size: 20px; }
.tile-text small { color: var(--muted); }
.tile-go { color: var(--faint); }

/* ---------- 공부 방법 · 설정 ---------- */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 16px; padding: 14px 0; }
.steps li + li { border-top: 1px solid var(--line); }
.steps p { margin: 2px 0 0; color: var(--muted); font-size: 17px; }
.step-no {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 800;
}
.plain { width: 100%; border-collapse: collapse; font-size: 17px; }
.plain th { width: 7.5em; padding: 10px 12px 10px 0; text-align: left; vertical-align: top; white-space: nowrap; }
.plain td { padding: 10px 0; color: var(--muted); }
.plain tr + tr th, .plain tr + tr td { border-top: 1px solid var(--line); }
.example { display: flex; flex-direction: column; gap: 6px; margin: 14px 0 0; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); font-weight: 600; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row > div:first-child { display: flex; flex-direction: column; }
.row small { color: var(--muted); }

/* ---------- 진행 막대 ---------- */
.bar { height: 6px; margin: 12px 0 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--accent); transition: width .25s; }

/* ---------- 학습 화면 ---------- */
.study { min-height: 70vh; }
.s-head { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.tag {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 700;
}
.s-count { color: var(--muted); font-size: 16px; font-variant-numeric: tabular-nums; }
.s-step { margin: 26px 0 10px; color: var(--accent); font-size: 16px; font-weight: 700; letter-spacing: 0; }
.s-en { font-size: 31px; line-height: 1.35; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; overflow-wrap: anywhere; }
.s-ko { font-size: 20px; color: var(--muted); }
.s-note { font-size: 16px; color: var(--muted); margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); }
.s-prompt { font-size: 30px; line-height: 1.4; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0 10px; }
.s-blank { font-size: 21px; color: var(--muted); padding: 12px 16px; border-radius: 12px; background: var(--surface-2); }
.s-answer { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.s-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.s-next { width: 100%; margin-top: 28px; }
.s-skip {
  display: block; margin: 10px auto 0; min-height: 44px; padding: 0 12px; border: 0; background: none;
  color: var(--muted); font-size: 16px; font-weight: 600;
}
.s-done { font-size: 22px; margin: 6px 0; }
.s-done b { color: var(--accent); }
.study .card .actions .btn-main, .study .card .actions .btn-link { flex: 1; }

.grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 24px; }
.grades button {
  min-height: 66px; border: 0; border-radius: var(--radius-sm);
  font-size: 18px; font-weight: 700;
}
.grades .g0 { background: var(--bad-soft); color: var(--bad); }
.grades .g1 { background: var(--warn-soft); color: var(--warn); }
.grades .g2 { background: var(--ok); color: #fff; }

/* ---------- 문장 목록 ---------- */
.pack h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sent-list { margin: 10px 0 0; padding-left: 26px; }
.sent { padding: 16px 0; border-top: 1px solid var(--line); }
.sent-list .sent:first-child { border-top: 0; }
.sent .en { font-size: 21px; font-weight: 700; letter-spacing: -0.015em; }
.sent .ko { color: var(--muted); font-size: 18px; }
.sent .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; font-size: 15px; }
.sent .note { color: var(--muted); }
.variants { list-style: none; margin: 10px 0 0; padding: 2px 0 0 14px; border-left: 3px solid var(--line); }
.variants li { padding: 6px 0; }
.variants .en { font-size: 18px; font-weight: 600; }
.play {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; min-height: 36px; margin: 0 8px 4px 0; padding: 0 10px; vertical-align: middle;
  border: 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-size: 14px; font-weight: 700;
}
.play.playing { background: var(--accent); color: var(--accent-text); }

/* ---------- 음성 만들기 ---------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 14px 0 0; font-size: 17px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.stat { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 10px 0 0; padding: 0; color: var(--muted); }
.stat b { color: var(--text); font-size: 26px; font-variant-numeric: tabular-nums; }
.log { margin: 8px 0 0; padding-left: 20px; color: var(--bad); font-size: 16px; }
.voices { list-style: none; margin: 12px 0 0; padding: 0; }
.voices li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }
.voices li .sub { font-size: 15px; }
.v-body { flex: 1; min-width: 0; }
.v-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.v-msg { margin: 6px 0 0; }

/* ---------- 차에서 듣기 ---------- */
.big-select {
  width: 100%; min-height: 58px; padding: 0 44px 0 16px; font: inherit; font-size: 19px; font-weight: 600;
  border: 0; border-radius: var(--radius-sm); background-color: var(--surface-2); color: var(--text);
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236d6a64' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 20px;
}
.opt { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 14px 0; }
.opt + .opt { border-top: 1px solid var(--line); }
.opt > span { font-weight: 600; }
#d-setup label { display: block; margin-top: 0; }
#d-setup .big-select { margin-bottom: 10px; }
#d-build { margin-top: 18px; }

.player { text-align: center; padding: 22px 20px 26px; }
.player .s-head { text-align: left; }
.d-en { min-height: 3.9em; display: flex; align-items: center; justify-content: center; margin: 26px 0 4px; font-size: 32px; line-height: 1.3; font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.d-ko { min-height: 1.6em; font-size: 20px; color: var(--muted); }
.player input[type="range"] { width: 100%; height: 28px; margin: 30px 0 2px; accent-color: var(--accent); }
.d-time { display: flex; justify-content: space-between; color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.d-ctrl { display: flex; justify-content: center; align-items: center; gap: 28px; margin: 20px 0 14px; }
.d-ctrl button {
  display: grid; place-items: center; width: 64px; height: 64px; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--text);
}
.d-ctrl .d-main { width: 96px; height: 96px; background: var(--accent); color: var(--accent-text); box-shadow: var(--shadow-lg); }
.d-ctrl .ico { width: 28px; height: 28px; }
.d-ctrl .d-main .ico { width: 40px; height: 40px; }
.check { display: inline-flex; align-items: center; gap: 10px; margin-top: 6px; font-weight: 500; color: var(--muted); font-size: 16px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }

/* 내 목소리 녹음 */
.s-rec { margin-top: 10px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
.rec-on { background: var(--bad); color: #fff; }
.rec-on .dot { background: #fff; animation: rec-blink 1s infinite; }
@keyframes rec-blink { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .rec-on .dot { animation: none; } }

/* 차에서 듣기 — 위쪽 버튼 */
.d-top { display: flex; gap: 8px; }
.d-top a.btn-quiet { text-decoration: none; }

/* 상단 새로고침 */
.top-right { display: flex; align-items: center; gap: 8px; }
.top-icon {
  display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow); color: var(--muted);
}
.top-icon.spin .ico { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 말해서 확인 */
.say .ico { width: 24px; height: 24px; }
.say.listening { background: var(--bad); }
.say.listening .ico { animation: rec-blink 1s infinite; }
.s-next + .s-next { margin-top: 10px; }
.heard-live { min-height: 1.6em; margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 19px; }
.heard {
  display: flex; align-items: baseline; gap: 10px; margin-top: 12px; padding: 14px 16px;
  border-radius: var(--radius-sm); background: var(--surface-2);
}
.heard-label { flex: none; color: var(--muted); font-size: 15px; font-weight: 600; }
.heard-text { flex: 1; font-size: 18px; overflow-wrap: anywhere; }
.heard-score {
  flex: none; padding: 2px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn);
  font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.heard-score.full { background: var(--ok-soft); color: var(--ok); }
.miss { color: var(--bad); text-decoration: underline wavy var(--bad); text-underline-offset: 6px; text-decoration-thickness: 2px; }
.grades .suggest { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px currentColor; }
.grades .g2.suggest { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--ok); }

/* 차에서 듣기 — 재생 카드 */
.d-go .ico { width: 24px; height: 24px; }
.now {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  min-height: calc(100vh - 96px); min-height: calc(100svh - 96px);
  margin: 4px 0 0; padding: 18px 20px 30px; border-radius: 28px;
  background: linear-gradient(165deg, var(--hero-from), var(--hero-to));
  color: #fff; box-shadow: var(--shadow-lg);
}
.now[hidden] { display: none; }
.now::before {
  content: ""; position: absolute; left: 50%; top: 18%; width: 340px; height: 340px; margin-left: -170px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .12), transparent 65%); pointer-events: none;
}
.now-top { position: relative; display: flex; align-items: center; justify-content: space-between; }
.now-pos {
  padding: 5px 14px; border-radius: 999px; background: rgba(255, 255, 255, .14);
  font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.now-tools { display: flex; gap: 8px; }
.now-icon {
  display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none;
}
.now-icon.on { background: #fff; color: var(--hero-to); }
.now-text { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; padding: 28px 0; }
.now .d-en { min-height: 0; display: block; margin: 0 0 14px; color: #fff; font-size: 34px; line-height: 1.28; }
.now .d-ko { color: rgba(255, 255, 255, .72); font-size: 20px; }

.now input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; background: transparent;
}
.now input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .25); }
.now input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.now input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .25); }
.now input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; }
.now .d-time { position: relative; color: rgba(255, 255, 255, .65); }
.now .d-ctrl { position: relative; margin: 22px 0 0; gap: 30px; }
.now .d-ctrl button { background: rgba(255, 255, 255, .12); color: #fff; }
.now .d-ctrl .d-main { background: #fff; color: var(--hero-to); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }

/* =====================================================================
   오늘의 학습 — 단계 표시 · 문장 카드 · 아래 행동 버튼
   ===================================================================== */
.study { display: flex; flex-direction: column; min-height: calc(100vh - 84px); min-height: calc(100svh - 84px); }
.lesson-head { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.lesson-head .bar { flex: 1; margin: 0; }

.stepper { display: flex; list-style: none; margin: 18px 0 0; padding: 0; }
.stepper li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; color: var(--faint); font-size: 14px; font-weight: 600; }
.stepper li::before {
  content: ""; position: absolute; top: 6px; right: 50%; width: 100%; height: 2px; background: var(--line);
}
.stepper li:first-child::before { display: none; }
.stepper i { position: relative; z-index: 1; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line); }
.stepper li.done { color: var(--muted); }
.stepper li.done i { background: var(--accent); border-color: var(--accent); }
.stepper li.done::before, .stepper li.on::before { background: var(--accent); }
.stepper li.on { color: var(--accent); }
.stepper li.on i { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }

.lesson {
  margin-top: 18px; padding: 28px 22px 16px; border-radius: 24px;
  background: var(--surface); box-shadow: var(--shadow);
}
.lesson .s-en { font-size: 31px; margin-bottom: 10px; }
.lesson .s-prompt { margin: 4px 0 14px; }
.lesson .s-blank { margin-bottom: 8px; }
.lesson .heard { margin-top: 18px; }
.lesson-kicker { margin: 0; text-align: center; color: var(--accent); font-size: 15px; font-weight: 700; }
.listen-big {
  display: grid; place-items: center; width: 96px; height: 96px; margin: 22px auto 10px; border: 0; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
}
.listen-big .ico { width: 40px; height: 40px; }

.lesson-bar {
  display: flex; align-items: center; gap: 8px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line);
}
.lesson-bar .grow { flex: 1; }
.rec-zone { display: flex; align-items: center; gap: 8px; }
.round {
  display: grid; place-items: center; width: 48px; height: 48px; flex: none; border: 0; border-radius: 50%;
  background: var(--accent); color: var(--accent-text);
}
.round.ghost { background: var(--surface-2); color: var(--muted); }
.round.rec-on { background: var(--bad); color: #fff; animation: rec-blink 1.2s infinite; }
.chip {
  min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-size: 15px; font-weight: 600;
}
.chip.on { background: var(--accent); color: var(--accent-text); }

.lesson-actions {
  position: sticky; bottom: 0; margin-top: auto; padding: 22px 0 calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--bg) 22px);
}
.lesson-actions .btn-main { min-height: 60px; font-size: 20px; }
.lesson-actions .btn-main .ico { width: 24px; height: 24px; }
.lesson-actions .grades { margin-top: 0; }
.btn-text {
  display: block; width: 100%; min-height: 48px; margin-top: 6px; border: 0; background: none;
  color: var(--muted); font-size: 17px; font-weight: 600;
}
.dots { display: inline-flex; gap: 6px; margin-left: 4px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.dots i.on { background: #fff; }

.hero-note { margin: 0 0 18px; font-size: 16px; opacity: .8; }
.hero-buttons { display: flex; flex-direction: column; gap: 10px; }
.study > .hero { margin-top: 10vh; }

/* =====================================================================
   학습 기록
   ===================================================================== */
a.hero-foot { display: block; color: inherit; text-decoration: none; }
.round.playing { background: var(--accent); color: var(--accent-text); }

.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); padding: 20px 8px; margin-top: 6px; }
.stats3 div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stats3 div + div { border-left: 1px solid var(--line); }
.stats3 b { font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stats3 span { color: var(--muted); font-size: 15px; }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin: -4px 0 12px; }
.cal-head b { font-size: 19px; }
.cal-nav { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--muted); }
a.cal-nav:hover { background: var(--surface-2); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px 0; text-align: center; }
.cal-w { color: var(--faint); font-size: 13px; font-weight: 600; padding-bottom: 4px; }
.cal-w:first-child { color: var(--bad); opacity: .7; }
.cal-d {
  display: grid; place-items: center; width: 38px; height: 38px; margin: 0 auto; border-radius: 50%;
  font-size: 16px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.cal-d.lv1 { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.cal-d.lv2 { background: var(--accent); color: var(--accent-text); font-weight: 700; }
.cal-d.today { box-shadow: 0 0 0 2px var(--accent); }

.packs { list-style: none; margin: 0; padding: 0; }
.packs li + li { margin-top: 14px; }
.packs-row { display: flex; justify-content: space-between; font-size: 17px; font-weight: 600; }
.packs-n { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.packs .bar { margin: 6px 0 0; }

.weak { list-style: none; margin: 0; padding: 0; }
.weak li { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.weak li + li { border-top: 1px solid var(--line); }
.weak li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.weak b { font-size: 18px; }
.weak span { color: var(--muted); font-size: 16px; }
.weak .weak-n { flex: none; padding: 2px 10px; border-radius: 999px; background: var(--bad-soft); color: var(--bad); font-size: 14px; font-weight: 700; }

/* =====================================================================
   첫 화면 — 바로가기
   ===================================================================== */
.hero-nums-done { align-items: center; }
.hero-check {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff;
}
.hero-check .ico { width: 28px; height: 28px; stroke-width: 2.4; }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.quick a {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px;
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
  color: var(--text); text-decoration: none;
}
.quick a:active { transform: scale(.98); }
.quick b { font-size: 16px; }
.quick small { color: var(--muted); }
.quick-icon {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px;
  background: var(--surface-2); color: var(--muted);
}
.quick a.quick-main {
  grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 16px; padding: 18px 20px;
}
.quick-main .quick-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); }
.quick-main .quick-icon .ico { width: 28px; height: 28px; }
.quick-main b { font-size: 20px; }
.quick-main small { margin-left: auto; }

/* =====================================================================
   문장 목록
   ===================================================================== */
.chips {
  position: sticky; top: 60px; z-index: 10;
  display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 6px 16px 12px;
  background: var(--bg); scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chips .chip { flex: none; min-height: 42px; padding: 0 16px; background: var(--surface); box-shadow: var(--shadow); }
.chips .chip.on { background: var(--text); color: var(--bg); box-shadow: none; }
.chip.playing { background: var(--accent); color: var(--accent-text); }

.pack { margin-top: 10px; }
.pack-head { display: flex; align-items: baseline; justify-content: space-between; margin: 14px 6px 10px; }
.pack-head h2 { font-size: 20px; }
.pack-head span { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }

.slist { list-style: none; margin: 0 0 14px; padding: 6px 16px; }
.srow { display: flex; align-items: center; gap: 12px; padding: 14px 0; }
.srow + .srow { border-top: 1px solid var(--line); }
.srow-var { padding-left: 22px; }
.srow-var + .srow-var { border-top-style: dashed; }
.srow .round { width: 42px; height: 42px; }
.srow .round .ico { width: 18px; height: 18px; }
.srow-var .round { width: 36px; height: 36px; }
.round-ph { width: 42px; flex: none; }
.srow-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.srow-text b { font-size: 18px; line-height: 1.35; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.srow-var .srow-text b { font-size: 16px; font-weight: 600; }
.srow-text span { color: var(--muted); font-size: 15px; }
.srow-text em { font-style: normal; margin-left: 4px; padding: 1px 8px; font-size: 12px; }
.srow-text code { font-size: 12px; color: var(--faint); }
.srow .chip { min-height: 34px; padding: 0 10px; font-size: 13px; }
.srow-mark {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--line); color: var(--accent-text);
}
.srow-mark.on { background: var(--ok); border-color: var(--ok); }
.srow-mark .ico { width: 14px; height: 14px; stroke-width: 3; }
.admin-box { margin-top: 24px; }

/* =====================================================================
   음성 만들기 (관리자)
   ===================================================================== */
.quota-num { margin: 6px 0 16px; font-size: 44px; line-height: 1; font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.pack-head.flush { margin: 0 0 14px; }
.stats3.inner { padding: 4px 0 18px; margin: 0; }
.stats3.inner b { font-size: 28px; }
.btn-split { justify-content: space-between; }
.btn-split small { font-size: 15px; font-weight: 600; opacity: .75; }
.btn-split + .btn-split { margin-top: 10px; }
#progress .btn-block { margin-top: 12px; }
#v-load { margin-top: 2px; }
.voices li { align-items: center; }
.v-name { display: flex; align-items: center; gap: 8px; }
.v-name .tag { padding: 1px 8px; font-size: 12px; }
.v-body code { display: block; margin-top: 2px; font-size: 12px; color: var(--faint); }
.v-actions .chip { min-height: 36px; font-size: 14px; }
.weak-go { margin-top: 14px; }

/* =====================================================================
   글자 크기 (설정 → 이 기기에만) — 화면 전체를 비율로 키운다
   ===================================================================== */
html[data-text="l"] body { zoom: 1.12; }
html[data-text="xl"] body { zoom: 1.25; }
.settings { padding-top: 8px; padding-bottom: 8px; }
.settings .row { padding: 16px 0; }
.settings .row + .row { border-top: 1px solid var(--line); }
/* 확대하면 화면 높이에 맞춘 영역도 같이 커지므로 비율만큼 나눠 원래 화면 안에 맞춘다 */
html[data-text="l"] .study { min-height: calc((100vh - 84px) / 1.12); min-height: calc((100svh - 84px) / 1.12); }
html[data-text="xl"] .study { min-height: calc((100vh - 84px) / 1.25); min-height: calc((100svh - 84px) / 1.25); }
html[data-text="l"] .now { min-height: calc((100vh - 96px) / 1.12); min-height: calc((100svh - 96px) / 1.12); }
html[data-text="xl"] .now { min-height: calc((100vh - 96px) / 1.25); min-height: calc((100svh - 96px) / 1.25); }

/* =====================================================================
   상태 점검 (관리자)
   ===================================================================== */
.checks ul { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; }
.checks li + li { border-top: 1px solid var(--line); }
.checks li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.checks b { font-size: 17px; }
.checks li span:not(.chk-ico) { color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.chk-ico { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; margin-top: 1px; }
.chk-ico .ico { width: 16px; height: 16px; stroke-width: 2.6; }
.chk-ok .chk-ico { background: var(--ok-soft); color: var(--ok); }
.chk-warn .chk-ico { background: var(--warn-soft); color: var(--warn); }
.chk-bad .chk-ico { background: var(--bad-soft); color: var(--bad); }
.checks .btn-link { margin-top: 12px; }

/* 꺼내 쓰기 — 한국어 문제 옆 다시 듣기 */
.prompt-row { display: flex; align-items: flex-start; gap: 12px; }
.prompt-row .s-prompt { flex: 1; }
.prompt-row .round { margin-top: 6px; width: 44px; height: 44px; }
.prompt-row .round .ico { width: 18px; height: 18px; }

/* =====================================================================
   첫 화면 바로가기 — 차에서 듣기 · 자면서 듣기 두 칸 + 작은 타일 세 칸
   ===================================================================== */
.quick { grid-template-columns: repeat(6, 1fr); }
.quick a { grid-column: span 2; }
/* 작은 칸 — 아이콘 위·이름 아래, 가운데 맞춤으로 낮게 */
.quick a:not(.quick-main) { align-items: center; gap: 6px; padding: 11px 8px; }
.quick a:not(.quick-main) .quick-icon { width: 34px; height: 34px; border-radius: 11px; }
.quick a:not(.quick-main) .quick-icon .ico { width: 20px; height: 20px; }
.quick a:not(.quick-main) b { font-size: 15px; letter-spacing: -0.02em; white-space: nowrap; }
/* 아이콘 왼쪽, 제목·설명 오른쪽 두 줄 — 높이를 줄인다 */
.quick a.quick-main {
  grid-column: span 3; display: grid; grid-template-columns: auto 1fr; align-items: center;
  column-gap: 12px; row-gap: 2px; padding: 14px;
}
.quick-main .quick-icon { grid-row: span 2; width: 44px; height: 44px; border-radius: 14px; }
.quick-main .quick-icon .ico { width: 24px; height: 24px; }
.quick-main b { align-self: end; font-size: 18px; letter-spacing: -0.03em; white-space: nowrap; }
.quick-main small { align-self: start; margin-left: 0; font-size: 14px; white-space: nowrap; }
.quick-night .quick-icon { background: #1d2333; color: #c9d4ff; }

/* =====================================================================
   자면서 듣기 — 방을 밝히지 않도록 아주 어둡게
   ===================================================================== */
.now.sleep { background: #07080b; box-shadow: none; color: #8d93a3; }
.now.sleep::before { background: radial-gradient(circle, rgba(120, 140, 255, .06), transparent 65%); }
.now.sleep .d-en { color: #a9afbf; font-weight: 600; }
.now.sleep .d-ko { color: #5f6574; }
.now.sleep .now-pos, .now.sleep .now-icon { background: rgba(255, 255, 255, .06); color: #8d93a3; }
.now.sleep .d-ctrl button { background: rgba(255, 255, 255, .06); color: #8d93a3; }
.now.sleep .d-ctrl .d-main { background: #1d2333; color: #c9d4ff; box-shadow: none; }
.now.sleep input[type="range"]::-webkit-slider-runnable-track { background: rgba(255, 255, 255, .1); }
.now.sleep input[type="range"]::-webkit-slider-thumb { background: #8d93a3; }
.now.sleep .d-time { color: #5f6574; }
/* 재생 중에는 바탕·상단까지 검정으로 */
body:has(.now.sleep:not([hidden])) { background: #000; }
body:has(.now.sleep:not([hidden])) .top { background: #000; -webkit-backdrop-filter: none; backdrop-filter: none; }
body:has(.now.sleep:not([hidden])) .top-back,
body:has(.now.sleep:not([hidden])) .menu summary,
body:has(.now.sleep:not([hidden])) .top-icon { background: transparent; box-shadow: none; color: #5f6574; }

/* =====================================================================
   시험 — 남은 시간 고리 · 한국어 문제 · 답
   ===================================================================== */
#t-setup label { display: block; margin-top: 0; }
#t-setup .big-select { margin-bottom: 10px; }
#t-start { margin-top: 18px; }

.t-card { text-align: center; padding-top: 22px; }
.t-card.shake { animation: t-shake .35s; }
@keyframes t-shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .t-card.shake { animation: none; } }

.t-top { display: flex; justify-content: center; margin-bottom: 18px; }
.t-clock {
  --p: 1; position: relative; display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 360deg), var(--surface-2) 0);
}
.t-clock::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.t-clock span { position: relative; display: grid; place-items: center; color: var(--accent); font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.t-clock .ico { width: 30px; height: 30px; stroke-width: 2.6; }
.t-clock.low { background: conic-gradient(var(--bad) calc(var(--p) * 360deg), var(--surface-2) 0); }
.t-clock.low span { color: var(--bad); }
.is-right .t-clock, .is-right .t-clock.low { background: var(--ok); }
.is-wrong .t-clock, .is-wrong .t-clock.low { background: var(--bad); }
.is-right .t-clock::before, .is-wrong .t-clock::before { background: transparent; }
.is-right .t-clock span, .is-wrong .t-clock span { color: #fff; }

.t-card .t-ko { margin: 0 0 6px; }
.t-answer { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.t-answer .s-en { margin: 0; font-size: 27px; }
.is-right .t-answer .s-en { color: var(--ok); }
.t-answer .heard { margin-top: 14px; text-align: left; }
.t-live { min-height: 2.6em; margin-top: 18px; }

.t-input {
  width: 100%; min-height: 60px; margin-top: 18px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 2px solid var(--line); background: var(--surface-2); color: var(--text);
  font: 600 22px/1.3 var(--font); letter-spacing: -0.01em;
}
.t-input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.is-right .t-input { border-color: var(--ok); }
.is-wrong .t-input { border-color: var(--bad); color: var(--muted); }

.t-wrong-actions { display: flex; align-items: center; gap: 10px; }
.t-wrong-actions .round { width: 60px; height: 60px; }

.study > .hero.t-result { margin-top: 8px; }
.t-result .hero-num small { margin-left: 2px; font-size: 26px; font-weight: 700; }
.t-miss { margin-top: 14px; padding-top: 8px; padding-bottom: 8px; }
.t-miss .round { width: 42px; height: 42px; }
.t-miss .round .ico { width: 18px; height: 18px; }
.quick-test .quick-icon { background: var(--accent-soft); color: var(--accent); }

/* 학습 기록 — 시험 */
.tests { list-style: none; margin: 0; padding: 0; }
.tests li { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.tests li + li { border-top: 1px solid var(--line); }
.tests li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tests b { font-size: 17px; font-variant-numeric: tabular-nums; }
.tests li > div span { color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.tests-score { color: var(--muted); font-size: 16px; font-variant-numeric: tabular-nums; }
.tests-pct {
  flex: none; min-width: 58px; padding: 4px 10px; border-radius: 999px; text-align: center;
  background: var(--warn-soft); color: var(--warn); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.tests-pct.good { background: var(--ok-soft); color: var(--ok); }
.tests-pct.low { background: var(--bad-soft); color: var(--bad); }

/* =====================================================================
   첫 화면 바로가기 — 다듬기
   · 차에서 듣기 : 밝은 카드에 남색 빛이 살짝
   · 자면서 듣기 : 밤하늘 같은 짙은 카드
   · 작은 칸     : 절제된 회색 아이콘, 시험만 남색
   ===================================================================== */
.quick { gap: 10px; }
.quick a {
  position: relative; border-radius: 18px;
  box-shadow: 0 1px 2px rgba(22, 24, 29, .04), 0 4px 14px rgba(22, 24, 29, .05);
  transition: transform .15s, box-shadow .15s;
}
.quick a:hover { box-shadow: 0 2px 4px rgba(22, 24, 29, .06), 0 10px 24px rgba(22, 24, 29, .08); }

.quick a.quick-main { overflow: hidden; }
.quick a.quick-main:first-child {
  background: radial-gradient(120% 140% at 0% 0%, var(--accent-soft) 0%, var(--surface) 55%);
}
.quick-main .quick-icon { background: var(--accent); color: var(--accent-text); box-shadow: 0 4px 12px rgba(31, 79, 168, .25); }
.quick-main small { color: var(--muted); }

.quick a.quick-night {
  background: radial-gradient(120% 140% at 100% 0%, #2a3560 0%, #141a2e 55%, #0e1222 100%);
  color: #eef1ff; box-shadow: 0 6px 18px rgba(14, 18, 34, .28);
}
.quick a.quick-night small { color: rgba(214, 222, 255, .62); }

.quick-night .quick-icon { background: rgba(255, 255, 255, .1); color: #d9e0ff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }

.quick a:not(.quick-main) .quick-icon { background: var(--surface-2); color: var(--text); opacity: .85; }
.quick a.quick-test .quick-icon { background: var(--accent-soft); color: var(--accent); opacity: 1; }
.quick a:not(.quick-main) b { font-weight: 600; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .quick-main .quick-icon { box-shadow: none; }
  :root:not([data-theme="light"]) .quick a.quick-night { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
}

/* 문장 목록 — 오른쪽 표시: 빈 동그라미 / ✓ 배운 문장 / "✓ 외움" 다 외운 문장(누르면 켜고 끔) */
.srow-mark {
  position: relative; width: auto; min-width: 26px; height: 26px; padding: 0; gap: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line); border-radius: 999px; background: transparent; color: transparent;
  transition: background .15s, border-color .15s;
}
.srow-mark::after { content: ""; position: absolute; inset: -9px; }      /* 누르는 곳을 넓게 */
.srow-mark span { display: none; font-size: 12px; font-weight: 700; letter-spacing: -0.01em; }
.srow-mark.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.srow-mark.done { padding: 0 8px 0 5px; background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.srow-mark.done span { display: inline; }
.srow-mark:disabled { opacity: .5; }
.btn-danger {
  flex: none; min-height: 44px; padding: 0 18px; border: 0; border-radius: 12px;
  background: var(--bad-soft); color: var(--bad); font-size: 16px; font-weight: 700;
}
.btn-danger:active { transform: scale(.98); }

/* 따라 말하기 — 저절로 3번, 지난 횟수만큼 채워진다 */
.echo-dots { display: flex; justify-content: center; gap: 10px; margin: 20px 0 0; }
.echo-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); transition: background .2s; }
.echo-dots i.on { background: var(--accent); }

/* =====================================================================
   내 답변 — 목록 · 등록 · 통암기
   ===================================================================== */
.my-new { margin: 4px 0 14px; gap: 8px; }
.my-list { list-style: none; margin: 0; padding: 4px 18px; }
.my-list li + li { border-top: 1px solid var(--line); }
.my-list a { display: flex; align-items: center; gap: 12px; padding: 16px 0; color: var(--text); text-decoration: none; }
.my-list a > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.my-list b { font-size: 18px; overflow-wrap: anywhere; }
.my-list a > div span { color: var(--muted); font-size: 15px; }

.my-edit label:first-child { margin-top: 0; }
.my-edit label { display: block; }
.my-edit input[type="text"] { width: 100%; }
.my-edit textarea {
  display: block; width: 100%; min-height: 240px; padding: 14px 16px; resize: vertical;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--text);
  font: 17px/1.55 var(--font);
}
.my-edit textarea:focus-visible { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.my-preview { margin-top: 18px; }
.my-preview ol { margin: 0; padding-left: 24px; }
.my-preview li { padding: 8px 0; }
.my-preview li + li { border-top: 1px dashed var(--line); }
.my-preview li b { display: block; font-size: 16px; font-weight: 600; }
.my-preview li span { display: block; color: var(--muted); font-size: 15px; }
.my-edit #m-save { margin-top: 20px; }
.my-del { color: var(--bad); }

.my-head { display: flex; align-items: center; gap: 10px; margin: 6px 4px 12px; }
.my-head h1 { flex: 1; min-width: 0; margin: 0; font-size: 22px; overflow-wrap: anywhere; }
.my-tts { padding: 14px; }
.my-tts .bar { margin: 12px 0 0; }
.my-tools { display: flex; justify-content: center; margin-bottom: 12px; }
.my-tools .seg { width: 100%; }
.my-tools .seg button { flex: 1; }

.passage { padding: 8px 18px; }
.p-line { display: flex; gap: 12px; margin: 0; padding: 14px 0; cursor: pointer; transition: background .2s; }
.p-line + .p-line { border-top: 1px solid var(--line); }
.p-line.p-now { border-radius: 12px; background: var(--accent-soft); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-top-color: transparent; }
.p-line.p-now + .p-line { border-top-color: transparent; }
.p-no { flex: none; width: 22px; padding-top: 3px; color: var(--faint); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.p-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.p-en { font-size: 20px; line-height: 1.55; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.p-ko { color: var(--muted); font-size: 16px; }
.v-ko .p-ko { color: var(--text); font-size: 18px; font-weight: 600; }
.w-hint { letter-spacing: .04em; color: var(--muted); }
.w-hide { color: transparent; background: var(--surface-2); border-radius: 5px; -webkit-user-select: none; user-select: none; }
.v-ko .p-en { font-size: 17px; }
.w-ok { color: var(--ok); }
.passage:not(.speaking) .w-ok { color: inherit; }

.my-result { margin: 4px 0 0; }
.my-score {
  display: flex; align-items: baseline; justify-content: center; gap: 12px; padding: 16px;
  border-radius: var(--radius); background: var(--warn-soft); color: var(--warn);
}
.my-score b { font-size: 40px; line-height: 1; font-weight: 800; letter-spacing: -0.03em; }
.my-score small { font-size: 20px; }
.my-score span { font-size: 16px; font-weight: 600; }
.my-score.good { background: var(--ok-soft); color: var(--ok); }
.my-score.low { background: var(--bad-soft); color: var(--bad); }

.my-actions { margin-top: 0; }
.my-play-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.my-play-row .grow { flex: 1; }
.my-play-row a.chip { display: inline-flex; align-items: center; text-decoration: none; }

/* 간단 학습 — 채점 네 칸(2×2), 자동 넘김 막대 */
.grades4 { grid-template-columns: repeat(2, 1fr); }
.grades .g3 { background: var(--accent); color: var(--accent-text); }
.auto-next { position: relative; overflow: hidden; }
.auto-bar { position: absolute; left: 0; bottom: 0; width: 0; height: 4px; background: rgba(255, 255, 255, .55); }
.auto-bar.run { animation: auto-fill linear forwards; }
@keyframes auto-fill { to { width: 100%; } }
.auto-track { position: relative; height: 4px; margin-top: 10px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.auto-track .auto-bar { background: var(--warn); }

/* 간단 학습 — 음성으로 넘기기: 마이크가 켜져 있으면 깜빡이고, 들은 말을 옆에 */
.voice-mark { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 28px; margin: 10px 0 0; color: var(--faint); font-size: 15px; }
.voice-mark .ico { width: 18px; height: 18px; }
.voice-mark.on { color: var(--accent); }
.voice-mark.on .ico { animation: rec-blink 1.2s infinite; }
.voice-mark span { max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }

/* 설정 — 복습할 문장 체크 */
.checks-row { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px 0 10px;
  border: 1.5px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted);
  font-size: 15px; font-weight: 600;
}
.check-chip .ico { width: 16px; height: 16px; stroke-width: 2.6; opacity: .25; }
.check-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.check-chip.on .ico { opacity: 1; }
.rv-kinds { padding-top: 4px; }

/* 목소리 등록 (voice.php) */
.kws-list { list-style: none; margin: 0; padding: 0; }
.kws-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.kws-row + .kws-row { border-top: 1px solid var(--line); }
.kws-row b { flex: 1; font-size: 19px; }
.kws-row .tag { display: none; color: var(--warn); background: var(--warn-soft); }
.kws-row.warn .tag { display: inline-block; }
.kws-dots { display: flex; gap: 6px; }
.kws-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.kws-dots i.on { background: var(--accent); }
.kws-row.rec .round { color: var(--bad); border-color: var(--bad); }
.kws-row.rec .round .ico { animation: rec-blink 1.2s infinite; }
#kws-mark { font-size: 20px; font-weight: 700; }
#kws-mark span { color: var(--accent); }

.row-link { flex-basis: 100%; margin: 0; }

/* 차에서 듣기 — 들을 문장 여러 개 고르기 */
.d-srcs { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.d-group { margin: 8px 0 0; color: var(--muted); font-size: 14px; font-weight: 700; }
.d-srcs .check-chip small { color: var(--faint); font-weight: 600; }
.d-srcs .check-chip.on small { color: inherit; opacity: .7; }
.d-srcs .check-chip:disabled { opacity: .4; }
#d-build small { font-size: 15px; font-weight: 600; opacity: .75; margin-left: 4px; }

/* 설정 — 이 기기에 음성 저장 */
#ac .bar { margin-top: 4px; }
.ac-btns { display: flex; gap: 8px; }
