/* Krtvel web — the iPhone app's iOS-7 design system in CSS: palettes «Night» (default), «Apricot», «Plain», each with
   light + dark; a 4-pt spacing scale; one card style; rounded type for titles, buttons and numbers; glass only on the
   control layer (tab bar, sidebar, mini player, toast). */

:root {
  --font: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Armenian", "Helvetica Neue", Arial, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Armenian", sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s12: 48px;
  --r-s: 10px; --r-m: 16px; --r-l: 22px; --r-xl: 28px;
  --tabbar-h: 64px;
  --mini-h: 64px;
  --side-w: 252px;
  --content-w: 760px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Night (light) */
  --accent: #5B43E6; --on-accent: #FFFFFF;
  --bg: #F5F4FB; --surface: #FFFFFF; --surface2: #ECEAF6; --stroke: #E2DFF0;
  --hero1: #6B55F0; --hero2: #4A35C9; --hero3: #2A2370;
  --hero-text: #FFFFFF; --hero-btn: #FFFFFF; --hero-btn-text: #2A2370;
  --success: #23854B; --warning: #B45309; --danger: #C52A2A;
  --text: #15131F; --text2: rgba(21, 19, 31, 0.62); --text3: rgba(21, 19, 31, 0.38);
  --glass: rgba(255, 255, 255, 0.72); --glass-stroke: rgba(21, 19, 31, 0.08);
  --shadow: 0 4px 12px rgba(10, 8, 40, 0.06), 0 1px 2px rgba(10, 8, 40, 0.04);
  --card-border: transparent;
  color-scheme: light;
}

/* Night (dark) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #A996FF; --on-accent: #120B33;
    --bg: #0A0A12; --surface: #16151F; --surface2: #23222F; --stroke: #2D2B3B;
    --hero1: #1E1650; --hero2: #3B2C9E; --hero3: #6D45C9;
    --success: #4CD483; --warning: #FFB648; --danger: #FF6B6B;
    --text: #F4F2FF; --text2: rgba(244, 242, 255, 0.62); --text3: rgba(244, 242, 255, 0.36);
    --glass: rgba(22, 21, 31, 0.72); --glass-stroke: rgba(255, 255, 255, 0.08);
    --shadow: none; --card-border: var(--stroke);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: #A996FF; --on-accent: #120B33;
  --bg: #0A0A12; --surface: #16151F; --surface2: #23222F; --stroke: #2D2B3B;
  --hero1: #1E1650; --hero2: #3B2C9E; --hero3: #6D45C9;
  --success: #4CD483; --warning: #FFB648; --danger: #FF6B6B;
  --text: #F4F2FF; --text2: rgba(244, 242, 255, 0.62); --text3: rgba(244, 242, 255, 0.36);
  --glass: rgba(22, 21, 31, 0.72); --glass-stroke: rgba(255, 255, 255, 0.08);
  --shadow: none; --card-border: var(--stroke);
  color-scheme: dark;
}

/* Apricot */
:root[data-palette="apricot"] {
  --accent: #C2410C; --on-accent: #FFFFFF;
  --bg: #F8F4EF; --surface: #FFFFFF; --surface2: #F1EAE2; --stroke: #E9E0D6;
  --hero1: #FFD3A1; --hero2: #FFA174; --hero3: #F07A86;
  --hero-text: #2A1409; --hero-btn: #2A1409; --hero-btn-text: #FFE9D6;
  --text: #1E1610; --text2: rgba(30, 22, 16, 0.62); --text3: rgba(30, 22, 16, 0.38);
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="apricot"]:not([data-theme="light"]) {
    --accent: #FF9154; --on-accent: #1F0E04;
    --bg: #0F0D0C; --surface: #1C1917; --surface2: #2A2522; --stroke: #332C28;
    --hero1: #3E1F44; --hero2: #8A3446; --hero3: #C8602E;
    --hero-text: #FFFFFF; --hero-btn: #FFFFFF; --hero-btn-text: #2A1409;
    --text: #FBF4EE; --text2: rgba(251, 244, 238, 0.62); --text3: rgba(251, 244, 238, 0.36);
  }
}
:root[data-palette="apricot"][data-theme="dark"] {
  --accent: #FF9154; --on-accent: #1F0E04;
  --bg: #0F0D0C; --surface: #1C1917; --surface2: #2A2522; --stroke: #332C28;
  --hero1: #3E1F44; --hero2: #8A3446; --hero3: #C8602E;
  --hero-text: #FFFFFF; --hero-btn: #FFFFFF; --hero-btn-text: #2A1409;
  --text: #FBF4EE; --text2: rgba(251, 244, 238, 0.62); --text3: rgba(251, 244, 238, 0.36);
}

