/* Study Verse Lab — premium study interface
   Warm paper, sage, muted lavender, soft blue. Light and dark are designed
   independently rather than inverted. */

:root {
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, ui-serif, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: #f6f1e7;
  --bg-deep: #ece4d4;
  --surface: rgba(255, 252, 246, 0.78);
  --surface-solid: #fffdf8;
  --surface-raised: #fffaf0;
  --ink: #2b2a26;
  --ink-soft: #5d5a52;
  --muted: #8a857a;
  --line: rgba(43, 42, 38, 0.1);
  --line-strong: rgba(43, 42, 38, 0.18);
  --sage: #607f66;
  --sage-bright: #7d9d82;
  --sage-soft: #dfe8dc;
  --lav: #74658f;
  --lav-bright: #9182ad;
  --lav-soft: #e7e1ef;
  --blue: #65879b;
  --blue-soft: #dde8ee;
  --gold: #a98544;
  --gold-soft: #f0e4cb;
  --danger: #a4554b;
  --danger-soft: #f3e1de;
  --ok: #5f8168;
  --shadow: 0 24px 60px -32px rgba(61, 50, 32, 0.38);
  --shadow-soft: 0 10px 30px -18px rgba(61, 50, 32, 0.28);
  --ring-track: rgba(43, 42, 38, 0.09);
  --nav-bg: rgba(255, 252, 246, 0.86);
  --backdrop: rgba(35, 32, 26, 0.38);
  --grain-opacity: 0.035;
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 13px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html[data-theme="dark"] {
  --bg: #121318;
  --bg-deep: #0b0c10;
  --surface: rgba(28, 29, 36, 0.78);
  --surface-solid: #1b1c23;
  --surface-raised: #22232c;
  --ink: #f1ece1;
  --ink-soft: #c6c0b4;
  --muted: #918c81;
  --line: rgba(241, 236, 225, 0.1);
  --line-strong: rgba(241, 236, 225, 0.2);
  --sage: #9cb89e;
  --sage-bright: #b0c9b2;
  --sage-soft: rgba(112, 148, 116, 0.18);
  --lav: #b4a5d1;
  --lav-bright: #c6b8e0;
  --lav-soft: rgba(140, 122, 179, 0.17);
  --blue: #9dbccb;
  --blue-soft: rgba(115, 153, 172, 0.16);
  --gold: #d5b67c;
  --gold-soft: rgba(196, 158, 91, 0.15);
  --danger: #d99185;
  --danger-soft: rgba(180, 90, 78, 0.18);
  --ok: #9fc2a6;
  --shadow: 0 30px 80px -42px rgba(0, 0, 0, 0.9);
  --shadow-soft: 0 14px 36px -22px rgba(0, 0, 0, 0.8);
  --ring-track: rgba(241, 236, 225, 0.11);
  --nav-bg: rgba(24, 25, 31, 0.86);
  --backdrop: rgba(0, 0, 0, 0.55);
  --grain-opacity: 0.055;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--sage); text-decoration: none; }
img { max-width: 100%; display: block; }
svg { display: block; }
.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.i .fill, .i path.fill { fill: currentColor; stroke: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ sky */
.sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.sky::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(90% 55% at 8% -10%, color-mix(in srgb, var(--sage-soft) 72%, transparent) 0%, transparent 62%),
    radial-gradient(70% 45% at 105% 6%, color-mix(in srgb, var(--lav-soft) 70%, transparent) 0%, transparent 60%),
    radial-gradient(100% 60% at 50% 112%, color-mix(in srgb, var(--blue-soft) 60%, transparent) 0%, transparent 62%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 130%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(38px); opacity: 0.55; }
.orb-a { width: 220px; height: 220px; left: -80px; top: 18%; background: var(--sage-soft); }
.orb-b { width: 260px; height: 260px; right: -110px; top: 46%; background: var(--lav-soft); }
.orb-c { width: 200px; height: 200px; left: 30%; bottom: -90px; background: var(--blue-soft); }
.stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.2px 1.2px at 18% 14%, color-mix(in srgb, var(--gold) 70%, transparent) 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 9%, color-mix(in srgb, var(--ink) 35%, transparent) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 84% 28%, color-mix(in srgb, var(--lav) 55%, transparent) 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 32%, color-mix(in srgb, var(--blue) 45%, transparent) 50%, transparent 51%),
    radial-gradient(1.1px 1.1px at 56% 22%, color-mix(in srgb, var(--gold) 45%, transparent) 50%, transparent 51%),
    radial-gradient(1px 1px at 9% 52%, color-mix(in srgb, var(--ink) 28%, transparent) 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 92% 61%, color-mix(in srgb, var(--sage) 50%, transparent) 50%, transparent 51%),
    radial-gradient(1px 1px at 44% 76%, color-mix(in srgb, var(--lav) 40%, transparent) 50%, transparent 51%);
  opacity: 0.9;
}

