/* sõna — a quiet, editorial interface for small daily language reminders. */

:root {
  color-scheme: dark;
  --bg: #0b1f19;
  --bg-2: #0e251e;
  --surface: #122e25;
  --surface-2: #17382d;
  --surface-3: #1d4336;
  --line: rgba(238, 233, 214, 0.12);
  --line-strong: rgba(238, 233, 214, 0.22);
  --text: #f2ecdc;
  --muted: #a0b4a9;
  --muted-2: #71877c;
  --accent: #8fb3ff;
  --accent-soft: rgba(143, 179, 255, 0.13);
  --amber: #e7b46a;
  --green: #7dd3a0;
  --red: #ef9a8a;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --radius: 22px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1100px 720px at 88% -12%, rgba(96, 134, 255, 0.15), transparent 62%),
    radial-gradient(900px 640px at -12% 108%, rgba(231, 180, 106, 0.065), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #b9cdff; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.is-hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; line-height: 1.55; color: var(--muted-2); }
.fineprint { font-size: 12px; line-height: 1.6; color: var(--muted-2); margin: 0; }
.eyebrow {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.link {
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.link:hover { color: #c3d5ff; }

/* Layout --------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 34px 26px 24px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14, 37, 30, 0.72), rgba(11, 31, 25, 0.35));
  backdrop-filter: blur(10px);
}
.brand-block { padding: 0 6px 38px; }
.brand {
  display: inline-block;
  font-family: var(--serif);
  font-size: 46px;
  line-height: 0.9;
  letter-spacing: -0.055em;
  color: var(--text);
  text-decoration: none;
}
.brand span { color: var(--amber); }
.tagline { margin: 14px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted-2); }
.nav { display: flex; flex-direction: column; gap: 5px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.nav-item svg { width: 18px; height: 18px; opacity: 0.8; }
.nav-item:hover { background: rgba(255, 255, 255, 0.035); color: var(--text); }
.nav-item.is-active { background: rgba(255, 255, 255, 0.055); border-color: var(--line); color: var(--text); }
.nav-item.is-active svg { color: var(--accent); opacity: 1; }
.sidebar-foot { margin-top: auto; padding: 0 6px; display: grid; gap: 14px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); box-shadow: 0 0 0 3px rgba(113, 135, 124, 0.14); }
.status[data-state="on"] { color: var(--green); }
.status[data-state="on"] .status-dot { background: var(--green); box-shadow: 0 0 0 3px rgba(125, 211, 160, 0.14); }
.status[data-state="blocked"] { color: var(--red); }
.status[data-state="blocked"] .status-dot { background: var(--red); box-shadow: 0 0 0 3px rgba(239, 154, 138, 0.14); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  padding: 0 46px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 31, 25, 0.72);
  backdrop-filter: blur(16px);
}
.crumb { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.next-mini { font-size: 12px; color: var(--muted-2); }
.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  transition: 0.18s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.06); }
.icon-btn svg { width: 17px; height: 17px; }

.views { width: 100%; max-width: 1220px; margin: 0 auto; padding: 46px 46px 80px; flex: 1; }
.view { display: none; }
.view.is-active { display: block; animation: rise 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 48px; margin-bottom: 34px; }
.view-head h1 {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: clamp(38px, 4.3vw, 58px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.view-head h1 em { color: var(--amber); font-weight: 400; }
.view-head.compact h1 { font-size: clamp(38px, 4vw, 52px); }
.lede { max-width: 390px; margin: 0; font-size: 14px; line-height: 1.65; color: var(--muted); }
.view-head.compact .lede { max-width: 420px; }

/* Today ---------------------------------------------------------------- */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.78fr); gap: 18px; align-items: stretch; }
.word-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 448px;
  padding: 30px 34px 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    radial-gradient(700px 300px at 18% 0%, rgba(143, 179, 255, 0.11), transparent 70%),
    linear-gradient(145deg, rgba(23, 56, 45, 0.95), rgba(15, 40, 32, 0.95));
  box-shadow: var(--shadow);
}
.word-card::after {
  content: "sõna";
  position: absolute;
  right: -20px;
  bottom: -54px;
  font-family: var(--serif);
  font-size: 230px;
  line-height: 1;
  letter-spacing: -0.07em;
  color: rgba(242, 236, 220, 0.026);
  pointer-events: none;
}
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; position: relative; z-index: 1; }
.card-top-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.card-tools { display: flex; align-items: center; gap: 5px; }
.card-tool { width: 32px; height: 32px; background: rgba(255, 255, 255, 0.04); }
.card-tool svg { width: 15px; height: 15px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}
.tier-1 { color: var(--green); border-color: rgba(125, 211, 160, 0.24); background: rgba(125, 211, 160, 0.07); }
.tier-2 { color: var(--accent); border-color: rgba(143, 179, 255, 0.24); background: rgba(143, 179, 255, 0.07); }
.tier-3 { color: var(--amber); border-color: rgba(231, 180, 106, 0.24); background: rgba(231, 180, 106, 0.07); }

.word-main { position: relative; z-index: 1; margin-top: 42px; flex: 1; }
.word-est {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(58px, 8.2vw, 104px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.94;
  overflow-wrap: anywhere;
}
.translation-wrap { min-height: 70px; margin-top: 18px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.translation {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.2;
  color: var(--amber);
  overflow-wrap: anywhere;
  transition: filter 0.35s ease, opacity 0.35s ease, transform 0.35s ease;
}
.translation.is-hidden { filter: blur(11px); opacity: 0.2; transform: translateY(6px); user-select: none; }
.word-card.is-revealed .translation { filter: none; opacity: 1; transform: none; }
.reveal-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.reveal-btn svg { width: 15px; height: 15px; transition: transform 0.2s ease; }
.reveal-btn:hover { color: var(--text); }
.reveal-btn:hover svg { transform: translateX(3px); }
.word-card.is-revealed .reveal-btn { display: none; }

.word-meta { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.word-meta span {
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.word-actions { position: relative; z-index: 1; display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.word-foot { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted-2); }

.slideshow-bar { display: none; position: relative; z-index: 1; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.word-card.is-slideshow .slideshow-bar { display: flex; }
.slideshow-state { display: flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: 0.02em; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(231, 180, 106, 0.14); animation: live-pulse 1.8s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.slideshow-bar-actions { display: flex; align-items: center; gap: 15px; }
.slideshow-progress { display: none; position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; height: 3px; background: rgba(255, 255, 255, 0.06); }
.word-card.is-slideshow .slideshow-progress { display: block; }
.slideshow-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--accent), var(--amber)); }
@keyframes slideshow-countdown { from { width: 0; } to { width: 100%; } }

/* Presentation: native fullscreen and the CSS fallback share one layout. */
.word-card:fullscreen,
.word-card.is-presenting {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  padding: clamp(24px, 3.5vw, 58px);
  overflow: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background:
    radial-gradient(1100px 600px at 20% 0%, rgba(143, 179, 255, 0.13), transparent 70%),
    linear-gradient(145deg, #163b2e, #0c241c);
}
.word-card:fullscreen::backdrop { background: #0c241c; }
.word-card.is-presenting { position: fixed; inset: 0; z-index: 80; }
body.presentation-open { overflow: hidden; }
.word-card:fullscreen .word-main,
.word-card.is-presenting .word-main {
  min-height: 0;
  margin-top: clamp(18px, 4vh, 42px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.word-card:fullscreen .word-est,
.word-card.is-presenting .word-est { font-size: clamp(72px, 12vw, 220px); line-height: 0.9; }
.word-card:fullscreen .translation-wrap,
.word-card.is-presenting .translation-wrap { min-height: 90px; margin-top: 24px; }
.word-card:fullscreen .translation,
.word-card.is-presenting .translation { font-size: clamp(30px, 3.6vw, 64px); }
.word-card:fullscreen .word-actions,
.word-card.is-presenting .word-actions { margin-top: clamp(22px, 4vh, 46px); gap: 14px; }
.word-card:fullscreen .word-actions .btn,
.word-card.is-presenting .word-actions .btn { min-height: 62px; padding: 0 30px; border-radius: 16px; font-size: 18px; }
.word-card:fullscreen .word-actions .btn svg,
.word-card.is-presenting .word-actions .btn svg { width: 20px; height: 20px; }
.word-card:fullscreen .word-meta span,
.word-card.is-presenting .word-meta span { padding: 7px 11px; font-size: 12px; }
.word-card:fullscreen .word-foot,
.word-card.is-presenting .word-foot { margin-top: auto; padding-top: 20px; font-size: 13px; }
.word-card:fullscreen .card-tool,
.word-card.is-presenting .card-tool { width: 44px; height: 44px; }
.word-card:fullscreen .card-tool svg,
.word-card.is-presenting .card-tool svg { width: 20px; height: 20px; }
.word-card:fullscreen .eyebrow,
.word-card.is-presenting .eyebrow { font-size: 12px; }
.word-card:fullscreen .slideshow-bar,
.word-card.is-presenting .slideshow-bar { font-size: 13px; margin-top: 18px; }
.word-card:fullscreen .slideshow-bar-actions .link,
.word-card.is-presenting .slideshow-bar-actions .link { font-size: 13px; }
.word-card:fullscreen .slideshow-progress,
.word-card.is-presenting .slideshow-progress { height: 6px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: #0a1a15; }
.btn.primary:hover { background: #b3caff; }
.btn.ghost { border-color: var(--line); background: rgba(255, 255, 255, 0.035); color: var(--text); }
.btn.ghost:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.07); }
.btn.small { min-height: 36px; padding: 0 13px; font-size: 12px; }
.btn.wide { width: 100%; }
.btn.danger-outline { border-color: rgba(239, 154, 138, 0.35); background: transparent; color: var(--red); }
.btn.danger-outline:hover { background: rgba(239, 154, 138, 0.08); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.today-panel { display: flex; flex-direction: column; gap: 12px; }
.next-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(23, 56, 45, 0.8), rgba(15, 40, 32, 0.72));
}
.next-card-top { display: flex; align-items: center; justify-content: space-between; }
.next-icon { width: 17px; height: 17px; color: var(--amber); }
.countdown { display: block; margin-top: 22px; font-family: var(--serif); font-size: 42px; font-weight: 400; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.next-card .muted { display: block; margin-top: 8px; font-size: 12px; }
.next-track { height: 3px; margin-top: 18px; border-radius: 3px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.next-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--amber)); transition: width 0.8s linear; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); }
.stats-grid div { padding: 16px 12px; background: rgba(18, 46, 37, 0.92); }
.stats-grid strong { display: block; font-family: var(--serif); font-size: 24px; font-weight: 400; line-height: 1; }
.stats-grid span { display: block; margin-top: 6px; font-size: 10px; line-height: 1.3; color: var(--muted-2); }
.schedule-strip { padding: 17px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(18, 46, 37, 0.55); }
.strip-head { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 600; color: var(--muted); }
.mini-dots { display: flex; align-items: center; gap: 5px; margin: 14px 0 10px; }
.mini-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); }
.mini-dot.on { background: var(--accent); box-shadow: 0 0 8px rgba(143, 179, 255, 0.45); }
.mini-dot.next { background: var(--amber); box-shadow: 0 0 9px rgba(231, 180, 106, 0.5); }

.banner { display: flex; align-items: center; gap: 16px; margin-top: 18px; padding: 16px 18px; border: 1px solid rgba(143, 179, 255, 0.28); border-radius: 16px; background: var(--accent-soft); }
.banner-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%; background: rgba(143, 179, 255, 0.16); color: var(--accent); }
.banner-copy { flex: 1; min-width: 0; }
.banner-copy strong { display: block; font-size: 13px; }
.banner-copy p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 56px; padding-top: 30px; border-top: 1px solid var(--line); }
.how-num { font-family: var(--serif); font-size: 12px; color: var(--amber); }
.how-item h3 { margin: 10px 0 8px; font-family: var(--serif); font-size: 18px; font-weight: 400; }
.how-item p { margin: 0; font-size: 12px; line-height: 1.7; color: var(--muted); }

/* Words ---------------------------------------------------------------- */
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.search-field { position: relative; flex: 1 1 260px; display: flex; align-items: center; }
.search-field svg { position: absolute; left: 13px; width: 16px; height: 16px; color: var(--muted-2); pointer-events: none; }
.search-field input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 13px;
}
.search-field input::placeholder { color: var(--muted-2); }
.search-field input:focus { border-color: rgba(143, 179, 255, 0.5); box-shadow: 0 0 0 3px rgba(143, 179, 255, 0.1); }
select {
  height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background-color: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}