/* Plain */
:root[data-palette="classic"] {
  --accent: #0062E0; --on-accent: #FFFFFF;
  --bg: #F2F2F7; --surface: #FFFFFF; --surface2: #E9E9EE; --stroke: #DEDEE3;
  --hero1: #2E7BF0; --hero2: #0A5FD6; --hero3: #0040A8;
  --hero-text: #FFFFFF; --hero-btn: #FFFFFF; --hero-btn-text: #0040A8;
  --text: #111114; --text2: rgba(17, 17, 20, 0.6); --text3: rgba(17, 17, 20, 0.36);
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="classic"]:not([data-theme="light"]) {
    --accent: #4AA3FF; --on-accent: #001A3D;
    --bg: #000000; --surface: #1C1C1E; --surface2: #2C2C2E; --stroke: #38383A;
    --hero1: #0B2A55; --hero2: #0A4AB0; --hero3: #1F6FE0;
    --text: #F5F5F7; --text2: rgba(245, 245, 247, 0.6); --text3: rgba(245, 245, 247, 0.34);
  }
}
:root[data-palette="classic"][data-theme="dark"] {
  --accent: #4AA3FF; --on-accent: #001A3D;
  --bg: #000000; --surface: #1C1C1E; --surface2: #2C2C2E; --stroke: #38383A;
  --hero1: #0B2A55; --hero2: #0A4AB0; --hero3: #1F6FE0;
  --text: #F5F5F7; --text2: rgba(245, 245, 247, 0.6); --text3: rgba(245, 245, 247, 0.34);
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}
body.locked { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text2); }
.faint { color: var(--text3); }
.round { font-family: var(--font-round); }
.num { font-family: var(--font-round); font-variant-numeric: tabular-nums; }
svg.i { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.fill { fill: currentColor; stroke: none; }

/* ---------- layout ---------- */

#app { min-height: 100vh; min-height: 100dvh; }
.sidebar { display: none; }
main#view {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + var(--s4)) calc(var(--s4) + env(safe-area-inset-right)) calc(var(--tabbar-h) + var(--s8) + env(safe-area-inset-bottom)) calc(var(--s4) + env(safe-area-inset-left));
  outline: none;
}
body.has-mini main#view { padding-bottom: calc(var(--tabbar-h) + var(--mini-h) + var(--s8) + env(safe-area-inset-bottom)); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 6px max(6px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(6px, env(safe-area-inset-left));
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  border-top: 0.5px solid var(--glass-stroke);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text3); font: 600 11px/1.1 var(--font-round); min-width: 0; border-radius: 14px;
}
.tabbar a .i { width: 25px; height: 25px; }
.tabbar a[aria-current="page"] { color: var(--accent); }

@media (min-width: 900px) {
  #app { display: grid; grid-template-columns: var(--side-w) 1fr; }
  .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: var(--s1);
    position: sticky; top: 0; height: 100vh; height: 100dvh;
    padding: var(--s6) var(--s4);
    border-right: 0.5px solid var(--glass-stroke);
    background: var(--glass);
    -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  }
  .brand { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s2) var(--s6); }
  .brand img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 4px 14px rgba(42, 35, 112, 0.25); }
  .brand b { font: 800 22px/1 var(--font-round); letter-spacing: -0.01em; }
  .brand small { display: block; font: 500 12px/1.2 var(--font); color: var(--text2); margin-top: 3px; }
  .sidebar a.nav {
    display: flex; align-items: center; gap: var(--s3);
    padding: 10px var(--s3); border-radius: 12px; color: var(--text);
    font: 600 15px/1.2 var(--font-round);
  }
  .sidebar a.nav .i { color: var(--text2); }
  .sidebar a.nav:hover { background: var(--surface2); }
  .sidebar a.nav[aria-current="page"] { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
  .sidebar a.nav[aria-current="page"] .i { color: var(--accent); }
  .sidebar .side-foot { margin-top: auto; padding: var(--s3) var(--s2) 0; font-size: 12px; color: var(--text3); }
  main#view { padding: var(--s8) var(--s8) calc(var(--s12) + var(--s8)); width: 100%; }
  body.has-mini main#view { padding-bottom: calc(var(--mini-h) + var(--s12) + var(--s8)); }
}