/* --------------------------------------------------------------- splash */
.splash {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; background: var(--bg); text-align: center; padding: 32px;
}
.splash-mark {
  width: 84px; height: 84px; color: var(--sage);
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, var(--surface-solid), var(--sage-soft));
  box-shadow: var(--shadow-soft), inset 0 0 0 1px var(--line);
  animation: breathe 3.2s ease-in-out infinite;
}
.splash-mark svg { width: 54px; height: 54px; }
.splash-name { font-family: var(--font-display); font-size: 25px; letter-spacing: 0.01em; margin: 14px 0 0; }
.splash-line { color: var(--muted); font-size: 14px; margin: 2px 0 0; }
@keyframes breathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-5px) scale(1.02); } }

/* ---------------------------------------------------------------- shell */
.app { position: relative; z-index: 1; max-width: 620px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(112px + var(--safe-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(14px + var(--safe-top)) 20px 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 88%, transparent) 55%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; color: var(--sage);
  background: radial-gradient(circle at 34% 28%, var(--surface-solid), var(--sage-soft));
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-soft);
}
.brand-mark svg { width: 25px; height: 25px; }
.brand-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.22; }
.brand-kicker { font-size: 10px; font-weight: 700; letter-spacing: 0.17em; text-transform: uppercase; color: var(--muted); }
.brand-sub { font-family: var(--font-display); font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 430px) {
  .brand-sub { display: none; }
  .brand-kicker { font-size: 11.5px; letter-spacing: 0.14em; }
}
.icon-btn {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-soft); backdrop-filter: blur(12px);
  transition: transform 0.18s ease, background 0.18s ease;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn .i { width: 20px; height: 20px; }

.main { padding: 4px 18px 0; }
.page { animation: pageIn 0.42s cubic-bezier(0.22, 0.8, 0.3, 1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- headings */
.kicker {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--sage); margin: 0 0 8px;
}
.kicker::before { content: ""; width: 18px; height: 1px; background: currentColor; opacity: 0.7; }
.display { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.015em; line-height: 1.1; margin: 0; font-size: clamp(27px, 7vw, 34px); }
.display em { font-style: italic; color: var(--lav); }
.sub { color: var(--muted); font-size: 14.5px; line-height: 1.55; margin: 8px 0 0; max-width: 42ch; }
.page-head { padding: 10px 2px 18px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 26px 2px 11px; }
.section-head h2 { font-family: var(--font-display); font-size: 20px; font-weight: 500; margin: 0; letter-spacing: -0.01em; }
.section-head .link { font-size: 12.5px; font-weight: 600; color: var(--muted); background: none; border: 0; padding: 2px; }
.section-head .link:hover { color: var(--sage); }

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  padding: 20px;
}
.card-flat { background: var(--surface-solid); box-shadow: none; }
.card-hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--lav-soft) 85%, transparent) 0%, transparent 58%),
    radial-gradient(120% 120% at 0% 100%, color-mix(in srgb, var(--sage-soft) 85%, transparent) 0%, transparent 60%),
    var(--surface);
}
.card-hero::after {
  content: ""; position: absolute; width: 150px; height: 150px; right: -58px; top: -64px;
  border-radius: 50%; border: 1px solid color-mix(in srgb, var(--gold) 32%, transparent);
  box-shadow: 0 0 0 22px color-mix(in srgb, var(--gold) 6%, transparent);
  pointer-events: none;
}
.card + .card { margin-top: 14px; }