select:focus { border-color: rgba(143, 179, 255, 0.5); }
option { background: #14342a; color: var(--text); }

.table-wrap { overflow: visible; border: 1px solid var(--line); border-radius: 16px; background: rgba(18, 46, 37, 0.55); }
.word-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.word-table th {
  position: sticky;
  top: 66px;
  z-index: 2;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #122e25;
  text-align: left;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
}
.word-table td { padding: 11px 16px; border-bottom: 1px solid rgba(238, 233, 214, 0.06); color: var(--muted); vertical-align: middle; }
.word-table tbody tr { cursor: pointer; transition: background 0.14s ease; }
.word-table tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
.word-table tbody tr:last-child td { border-bottom: 0; }
.word-table .et { font-family: var(--serif); font-size: 16px; color: var(--text); white-space: nowrap; }
.word-table .en { color: var(--text); overflow-wrap: anywhere; }
.word-table .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted-2); }
.status-pill { display: inline-flex; padding: 3px 7px; border-radius: 5px; font-size: 9px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.status-new { background: rgba(255, 255, 255, 0.055); color: var(--muted); }
.status-learning { background: rgba(231, 180, 106, 0.12); color: var(--amber); }
.status-known { background: rgba(125, 211, 160, 0.12); color: var(--green); }
.empty { padding: 46px 18px; text-align: center; color: var(--muted-2); font-size: 13px; }
.words-sentinel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted-2);
}
.words-sentinel.is-hidden { display: none; }
.words-sentinel .link { font-size: 12px; }
.words-footer { display: flex; align-items: center; justify-content: flex-start; gap: 16px; margin-top: 12px; font-size: 11px; color: var(--muted-2); }