/* ---------- headers ---------- */

.top { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); margin: var(--s2) 0 var(--s5); }
.top h1 { margin: 0; font: 800 34px/1.1 var(--font-round); letter-spacing: -0.02em; }
.top .sub { margin-top: 4px; color: var(--text2); font-weight: 500; }
.top .actions { display: flex; gap: var(--s2); }
.back {
  display: inline-flex; align-items: center; gap: 2px; margin: 0 0 var(--s3) -6px; padding: 6px 8px;
  color: var(--accent); font: 600 16px/1 var(--font-round); background: none; border: 0; border-radius: 10px;
}
.back .i { width: 20px; height: 20px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin: var(--s6) var(--s1) var(--s3); }
.section-title h2 { margin: 0; font: 700 20px/1.2 var(--font-round); }
.section-title span { color: var(--text2); font-size: 14px; }

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border-radius: var(--r-l);
  box-shadow: var(--shadow);
  border: 0.5px solid var(--card-border);
  padding: var(--s4);
}
.stack { display: grid; gap: var(--s3); }
.row { display: flex; align-items: center; gap: var(--s3); }
.grow { flex: 1; min-width: 0; }
button.card, a.card { display: block; width: 100%; text-align: left; color: inherit; transition: transform 0.25s var(--ease), opacity 0.2s; }
button.card:active, a.card:active, .press:active { transform: scale(0.985); opacity: 0.92; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- topic artwork ---------- */

.art {
  --a: #8F7CFF; --b: #4B39C9;
  position: relative; flex: none; width: 56px; height: 56px; border-radius: 26%;
  background: radial-gradient(120% 120% at 0% 0%, rgba(255, 255, 255, 0.35), transparent 60%), linear-gradient(135deg, var(--a), var(--b));
  color: #fff; display: grid; place-items: center; overflow: hidden;
  font: 850 24px/1 var(--font-round); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.art::after {
  content: ""; position: absolute; right: -16%; bottom: -18%; width: 72%; height: 72%; opacity: 0.14;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M3 10v4M7 6v12M11 3v18M15 7v10M19 10v4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.art .i { width: 42%; height: 42%; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2)); }
.art.fail { --a: #FF8A80; --b: #C52A2A; }
.art.lg { width: 84px; height: 84px; font-size: 38px; }
.art.xl { width: min(300px, 72vw); height: min(300px, 72vw); font-size: min(132px, 32vw); border-radius: 22%; }
.art.sm { width: 42px; height: 42px; font-size: 18px; }

/* ---------- chips, buttons ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  padding: 4px 9px; border-radius: 999px;
  font: 600 13px/1.25 var(--font);
  color: var(--tint, var(--text2));
  background: color-mix(in srgb, var(--tint, var(--text2)) 13%, transparent);
}
.chip .i { width: 14px; height: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 50px; padding: 13px var(--s5); border: 0; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font: 650 17px/1.2 var(--font-round);
  transition: transform 0.25s var(--ease), opacity 0.2s, background 0.2s;
}
.btn.block { width: 100%; }
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn .i { width: 20px; height: 20px; }
.btn.soft { min-height: 40px; padding: 9px var(--s4); background: color-mix(in srgb, var(--tint, var(--accent)) 13%, transparent); color: var(--tint, var(--accent)); font-size: 15px; }
.btn.soft:hover { background: color-mix(in srgb, var(--tint, var(--accent)) 20%, transparent); }
.btn.ghost { background: transparent; color: var(--accent); min-height: 40px; padding: 8px 12px; font-size: 15px; }
.btn.danger { --tint: var(--danger); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 50%; background: transparent; color: inherit;
  transition: transform 0.2s var(--ease), opacity 0.2s;
}
.icon-btn:active { transform: scale(0.9); opacity: 0.7; }
.icon-btn.filled { background: var(--accent); color: var(--on-accent); }
.icon-btn.tinted { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); }

/* ---------- the morning hero ---------- */

.hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: var(--s5); border-radius: var(--r-xl); color: var(--hero-text);
  background: linear-gradient(135deg, var(--hero1), var(--hero2) 55%, var(--hero3));
  box-shadow: 0 10px 28px color-mix(in srgb, var(--hero2) 35%, transparent);
}
.hero::before {
  content: ""; position: absolute; z-index: -1; width: 220px; height: 220px; right: -70px; top: -110px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.28); filter: blur(40px);
}
.hero .stars { position: absolute; inset: 0; z-index: -1; opacity: 0.55; pointer-events: none; }
.hero h2 { margin: 0; font: 750 24px/1.2 var(--font-round); }
.hero .sum { margin-top: 4px; font-weight: 550; opacity: 0.9; }
.hero .status { margin-top: var(--s4); font-size: 13.5px; font-weight: 550; opacity: 0.85; }
.hero .btn { margin-top: var(--s4); background: var(--hero-btn); color: var(--hero-btn-text); }
.ring { position: relative; width: 62px; height: 62px; flex: none; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .bg { stroke: currentColor; opacity: 0.22; }
.ring .fg { stroke: currentColor; stroke-linecap: round; transition: stroke-dashoffset 0.6s var(--ease); }
.ring .c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.05; }
.ring .c b { font: 750 15px/1 var(--font-round); font-variant-numeric: tabular-nums; }
.ring .c small { font-size: 10.5px; font-weight: 600; opacity: 0.85; }

