/* Morning Words — a pocket book of the morning's news.
   Each story is a sheet of paper on its own colored ground; turn it like a page.
   Ground: one saturated color per story category. Sheet: white paper, ink type.
   Type: Literata for reading, system UI + Pretendard for interface and Korean.
   Chrome: one liquid-glass tab bar floating over the ground. */

:root {
  --ink: #15171c;
  --ink-2: #474c58;
  --ink-3: #737987;
  --paper: #ffffff;
  --bg: #f2f3f5;
  --line: rgba(21, 23, 28, 0.1);
  --line-2: rgba(21, 23, 28, 0.06);
  --accent: #2443d6;
  --good: #0b7a55;
  --bad: #b8322a;
  --ground: #0b6e4f;
  --tint: rgba(11, 110, 79, 0.14);
  --read: "Literata", Georgia, serif;
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Pretendard", "Apple SD Gothic Neo", "Segoe UI", Roboto, sans-serif;
  --ko: "Pretendard", -apple-system, "Apple SD Gothic Neo", sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --bar-h: 64px;
  --bar-bottom: calc(6px + var(--safe-b) * 0.35);
  --bar-space: calc(var(--bar-h) + var(--bar-bottom) + 12px);
  --read-size: 18px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eceef2;
    --ink-2: #b4b9c4;
    --ink-3: #868c99;
    --paper: #1a1c21;
    --bg: #0e0f12;
    --line: rgba(236, 238, 242, 0.12);
    --line-2: rgba(236, 238, 242, 0.07);
    --accent: #7d93ff;
    --good: #3ccf95;
    --bad: #ff7b6e;
  }
}
[data-size="s"] { --read-size: 16.5px; }
[data-size="l"] { --read-size: 20px; }

* { box-sizing: border-box; min-width: 0; }
html, body { height: 100%; }
html, body { background: var(--page-bg, var(--bg)); transition: background-color 450ms ease; }
body {
  margin: 0;
  color: var(--ink);
  font: 16px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-underline-offset: 3px; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.ko { font-family: var(--ko); word-break: keep-all; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}

/* ---------- Views ---------- */
#app { min-height: 100%; }
.view { min-height: 100dvh; }
.view-today {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  min-height: 100lvh;
  background: var(--ground);
  transition: background-color 450ms var(--ease-out);
  display: flex; flex-direction: column;
  padding-top: calc(var(--safe-t) + 10px);
  color: #fff;
}
/* iOS home-screen apps can leave a strip under fixed elements: paint it with the same ground */
.view-today::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 50vh;
  background: inherit; pointer-events: none;
}
.view-plain {
  padding: calc(var(--safe-t) + 22px) 18px var(--bar-space);
  max-width: 640px; margin: 0 auto;
}

/* ---------- Today: top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 4px 20px 0;
  max-width: 640px; width: 100%; margin: 0 auto;
}
.topbar-date { margin: 0; font-weight: 650; font-size: 20px; letter-spacing: -0.01em; }
.topbar-sub { margin: 1px 0 0; font-size: 13.5px; color: rgba(255, 255, 255, 0.82); font-variant-numeric: tabular-nums; }
.glass-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 40px; padding: 0 14px 0 11px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: #fff;
  background: linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,.1));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 0 0 .5px rgba(255,255,255,.35), 0 4px 14px rgba(0,0,0,.12);
  -webkit-backdrop-filter: blur(14px) saturate(170%); backdrop-filter: blur(14px) saturate(170%);
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease;
}
.glass-btn .ic { width: 19px; height: 19px; }
.glass-btn:active { transform: scale(0.96); }
.glass-btn[aria-pressed="true"] { background: #fff; color: var(--ground); box-shadow: 0 4px 14px rgba(0,0,0,.16); }

.segments {
  display: flex; gap: 5px; padding: 12px 20px 12px;
  max-width: 640px; width: 100%; margin: 0 auto;
}
.segments span {
  flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.28);
  transition: background-color 300ms ease;
}
.segments span.on { background: rgba(255,255,255,.95); }

/* ---------- Today: the book ---------- */
.book-wrap {
  position: relative; flex: 1;
  display: flex; justify-content: center;
  padding: 0 14px var(--bar-space);
}
.book {
  position: relative; width: 100%; max-width: 560px; height: 100%;
  perspective: 2600px; perspective-origin: 0% 50%;
  touch-action: pan-y;
}
.page {
  position: absolute; inset: 0;
  background: var(--paper); color: var(--ink);
  border-radius: 6px 22px 22px 6px;
  box-shadow: 0 22px 48px -18px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.08);
  transform-origin: 0% 50%;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  overflow: hidden;
  display: none;
  --ground: inherit;
}
.page.is-current, .page.is-under { display: block; }
.page.is-current { z-index: 3; }
.page.is-under { z-index: 2; }
.page.is-turning { z-index: 4; will-change: transform; }
/* spine shading: a page curves into the binding */
.page::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 18px; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,.09), rgba(0,0,0,0));
}
.page-shade, .page-cast { position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 5; }
.page-shade { background: linear-gradient(90deg, rgba(0,0,0,0) 25%, rgba(0,0,0,.3)); }
.page-cast { background: linear-gradient(90deg, rgba(0,0,0,.34), rgba(0,0,0,0) 65%); }