/* ----------------------------------------------------------------- home */
.hero-greet { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.hero-greet .display { max-width: 12ch; }
.hero-date { font-size: 12.5px; color: var(--muted); text-align: right; line-height: 1.4; padding-top: 5px; white-space: nowrap; }
.focus-hero { display: flex; align-items: center; gap: 18px; padding: 22px 20px; }
.focus-hero .ring-wrap { flex: 0 0 auto; }
.focus-hero-copy { min-width: 0; flex: 1; }
.focus-hero-copy .label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.focus-hero-copy .value { font-family: var(--font-display); font-size: 32px; line-height: 1.05; margin: 3px 0 2px; }
.focus-hero-copy .value small { font-family: var(--font-ui); font-size: 12px; color: var(--muted); letter-spacing: 0; margin-inline-start: 3px; }
.focus-hero-copy .hint { color: var(--muted); font-size: 12.5px; margin: 0; }
.hero-actions { display: flex; gap: 9px; margin-top: 14px; flex-wrap: wrap; }

.ring { --size: 96px; --stroke: 7; --pct: 0; width: var(--size); height: var(--size); position: relative; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--ring-track); stroke-width: var(--stroke); }
.ring .value { fill: none; stroke: url(#ringGradient); stroke-width: var(--stroke); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--pct)); transition: stroke-dashoffset 0.8s cubic-bezier(0.22, 0.8, 0.3, 1); }
.ring .inner { position: relative; text-align: center; line-height: 1.05; }
.ring .inner strong { display: block; font-family: var(--font-display); font-size: 25px; font-weight: 500; }
.ring .inner span { font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.ring-lg { --size: 274px; --stroke: 9; }
.ring-lg .inner strong { font-size: 64px; letter-spacing: -0.03em; }
.ring-lg .inner span { font-size: 11px; letter-spacing: 0.2em; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 14px 15px; display: flex; align-items: center; gap: 11px; box-shadow: var(--shadow-soft);
}
.stat-ico { width: 35px; height: 35px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; }
.stat-ico .i { width: 18px; height: 18px; }
.stat-ico.sage { background: var(--sage-soft); color: var(--sage); }
.stat-ico.lav { background: var(--lav-soft); color: var(--lav); }
.stat-ico.blue { background: var(--blue-soft); color: var(--blue); }
.stat-ico.gold { background: var(--gold-soft); color: var(--gold); }
.stat b { display: block; font-family: var(--font-display); font-size: 22px; font-weight: 500; line-height: 1.1; }
.stat span { font-size: 11px; color: var(--muted); letter-spacing: 0.02em; }

.week { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; height: 96px; padding: 6px 2px 0; }
.week-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.week-bar { width: 100%; max-width: 22px; min-height: 4px; border-radius: 7px; background: linear-gradient(180deg, var(--sage-bright), var(--sage)); opacity: 0.55; transition: height 0.6s cubic-bezier(0.22, 0.8, 0.3, 1); }
.week-col.today .week-bar { opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 12%, transparent); }
.week-col span { font-size: 9.5px; color: var(--muted); letter-spacing: 0.04em; }
.week-col.today span { color: var(--sage); font-weight: 700; }

/* ---------------------------------------------------------------- tasks */
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 14px; border-radius: var(--radius-md);
  background: var(--surface-solid); border: 1px solid var(--line);
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.task:active { transform: scale(0.992); }
.task-check {
  width: 23px; height: 23px; flex: 0 0 auto; margin-top: 1px;
  border-radius: 50%; border: 1.6px solid var(--line-strong); background: transparent;
  display: grid; place-items: center; color: transparent; transition: all 0.18s ease;
}
.task-check .i { width: 14px; height: 14px; stroke-width: 2.2; }
.task.done .task-check { background: var(--sage); border-color: var(--sage); color: var(--surface-solid); }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 14.5px; font-weight: 550; line-height: 1.35; overflow-wrap: anywhere; }
.task-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 4px; font-size: 11px; color: var(--muted); }
.task-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.5; }
.task-meta .overdue { color: var(--danger); font-weight: 650; }
.task-prio { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; margin-top: 7px; }
.prio-1 { background: var(--danger); }
.prio-2 { background: var(--gold); }
.prio-3 { background: var(--blue); }
.task-actions { display: flex; gap: 4px; }
.task-del { width: 28px; height: 28px; border: 0; background: transparent; color: var(--muted); border-radius: 8px; display: grid; place-items: center; opacity: 0.6; }
.task-del .i { width: 16px; height: 16px; }