/* ---------- digest cards ---------- */

.dcard { display: flex; gap: var(--s3); align-items: flex-start; }
.dcard .t { font: 650 17px/1.25 var(--font-round); }
.dcard .cap { margin-top: 3px; color: var(--text2); font-size: 14.5px; line-height: 1.4; }
.dcard .meta { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s3); flex-wrap: wrap; }
.dcard .meta .em { font-size: 15px; }
.dcard .chev { color: var(--text3); align-self: center; }
.dcard.playing { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.pill {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px 0 10px; border-radius: 999px; border: 0;
  background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent);
  font: 650 14px/1 var(--font-round); font-variant-numeric: tabular-nums; isolation: isolate;
}
.pill .fillbar { position: absolute; inset: 0 auto 0 0; z-index: -1; background: color-mix(in srgb, var(--accent) 16%, transparent); }
.pill .i { width: 15px; height: 15px; }
.pill.done { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.reason { margin-top: 6px; color: var(--danger); font-size: 14px; }

.making { margin-top: var(--s3); }
.making .bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.making .bars i { height: 5px; border-radius: 3px; background: var(--surface2); }
.making .bars i.on { background: var(--accent); }
.making .bars i.next { background: color-mix(in srgb, var(--accent) 35%, transparent); animation: pulse 1.1s ease-in-out infinite alternate; }
.making .lbl { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--text2); font-size: 13.5px; }
.spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { from { opacity: 0.35; } to { opacity: 1; } }

/* ---------- skeleton / states ---------- */

