/* Truyện Audio — "Đọc truyện đêm khuya" */
:root {
  --night: #0a0f1d;
  --night-2: #080c18;
  --panel: #131b31;
  --panel-2: #18213a;
  --line: #1f2944;
  --line-2: #2a3554;
  --tick: #3a4668;
  --tick-major: #5b6890;
  --text: #ece6d8;
  --text-2: #c9c2b2;
  --muted: #8f99b3;
  --amber: #f2a541;
  --amber-2: #ffc06a;
  --amber-ink: #1a1206;
  --amber-dim: rgb(242 165 65 / 0.14);
  --danger: #ef7d6d;
  --ok: #8cc79b;
  --r: 16px;
  --r-lg: 22px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-h: 56px;
  --mini-h: 64px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}
/* App chỉ có một thế giới tối (nghe đêm); token giữ nguyên ở mọi chế độ hệ thống */
@media (prefers-color-scheme: light) { :root:not([data-theme="light"]) { color-scheme: dark; } }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* App shell cố định: body không cuộn, chỉ .view cuộn bên trong.
   Tránh lỗi iOS PWA đặt sai thanh fixed ở đáy khi vừa mở (viewport chỉ tính lại sau lần cuộn đầu). */
html { background: var(--night); -webkit-text-size-adjust: 100%; height: 100%; overflow: hidden; }
body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font-family: "Be Vietnam Pro", -apple-system, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  height: 100%;
  overflow: hidden;
}
::selection { background: var(--text-2); color: var(--night); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 8px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
input { caret-color: var(--text); }

svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { opacity: 0.35; cursor: default; }
a { color: inherit; text-decoration: none; }
img { display: block; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; text-wrap: balance; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 600; letter-spacing: -0.005em; text-wrap: balance; }
.muted { color: var(--muted); }
.amber { color: var(--amber); }

.view {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  --gutter: 16px;
  padding: calc(var(--safe-t) + 14px) max(var(--gutter), calc((100% - 608px) / 2)) calc(var(--tab-h) + var(--mini-h) + var(--safe-b) + 28px);
}
.view.no-mini { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px); }

/* ---------- atoms ---------- */
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text-2);
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
}
.icon-btn:active { background: var(--panel-2); transform: scale(0.94); }
.icon-btn.solid { background: var(--amber); color: var(--amber-ink); }
.icon-btn.lg { width: 52px; height: 52px; }
.icon-btn.lg svg { width: 26px; height: 26px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 14px;
  background: var(--panel-2); color: var(--text); font-weight: 600; font-size: 15px;
  border: 1px solid var(--line-2);
  transition: transform 0.15s var(--ease), background 0.2s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn.strong { background: var(--text); border-color: var(--text); color: var(--night); }
.btn.danger { background: transparent; border-color: rgb(239 125 109 / 0.55); color: var(--danger); }
.btn.block { width: 100%; }
.btn svg { width: 20px; height: 20px; }
.input {
  width: 100%; min-height: 46px; padding: 0 14px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line-2); color: var(--text); font: inherit; font-size: 16px;
}
.input::placeholder { color: var(--muted); }
.input:focus { border-color: var(--text-2); }
.lamp { width: 9px; height: 9px; border-radius: 50%; background: var(--tick-major); flex: none; transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.lamp.on { background: var(--amber); }
.empty { color: var(--muted); text-align: center; padding: 48px 12px; }
.empty b { display: block; color: var(--text); font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 4px 6px; }
.section-head h2 { font-size: 16px; }
.section-head span { font-size: 13px; color: var(--muted); }
.speed-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; margin: -6px 0; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text-2); font-size: 14px; font-weight: 600; }
.speed-chip svg { width: 17px; height: 17px; }
.speed-chip:active { background: var(--panel-2); }
.cover { display: block; background: var(--panel-2); object-fit: cover; }
.cover.land, .cover.port { height: auto !important; aspect-ratio: var(--ar, 1.778); }
.cover.ph { background: linear-gradient(90deg, var(--tick) 0 1px, transparent 1px) left 18% bottom 16% / 6px 14% repeat-x, var(--panel-2); border: 1px solid var(--line); }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-bottom: 14px; }
.top h1 { flex: 1; min-width: 0; }
.top .clock { font-size: 14px; color: var(--muted); }
.top.sub { margin: -4px -6px 10px; }
.top.sub h1 { font-size: 16px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top.sub .spacer { width: 44px; flex: none; }

/* ---------- on air (home) ---------- */
.onair-title { display: flex; align-items: center; gap: 10px; }
.air {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 16px; box-shadow: 0 18px 40px -24px rgb(0 0 0 / 0.8);
}
.air-head { display: flex; gap: 14px; text-align: left; width: 100%; }
.air-head .cover { width: 92px; height: 122px; border-radius: 12px; flex: none; align-self: flex-start; }
.air-head .cover.land { width: 112px; }
.air-head .t { display: block; font-size: 17px; font-weight: 600; line-height: 1.32; text-wrap: pretty; }
.air-head .c { font-size: 13px; color: var(--muted); margin-top: 6px; }
.air .dial { margin-top: 20px; }
.air-ctl { display: grid; grid-template-columns: 1fr auto auto auto 1fr; align-items: center; gap: 10px; margin-top: 6px; }
.air-ctl .tm { font-size: 13px; color: var(--muted); }
.air-ctl .tm:last-child { text-align: right; }
.air-ctl .icon-btn { border: 1px solid var(--line-2); width: 46px; height: 46px; }
.play-btn {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--amber); color: var(--amber-ink);
  box-shadow: 0 10px 22px -12px rgb(0 0 0 / 0.85);
  transition: transform 0.15s var(--ease), background 0.2s var(--ease);
}
.play-btn:active { transform: scale(0.95); background: var(--amber-2); }
.play-btn svg { width: 28px; height: 28px; }
.play-btn.loading svg, .icon-btn.loading svg { animation: breathe 1.2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.35; } }
.skip { position: relative; }
.skip small { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700; padding-top: 1px; pointer-events: none; }
.skip svg { width: 30px; height: 30px; }