/* Settings ------------------------------------------------------------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(18, 46, 37, 0.55); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.panel-head h2 { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 400; }
.panel-kicker { font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); }
.field { padding: 16px 0; border-top: 1px solid var(--line); }
.field:first-of-type { border-top: 0; padding-top: 0; }
.field > label, .field-label-row label { font-size: 12px; font-weight: 600; color: var(--text); }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.field-label-row output { font-size: 12px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.time-row { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
input[type="time"], input[type="number"] {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
input[type="time"]:focus, input[type="number"]:focus { border-color: rgba(143, 179, 255, 0.5); }
input[type="time"] { width: 118px; }
.dash { font-size: 11px; color: var(--muted-2); }
.hint { margin: 8px 0 0; font-size: 11px; line-height: 1.55; color: var(--muted-2); }
input[type="range"] { width: 100%; height: 4px; margin: 7px 0 0; accent-color: var(--accent); cursor: pointer; }
.range-ends { display: flex; justify-content: space-between; margin-top: 5px; font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2); }

.segmented { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: rgba(0, 0, 0, 0.12); }
.segmented button { flex: 1; padding: 8px 6px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 600; cursor: pointer; transition: 0.16s ease; }
.segmented button:hover { color: var(--text); }
.segmented button.is-active { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2); }

.schedule-preview { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.preview-times { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.preview-times span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }

.check-list { display: grid; gap: 9px; }
.check { display: flex; align-items: flex-start; gap: 11px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; transition: 0.16s ease; }
.check:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.025); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box { position: relative; flex: 0 0 auto; width: 17px; height: 17px; margin-top: 2px; border: 1px solid var(--line-strong); border-radius: 5px; background: rgba(0, 0, 0, 0.12); }
.check input:checked + .check-box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .check-box::after { content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid #0b1f19; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.check-copy { display: grid; gap: 2px; }
.check-copy strong { font-size: 12px; }
.check-copy small { font-size: 10px; color: var(--muted-2); }

.presets { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--line); }
.presets span { font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); }
.presets .link { font-size: 11px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.chips button { min-width: 40px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer; }
.chips button:hover { border-color: var(--line-strong); color: var(--text); }
.chips button.is-active { background: var(--accent-soft); border-color: rgba(143, 179, 255, 0.4); color: var(--accent); }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-top: 1px solid var(--line); cursor: pointer; }
.switch-row:first-of-type { border-top: 0; padding-top: 0; }
.switch-row span:first-child { display: grid; gap: 2px; }
.switch-row strong { font-size: 12px; font-weight: 600; }
.switch-row small { font-size: 10px; color: var(--muted-2); }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; flex: 0 0 auto; width: 38px; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); transition: 0.18s ease; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: 0.18s ease; }
.switch-row input:checked + .switch { background: rgba(143, 179, 255, 0.5); }
.switch-row input:checked + .switch::after { transform: translateX(16px); background: #fff; }

.field.inline { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); }
.inline-input { display: flex; align-items: center; gap: 7px; }
.inline-input input { width: 64px; }
.inline-input span { font-size: 11px; color: var(--muted-2); }

.permission-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; }
.permission-state { font-size: 12px; color: var(--muted); }
.permission-state.ok { color: var(--green); }
.permission-state.bad { color: var(--red); }
.diagnostics {
  margin: 14px 0 0;
  padding: 12px;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.progress-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); margin-bottom: 16px; }
.progress-summary div { padding: 15px 10px; background: rgba(0, 0, 0, 0.12); }
.progress-summary strong { display: block; font-family: var(--serif); font-size: 24px; font-weight: 400; line-height: 1; }
.progress-summary span { display: block; margin-top: 5px; font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); }

/* Stats & account ------------------------------------------------------ */
.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.18s ease;
}
.account-btn:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.06); }
.account-btn svg { width: 15px; height: 15px; }
.account-btn.is-signed-in { color: var(--green); border-color: rgba(125, 211, 160, 0.25); }