.skel { background: var(--surface2); border-radius: 12px; animation: pulse 0.9s ease-in-out infinite alternate; }
.state { text-align: center; padding: var(--s8) var(--s5); }
.state .bubble { width: 96px; height: 96px; margin: 0 auto var(--s4); border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.state .bubble .i { width: 42px; height: 42px; }
.state h3 { margin: 0 0 6px; font: 700 20px/1.25 var(--font-round); }
.state p { margin: 0 auto var(--s4); color: var(--text2); max-width: 30em; }

/* ---------- forms / settings lists ---------- */

.list { background: var(--surface); border-radius: var(--r-m); border: 0.5px solid var(--card-border); box-shadow: var(--shadow); overflow: hidden; }
.list > .item { display: flex; align-items: center; gap: var(--s3); min-height: 54px; padding: 10px var(--s4); }
.list > .item + .item { border-top: 0.5px solid var(--stroke); }
.list > a.item { color: inherit; }
.list > a.item:active, .list > button.item:active { background: var(--surface2); }
.list > button.item { width: 100%; border: 0; background: none; text-align: left; }
.list-head { margin: var(--s6) var(--s4) var(--s2); color: var(--text2); font: 600 13px/1.2 var(--font); text-transform: uppercase; letter-spacing: 0.03em; }
.list-foot { margin: var(--s2) var(--s4) 0; color: var(--text2); font-size: 13px; }
.sq { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; background: var(--c, var(--accent)); }
.sq .i { width: 17px; height: 17px; }
.item .val { color: var(--text2); }
.item .lab { flex: 1; min-width: 0; }
.item .lab small { display: block; color: var(--text2); font-size: 13px; margin-top: 1px; }

label.field { display: block; }
label.field > span { display: block; margin: 0 0 6px var(--s1); color: var(--text2); font: 600 13px/1.2 var(--font); }
input[type="text"], input[type="search"], textarea, select {
  width: 100%; border: 1px solid var(--stroke); background: var(--surface); color: var(--text);
  border-radius: 14px; padding: 12px 14px; font-size: 16px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
select.inline { width: auto; padding: 7px 30px 7px 12px; border-radius: 10px; background-color: var(--surface2); border-color: transparent; font-weight: 600; background-position: right 8px center; }

.seg { display: flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface2); }
.seg button { flex: 1; min-height: 36px; padding: 6px 8px; border: 0; border-radius: 9px; background: none; color: var(--text); font: 600 14px/1.2 var(--font-round); }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); color: var(--accent); }

.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--surface2); transition: background 0.2s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22); transition: transform 0.25s var(--ease); }
.switch input:checked + i { background: var(--success); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2.5px solid var(--accent); outline-offset: 2px; }

input[type="range"].slider { width: 100%; accent-color: var(--accent); height: 28px; }

.form { display: grid; gap: var(--s4); }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.savebar {
  position: sticky; z-index: 5; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--s3));
  margin-top: var(--s5); display: flex; gap: var(--s2); padding: var(--s2); border-radius: 999px;
  background: var(--glass); border: 0.5px solid var(--glass-stroke);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
}
body.has-mini .savebar { bottom: calc(var(--tabbar-h) + var(--mini-h) + env(safe-area-inset-bottom) + var(--s3)); }
@media (min-width: 900px) {
  .savebar { bottom: var(--s4); }
  body.has-mini .savebar { bottom: calc(var(--mini-h) + var(--s4) + var(--s3)); }
}
.savebar .btn { flex: 1; min-height: 46px; }

/* ---------- detail ---------- */

.dhead { display: flex; align-items: center; gap: var(--s4); margin: var(--s2) 0 var(--s5); }
.dhead h1 { margin: 0 0 6px; font: 750 26px/1.15 var(--font-round); letter-spacing: -0.01em; }
.rating { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.rating button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; min-height: 64px;
  border: 1.5px solid var(--stroke); border-radius: 18px; background: var(--surface); color: var(--text);
  font: 650 13.5px/1.2 var(--font-round); transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}
.rating button .em { font-size: 24px; line-height: 1.1; }
.rating button:active { transform: scale(0.95); }
.rating button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }
a.card.vid, .vid { display: flex; gap: var(--s3); align-items: center; padding: 10px; color: inherit; }
.vid .th { position: relative; width: 120px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; flex: none; background: var(--surface2); }
.vid .th img { width: 100%; height: 100%; object-fit: cover; }
.vid .th .d { position: absolute; right: 4px; bottom: 4px; padding: 1px 5px; border-radius: 5px; background: rgba(0, 0, 0, 0.7); color: #fff; font: 700 11px/1.4 var(--font-round); font-variant-numeric: tabular-nums; }
.vid b { display: block; font: 600 15px/1.3 var(--font); }
.bubble-c { margin-left: var(--s8); padding: 10px 14px; border-radius: 18px; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.bubble-c small { display: block; margin-top: 3px; color: var(--text2); font-size: 12px; }
.composer { display: flex; gap: var(--s2); align-items: flex-end; }
.composer textarea { min-height: 46px; height: 46px; border-radius: 23px; padding: 11px 16px; resize: none; }
.script { white-space: pre-wrap; line-height: 1.65; position: relative; }
.script.closed { max-height: 8.5em; overflow: hidden; cursor: pointer; }
.script.closed::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: linear-gradient(transparent, var(--surface)); }

/* ---------- taste ---------- */

.tbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface2); margin-top: var(--s3); }
.tbar i { display: block; height: 100%; }
.psec h3 { margin: 0 0 var(--s2); font: 700 16px/1.3 var(--font-round); }
.psec ul { margin: 0; padding-left: 1.15em; display: grid; gap: 5px; }
.psec li::marker { color: var(--accent); }
.note { padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--tint, var(--accent)) 10%, transparent); font-size: 14.5px; }