/* ---------- dial (signature) ---------- */
.dial { position: relative; height: 46px; touch-action: none; cursor: pointer; user-select: none; -webkit-user-select: none; }
.dial-lg { height: 60px; }
.dial-track { position: absolute; left: 0; right: 0; top: 0; height: 24px; border-top: 1px solid var(--line-2); overflow: hidden; }
.dial-lg .dial-track { height: 32px; }
.dial-ticks, .dial-played {
  position: absolute; left: 0; top: 0; bottom: 0;
  background-image:
    linear-gradient(90deg, var(--tick-c, var(--tick)) 0 1px, transparent 1px),
    linear-gradient(90deg, var(--major-c, var(--tick-major)) 0 1.5px, transparent 1.5px);
  background-size: var(--minor) 45%, var(--major) 100%;
  background-repeat: repeat-x;
}
.dial-ticks { right: 0; }
.dial-played { width: 0; --tick-c: rgb(242 165 65 / 0.6); --major-c: var(--amber); }
.dial-labels { position: absolute; left: 0; right: 0; top: 28px; height: 14px; font-size: 11px; color: var(--muted); }
.dial-lg .dial-labels { top: 38px; font-size: 12.5px; }
.dial-labels span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.dial-labels span.first { transform: none; }
.dial-labels span.end { transform: translateX(-100%); }
.dial-needle {
  position: absolute; top: -6px; height: 31px; width: 2px; margin-left: -1px; left: 0;
  background: var(--amber); border-radius: 1px;
}
.dial-lg .dial-needle { height: 41px; top: -7px; }
.dial-needle::after { content: ""; position: absolute; top: -4px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); transition: transform 0.15s var(--ease); }
.dial.dragging .dial-needle::after { transform: scale(1.5); }
.dial-peek {
  position: absolute; bottom: calc(100% + 12px); transform: translateX(-50%); padding: 4px 9px; border-radius: 8px;
  background: var(--amber); color: var(--amber-ink); font-size: 13px; font-weight: 600; pointer-events: none; opacity: 0;
  transition: opacity 0.15s; white-space: nowrap;
}
.dial.dragging .dial-peek { opacity: 1; }
.dial input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; pointer-events: none; }