.stat-cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat-card { padding: 16px 15px; border: 1px solid var(--line); border-radius: 15px; background: rgba(18, 46, 37, 0.55); }
.stat-label { display: block; font-size: 9px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.stat-card strong { display: block; margin-top: 10px; font-family: var(--serif); font-size: 30px; font-weight: 400; line-height: 1; }
.stat-card small { display: block; margin-top: 5px; font-size: 10px; line-height: 1.4; color: var(--muted-2); }

.stats-columns { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.chart-wrap { width: 100%; min-height: 220px; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: rgba(238, 233, 214, 0.09); stroke-width: 1; }
.chart-label { fill: var(--muted-2); font-family: var(--sans); font-size: 10px; }
.chart-bar { fill: var(--accent); opacity: 0.85; transition: opacity 0.15s ease, fill 0.15s ease; }
.chart-bar:hover { fill: var(--amber); opacity: 1; }
.chart-bar.today { fill: var(--amber); }
.chart-empty { fill: var(--muted-2); font-family: var(--serif); font-size: 16px; }
.range-tabs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, 0.12); }
.range-tabs button { padding: 5px 8px; border: 0; border-radius: 6px; background: none; color: var(--muted-2); font-size: 10px; font-weight: 600; cursor: pointer; }
.range-tabs button:hover { color: var(--text); }
.range-tabs button.is-active { background: var(--surface-2); color: var(--text); }