/* --------------------------------------------------------------- empty */
.empty { text-align: center; padding: 34px 20px 30px; }
.empty-art { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; color: var(--sage); background: radial-gradient(circle at 32% 28%, var(--surface-solid), var(--sage-soft)); box-shadow: inset 0 0 0 1px var(--line); position: relative; }
.empty-art::after { content: ""; position: absolute; inset: -11px; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--gold) 36%, transparent); }
.empty-art .i { width: 34px; height: 34px; }
.empty h3 { font-family: var(--font-display); font-size: 21px; font-weight: 500; margin: 0 0 5px; }
.empty p { color: var(--muted); font-size: 13px; margin: 0 auto; max-width: 32ch; line-height: 1.55; }

/* ------------------------------------------------------------ motivation */
.quote-card { position: relative; overflow: hidden; padding: 24px 22px 20px; }
.quote-card::before { content: "“"; position: absolute; right: 18px; top: -18px; font-family: var(--font-display); font-size: 110px; line-height: 1; color: var(--lav); opacity: 0.12; }
.quote-card blockquote { margin: 0; font-family: var(--font-display); font-size: 21px; line-height: 1.36; letter-spacing: -0.005em; max-width: 30ch; }
.quote-card cite { display: block; margin-top: 12px; font-style: normal; font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }
.quote-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }

.youtube-card { display: flex; align-items: center; gap: 14px; padding: 16px; }
.youtube-art { width: 54px; height: 54px; border-radius: 15px; flex: 0 0 auto; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); }
.youtube-art .i { width: 24px; height: 24px; }
.youtube-copy { flex: 1; min-width: 0; }
.youtube-copy b { display: block; font-size: 14px; }
.youtube-copy span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------------------------------------------------------------- focus */
.focus-stage { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 12px 0 6px; }
.focus-clock { position: relative; margin: 14px 0 18px; filter: drop-shadow(0 24px 40px color-mix(in srgb, var(--sage) 18%, transparent)); }
.focus-clock .ring .value { stroke-width: 9; }
.focus-clock .ring .track { stroke-width: 9; }
.focus-clock .inner strong { font-variant-numeric: tabular-nums; font-size: 58px; }
.focus-state { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.focus-state.live { color: var(--sage); }
.focus-state.live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--sage); margin-right: 6px; animation: pulse 1.8s ease-in-out infinite; vertical-align: 1px; }
.focus-state.paused { color: var(--gold); }
.focus-state.paused::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-right: 6px; vertical-align: 1px; }
.focus-pill.is-paused .focus-pill-dot { background: var(--gold); animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }
.duration-row { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; margin: 4px 0 18px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  padding: 9px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  transition: all 0.16s ease; box-shadow: var(--shadow-soft);
}
.chip:active { transform: scale(0.96); }
.chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.focus-controls { display: flex; gap: 10px; width: 100%; max-width: 340px; }
.focus-controls .btn { flex: 1; }
.focus-note { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 11.5px; margin: 16px 0 0; }
.focus-note .i { width: 14px; height: 14px; }
.focus-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }

/* --------------------------------------------------------------- planner */
.week-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.week-strip::-webkit-scrollbar { display: none; }
.day-pill {
  flex: 1 0 44px; min-width: 44px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 15px; padding: 9px 4px 8px; text-align: center; color: var(--muted);
  transition: all 0.16s ease;
}
.day-pill b { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 500; color: var(--ink); line-height: 1.15; }
.day-pill span { font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; }
.day-pill i { display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--sage); margin: 4px auto 0; opacity: 0; }
.day-pill.has-tasks i { opacity: 1; }
.day-pill.today { background: var(--sage-soft); border-color: color-mix(in srgb, var(--sage) 32%, transparent); }
.day-pill.today b { color: var(--sage); }
.group { margin-top: 18px; }
.group-head { display: flex; align-items: center; gap: 8px; margin: 0 3px 8px; }
.group-head h3 { font-size: 10.5px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); margin: 0; font-weight: 700; }
.group-head .count { font-size: 10px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.group-head .rule { flex: 1; height: 1px; background: var(--line); }
.group-empty { font-size: 12px; color: var(--muted); padding: 2px 4px 4px; }

/* ---------------------------------------------------------------- radio */
.radio-hero { padding: 26px 22px; text-align: center; }
.radio-orbit { width: 132px; height: 132px; margin: 4px auto 16px; position: relative; display: grid; place-items: center; color: var(--lav); }
.radio-orbit .planet { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 32% 28%, var(--surface-solid), var(--lav-soft)); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-soft); }
.radio-orbit .planet .i { width: 30px; height: 30px; }
.radio-orbit .orbit { position: absolute; inset: 0; border: 1px solid color-mix(in srgb, var(--lav) 30%, transparent); border-radius: 50%; }
.radio-orbit .orbit::after { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); top: 14px; right: 20px; box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 14%, transparent); }
.radio-orbit .orbit.b { inset: 16px; border-style: dashed; opacity: 0.55; transform: rotate(24deg); }
.radio-hero h2 { font-family: var(--font-display); font-size: 23px; font-weight: 500; margin: 0 0 6px; }
.radio-hero p { color: var(--muted); font-size: 13px; max-width: 34ch; margin: 0 auto; line-height: 1.55; }
.track-list { display: flex; flex-direction: column; gap: 8px; }
.track {
  display: flex; align-items: center; gap: 12px; padding: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft); text-align: left; width: 100%;
}
.track-cover { width: 50px; height: 50px; border-radius: 13px; flex: 0 0 auto; object-fit: cover; background: linear-gradient(135deg, var(--sage-soft), var(--lav-soft)); display: grid; place-items: center; color: var(--lav); }
.track-cover .i { width: 20px; height: 20px; }
.track-copy { flex: 1; min-width: 0; }
.track-copy b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-copy span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-play { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-solid); color: var(--sage); display: grid; place-items: center; flex: 0 0 auto; }
.track-play .i { width: 16px; height: 16px; }
.track.is-playing { border-color: color-mix(in srgb, var(--sage) 40%, transparent); background: color-mix(in srgb, var(--sage-soft) 45%, var(--surface)); }
.player {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(92px + var(--safe-bottom)); width: min(calc(100% - 28px), 592px);
  background: var(--surface-solid); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); padding: 10px 12px; z-index: 30;
  display: flex; align-items: center; gap: 11px;
  animation: playerIn 0.35s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}
@keyframes playerIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.player-cover { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; background: var(--lav-soft); display: grid; place-items: center; color: var(--lav); flex: 0 0 auto; }
.player-copy { flex: 1; min-width: 0; }
.player-copy b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-copy span { font-size: 10.5px; color: var(--muted); }
.player-progress { position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.player-progress i { display: block; height: 100%; width: 0; background: var(--sage); transition: width 0.3s linear; }
.focus-pill {
  position: fixed; z-index: 35; left: 50%; transform: translateX(-50%);
  bottom: calc(92px + var(--safe-bottom)); display: flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--bg); border: 0; border-radius: 999px;
  padding: 9px 15px; font-size: 11.5px; font-weight: 600; box-shadow: var(--shadow);
  animation: toastIn 0.3s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}
.focus-pill b { font-variant-numeric: tabular-nums; font-size: 12.5px; letter-spacing: 0.02em; }
.focus-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sage-bright); animation: pulse 1.8s ease-in-out infinite; }
body.has-player .focus-pill { bottom: calc(158px + var(--safe-bottom)); }
.chev { width: 17px; height: 17px; color: var(--muted); flex: 0 0 auto; }