/* ---------- schedule ---------- */
.sched { margin: 0 4px; }
.slot {
  display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 0 8px;
  min-height: 56px; border-bottom: 1px solid var(--line); width: 100%; text-align: left;
}
.slot .hh { font-size: 15px; font-weight: 600; color: var(--amber); }
.slot .nm { font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .nm small { color: var(--muted); font-size: 12.5px; margin-left: 4px; }
.slot .rt { font-size: 12.5px; color: var(--muted); }
.slot.after .hh, .slot.after .nm { color: var(--muted); }
.slot.now .nm { font-weight: 600; }
.stopline { display: grid; grid-template-columns: 58px 1fr; align-items: center; gap: 0 8px; color: var(--amber); font-size: 13px; }
.stopline > span:last-child { display: flex; align-items: center; gap: 8px; border-top: 1px dashed rgb(242 165 65 / 0.45); min-height: 40px; }
.stopline svg { width: 16px; height: 16px; }
.sched-note { font-size: 12.5px; color: var(--muted); margin: 10px 4px 0; }

/* ---------- rows ---------- */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; gap: 12px; align-items: center; width: 100%; text-align: left;
  padding: 10px 4px; min-height: 76px; border-bottom: 1px solid var(--line);
  transition: background 0.2s var(--ease);
}
.row:active { background: var(--panel); }
.row .cover { width: 46px; height: 62px; border-radius: 8px; flex: none; margin: 0 20px; }
.row .cover.land { width: 86px; margin: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-size: 15px; font-weight: 600; line-height: 1.32; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.row .m { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.row.dim .t { color: var(--text-2); font-weight: 500; }
.row.dim .cover { opacity: 0.5; }
.row .end { color: var(--muted); }
.row .when { width: 50px; flex: none; font-size: 15px; font-weight: 600; color: var(--amber); align-self: flex-start; padding-top: 2px; }
.thin { height: 3px; border-radius: 2px; background: var(--line-2); margin-top: 7px; overflow: hidden; max-width: 220px; }
.thin span { display: block; height: 100%; background: var(--amber); }
.day { font-size: 13px; font-weight: 600; color: var(--muted); margin: 24px 4px 2px; }
.day:first-child { margin-top: 4px; }

/* ---------- library controls ---------- */
.searchbox { position: relative; display: block; margin-bottom: 14px; }
.searchbox svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.searchbox .input { padding-left: 40px; }
.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 6px; padding: 0 16px 4px; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: 14px;
  background: var(--panel); border: 1px solid var(--line-2); color: var(--text-2);
}
.seg button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--night); font-weight: 600; }
.count { font-size: 13px; color: var(--muted); margin: 6px 4px 0; }