.heatmap { display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 4px; }
.heat-cell { aspect-ratio: 1; min-height: 12px; border-radius: 3px; border: 1px solid rgba(238, 233, 214, 0.05); background: rgba(255, 255, 255, 0.035); }
.heat-cell[data-level="1"] { background: rgba(125, 211, 160, 0.15); }
.heat-cell[data-level="2"] { background: rgba(125, 211, 160, 0.3); }
.heat-cell[data-level="3"] { background: rgba(125, 211, 160, 0.48); }
.heat-cell[data-level="4"] { background: rgba(125, 211, 160, 0.7); }
.heat-cell.is-future { opacity: 0.22; }
.heatmap-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 12px; font-size: 9px; color: var(--muted-2); }
.heatmap-legend i { width: 10px; height: 10px; border-radius: 2px; background: rgba(125, 211, 160, 0.2); }
.heatmap-legend i:nth-of-type(2) { background: rgba(125, 211, 160, 0.35); }
.heatmap-legend i:nth-of-type(3) { background: rgba(125, 211, 160, 0.5); }
.heatmap-legend i:nth-of-type(4) { background: rgba(125, 211, 160, 0.7); }

.breakdown { display: grid; gap: 13px; }
.breakdown-row { display: grid; gap: 5px; }
.breakdown-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); }
.breakdown-head strong { color: var(--text); font-weight: 600; }
.breakdown-track { height: 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.breakdown-fill { height: 100%; border-radius: inherit; background: var(--accent); }
.breakdown-fill.tier-1 { background: var(--green); }
.breakdown-fill.tier-2 { background: var(--accent); }
.breakdown-fill.tier-3 { background: var(--amber); }
.breakdown-title { margin: 22px 0 12px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); }