.page-scroll {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 26px 24px 22px 28px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.page h1 {
  font-family: var(--read); font-weight: 600; font-size: 25px; line-height: 1.18;
  letter-spacing: -0.012em; margin: 0; text-wrap: balance;
}
.page .ko-head { margin: 8px 0 0; font-size: 14.5px; color: var(--ink-3); }
.page-tools { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  background: var(--line-2); box-shadow: inset 0 0 0 .5px var(--line);
  transition: transform 160ms var(--ease-out), background-color 200ms ease;
}
.chip:active { transform: scale(0.96); }
.chip[aria-expanded="true"] { background: var(--tint); color: var(--ink); }
.summary {
  margin: 10px 0 0; padding: 12px 14px; border-radius: 14px;
  background: var(--tint); font-size: 15px; line-height: 1.6; color: var(--ink);
}
.prose {
  font-family: var(--read); font-size: var(--read-size); line-height: 1.66;
  margin: 18px 0 0; overflow-wrap: break-word;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.prose .s { transition: background-color 200ms ease; border-radius: 4px; }
.prose .s.is-held { background: var(--tint); }
.prose .tok { cursor: pointer; border-radius: 3px; transition: background-color 160ms ease; }
.prose .tok.is-flash { background: var(--tint); }
.prose .tok.is-added { background: var(--tint); }
.tgt {
  font: inherit; color: inherit; cursor: pointer; padding: 0 1px; border-radius: 3px;
  text-decoration: underline; text-decoration-color: var(--ground);
  text-decoration-thickness: 2px; text-underline-offset: 4px;
  transition: background-color 200ms ease, text-decoration-color 200ms ease;
}
.tgt.is-learning { background: var(--tint); }
.tgt.is-known { text-decoration-style: dotted; text-decoration-color: var(--ink-3); text-decoration-thickness: 1.5px; }
.prose.is-split .s { display: block; }
.prose .ko-line {
  display: block; font-family: var(--ko); font-size: 14.5px; line-height: 1.6;
  color: var(--ink-3); margin: 2px 0 14px; word-break: keep-all;
}
.page-foot {
  margin: 22px 0 0; padding-top: 14px; border-top: 1px solid var(--line-2);
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ink-3);
}
.page-foot a { color: var(--ink-2); }
.hint {
  display: flex; align-items: center; gap: 6px; margin: 16px 0 0;
  font-size: 13px; color: var(--ink-3);
}
.hint .ic { width: 16px; height: 16px; }

/* End page */
.end { display: flex; flex-direction: column; min-height: 100%; }
.end h1 { font-size: 30px; }
.end-lede { font-family: var(--read); font-size: 18px; line-height: 1.55; color: var(--ink-2); margin: 10px 0 0; }
.end-list { list-style: none; margin: 22px 0 0; padding: 0; border-top: 1px solid var(--line-2); }
.end-list li { display: flex; justify-content: space-between; align-items: baseline; padding: 13px 2px; border-bottom: 1px solid var(--line-2); font-size: 15.5px; }
.end-list b { font-variant-numeric: tabular-nums; font-weight: 650; }
.end-words { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.end-actions { margin-top: auto; padding-top: 24px; display: grid; gap: 10px; }

/* Edge buttons (wide screens) */
.edge {
  position: absolute; top: 40%; z-index: 6; display: none;
  width: 44px; height: 44px; border-radius: 50%; color: #fff; place-items: center;
  background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.35);
  transition: background-color 200ms ease, transform 160ms var(--ease-out), opacity 200ms ease;
}
.edge:active { transform: scale(0.94); }
.edge:disabled { opacity: 0; pointer-events: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 760px) {
  .edge { display: grid; }
  .edge:hover { background: rgba(255,255,255,.28); }
  .edge-prev { left: calc(50% - 280px - 64px); }
  .edge-next { right: calc(50% - 280px - 64px); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 20px; border-radius: 16px;
  font-size: 16px; font-weight: 650; letter-spacing: -0.005em;
  background: var(--line-2); color: var(--ink); box-shadow: inset 0 0 0 .5px var(--line);
  transition: transform 160ms var(--ease-out), background-color 200ms ease, opacity 200ms ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn .ic { width: 19px; height: 19px; }
.btn-primary { background: var(--ink); color: var(--paper); box-shadow: none; }
.btn-know { background: color-mix(in srgb, var(--good) 13%, var(--paper)); color: var(--good); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 30%, transparent); }
.btn-dont { background: color-mix(in srgb, var(--bad) 10%, var(--paper)); color: var(--bad); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 26%, transparent); }
.btn.is-chosen { box-shadow: inset 0 0 0 2px currentColor; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Liquid glass tab bar ---------- */
.tabbar {
  position: fixed; z-index: 30;
  left: 50%; bottom: var(--bar-bottom);
  transform: translateX(-50%);
  width: min(460px, calc(100% - 24px)); height: var(--bar-h);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px;
  border-radius: 32px; isolation: isolate;
  background:
    radial-gradient(120% 90% at 20% 0%, rgba(255,255,255,.55), rgba(255,255,255,0) 55%),
    linear-gradient(180deg, rgba(255,255,255,.6), rgba(255,255,255,.32));
  -webkit-backdrop-filter: blur(22px) saturate(200%) brightness(1.05);
  backdrop-filter: blur(22px) saturate(200%) brightness(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.85),
    inset 0 -1px 0 rgba(255,255,255,.25),
    inset 0 0 0 .5px rgba(255,255,255,.55),
    0 12px 32px -6px rgba(0,0,0,.28),
    0 2px 6px rgba(0,0,0,.08);
}
@media (prefers-color-scheme: dark) {
  .tabbar {
    background:
      radial-gradient(120% 90% at 20% 0%, rgba(255,255,255,.16), rgba(255,255,255,0) 55%),
      linear-gradient(180deg, rgba(40,42,48,.62), rgba(24,25,29,.5));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 0 0 .5px rgba(255,255,255,.14), 0 12px 32px -6px rgba(0,0,0,.6);
  }
}
.tab-lens {
  position: absolute; z-index: 0; top: 6px; bottom: 6px; left: 6px;
  width: calc((100% - 12px) / 5);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.4));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), inset 0 0 0 .5px rgba(255,255,255,.7), 0 3px 10px rgba(0,0,0,.1);
  transition: transform 420ms cubic-bezier(.34, 1.3, .64, 1);
}
@media (prefers-color-scheme: dark) {
  .tab-lens { background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.08)); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 0 0 .5px rgba(255,255,255,.16); }
}
.tab {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 26px; color: rgba(21,23,28,.74);
  font-size: 10.5px; font-weight: 600; letter-spacing: .01em;
  transition: color 200ms ease, transform 160ms var(--ease-out);
}
@media (prefers-color-scheme: dark) { .tab { color: rgba(236,238,242,.66); } }
.tab:active { transform: scale(0.94); }
.tab[aria-current="page"] { color: #121418; }
@media (prefers-color-scheme: dark) { .tab[aria-current="page"] { color: #fff; } }
.tab .ic { width: 23px; height: 23px; }
.tab-badge {
  position: absolute; top: 3px; left: calc(50% + 6px);
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: #e5484d; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---------- Sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(8, 10, 14, .32); opacity: 0; transition: opacity 260ms ease; }
.scrim.is-open { opacity: 1; }
.sheet {
  position: fixed; z-index: 41; left: 50%; bottom: 0;
  width: min(560px, 100%); max-height: min(86dvh, 760px);
  transform: translate(-50%, 104%);
  background: var(--paper); color: var(--ink);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -12px 40px rgba(0,0,0,.2);
  display: flex; flex-direction: column;
  transition: transform 360ms var(--ease-drawer), visibility 0s linear 360ms;
  visibility: hidden;
}
.sheet.is-open { transform: translate(-50%, 0); visibility: visible; transition: transform 420ms var(--ease-drawer), visibility 0s; }
.sheet.is-dragging { transition: none; }
.sheet-grab { padding: 10px 0 4px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.sheet-grab span { width: 38px; height: 5px; border-radius: 3px; background: var(--line); }
.sheet-body { overflow-y: auto; padding: 8px 22px calc(22px + var(--safe-b)); overscroll-behavior: contain; }

.w-head { display: flex; align-items: center; gap: 12px; }
.w-word { font-family: var(--read); font-size: 32px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.1; margin: 0; overflow-wrap: anywhere; }
.icon-btn {
  margin-left: auto; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--line-2); box-shadow: inset 0 0 0 .5px var(--line); color: var(--ink-2);
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease;
}
.icon-btn:active { transform: scale(0.93); }
.icon-btn.is-playing { color: var(--accent); }
.w-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 0; color: var(--ink-3); font-size: 14.5px; }
.lv {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--ink-2); background: var(--line-2);
  box-shadow: inset 0 0 0 .5px var(--line);
}
.w-ko { margin: 16px 0 0; font-size: 20px; font-weight: 650; line-height: 1.4; }
.w-en { margin: 4px 0 0; font-size: 15.5px; color: var(--ink-2); line-height: 1.5; }
.w-ex { margin: 14px 0 0; font-family: var(--read); font-style: italic; font-size: 16.5px; line-height: 1.55; color: var(--ink); }
.w-note { margin: 10px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink-3); }
.w-ctx { margin: 18px 0 0; padding: 14px 16px; border-radius: 16px; background: var(--line-2); }
.w-ctx-label { margin: 0 0 6px; font-size: 12.5px; font-weight: 650; color: var(--ink-3); }
.w-ctx-en { margin: 0; font-family: var(--read); font-size: 16px; line-height: 1.55; }
.w-ctx-en mark { background: none; color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--ground); }
.w-ctx-ko { margin: 8px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.w-actions { margin: 20px 0 0; }
.muted { color: var(--ink-3); }
.loading-line { height: 14px; border-radius: 7px; background: var(--line-2); margin: 10px 0 0; width: 70%; animation: pulse 1.1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .5 } to { opacity: 1 } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 50; left: 50%; bottom: calc(var(--bar-space) + 6px);
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: #fff; background: rgba(20, 22, 27, .88);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: opacity 200ms ease, transform 260ms var(--ease-out);
  white-space: nowrap;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Plain views ---------- */
.v-title { font-size: 32px; font-weight: 750; letter-spacing: -0.025em; margin: 0; line-height: 1.1; }
.v-sub { margin: 6px 0 0; color: var(--ink-3); font-size: 15px; }
.group { margin: 26px 0 0; }
.group-title { font-size: 13px; font-weight: 650; color: var(--ink-3); margin: 0 0 8px 4px; }
.panel { background: var(--paper); border-radius: 20px; box-shadow: 0 1px 2px rgba(0,0,0,.04), inset 0 0 0 .5px var(--line-2); overflow: hidden; }
.cell {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 16px;
  border-bottom: .5px solid var(--line); font-size: 16px; width: 100%; text-align: left;
}
.cell:last-child { border-bottom: 0; }
.cell .val { margin-left: auto; color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: right; flex: none; }
.cell-main { flex: 1; }
.cell-main small { display: block; color: var(--ink-3); font-size: 13.5px; margin-top: 1px; }
button.cell { transition: background-color 160ms ease; }
button.cell:active { background: var(--line-2); }

.seg {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; flex: none;
  padding: 3px; border-radius: 11px; background: var(--line-2); box-shadow: inset 0 0 0 .5px var(--line);
}
.seg button { height: 32px; padding: 0 12px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: background-color 200ms ease, color 200ms ease; }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg.full { display: grid; width: 100%; margin: 0 0 10px; }

.switch { margin-left: auto; width: 51px; height: 31px; border-radius: 16px; background: var(--line); position: relative; flex: none; transition: background-color 200ms ease; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: transform 240ms var(--ease-out); }
.switch[aria-checked="true"] { background: var(--good); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }

/* Review */
.card {
  position: relative; margin: 14px 0 0; min-height: 300px; width: 100%; text-align: left;
  background: var(--paper); border-radius: 6px 22px 22px 6px; padding: 26px 22px 24px 28px;
  box-shadow: 0 18px 40px -20px rgba(0,0,0,.35), inset 0 0 0 .5px var(--line-2);
  display: flex; flex-direction: column; cursor: pointer;
  transition: transform 160ms var(--ease-out);
}
.card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 14px; border-radius: 6px 0 0 6px; background: linear-gradient(90deg, rgba(0,0,0,.06), transparent); }
.card:active { transform: scale(0.99); }
.card-word { font-family: var(--read); font-size: 34px; font-weight: 600; letter-spacing: -0.015em; margin: 0; line-height: 1.1; }
.card-ctx { margin: 18px 0 0; font-family: var(--read); font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.card-ctx mark { background: none; color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--accent); }
.card-tap { margin-top: auto; padding-top: 22px; font-size: 13.5px; color: var(--ink-3); }
.card-back { animation: reveal 260ms var(--ease-out); }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); filter: blur(3px); } }
.review-meta { display: flex; justify-content: space-between; align-items: center; margin: 18px 2px 0; font-size: 13.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.meter { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin: 8px 0 0; }
.meter > i { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 2px; transition: transform 300ms var(--ease-out); transform-origin: left; }
.empty {
  margin: 20px 0 0; padding: 26px 22px; border-radius: 22px; background: var(--paper);
  box-shadow: inset 0 0 0 .5px var(--line-2);
}
.empty h2 { margin: 0; font-size: 21px; letter-spacing: -0.01em; }
.empty p { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.empty .btn { margin-top: 16px; width: 100%; }

.search {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 12px;
  background: var(--line-2); box-shadow: inset 0 0 0 .5px var(--line); margin: 0 0 10px; color: var(--ink-3);
}
.search input { flex: 1; border: 0; background: none; font: inherit; font-size: 16px; color: var(--ink); outline: none; }
.search input::placeholder { color: var(--ink-3); }
.search .ic { width: 18px; height: 18px; }
.word-row .wr-word { font-family: var(--read); font-weight: 600; font-size: 17px; }
.word-row .wr-ko { display: block; font-size: 14px; color: var(--ink-3); margin-top: 1px; font-family: var(--ko); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.learning { background: #e8a317; }
.dot.mastered { background: var(--good); }
.dot.known { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 6px 16px; }
.cal-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.cal-nav { display: flex; gap: 4px; }
.cal-nav button { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--accent); }
.cal-nav button:disabled { color: var(--ink-3); opacity: .4; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 4px 8px 12px; text-align: center; }
.cal-dow { font-size: 12px; font-weight: 650; color: var(--ink-3); padding: 6px 0; }
.cal-day {
  position: relative; aspect-ratio: 1; display: grid; place-items: center; margin: 2px;
  border-radius: 50%; font-size: 16px; font-variant-numeric: tabular-nums; color: var(--ink);
  transition: transform 160ms var(--ease-out), background-color 200ms ease;
}
.cal-day:disabled { color: var(--ink-3); opacity: .45; cursor: default; }
.cal-day.has::after { content: ""; position: absolute; bottom: 12%; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.cal-day.done { background: var(--ink); color: var(--paper); }
.cal-day.done::after { background: var(--paper); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day:not(:disabled):active { transform: scale(0.92); }
.legend { display: flex; gap: 16px; padding: 0 16px 14px; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Stats */
.level-panel { padding: 20px 18px 16px; }
.level-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.level-big { font-size: 44px; font-weight: 750; letter-spacing: -0.03em; line-height: 1; }
.level-desc { margin: 8px 0 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.chart { position: relative; height: 150px; margin: 14px 0 0; }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dist { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin: 16px 16px 6px; background: var(--line-2); }
.dist i { display: block; height: 100%; }
.dist-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 4px 16px 16px; font-size: 13px; color: var(--ink-3); }
.dist-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dist-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Profile */
.me { display: flex; align-items: center; gap: 14px; padding: 16px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 20px; color: #fff; background: linear-gradient(140deg, #2443d6, #0b6e4f); flex: none; }
.me h2 { margin: 0; font-size: 19px; }
.me p { margin: 2px 0 0; color: var(--ink-3); font-size: 14px; }
.cell-danger { color: var(--bad); justify-content: center; font-weight: 600; }
.foot-note { margin: 14px 6px 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.55; }

@media (min-width: 760px) {
  .page-scroll { padding: 40px 44px 30px 48px; }
  .page h1 { font-size: 30px; }
  .view-plain { padding-top: calc(var(--safe-t) + 40px); }
}
.sheet:focus, .sheet:focus-visible { outline: none; }