/* --------------------------------------------------------------- profile */
.profile-hero { display: flex; align-items: center; gap: 14px; padding: 20px; }
.avatar { width: 62px; height: 62px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-family: var(--font-display); font-size: 26px; color: var(--surface-solid); background: linear-gradient(145deg, var(--sage), var(--lav)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), var(--shadow-soft); }
.profile-hero b { display: block; font-family: var(--font-display); font-size: 23px; font-weight: 500; line-height: 1.15; }
.profile-hero span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.settings-card { padding: 6px 0; overflow: hidden; }
.setting { display: flex; align-items: center; gap: 12px; padding: 13px 18px; width: 100%; background: none; border: 0; text-align: left; color: var(--ink); }
.setting + .setting { border-top: 1px solid var(--line); }
.setting-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; background: var(--sage-soft); color: var(--sage); }
.setting-ico .i { width: 17px; height: 17px; }
.setting-ico.lav { background: var(--lav-soft); color: var(--lav); }
.setting-ico.blue { background: var(--blue-soft); color: var(--blue); }
.setting-ico.gold { background: var(--gold-soft); color: var(--gold); }
.setting-copy { flex: 1; min-width: 0; }
.setting-copy b { display: block; font-size: 13.5px; font-weight: 550; }
.setting-copy span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setting .chev { width: 17px; height: 17px; color: var(--muted); flex: 0 0 auto; }
.setting-value { font-size: 12px; color: var(--muted); max-width: 42%; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-foot { text-align: center; padding: 26px 0 10px; color: var(--muted); font-size: 11px; letter-spacing: 0.04em; }
.profile-foot .tagline { display: block; font-family: var(--font-display); font-style: italic; font-size: 13px; color: var(--ink-soft); margin-bottom: 4px; }

/* ------------------------------------------------------------- controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface-solid); color: var(--ink);
  padding: 12px 18px; border-radius: 14px; font-size: 13.5px; font-weight: 600;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  min-height: 46px; text-decoration: none;
}
.btn:active { transform: scale(0.975); }
.btn .i { width: 17px; height: 17px; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--bg); box-shadow: 0 14px 30px -16px color-mix(in srgb, var(--ink) 55%, transparent); }
.btn-sage { background: var(--sage); border-color: var(--sage); color: #fffdf8; box-shadow: 0 14px 30px -16px color-mix(in srgb, var(--sage) 60%, transparent); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn-sm { padding: 8px 13px; min-height: 36px; font-size: 12px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--sage); font-weight: 600; font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; }
.link-btn .i { width: 14px; height: 14px; }

.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px 2px; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface-solid);
  border-radius: 13px; padding: 12px 13px; font-size: 14px; color: var(--ink);
  outline: none; transition: border-color 0.16s ease, box-shadow 0.16s ease;
  min-height: 46px;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--sage); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 16%, transparent); }
.textarea { min-height: 96px; resize: vertical; }
.hint { font-size: 11px; color: var(--muted); margin: 5px 2px 0; line-height: 1.45; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid .field { margin-bottom: 10px; }

.segmented { display: flex; gap: 3px; padding: 3px; background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 12px; }
.segmented button { flex: 1; border: 0; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 600; padding: 7px 6px; border-radius: 9px; }
.segmented button.is-active { background: var(--surface-solid); color: var(--ink); box-shadow: 0 2px 8px -4px rgba(0,0,0,.3); }

.switch { width: 44px; height: 26px; border-radius: 999px; border: 0; background: color-mix(in srgb, var(--ink) 14%, transparent); position: relative; flex: 0 0 auto; transition: background 0.2s ease; }
.switch::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-solid); top: 3px; left: 3px; transition: transform 0.2s cubic-bezier(0.22, 0.8, 0.3, 1); box-shadow: 0 2px 5px rgba(0,0,0,.25); }
.switch[aria-checked="true"] { background: var(--sage); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
html[dir="rtl"] .switch[aria-checked="true"]::after { transform: translateX(-18px); }

.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-solid); font-size: 19px; line-height: 1; }
.stepper b { min-width: 64px; text-align: center; font-family: var(--font-display); font-size: 20px; font-weight: 500; }

/* --------------------------------------------------------------- tabbar */
.tabbar {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + var(--safe-bottom)); width: min(calc(100% - 24px), 596px);
  display: flex; gap: 2px; padding: 7px;
  background: var(--nav-bg); border: 1px solid var(--line); border-radius: 24px;
  box-shadow: var(--shadow); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 0; background: transparent; color: var(--muted); padding: 7px 2px 6px;
  border-radius: 17px; transition: color 0.18s ease, background 0.18s ease; min-width: 0;
}
.tab .i { width: 21px; height: 21px; transition: transform 0.2s ease; }
.tab span { font-size: 9.5px; font-weight: 650; letter-spacing: 0.02em; white-space: nowrap; }
.tab.is-active { color: var(--sage); background: color-mix(in srgb, var(--sage) 10%, transparent); }
.tab.is-active .i { transform: translateY(-1px); }

