:root {
  --bg: #000;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --surface-3: #3a3a3c;
  --sep: #38383a;
  --text: #fff;
  --text-2: #a1a1a6;
  --text-3: #8e8e93;
  --accent: #30d158;
  --accent-ink: #000;
  --book: #ff9f0a;
  --danger: #ff453a;
  --radius: 14px;
  --tint: #0f1f16;
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* iPhone Dynamic Island / notch, and the sides in landscape */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body { overflow: hidden; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
img { display: block; }
.i { width: 24px; height: 24px; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- App frame ---------- */

.app { height: 100dvh; padding: var(--safe-t) var(--safe-r) 0 var(--safe-l); display: grid; grid-template-columns: 1fr; grid-template-rows: 1fr auto auto; }
.view { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; outline: none; min-height: 0; }
.route { height: 100%; }
.sidebar { display: none; }
.tabbar {
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(6px + var(--safe-b));
  background: rgba(18, 18, 18, 0.88); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--surface-2);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; color: var(--text-3); font-size: 11px; font-weight: 500; }
.tabbar a.active { color: var(--accent); }

@media (min-width: 900px) {
  .app { grid-template-columns: 232px 1fr; grid-template-rows: 1fr auto; }
  .sidebar { display: flex; grid-row: 1 / 3; flex-direction: column; gap: 2px; padding: 24px 12px; border-right: 1px solid var(--surface); overflow-y: auto; }
  .tabbar { display: none; }
  .view { grid-column: 2; }
  .mini { grid-column: 2; }
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; padding: 0 10px 18px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #000; display: grid; place-items: center; }
.brand-mark .i { width: 20px; height: 20px; }
.sidebar a { display: flex; align-items: center; gap: 14px; height: 46px; padding: 0 12px; border-radius: 10px; color: var(--text-2); font-size: 16px; font-weight: 600; }
.sidebar a:hover { color: var(--text); }
.sidebar a.active { color: var(--text); background: var(--surface); }
.sidebar a.active .i { color: var(--accent); }
.sidebar-foot { margin-top: auto; padding: 12px; font-size: 13px; color: var(--text-2); line-height: 1.4; }

/* ---------- Mini player ---------- */

.mini { position: relative; display: flex; align-items: center; gap: 12px; margin: 0 8px 6px; padding: 8px 10px 8px 8px; border-radius: 12px; background: var(--tint); overflow: hidden; }
.mini[hidden] { display: none; }
@media (min-width: 900px) { .mini { margin: 0 16px 12px; padding: 10px 14px 10px 10px; } }
.mini .art { width: 44px; height: 44px; border-radius: 7px; }
.mini-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mini-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-sub { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-progress { position: absolute; left: 10px; right: 10px; bottom: 2px; height: 2px; border-radius: 1px; background: rgba(255,255,255,0.2); }
.mini-progress > div { height: 100%; background: #fff; border-radius: 1px; }
.mini .icon-btn { width: 44px; height: 44px; }
.mini .i { width: 26px; height: 26px; }
.mini-open { position: absolute; inset: 0; }
.mini > *:not(.mini-open) { position: relative; z-index: 1; }
.mini-text { pointer-events: none; }

/* ---------- Pages ---------- */

.page { padding: 20px 16px 32px; max-width: 1100px; }
@media (min-width: 900px) { .page { padding: 32px 40px 48px; } }
.page-title { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; margin: 8px 0 18px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 4px 12px; min-height: 44px; flex-wrap: wrap; }
.topbar .page-title { min-width: 0; overflow-wrap: anywhere; }
.back { display: inline-flex; align-items: center; gap: 4px; height: 44px; padding-right: 10px; color: var(--accent); font-size: 17px; font-weight: 500; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.section-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.label { padding: 0 16px 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: var(--text-2); text-transform: uppercase; }
.foot { padding: 8px 16px 0; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.muted { color: var(--text-2); }
.empty { padding: 40px 16px; text-align: center; color: var(--text-2); font-size: 16px; line-height: 1.5; }
.empty .i { width: 44px; height: 44px; margin-bottom: 10px; color: var(--text-3); }
.link { color: var(--accent); font-weight: 600; font-size: 15px; }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); font-size: 15px; line-height: 1.45; margin-bottom: 20px; }
.banner .i { color: var(--book); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin 0.8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Buttons ---------- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 16px; font-weight: 600; white-space: nowrap; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn-white { background: #fff; color: #000; font-weight: 700; }
.btn-ghost { background: transparent; border: 1px solid #48484a; }
.btn-danger { color: var(--danger); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn .i { width: 20px; height: 20px; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--text); flex-shrink: 0; }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.on { color: var(--accent); }
.icon-btn.dim { color: var(--text-2); }
.circle-play { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #000; display: grid; place-items: center; flex-shrink: 0; }
.circle-play .i { width: 26px; height: 26px; }
.circle-play:active { transform: scale(0.95); }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; background: rgba(255,255,255,0.1); font-size: 14px; font-weight: 600; max-width: 100%; }
.pill .i { width: 16px; height: 16px; }
.pill span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.dot.off { background: var(--text-3); }

/* ---------- Chips & segmented ---------- */

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { height: 34px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); font-size: 14px; font-weight: 500; white-space: nowrap; flex-shrink: 0; }
.chip.on { background: var(--accent); color: #000; font-weight: 600; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface); }
.seg button { height: 38px; border-radius: 9px; font-size: 14px; font-weight: 500; }
.seg button.on { background: #48484a; font-weight: 600; }

/* ---------- Rows (songs, episodes) ---------- */

.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 4px; border-radius: 10px; }
.row:hover { background: rgba(255,255,255,0.04); }
.row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 7px 4px 7px 6px; text-align: left; }
.row .art { width: 48px; height: 48px; border-radius: 6px; }
.row-num { width: 28px; text-align: center; color: var(--text-2); font-size: 15px; flex-shrink: 0; }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 14px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.playing .row-title { color: var(--accent); }
.row .icon-btn { color: var(--text-2); }
.row .icon-btn .i { width: 22px; height: 22px; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; margin-right: 6px; }
.eq span { width: 3px; background: var(--accent); border-radius: 1px; animation: eq 0.9s ease-in-out infinite; }
.eq span:nth-child(2) { animation-delay: -0.3s; }
.eq span:nth-child(3) { animation-delay: -0.6s; }
.eq.paused span { animation: none; height: 5px; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }

/* ---------- Cards (playlists, albums) ---------- */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; }
@media (max-width: 480px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; gap: 8px; text-align: left; min-width: 0; }
.card .art { width: 100%; aspect-ratio: 1; height: auto; border-radius: 8px; }
.card.round .art { border-radius: 50%; }
.card-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: -4px; }
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.shelf::-webkit-scrollbar { display: none; }

.art { object-fit: cover; background: var(--surface-2); }
.art-empty { display: grid; place-items: center; color: var(--text-3); }
/* While a cover is retrying, show the plain tile instead of a broken-image icon. */
img.art-broken { color: transparent; position: relative; }
img.art-broken::before { content: ''; position: absolute; inset: 0; background: var(--surface-2); }
.art-empty .i { width: 40%; height: 40%; }

/* Library list (Spotify-style compact rows) */
.lib-list { display: flex; flex-direction: column; gap: 2px; }
.lib-item { display: flex; align-items: center; gap: 12px; padding: 6px; border-radius: 10px; text-align: left; }
.lib-item:hover { background: rgba(255,255,255,0.04); }
.lib-item .art { width: 58px; height: 58px; border-radius: 6px; }
.lib-item.round .art { border-radius: 50%; }
.liked-art { width: 58px; height: 58px; border-radius: 6px; background: #3b2d8f; display: grid; place-items: center; flex-shrink: 0; }
.liked-art .i { width: 26px; height: 26px; }

/* ---------- Detail header ---------- */

.detail-head { display: flex; flex-direction: column; gap: 18px; margin: 8px 0 20px; }
.detail-head .art { width: 220px; height: 220px; border-radius: 10px; box-shadow: 0 18px 40px rgba(0,0,0,0.5); align-self: center; }
.detail-head.round .art { border-radius: 50%; }
@media (min-width: 700px) {
  .detail-head { flex-direction: row; align-items: flex-end; gap: 28px; }
  .detail-head .art { align-self: auto; }
}
.detail-kind { font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; }
.detail-title { font-size: clamp(28px, 5vw, 44px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; margin: 4px 0 8px; }
.detail-sub { font-size: 15px; color: var(--text-2); line-height: 1.4; }
.detail-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- Grouped lists (iOS settings style) ---------- */

.group { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.cell { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 16px; border-bottom: 1px solid var(--sep); font-size: 17px; width: 100%; text-align: left; }
.cell:last-child { border-bottom: none; }
.cell-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cell-sub { font-size: 14px; color: var(--text-2); }
.cell-value { color: var(--text-2); font-size: 16px; display: flex; align-items: center; gap: 4px; text-align: right; }
.cell-value .i { width: 16px; height: 16px; color: var(--text-3); }
.cell-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: #000; flex-shrink: 0; }
.cell-icon .i { width: 18px; height: 18px; }
.cell input[type="text"], .cell input[type="password"], .cell input[type="url"], .cell input[type="number"], .cell input[type="time"], .cell select {
  background: var(--surface-2); border: none; border-radius: 8px; height: 36px; padding: 0 10px; font-size: 16px; min-width: 0; max-width: 60%; text-align: right;
}
.cell input[type="number"] { width: 80px; }
.cell input[type="time"] { color-scheme: dark; }
.field { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--sep); }
.field:last-child { border-bottom: none; }
.field label { font-size: 14px; color: var(--text-2); }
.field input, .field textarea { background: var(--surface-2); border: none; border-radius: 8px; padding: 10px 12px; font-size: 16px; width: 100%; }
.field textarea { min-height: 90px; resize: vertical; font-family: ui-monospace, monospace; font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 22px; }

.switch { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 999px; background: var(--surface-3); position: relative; flex-shrink: 0; cursor: pointer; transition: background 0.2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.3); transition: transform 0.2s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }

.days { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.days button { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); font-size: 14px; font-weight: 600; }
.days button.on { background: var(--accent); color: #000; }

/* ---------- Range sliders ---------- */

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; cursor: pointer; --p: 50%; }
input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: linear-gradient(to right, #fff var(--p), rgba(255,255,255,0.22) var(--p)); }
input[type="range"]::-moz-range-track { height: 5px; border-radius: 3px; background: rgba(255,255,255,0.22); }
input[type="range"]::-moz-range-progress { height: 5px; border-radius: 3px; background: #fff; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; margin-top: -5.5px; opacity: 0; transition: opacity 0.15s; }
input[type="range"]:hover::-webkit-slider-thumb, input[type="range"]:active::-webkit-slider-thumb, input[type="range"]:focus-visible::-webkit-slider-thumb { opacity: 1; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border: none; border-radius: 50%; background: #fff; }
input[type="range"]:disabled { opacity: 0.35; }

/* ---------- Now Playing ---------- */

.now { min-height: 100%; display: flex; flex-direction: column; }
.now-main { background: var(--tint); transition: background 0.8s; padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 20px; }
.now-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.now-from { display: flex; flex-direction: column; min-width: 0; }
.eyebrow { font-size: 11px; font-weight: 600; color: var(--text-2); letter-spacing: 0.04em; text-transform: uppercase; }
.now-from-name { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-body { display: flex; flex-direction: column; gap: 22px; }
.now-art { width: min(100%, 360px); aspect-ratio: 1; align-self: center; border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,0.55); overflow: hidden; }
.now-art .art { width: 100%; height: 100%; }
.now-info { display: flex; flex-direction: column; gap: 18px; flex: 1; min-width: 0; }
.title-row { display: flex; align-items: center; gap: 10px; }
.title-row > div { flex: 1; min-width: 0; }
.np-title { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.np-artist { display: block; margin-top: 4px; font-size: 17px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-row .icon-btn .i { width: 28px; height: 28px; }
.times { display: flex; justify-content: space-between; font-size: 12px; font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; margin-top: 2px; }
.controls { display: flex; align-items: center; justify-content: space-between; }
.controls .icon-btn { width: 56px; height: 56px; }
.controls .big .i { width: 36px; height: 36px; }
.controls .small .i { width: 24px; height: 24px; }
.play-btn { width: 76px; height: 76px; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center; flex-shrink: 0; }
.play-btn .i { width: 32px; height: 32px; }
.play-btn:active { transform: scale(0.95); }
.vol { display: flex; align-items: center; gap: 4px; color: var(--text-2); }
.vol .vol-step { color: var(--text-2); touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.vol .vol-step:active { color: var(--text); background: var(--surface-2, #2c2c2e); }
.vol .vol-step:disabled { opacity: 0.4; }
.vol .vol-step .i { width: 22px; height: 22px; }
.vol .i { width: 18px; height: 18px; }
.status-line { display: flex; flex-wrap: wrap; gap: 8px; min-height: 0; }
.status-chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 12px; border-radius: 999px; background: rgba(255,255,255,0.1); font-size: 14px; font-weight: 600; }
.status-chip .i { width: 16px; height: 16px; }
.status-chip button { height: 26px; padding: 0 10px; border-radius: 999px; background: rgba(255,255,255,0.14); font-size: 13px; font-weight: 600; }
.status-chip.book { color: var(--book); }
.status-chip.warn { color: #ffb86b; padding-right: 12px; }
.now-side { padding: 22px 16px 28px; display: flex; flex-direction: column; gap: 22px; }
.now-empty { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding: 40px 0 10px; }
.now-empty h1 { margin: 0; font-size: 28px; letter-spacing: -0.02em; }
.now-empty p { margin: 0; color: var(--text-2); font-size: 16px; max-width: 420px; line-height: 1.45; }
.now.book .play-btn { background: #fff; }
.now.book .on { color: var(--book); }

@media (min-width: 900px) {
  .now { flex-direction: row; height: 100%; min-height: 0; }
  .now-main { flex: 1; min-width: 0; padding: 28px 40px; justify-content: space-between; overflow-y: auto; }
  .now-body { flex-direction: row; align-items: center; gap: 44px; }
  .now-art { width: min(40vh, 360px); flex-shrink: 0; align-self: center; }
  .np-title { font-size: 32px; }
  .np-artist { font-size: 19px; }
  .play-btn { width: 88px; height: 88px; }
  .now-side { width: 360px; flex-shrink: 0; overflow-y: auto; padding: 28px 24px; }
  /* The middle column decides its own layout: art beside the controls only when there's room. */
  .now-main { container-type: inline-size; }
}
@container (max-width: 780px) {
  .now-body { flex-direction: column; align-items: stretch; gap: 18px; }
  .now-art { width: min(36vh, 320px); }
  .now-info { width: 100%; max-width: 520px; align-self: center; gap: 14px; }
  .np-title { font-size: 26px; }
  .np-artist { font-size: 17px; }
  .play-btn { width: 76px; height: 76px; }
}

/* Tablets in landscape (about 900–1365px wide): icon-only sidebar, slimmer side panel. */
@media (min-width: 900px) and (max-width: 1365px) {
  .app { grid-template-columns: 76px 1fr; }
  .sidebar { padding: 18px 12px; align-items: center; overflow-x: hidden; }
  .brand { font-size: 0; padding: 0 0 18px; }
  .sidebar a { font-size: 0; width: 52px; justify-content: center; padding: 0; }
  .sidebar-foot { display: none; }
  .now-main { padding: 20px 28px; }
  .now-side { width: 300px; padding: 20px 16px; }
  .toast { left: calc(50% + 38px); }
}

/* Mood tiles */
.moods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 900px) { .now-side .moods { grid-template-columns: 1fr; } }
.mood { display: flex; align-items: center; gap: 12px; height: 60px; border-radius: 10px; background: var(--surface); overflow: hidden; text-align: left; padding-right: 10px; }
.mood .art { width: 60px; height: 60px; border-radius: 0; flex-shrink: 0; }
.mood-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mood.on .mood-name { color: var(--accent); }
.mood:active { transform: scale(0.98); }
.side-label { font-size: 13px; font-weight: 600; color: var(--text-2); letter-spacing: 0.02em; text-transform: uppercase; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.side-label a, .side-label button { text-transform: none; letter-spacing: 0; color: var(--accent); font-size: 14px; }
.tool { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; border-radius: var(--radius); background: var(--surface); text-align: left; width: 100%; }
.tool-icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); flex-shrink: 0; }
.tool-icon .i { width: 20px; height: 20px; }
.tool-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.tool-title { font-size: 16px; font-weight: 600; }
.tool-sub { font-size: 13px; color: var(--text-2); }
.tools { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Search ---------- */

.search-box { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 6px 0 12px; }
.search-field { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 12px; background: #fff; color: #000; }
.search-field .i { width: 22px; height: 22px; color: #3a3a3c; }
.search-field input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; color: #000; font-size: 17px; font-weight: 500; }
.search-field input::placeholder { color: #6e6e73; }
.search-field button { color: #3a3a3c; }
.recent { display: flex; flex-direction: column; }
.recent button { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 6px; text-align: left; font-size: 16px; }
.recent .i { width: 20px; height: 20px; color: var(--text-2); }

/* ---------- Sheets ---------- */

.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); opacity: 0; transition: opacity 0.2s; }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: min(88dvh, calc(100dvh - var(--safe-t) - 24px)); overflow-y: auto; background: #1c1c1e; border-radius: 16px 16px 0 0; padding: 10px 16px calc(20px + var(--safe-b)); transform: translateY(100%); transition: transform 0.25s cubic-bezier(.2,.8,.2,1); }
.sheet::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 3px; background: #48484a; margin: 0 auto 12px; }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 18px; padding: 22px 22px 22px; transform: scale(0.96); opacity: 0; transition: transform 0.2s, opacity 0.2s; }
  .sheet::before { display: none; }
  .sheet-wrap.open .sheet { opacity: 1; }
}
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 4px 0 14px; border-bottom: 1px solid var(--sep); margin-bottom: 8px; }
.sheet-head .art { width: 52px; height: 52px; border-radius: 6px; }
.sheet-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin: 2px 0 14px; }
.qr-box { width: min(100%, 360px, 52dvh); margin: 0 auto; border-radius: 12px; overflow: hidden; background: #fff; }
.qr-box svg { display: block; width: 100%; height: auto; }
.menu { display: flex; flex-direction: column; }
.menu button, .menu a { display: flex; align-items: center; gap: 16px; min-height: 52px; padding: 0 4px; font-size: 17px; text-align: left; }
.menu .i { color: var(--text-2); width: 22px; height: 22px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet-actions .btn { flex: 1; }

/* Wake-up steps */
.wake-ring { width: 120px; height: 120px; margin: 8px auto 14px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); position: relative; }
.wake-ring::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 4px solid transparent; border-top-color: var(--accent); animation: spin 1.2s linear infinite; }
.wake-ring.done::after, .wake-ring.error::after { animation: none; border-color: var(--accent); }
.wake-ring.error::after { border-color: var(--book); }
.wake-ring .i { width: 52px; height: 52px; }
.steps { list-style: none; margin: 0; padding: 0; background: var(--surface-2); border-radius: var(--radius); overflow: hidden; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--surface-3); }
.steps li:last-child { border-bottom: none; }
.step-mark { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #48484a; flex-shrink: 0; display: grid; place-items: center; }
.step-mark .i { width: 14px; height: 14px; }
.steps .done .step-mark { background: var(--accent); border-color: var(--accent); color: #000; }
.steps .active .step-mark { border-color: var(--accent); border-right-color: transparent; animation: spin 0.9s linear infinite; }
.steps .error .step-mark { background: var(--book); border-color: var(--book); color: #000; }
.steps .pending { color: #d1d1d6; }

/* ---------- Toast ---------- */

.toast { position: fixed; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 60; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: #f2f2f7; color: #000; font-size: 15px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #3a1d1b; color: #ffd6d3; }
@media (min-width: 900px) { .toast { bottom: 100px; left: calc(50% + 116px); } }

/* ---------- Sign-in ---------- */

.welcome { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: calc(24px + var(--safe-t)) calc(16px + var(--safe-r)) calc(24px + var(--safe-b)) calc(16px + var(--safe-l)); }
.welcome-card { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 22px; }
.welcome-mark { width: 72px; height: 72px; border-radius: 18px; background: var(--accent); color: #000; display: grid; place-items: center; margin: 0 auto; }
.welcome-mark .i { width: 38px; height: 38px; }
.welcome-avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; margin: 0 auto; background: var(--surface-2, #2c2c2e); }
.welcome h1 { margin: 0; text-align: center; font-size: 34px; letter-spacing: -0.03em; }
.welcome p { margin: 0; text-align: center; color: var(--text-2); font-size: 17px; line-height: 1.45; }
.code { font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all; color: var(--text); }
body.signed-out .app { display: none; }

/* Idle screen (home player) */
.idle { position: fixed; inset: 0; z-index: 90; background: #000; color: #fff; display: grid; place-items: center; overflow: hidden; opacity: 0; transition: opacity 0.4s ease, filter 2s ease; cursor: pointer; padding: calc(24px + var(--safe-t)) calc(32px + var(--safe-r)) calc(24px + var(--safe-b)) calc(32px + var(--safe-l)); }
.idle[hidden] { display: none; }
.idle.on { opacity: 1; }
.idle.night { filter: brightness(0.35); }
.idle-bg { position: absolute; inset: -60px; background-size: cover; background-position: center; filter: blur(60px) saturate(1.3); opacity: 0.45; }
.idle-inner { position: relative; display: flex; align-items: center; gap: clamp(24px, 5vw, 64px); max-width: 1200px; width: 100%; }
.idle-art { width: min(44vw, 72vh, 520px); aspect-ratio: 1; object-fit: cover; border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.6); flex-shrink: 0; }
.idle-text { min-width: 0; flex: 1; }
.idle-clock { font-size: clamp(64px, 11vw, 150px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.idle-date { font-size: clamp(18px, 2.2vw, 26px); color: rgba(255,255,255,.7); margin: 8px 0 clamp(20px, 4vh, 48px); }
.idle-title { font-size: clamp(24px, 3.4vw, 42px); font-weight: 700; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.idle-artist { font-size: clamp(18px, 2.4vw, 28px); color: rgba(255,255,255,.75); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idle-bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,.2); margin-top: 24px; max-width: 520px; overflow: hidden; }
.idle-bar > div { height: 100%; background: #fff; width: 0; transition: width 1s linear; }
.idle-paused { margin-top: 12px; font-size: 15px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.idle-hint { position: absolute; bottom: calc(16px + var(--safe-b)); left: 0; right: 0; text-align: center; font-size: 13px; color: rgba(255,255,255,.4); }
@media (orientation: portrait) {
  .idle-inner { flex-direction: column; text-align: center; }
  .idle-art { width: min(76vw, 46vh, 560px); }
  .idle-bar { margin-left: auto; margin-right: auto; }
}
@media (prefers-reduced-motion: reduce) { .idle, .idle-bar > div { transition: none; } }

/* ---------- For you (Search page with nothing typed) ---------- */
.recent-chips { margin: 4px 0 18px; }
.recent-chips .chip { display: inline-flex; align-items: center; gap: 6px; }
.recent-chips .i { width: 15px; height: 15px; color: var(--text-2); }
.fy-tabs { max-width: 420px; margin-bottom: 4px; }
.fy-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.fy-tabs .i { width: 17px; height: 17px; }
.fy-foot { text-align: center; margin-top: 28px; }
.fy-enable { margin-top: 24px; padding: 22px; border-radius: var(--radius); background: var(--surface); line-height: 1.5; }
.fy-enable p { margin: 10px 0; color: var(--text-2); }
[data-hold] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.fy-card { position: relative; }
.fy-open { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fy-card .liked-art { width: 100%; height: auto; aspect-ratio: 1; border-radius: 8px; }
.fy-card .liked-art .i { width: 40%; height: 40%; }
.fy-play { position: absolute; right: 8px; bottom: 58px; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #000; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(0,0,0,0.45); }
.fy-play .i { width: 20px; height: 20px; }
.fy-play:active { transform: scale(0.94); }
.gchips { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.gchip { display: flex; align-items: stretch; height: 64px; border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.gchip-play { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding-right: 10px; text-align: left; }
.gchip-play:active { background: var(--surface-3); }
.gchip-art { width: 64px; height: 64px; flex-shrink: 0; }
.gchip-name { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gchip-play .i { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }
.gchip-open { width: 46px; display: grid; place-items: center; border-left: 1px solid var(--sep); color: var(--text-2); }
.gchip-open .i { width: 18px; height: 18px; }
.fy-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.fy-cat { display: inline-flex; align-items: center; gap: 8px; height: 42px; font-size: 15px; }
.fy-cat .i { width: 17px; height: 17px; color: var(--book); }
@media (max-width: 520px) {
  .gchips { grid-template-columns: 1fr 1fr; }
  .gchip { height: 56px; }
  .gchip-art { width: 56px; height: 56px; }
  .gchip-name { font-size: 14px; white-space: normal; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .gchip-play { gap: 8px; }
  .gchip-play .i { display: none; }
  .gchip-open { width: 34px; }
}

/* ---------- YouTube Music section: its own video-site look ---------- */
.yt-page { --yt-bg: #0f0f0f; --yt-raised: #272727; --yt-hover: #3f3f3f; --yt-text: #f1f1f1; --yt-dim: #aaa; --yt-red: #e3263f;
  background: var(--yt-bg); color: var(--yt-text); min-height: 100%; padding: 12px 16px 40px; box-sizing: border-box; }
.yt-page .spinner { border-top-color: var(--yt-red); }
.yt-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 4px 0 12px; }
.yt-brand { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.yt-mark { width: 30px; height: 30px; border-radius: 50%; background: var(--yt-red); color: #fff; display: grid; place-items: center; }
.yt-mark .i { width: 18px; height: 18px; }
.yt-search { flex: 1 1 280px; max-width: 640px; display: flex; align-items: stretch; height: 42px; margin: 0 auto 0 0; }
.yt-search input { flex: 1; min-width: 0; background: #121212; color: var(--yt-text); border: 1px solid #303030; border-right: 0; border-radius: 21px 0 0 21px; padding: 0 16px; font: inherit; font-size: 16px; outline: none; }
.yt-search input:focus { border-color: #1c62b9; }
.yt-search input::-webkit-search-cancel-button { display: none; }
.yt-clear { background: #121212; border: 1px solid #303030; border-left: 0; border-right: 0; color: var(--yt-dim); padding: 0 8px; display: grid; place-items: center; }
.yt-go { width: 64px; background: var(--yt-raised); border: 1px solid #303030; border-radius: 0 21px 21px 0; color: var(--yt-text); display: grid; place-items: center; }
.yt-go .i, .yt-clear .i { width: 20px; height: 20px; }
.yt-clear[hidden] { display: none; }
.yt-search:not(:has(.yt-clear:not([hidden]))) input { border-right: 1px solid #303030; }
.yt-chips, .yt-recent { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.yt-chips::-webkit-scrollbar, .yt-recent::-webkit-scrollbar { display: none; }
.yt-chip { flex: none; height: 34px; padding: 0 14px; border-radius: 8px; background: var(--yt-raised); color: var(--yt-text); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.yt-chip:hover { background: var(--yt-hover); }
.yt-chip.on { background: var(--yt-text); color: #0f0f0f; }
.yt-chip.ghost { background: transparent; border: 1px solid #303030; color: var(--yt-dim); }
.yt-chip .i { width: 16px; height: 16px; }
.yt-h { font-size: 20px; font-weight: 700; margin: 10px 0 14px; }
.yt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 28px 16px; }
.yt-card { display: flex; flex-direction: column; gap: 12px; text-align: left; color: inherit; text-decoration: none; background: none; padding: 0; min-width: 0; }
.yt-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--yt-raised); }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.yt-card:hover .yt-thumb img { transform: scale(1.03); }
.yt-thumb.stack { box-shadow: 0 -6px 0 -2px #3a3a3a, 0 -11px 0 -5px #2a2a2a; margin-top: 10px; }
.yt-len { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.82); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 5px; border-radius: 4px; display: inline-flex; align-items: center; gap: 4px; }
.yt-len .i { width: 14px; height: 14px; }
.yt-hover { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.35); opacity: 0; transition: opacity .15s; }
.yt-hover .i { width: 46px; height: 46px; color: #fff; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
.yt-card:hover .yt-hover, .yt-card:focus-visible .yt-hover { opacity: 1; }
.yt-meta { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.yt-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: #4a4a4a; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 15px; }
.yt-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.yt-title { font-size: 16px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-sub { font-size: 14px; color: var(--yt-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yt-dim { color: var(--yt-dim); }
.yt-more { text-align: center; margin-top: 24px; }
.yt-btn { height: 38px; padding: 0 18px; border-radius: 19px; background: var(--yt-raised); color: var(--yt-text); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.yt-btn:hover { background: var(--yt-hover); }
.yt-btn.red { background: var(--yt-text); color: #0f0f0f; }
.yt-btn .i { width: 18px; height: 18px; }
.yt-setup { max-width: 620px; background: #181818; border: 1px solid #2a2a2a; border-radius: 16px; padding: 20px 22px; margin-top: 12px; line-height: 1.5; }
.yt-setup h2 { margin: 0 0 8px; font-size: 20px; }
.yt-setup ol { padding-left: 20px; margin: 10px 0; }
.yt-setup li { margin: 6px 0; }
.yt-setup code { background: var(--yt-raised); padding: 1px 6px; border-radius: 5px; font-size: 13px; overflow-wrap: anywhere; }
.yt-list-head { display: flex; gap: 24px; align-items: flex-end; flex-wrap: wrap; margin: 8px 0 22px; padding: 20px; border-radius: 16px; background: linear-gradient(180deg, #2a2a2a, #161616); }
.yt-thumb.big { width: min(360px, 100%); flex: none; }
.yt-list-info { flex: 1 1 240px; min-width: 0; }
.yt-list-title { font-size: 28px; font-weight: 700; margin: 0 0 6px; overflow-wrap: anywhere; }
.yt-list-actions { margin-top: 14px; display: flex; gap: 10px; }
.yt-rows { display: flex; flex-direction: column; }
.yt-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; text-align: left; background: none; color: inherit; min-width: 0; }
.yt-row:hover { background: #1f1f1f; }
.yt-row .yt-text { flex: 1; }
.yt-row .yt-title { font-size: 15px; -webkit-line-clamp: 1; }
.yt-row-num { width: 24px; text-align: center; color: var(--yt-dim); font-size: 14px; flex: none; }
.yt-thumb.small { width: 120px; flex: none; border-radius: 8px; }
.yt-row-len { flex: none; }
@media (max-width: 520px) {
  .yt-grid { grid-template-columns: 1fr; gap: 22px; }
  .yt-brand { font-size: 18px; }
  .yt-search { flex-basis: 100%; }
  .yt-thumb.small { width: 96px; }
  .yt-list-head { padding: 14px; }
}

/* ---------- Home ---------- */
.sidebar-label { padding: 16px 12px 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); }
.home-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
@media (max-width: 520px) { .home-head .page-title { font-size: 26px; } .person-chip { max-width: 44%; height: 36px; font-size: 14px; } .person-chip img, .person-chip .i { width: 28px; height: 28px; } }
.home-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-2); font-size: 15px; }
.home-meta span { display: inline-flex; align-items: center; gap: 6px; }
.home-meta .i { width: 16px; height: 16px; }
.person-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 4px; border-radius: 999px; background: var(--surface-2); font-size: 15px; font-weight: 600; flex-shrink: 0; max-width: 50%; }
.person-chip img, .person-chip .i { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; padding: 0; }
.person-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-icon.person { border-radius: 50%; overflow: hidden; }
.cell-icon.person img { width: 100%; height: 100%; object-fit: cover; }
.home-now { position: relative; display: flex; align-items: center; gap: 16px; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, #1f2a22, var(--surface)); }
.home-now.empty { background: var(--surface); }
.home-now.empty .welcome-mark { width: 56px; height: 56px; border-radius: 14px; margin: 0; flex-shrink: 0; }
.home-now.empty .welcome-mark .i { width: 28px; height: 28px; }
.home-now > .art { width: 84px; height: 84px; border-radius: 10px; flex-shrink: 0; }
.home-now-open { position: absolute; inset: 0; border-radius: inherit; }
.home-now-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.home-now-title { font-size: 19px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-now-sub { font-size: 15px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-now.empty .home-now-sub { white-space: normal; }
.home-now-btns { position: relative; display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.home-now .btn { position: relative; flex-shrink: 0; }
.play-btn.small { width: 52px; height: 52px; }
.play-btn.small .i { width: 24px; height: 24px; }
@media (max-width: 520px) {
  .home-now { flex-wrap: wrap; }
  .home-now > .art { width: 64px; height: 64px; }
  .home-now-btns { width: 100%; justify-content: center; }
  .home-now.empty .btn { width: 100%; }
}
.home-scenes { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
@media (max-width: 480px) { .home-scenes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mood-badge { color: #ffd60a; display: grid; place-items: center; }
.mood-badge .i { width: 16px; height: 16px; }
.scene-lights { color: #ffd60a; background: #2b2410; }
.sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.source { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 10px 14px; border-radius: var(--radius); background: var(--surface); }
.source:active { transform: scale(0.98); }
.source-icon { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.source-icon .i { width: 24px; height: 24px; }
.cell code, .foot code { font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }

/* ---------- Audiobookshelf ---------- */
.abs-cover { position: relative; display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.abs-cover .art { width: 100%; height: 100%; border-radius: 0; aspect-ratio: auto; }
.abs-cover.big { width: 220px; flex-shrink: 0; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.abs-bar { display: block; height: 4px; background: rgba(255,255,255,.18); border-radius: 2px; overflow: hidden; }
.abs-bar > span { display: block; height: 100%; background: var(--book); }
.abs-cover .abs-bar { position: absolute; left: 8px; right: 8px; bottom: 8px; }
.abs-done { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--book); color: #000; display: grid; place-items: center; }
.abs-done .i { width: 14px; height: 14px; }
.abs-search { background: var(--surface-2); border: none; border-radius: 999px; height: 38px; padding: 0 16px; font-size: 15px; width: min(320px, 100%); }
.abs-head { display: flex; gap: 24px; align-items: flex-end; }
.abs-head-info { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.abs-title { font-size: clamp(26px, 4vw, 40px); font-weight: 800; letter-spacing: -0.03em; margin: 0; line-height: 1.1; }
.abs-sub { font-size: 16px; color: var(--text); }
.abs-sub.dim { color: var(--text-2); font-size: 14px; }
.abs-progress { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); margin-top: 4px; }
.abs-progress .abs-bar { width: 160px; }
.abs-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.abs-actions .btn-primary { background: var(--book); }
.abs-desc { color: var(--text-2); font-size: 15px; line-height: 1.6; margin: 0; max-height: 9.6em; overflow: auto; }
.abs-ch .row-num { flex-shrink: 0; }
.abs-ch.on { color: var(--book); }
@media (max-width: 600px) {
  .abs-head { flex-direction: column; align-items: flex-start; }
  .abs-cover.big { width: 60%; max-width: 240px; align-self: center; }
}

/* ---------- Lights in the scene editor ---------- */
.light-row { border-bottom: 1px solid var(--sep); }
.light-row:last-child { border-bottom: none; }
.light-row .cell { border-bottom: none; }
.light-opts { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 14px 60px; }
.light-opts[hidden], .light-bright[hidden], .swatches[hidden] { display: none; }
.light-bright { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.light-bright input { flex: 1; }
.light-bright .i { width: 18px; height: 18px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.swatch.on { border-color: #fff; }
.swatch.none { background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); }
.swatch.none .i { width: 14px; height: 14px; }

/* ---------- Idle screen extras ---------- */
.idle-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: clamp(16px, 1.8vw, 22px); color: rgba(255,255,255,.62); margin: -12px 0 clamp(18px, 3.5vh, 40px); }
.idle-meta:empty { display: none; }