.activity-list { display: grid; }
.activity-item { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.activity-item:first-child { border-top: 0; padding-top: 0; }
.activity-icon { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto; border-radius: 8px; background: rgba(255, 255, 255, 0.05); color: var(--muted); }
.activity-icon svg { width: 14px; height: 14px; }
.activity-icon.known { color: var(--green); background: rgba(125, 211, 160, 0.1); }
.activity-icon.notification { color: var(--accent); background: rgba(143, 179, 255, 0.1); }
.activity-icon.forgot { color: var(--amber); background: rgba(231, 180, 106, 0.1); }
.activity-copy { flex: 1; min-width: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.activity-copy strong { color: var(--text); font-weight: 600; }
.activity-time { flex: 0 0 auto; font-size: 10px; color: var(--muted-2); white-space: nowrap; }

.account-panel { min-height: 260px; }
.account-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.account-head svg { width: 18px; height: 18px; color: var(--amber); }
.account-title { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 400; }
.account-panel p { font-size: 12px; line-height: 1.65; color: var(--muted); }
.account-panel .btn { margin-top: 6px; }
.account-card { width: min(440px, 100%); }
.account-card h2 { font-size: 34px; }
.account-intro { margin: 8px 0 20px; font-size: 12px; line-height: 1.65; color: var(--muted); }
.account-form { display: grid; gap: 12px; }
.account-form label { display: grid; gap: 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
.account-form input {
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
}
.account-form input:focus { border-color: rgba(143, 179, 255, 0.5); }
.account-form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.account-message { min-height: 18px; margin: 12px 0 4px; font-size: 11px; color: var(--red); }
.account-message.ok { color: var(--green); }
.account-who { margin: 18px 0 4px; font-size: 13px; color: var(--text); }
.account-who strong { font-family: var(--serif); font-size: 22px; font-weight: 400; }
.account-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 14px; }

.leaderboard { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.leaderboard-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.leaderboard-head h3 { margin: 0; font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); }
.leaderboard-list { display: grid; gap: 2px; }
.leaderboard-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 7px; font-size: 11px; color: var(--muted); }
.leaderboard-row:nth-child(odd) { background: rgba(255, 255, 255, 0.025); }
.leaderboard-row.is-me { background: rgba(143, 179, 255, 0.1); color: var(--text); }
.leaderboard-rank { font-family: var(--serif); color: var(--muted-2); }
.leaderboard-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-count { color: var(--green); font-variant-numeric: tabular-nums; }
.leaderboard-empty { padding: 12px 0; font-size: 11px; line-height: 1.6; color: var(--muted-2); }

/* About ---------------------------------------------------------------- */
.about-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 16px; align-items: start; }
.about-grid .panel:first-child { grid-row: span 2; }
.prose h2 { margin: 0 0 12px; font-family: var(--serif); font-size: 21px; font-weight: 400; }
.prose h2:not(:first-child) { margin-top: 26px; }
.prose p { margin: 0 0 12px; font-size: 13px; line-height: 1.75; color: var(--muted); }
.prose em { color: var(--text); }
.sources, .notes { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.sources li, .notes li { font-size: 12px; line-height: 1.65; color: var(--muted); padding-left: 14px; position: relative; }
.sources li::before, .notes li::before { content: ""; position: absolute; left: 0; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--amber); }
.sources strong, .notes strong { color: var(--text); }
.notes li::before { background: var(--accent); }

.foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 46px 26px; border-top: 1px solid var(--line); font-size: 10px; letter-spacing: 0.04em; color: var(--muted-2); }

/* Mobile nav, toast, modal --------------------------------------------- */
.mobile-nav { display: none; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 100;
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #17382d;
  color: var(--text);
  font-size: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: 0.22s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 14, 10, 0.72);
  backdrop-filter: blur(8px);
}
.modal-card {
  position: relative;
  width: min(480px, 100%);
  padding: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: #14342a;
  box-shadow: var(--shadow);
}
.modal-close { position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.modal-close:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.modal-card h2 { margin: 10px 0 4px; font-family: var(--serif); font-size: 42px; font-weight: 400; letter-spacing: -0.03em; }
.modal-translation { margin: 0; font-family: var(--serif); font-size: 22px; color: var(--amber); }
.modal-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0; }
.modal-meta span { padding: 4px 8px; border-radius: 5px; background: rgba(255, 255, 255, 0.05); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.noscript { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 30px; background: var(--bg); font-size: 15px; color: var(--text); }

/* Responsive ----------------------------------------------------------- */
@media (max-width: 1060px) {
  .view-head { display: block; }
  .lede { max-width: none; margin-top: 12px; }
  .hero-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-columns { grid-template-columns: 1fr; }
  .today-panel { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .today-panel .schedule-strip { grid-column: 1 / -1; }
  .today-panel .fineprint { grid-column: 1 / -1; }
  .about-grid { grid-template-columns: 1fr; }
  .about-grid .panel:first-child { grid-row: auto; }
}

@media (max-width: 900px) {
  .shell { display: block; }
  .word-table th { top: 58px; }
  .sidebar { display: none; }
  .topbar { padding: 0 18px; height: 58px; }
  .next-mini { display: none; }
  .views { padding: 28px 18px 92px; }
  .view-head { display: block; margin-bottom: 24px; }
  .view-head h1 { font-size: 38px; }
  .lede { max-width: none; margin-top: 12px; }
  .word-card { min-height: 390px; padding: 24px 22px 20px; border-radius: 20px; }
  .word-main { margin-top: 32px; }
  .word-est { font-size: clamp(52px, 16vw, 78px); }
  .today-panel { grid-template-columns: 1fr; }
  .how { grid-template-columns: 1fr; gap: 22px; margin-top: 38px; }
  .settings-grid { grid-template-columns: 1fr; }
  .foot { display: none; }
  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    justify-content: space-around;
    padding: 8px 8px max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(11, 31, 25, 0.92);
    backdrop-filter: blur(18px);
  }
  .mobile-nav button { display: grid; justify-items: center; gap: 4px; min-width: 52px; padding: 6px; border: 0; background: none; color: var(--muted-2); font-size: 9px; font-weight: 600; cursor: pointer; }
  .mobile-nav button svg { width: 19px; height: 19px; }
  .mobile-nav button.is-active { color: var(--text); }
  .mobile-nav button.is-active svg { color: var(--accent); }
  .toast { bottom: 84px; }
  .modal-card { padding: 24px; }
  .modal-card h2 { font-size: 36px; }
}

@media (max-width: 560px) {
  .topbar { padding: 0 14px; }
  .account-btn { width: 36px; padding: 0; justify-content: center; }
  .account-btn span { display: none; }
  .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .views { padding-left: 14px; padding-right: 14px; }
  .view-head h1 { font-size: 34px; }
  .word-est { font-size: 54px; }
  .translation-wrap { min-height: 54px; gap: 8px; }
  .word-actions .btn { flex: 1; }
  .stats-grid strong { font-size: 21px; }
  .filters select { flex: 1; min-width: 0; }
  .search-field { flex-basis: 100%; }
  .word-table th:nth-child(4), .word-table td:nth-child(4), .word-table th:nth-child(5), .word-table td:nth-child(5) { display: none; }
  .panel { padding: 19px; }
  .banner { align-items: flex-start; flex-wrap: wrap; }
  .banner .btn { width: 100%; }
}

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