/* -------------------------------------------------------------- onboarding */
.onboarding { position: fixed; inset: 0; z-index: 80; background: var(--bg); overflow-y: auto; }
.onb-shell { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding: calc(22px + var(--safe-top)) 24px calc(22px + var(--safe-bottom)); }
.onb-top { display: flex; align-items: center; justify-content: space-between; }
.onb-brand { font-family: var(--font-display); font-size: 16px; letter-spacing: 0.01em; }
.onb-step { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.onb-progress { height: 3px; background: var(--line); border-radius: 3px; margin: 16px 0 0; overflow: hidden; }
.onb-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--sage), var(--lav)); border-radius: 3px; transition: width 0.4s cubic-bezier(0.22, 0.8, 0.3, 1); }
.onb-body { flex: 1; padding: 34px 0 18px; animation: pageIn 0.4s cubic-bezier(0.22, 0.8, 0.3, 1) both; }
.onb-body .display { max-width: 15ch; }
.onb-body .sub { max-width: 38ch; }
.onb-actions { display: flex; gap: 10px; padding-top: 14px; }
.onb-actions .btn { flex: 1; }
.onb-actions .btn-ghost { flex: 0 0 auto; }
.onb-art { width: 150px; height: 150px; margin: 6px auto 26px; position: relative; display: grid; place-items: center; color: var(--sage); }
.onb-art .core { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 32% 26%, var(--surface-solid), var(--sage-soft)); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-soft); }
.onb-art .core svg { width: 54px; height: 54px; }
.onb-art .o1, .onb-art .o2 { position: absolute; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--gold) 34%, transparent); }
.onb-art .o1 { inset: 0; }
.onb-art .o2 { inset: 24px; border-style: dashed; opacity: 0.6; }
.onb-art .spark { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); top: 16px; right: 24px; box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 12%, transparent); }
.lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 20px; }
.lang-opt { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 13px; padding: 11px 12px; color: var(--ink); }
.lang-opt b { display: block; font-size: 13px; font-weight: 600; }
.lang-opt span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.lang-opt.is-active { border-color: var(--sage); background: var(--sage-soft); }
.country-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; max-height: 42vh; overflow-y: auto; padding-bottom: 6px; }
.country-opt { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 13px; padding: 10px 12px; text-align: left; color: var(--ink); }
.country-opt .flag { font-size: 19px; }
.country-opt b { font-size: 13px; font-weight: 550; }
.country-opt .zone { margin-left: auto; font-size: 10px; color: var(--muted); }
.country-opt.is-active { border-color: var(--sage); background: var(--sage-soft); }
.choice-grid { display: grid; gap: 7px; margin-top: 18px; }
.choice { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 13px; padding: 13px 14px; text-align: left; color: var(--ink); }
.choice b { font-size: 13.5px; font-weight: 550; }
.choice span { font-size: 11px; color: var(--muted); }
.choice.is-active { border-color: var(--sage); background: var(--sage-soft); }
.choice .check { width: 19px; height: 19px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: transparent; }
.choice.is-active .check { background: var(--sage); border-color: var(--sage); color: #fff; }
.choice .check .i { width: 11px; height: 11px; stroke-width: 2.4; }
.onb-summary { margin-top: 16px; display: grid; gap: 8px; }
.onb-summary .row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 12.5px; }
.onb-summary .row span { color: var(--muted); }