/* ---------- costs ---------- */

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.kpi { padding: var(--s3); }
.kpi small { display: block; color: var(--text2); font-size: 12.5px; font-weight: 600; }
.kpi b { display: block; margin-top: 4px; font: 750 19px/1.1 var(--font-round); font-variant-numeric: tabular-nums; }
.meter { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.25); overflow: hidden; margin-top: var(--s3); }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--hero-text); }
.chart { width: 100%; height: 160px; display: block; }
.chart rect.p { fill: var(--accent); }
.chart rect.l { fill: color-mix(in srgb, var(--accent) 22%, transparent); }
.chart rect.hit { fill: transparent; cursor: pointer; }
.chart text { fill: var(--text2); font: 600 10px var(--font-round); }
.chart line { stroke: var(--stroke); stroke-width: 1; }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.t th { text-align: left; color: var(--text2); font: 600 12.5px/1.2 var(--font); padding: 0 0 8px; }
table.t td { padding: 9px 0; border-top: 0.5px solid var(--stroke); font-variant-numeric: tabular-nums; }
table.t td + td, table.t th + th { text-align: right; padding-left: 10px; }

/* ---------- mini player ---------- */

.mini {
  position: fixed; z-index: 29; left: max(var(--s2), env(safe-area-inset-left)); right: max(var(--s2), env(safe-area-inset-right));
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 6px);
  height: var(--mini-h); display: none; align-items: center; gap: var(--s3); padding: 0 var(--s2) 0 10px;
  border-radius: 20px; background: var(--glass); border: 0.5px solid var(--glass-stroke);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 8px 30px rgba(10, 8, 40, 0.18); overflow: hidden; cursor: pointer;
}
body.has-mini .mini { display: flex; }
.mini .t { font: 650 15px/1.2 var(--font-round); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .s { font-size: 12.5px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.mini .prog { position: absolute; left: 14px; right: 14px; bottom: 0; height: 2.5px; border-radius: 2px; background: color-mix(in srgb, var(--text) 10%, transparent); }
.mini .prog i { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
@media (min-width: 900px) {
  .mini { left: calc(var(--side-w) + var(--s6)); right: var(--s6); bottom: var(--s4); max-width: calc(var(--content-w) + 80px); margin: 0 auto; }
}

/* ---------- full player ---------- */

.player {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center;
  color: #fff; overflow-y: auto; overscroll-behavior: contain;
  padding: calc(env(safe-area-inset-top) + var(--s3)) var(--s5) calc(env(safe-area-inset-bottom) + var(--s6));
  background: #0b0a14;
  transform: translateY(100%); transition: transform 0.45s var(--ease); visibility: hidden;
}
.player.open { transform: none; visibility: visible; }
.player .bgfx { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.player .bgfx::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.28); }
.player .inner { width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: stretch; }
.player .grab { display: flex; justify-content: space-between; align-items: center; }
.player .grab small { font: 650 12px/1 var(--font-round); letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; }
.player .artwrap { display: grid; place-items: center; margin: var(--s5) 0 var(--s6); }
.player .art.xl { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); transition: transform 0.5s var(--ease); }
.player.paused .art.xl { transform: scale(0.88); }
.player h2 { margin: 0; font: 750 23px/1.2 var(--font-round); }
.player .by { margin-top: 3px; opacity: 0.72; font-weight: 550; }
.scrub { margin-top: var(--s5); }
.scrub input { width: 100%; height: 22px; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
.scrub input::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #fff var(--p, 0%), rgba(255, 255, 255, 0.25) var(--p, 0%)); }
.scrub input::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.25); }
.scrub input::-moz-range-progress { height: 6px; border-radius: 3px; background: #fff; }
.scrub input::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
.scrub input::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; }
.scrub .times { display: flex; justify-content: space-between; margin-top: 4px; font: 600 12.5px/1 var(--font-round); font-variant-numeric: tabular-nums; opacity: 0.7; }
.controls { display: flex; align-items: center; justify-content: space-between; margin: var(--s4) 0 var(--s2); }
.controls .icon-btn { color: #fff; }
.controls .icon-btn .i { width: 30px; height: 30px; }
.controls .big { width: 82px; height: 82px; background: #fff; color: #15131f; }
.controls .big .i { width: 36px; height: 36px; }
.controls .skip { position: relative; }
.controls .skip span { position: absolute; inset: 0; display: grid; place-items: center; font: 800 10px/1 var(--font-round); padding-top: 3px; }
.prow { display: flex; justify-content: space-between; align-items: center; margin-top: var(--s2); }
.prow .btn.soft { --tint: #fff; color: #fff; background: rgba(255, 255, 255, 0.14); }
.player .rating button { background: rgba(255, 255, 255, 0.1); border-color: transparent; color: #fff; }
.player .rating button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.24); border-color: rgba(255, 255, 255, 0.7); color: #fff; }
.player .queue { margin-top: var(--s5); }
.player .queue h3 { margin: 0 0 var(--s2); font: 700 17px/1.2 var(--font-round); }
.player .qi { display: flex; align-items: center; gap: var(--s3); width: 100%; padding: 8px; border: 0; border-radius: 14px; background: none; color: #fff; text-align: left; }
.player .qi.cur { background: rgba(255, 255, 255, 0.12); }
.player .qi small { display: block; opacity: 0.65; font-size: 12.5px; }
@media (min-width: 900px) {
  .player { inset: 0; padding-top: var(--s8); }
  .player .art.xl { width: 280px; height: 280px; font-size: 120px; }
}

/* ---------- sheets, dialogs, toast ---------- */

.backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(8, 6, 20, 0.45); display: grid; align-items: end; justify-items: center; animation: fade 0.2s ease; }
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow-y: auto;
  background: var(--bg); border-radius: 28px 28px 0 0; padding: var(--s5) var(--s5) calc(env(safe-area-inset-bottom) + var(--s5));
  animation: up 0.35s var(--ease);
}
.sheet .hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s4); }
.sheet .hd h2 { margin: 0; font: 750 22px/1.2 var(--font-round); }
.dialog { align-items: center; }
.dialog .box { width: min(340px, calc(100vw - 48px)); background: var(--surface); border-radius: 22px; padding: var(--s5); text-align: center; animation: pop 0.25s var(--ease); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
.dialog .box h3 { margin: 0 0 6px; font: 700 18px/1.25 var(--font-round); }
.dialog .box p { margin: 0 0 var(--s4); color: var(--text2); font-size: 14.5px; }
.dialog .box .row { justify-content: center; }
.dialog .box .btn { flex: 1; min-height: 44px; font-size: 16px; }
@media (min-width: 700px) {
  .backdrop { align-items: center; }
  .sheet { border-radius: 28px; max-height: 86vh; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { from { transform: scale(0.94); opacity: 0; } }

#toast {
  position: fixed; z-index: 90; left: 50%; top: calc(env(safe-area-inset-top) + 12px);
  transform: translate(-50%, -140%); transition: transform 0.4s var(--ease), opacity 0.3s, visibility 0s linear 0.4s;
  opacity: 0; visibility: hidden;
  max-width: min(520px, calc(100vw - 32px)); padding: 11px 18px; border-radius: 999px;
  background: var(--glass); border: 0.5px solid var(--glass-stroke); color: var(--text);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16); font-weight: 600; font-size: 14.5px; text-align: center;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform 0.4s var(--ease), opacity 0.2s, visibility 0s; }

.palettes { display: flex; gap: var(--s3); }
.palettes button { flex: 1; padding: 10px 6px 8px; border-radius: 16px; border: 2px solid transparent; background: var(--surface2); color: var(--text); font: 600 13px/1.2 var(--font-round); }
.palettes button[aria-pressed="true"] { border-color: var(--accent); }
.palettes .sw { display: block; height: 34px; border-radius: 10px; margin-bottom: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
.mini .skip { position: relative; }
.mini .skip span { position: absolute; inset: 0; display: grid; place-items: center; font: 800 8.5px/1 var(--font-round); padding-top: 2px; }