/* ---------- story ---------- */
.story-head { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: start; }
.story-head .cover { width: 112px; height: 150px; border-radius: 14px; box-shadow: 0 18px 30px -18px rgb(0 0 0 / 0.9); }
.story-head.has-land { grid-template-columns: 1fr; }
.story-head .cover.land { width: 100%; max-width: 480px; }
.story-head h1 { font-size: 20px; line-height: 1.3; }
.story-meta { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.55; }
.story-actions { display: flex; gap: 10px; margin: 18px 0 4px; }
.story-actions .btn.primary { flex: 1; min-width: 0; }
.story-actions .btn.primary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-actions .btn.sq { width: 46px; padding: 0; flex: none; }
.story-actions .btn[aria-pressed="true"] { color: var(--text); border-color: var(--text-2); }
.desc { color: var(--text-2); font-size: 15px; line-height: 1.65; white-space: pre-line; margin-top: 16px; max-height: 4.95em; overflow: hidden; max-width: 68ch;
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.desc.open { max-height: none; -webkit-mask-image: none; mask-image: none; }
.more { color: var(--text-2); font-size: 14px; font-weight: 500; min-height: 40px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.ch {
  display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 0 8px;
  min-height: 64px; padding: 8px 0 8px 6px; border-bottom: 1px solid var(--line); width: 100%; text-align: left;
}
.ch .no { font-size: 15px; font-weight: 600; color: var(--text-2); }
.ch.cur .no { color: var(--amber); }
.ch .nm { font-size: 15px; font-weight: 500; }
.ch .s { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.ch .s svg { width: 14px; height: 14px; }
.ch .thin { max-width: none; }
.ch.cur { background: linear-gradient(90deg, var(--amber-dim), transparent 75%); border-radius: 12px; border-bottom-color: transparent; }
.ch.done .no { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--amber); text-decoration-thickness: 1.5px; }
.ch.off .no, .ch.off .nm { color: var(--muted); }
.ch .act { color: var(--muted); }
.ch .act.saved { color: var(--ok); }
.ch .pct { font-size: 12.5px; font-weight: 600; color: var(--amber); width: 44px; text-align: center; }

/* ---------- settings ---------- */
.group { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.group-label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 26px 6px 8px; }
.group-label.first { margin-top: 4px; }
.cell { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; font-size: 15px; }
.cell:last-child { border-bottom: 0; }
.cell > span:first-child { flex: 1; min-width: 0; padding: 8px 0; }
.cell small { display: block; color: var(--muted); font-size: 12.5px; }
.cell .val { color: var(--muted); font-size: 14px; }
.cell select { background: transparent; border: 0; color: var(--text-2); font: inherit; font-size: 15px; font-weight: 500; text-align: right; appearance: none; -webkit-appearance: none; padding: 12px 0; }
.cell svg.chev { color: var(--muted); width: 18px; height: 18px; }
.cell.danger { color: var(--danger); }
.cell .lead { color: var(--text-2); }
.group-note { font-size: 12.5px; color: var(--muted); margin: 8px 6px 0; line-height: 1.5; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background 0.2s var(--ease); pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--text); transition: transform 0.25s var(--ease); }
.switch input:checked + span { background: var(--text); }
.switch input:checked + span::after { transform: translateX(20px); background: var(--night); }
.switch input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.facts { display: grid; grid-template-columns: 1fr auto; margin: 0; }
.facts dt, .facts dd { margin: 0; padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 15px; }
.facts dd { text-align: right; color: var(--text); font-weight: 600; }
.facts dt:last-of-type, .facts dd:last-of-type { border-bottom: 0; }

/* ---------- login ---------- */
.login { min-height: calc(100dvh - var(--safe-t) - 60px); display: flex; flex-direction: column; justify-content: center; gap: 12px; max-width: 360px; margin: 0 auto; }
.login .brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.login .brand img { width: 60px; height: 60px; border-radius: 14px; }
.login .brand p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.login .or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 8px 0; }
.login .or::before, .login .or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.login form { display: flex; flex-direction: column; gap: 10px; }
.login .hint { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 6px; line-height: 1.5; }