/* --------------------------------------------------------------- sheets */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: var(--backdrop); backdrop-filter: blur(3px); animation: fadeIn 0.2s ease both; }
.sheet {
  position: fixed; z-index: 61; left: 50%; transform: translateX(-50%);
  bottom: 0; width: min(100%, 620px); max-height: 88dvh;
  background: var(--surface-solid); border-radius: 26px 26px 0 0;
  box-shadow: 0 -24px 70px -20px rgba(0,0,0,.4); padding: 8px 20px calc(20px + var(--safe-bottom));
  overflow-y: auto; animation: sheetIn 0.34s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}
@keyframes sheetIn { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet-grip { width: 36px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet-head h2 { font-family: var(--font-display); font-size: 22px; font-weight: 500; margin: 0; }
.sheet-body { padding-bottom: 6px; }

/* ------------------------------------------------------------ celebration */
.celebration { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: var(--backdrop); backdrop-filter: blur(7px); padding: 26px; animation: fadeIn 0.3s ease both; }
.celebration-card { width: 100%; max-width: 360px; text-align: center; background: var(--surface-solid); border: 1px solid var(--line); border-radius: 28px; padding: 32px 26px 26px; box-shadow: var(--shadow); animation: popIn 0.45s cubic-bezier(0.22, 0.9, 0.3, 1.2) both; }
@keyframes popIn { from { opacity: 0; transform: scale(0.9) translateY(12px); } to { opacity: 1; transform: none; } }
.celebration-glyph { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; color: var(--gold); background: radial-gradient(circle at 32% 28%, var(--surface-solid), var(--gold-soft)); box-shadow: inset 0 0 0 1px var(--line); }
.celebration-glyph .i { width: 34px; height: 34px; }
.celebration-card h2 { font-family: var(--font-display); font-size: 27px; font-weight: 500; margin: 0 0 7px; }
.celebration-card p { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; line-height: 1.55; }

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed; z-index: 95; left: 50%; transform: translateX(-50%);
  bottom: calc(96px + var(--safe-bottom)); max-width: min(calc(100% - 40px), 420px);
  background: var(--ink); color: var(--bg); font-size: 12.5px; font-weight: 550;
  padding: 11px 17px; border-radius: 999px; box-shadow: var(--shadow);
  text-align: center; animation: toastIn 0.3s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.offline {
  position: fixed; z-index: 85; left: 50%; transform: translateX(-50%);
  top: calc(8px + var(--safe-top)); display: flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--bg); font-size: 11.5px; font-weight: 550;
  padding: 8px 14px; border-radius: 999px; box-shadow: var(--shadow); max-width: calc(100% - 30px);
}
.offline-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex: 0 0 auto; }

/* --------------------------------------------------------------- skeleton */
.skeleton { border-radius: var(--radius-lg); background: linear-gradient(100deg, var(--surface) 30%, color-mix(in srgb, var(--surface-solid) 80%, var(--lav-soft)) 50%, var(--surface) 70%); background-size: 200% 100%; animation: shimmer 1.5s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ------------------------------------------------------------------ misc */
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.small { font-size: 12px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; border-radius: 6px; }

html[dir="rtl"] body { text-align: right; }
html[dir="rtl"] .kicker::before { margin-left: 0; }
html[dir="rtl"] .hero-date { text-align: left; }
html[dir="rtl"] .setting { text-align: right; }
html[dir="rtl"] .lang-opt, html[dir="rtl"] .country-opt, html[dir="rtl"] .choice { text-align: right; }
html[dir="rtl"] .country-opt .zone { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .task-meta { flex-direction: row; }
html[dir="rtl"] .section-head .link .i { transform: scaleX(-1); }

@media (min-width: 720px) {
  .app { padding-top: 8px; }
  .main { padding-left: 26px; padding-right: 26px; }
  .topbar { padding-left: 26px; padding-right: 26px; }
  .focus-hero { padding: 26px 24px; }
}
@media (max-width: 370px) {
  .display { font-size: 26px; }
  .ring-lg { --size: 238px; }
  .ring-lg .inner strong { font-size: 54px; }
  .focus-hero-copy .value { font-size: 28px; }
  .stat { padding: 12px; gap: 9px; }
  .stat b { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
html[data-motion="reduced"] *, html[data-motion="reduced"] *::before, html[data-motion="reduced"] *::after {
  animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important;
}