/* ---------- tabs + mini ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgb(8 12 24 / 0.94); backdrop-filter: saturate(140%) blur(18px); -webkit-backdrop-filter: saturate(140%) blur(18px);
  border-top: 1px solid var(--line);
}
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--muted); }
.tabs a svg { width: 23px; height: 23px; }
.tabs a[aria-current="page"] { color: var(--amber); }
.mini {
  position: fixed; z-index: 21; left: 8px; right: 8px; bottom: calc(var(--tab-h) + var(--safe-b) + 8px);
  max-width: 624px; margin: 0 auto; height: var(--mini-h); padding: 0 8px;
  display: flex; align-items: center; gap: 4px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: 0 14px 30px -12px rgb(0 0 0 / 0.8); overflow: hidden;
}
.mini-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 100%; text-align: left; }
.mini-open img { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: var(--panel); flex: none; }
.mini-open img.land { width: 66px; height: auto; aspect-ratio: var(--ar, 1.778); border-radius: 8px; }
.mini-open img.port { width: auto; height: 46px; aspect-ratio: var(--ar, 0.75); border-radius: 8px; }
.mini-text { min-width: 0; display: flex; flex-direction: column; }
.mini-text b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-text small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-line { position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: var(--line-2); }
.mini-line span { display: block; height: 100%; width: 0; background: var(--amber); }

/* ---------- full player ---------- */
.player {
  position: fixed; inset: 0; z-index: 40; background: var(--night);
  display: flex; flex-direction: column;
  padding: calc(var(--safe-t) + 6px) 20px calc(var(--safe-b) + 18px);
  animation: rise 0.36s var(--ease);
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.player-bar { display: flex; align-items: center; justify-content: space-between; }
.player-onair { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.player-onair.on { color: var(--amber); }
.player-body { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; gap: 14px; max-width: 460px; width: 100%; margin: 0 auto; padding-top: clamp(8px, 3dvh, 32px); }
.player-note { margin-top: auto; }
/* khung đúng tỉ lệ ảnh, vừa cả bề ngang cột lẫn 36dvh chiều cao: không cắt, không viền */
.player-cover.land, .player-cover.port { width: min(100%, calc(36dvh * var(--ar))); height: auto !important; max-height: none; aspect-ratio: var(--ar); object-fit: cover; }
.player-cover { width: 100%; height: auto; max-width: 460px; max-height: 36dvh; border-radius: 16px; margin: 0 auto 6px; box-shadow: 0 30px 50px -24px rgb(0 0 0 / 0.9); background: var(--panel); object-fit: contain; }
.player-titles { text-align: center; }
.player-titles h2 { font-size: 20px; }
.player-titles p { font-size: 14px; color: var(--muted); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.player .dial { margin-top: 14px; }
.player-times { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: -2px; }
.player-times #p-status { color: var(--amber); font-weight: 500; }
.controls { display: flex; align-items: center; justify-content: space-between; margin: 4px 0; }
.controls .play-btn { width: 76px; height: 76px; }
.controls .play-btn svg { width: 32px; height: 32px; }
.player-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tool { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--text-2); font-size: 14px; font-weight: 500; white-space: nowrap; }
.tool svg { width: 19px; height: 19px; }
.tool.on, .tool[aria-pressed="true"] { color: var(--amber); border-color: rgb(242 165 65 / 0.45); background: var(--amber-dim); }
.player-note { text-align: center; font-size: 13px; color: var(--muted); min-height: 20px; }

/* ---------- update bar ---------- */
.update {
  position: fixed; z-index: 65; left: 12px; right: 12px; top: calc(var(--safe-t) + 10px); max-width: 616px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; padding: 10px 6px 10px 16px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: 0 14px 30px -12px rgb(0 0 0 / 0.8); animation: rise 0.3s var(--ease);
}
.update > span { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 15px; }
.update small { font-size: 12.5px; color: var(--muted); }
.update .btn { min-height: 40px; padding: 0 14px; font-size: 14px; }

/* ---------- sheet + toast ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgb(4 6 12 / 0.6); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.2s ease-out; }
@keyframes fade { from { opacity: 0; } }
.sheet-card {
  width: 100%; max-width: 520px; max-height: 82dvh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line-2); border-bottom: 0; border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(var(--safe-b) + 16px); animation: rise 0.3s var(--ease);
}
.sheet-card::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 14px; }
.sheet-card h3 { font-size: 17px; font-weight: 600; margin: 0 4px 4px; }
.sheet-card .sub { font-size: 13px; color: var(--muted); margin: 0 4px 10px; line-height: 1.5; }
.opt { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 50px; padding: 0 12px; border-radius: 12px; font-size: 16px; text-align: left; }
.opt:active { background: var(--panel-2); }
.opt[aria-checked="true"] { color: var(--text); font-weight: 600; background: var(--panel-2); }
.opt .hint { color: var(--muted); font-size: 13px; font-weight: 400; }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 70;
  bottom: calc(var(--tab-h) + var(--mini-h) + var(--safe-b) + 22px);
  background: var(--text); color: var(--night); padding: 10px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 500; max-width: calc(100vw - 32px); width: max-content; text-align: center;
  box-shadow: 0 12px 28px -10px rgb(0 0 0 / 0.7);
}

@media (min-width: 720px) {
  .view { --gutter: 24px; }
  .tabs { padding-left: max(0px, calc((100% - 640px) / 2)); padding-right: max(0px, calc((100% - 640px) / 2)); }
  .story-head { grid-template-columns: 150px 1fr; }
  .story-head .cover { width: 150px; height: 200px; }
  .story-head.has-land { grid-template-columns: 300px 1fr; }
  .story-head .cover.land { width: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
