/* ==========================================================================
   Đọc sách cùng Thawnnn — Conflict-Free PC & Mobile Stylesheet
   ========================================================================== */
:root {
  --paper: #EDEBE6;
  --sheet: #F4F2ED;
  --card: rgba(252, 250, 245, 0.92);
  --ink: #141414;
  --muted: #6D6A63;
  --cobalt: #1F3FB0;
  --gold: #d99b00;
  --rule: rgba(20, 20, 20, 0.2);
  --rule-strong: rgba(20, 20, 20, 0.72);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --H: min(44vh, 28vw);
  --sans: "Inter Tight", system-ui, -apple-system, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  color-scheme: light;
}

html.theme-dark {
  color-scheme: dark;
  --paper: #141820;
  --sheet: #1E2430;
  --card: #242B38;
  --ink: #F0EEE9;
  --muted: #A6ACB8;
  --cobalt: #8CA8FF;
  --gold: #F5B82E;
  --rule: rgba(240, 238, 233, 0.18);
  --rule-strong: rgba(240, 238, 233, 0.6);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
html, body {
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  user-select: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }

.lbl {
  font: 600 10.5px/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.box:hover { background: rgba(127, 127, 127, 0.1); }

/* ==========================================================================
   BRAND LOGO
   ========================================================================== */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--cobalt);
}
.brand-icon {
  width: 26px;
  height: 26px;
  flex: none;
}
.brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.brand-text b {
  font: 500 20px/1.05 var(--serif);
  letter-spacing: -0.015em;
  color: var(--ink);
  white-space: nowrap;
}
.brand-text i {
  font: 700 8.5px/1 var(--sans);
  font-style: normal;
  letter-spacing: 0.28em;
  color: var(--cobalt);
  opacity: 0.9;
}

/* ==========================================================================
   BACKGROUND CANVAS (PC ONLY)
   ========================================================================== */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
html.theme-dark #bg {
  filter: brightness(0.32) saturate(0.8);
}

/* ==========================================================================
   PC DESKTOP SHELL (>= 900px) — 5-ROW GRID, ZERO OVERLAP
   ========================================================================== */
.pc-shell {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mob-shell { display: none; }

/* Row 1: Header bar */
.bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 28px 6px;
  z-index: 30;
}
.bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  min-width: 0;
}
.bar .logo {
  justify-self: center;
}
.bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
  min-width: 0;
}

.lib-pill, .pill-btn, .read-session-clock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 31px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: rgba(250, 248, 242, 0.72);
  color: var(--ink);
  font: 600 11px/1 var(--sans);
  white-space: nowrap;
  flex: none;
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
}
@supports (backdrop-filter: blur(8px)) {
  .lib-pill, .pill-btn, .read-session-clock, .sr-box, .mu-bar, .book-request-open {
    -webkit-backdrop-filter: blur(8px) saturate(135%);
    backdrop-filter: blur(8px) saturate(135%);
  }
}
html.theme-dark .lib-pill,
html.theme-dark .pill-btn,
html.theme-dark .read-session-clock {
  background: rgba(34, 40, 52, 0.78);
  border-color: rgba(255, 255, 255, 0.16);
}
.pill-btn:hover {
  background: rgba(255, 255, 255, 0.92);
  transform: translateY(-1px);
}
html.theme-dark .pill-btn:hover {
  background: rgba(54, 62, 78, 0.92);
}
.pill-btn svg, .read-session-clock svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle .moon { display: none; }
html.theme-dark .theme-toggle .sun { display: none; }
html.theme-dark .theme-toggle .moon { display: block; }
html.lite .lite-toggle {
  background: var(--cobalt) !important;
  color: #fff !important;
  border-color: transparent !important;
}
.flt-toggle { position: relative; }
.flt-toggle.on {
  border-color: var(--cobalt);
  color: var(--cobalt);
}
.flt-toggle.on::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e5a100;
}
.read-session-clock { font-variant-numeric: tabular-nums; cursor: default; }

/* Recent dropdown */
.recent-wrap { position: relative; }
.recent-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(340px, calc(100vw - 32px));
  max-height: min(400px, 60vh);
  overflow: auto;
  z-index: 900;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--rule);
  background: var(--sheet);
  color: var(--ink);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}
.recent-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 10px;
  border-bottom: 1px solid var(--rule);
}
.recent-head strong { font-size: 14px; }
.recent-head small { font-size: 10.5px; color: var(--muted); }
.recent-list { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; }
.recent-empty { padding: 18px 8px; text-align: center; color: var(--muted); font-size: 12.5px; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border-radius: 12px;
  text-align: left;
  transition: background-color 0.15s;
}
.recent-item:hover { background: rgba(31, 63, 176, 0.1); }
.recent-cover {
  width: 36px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  flex: none;
  background: var(--paper);
}
.recent-fallback {
  display: grid;
  place-items: center;
  font-size: 18px;
}
.recent-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.recent-info b {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-info small { font-size: 11px; color: var(--muted); }

/* Row 2: Tabs */
.tabs {
  position: relative;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  max-width: calc(100vw - 32px);
  margin: 4px auto 0;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(250, 248, 242, 0.6);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 2px;
  z-index: 25;
}
html.theme-dark .tabs { background: rgba(30, 36, 48, 0.72); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  position: relative;
  z-index: 1;
  height: 28px;
  padding: 0 13px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.35s var(--ease);
}
.tabs button.on { color: #fff; }
.ind {
  position: absolute;
  z-index: 0;
  left: 0;
  top: 2px;
  height: 28px;
  width: 0;
  border-radius: 999px;
  background: var(--cobalt);
  transition: width 0.45s var(--ease), transform 0.45s var(--ease);
}
.fav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gold);
  color: #141414;
  font: 700 10px/1 var(--sans);
}

/* Row 3: 3D Bookshelf Zone */
.shelf-zone {
  position: relative;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.shelf {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1500px;
  perspective-origin: 50% 50%;
  touch-action: pan-y;
}
.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
}
.tape {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
}
.f {
  position: absolute;
  top: calc(var(--H) / -2);
  height: var(--H);
  backface-visibility: hidden;
  border-radius: var(--bs, 4px);
  background-size: 100% 100%;
  overflow: hidden;
}
.f::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #000;
  opacity: var(--sh, 0);
  pointer-events: none;
}
.f.ok > * { display: none; }
.f.dim { filter: grayscale(0.6); opacity: 0.32; }

.sp {
  width: var(--ws);
  left: calc(var(--ws) / -2);
  transform: translateZ(calc(var(--d) / 2));
  background-color: var(--c1);
  border: 1px solid rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0 10px;
  gap: 6px;
  color: var(--c2);
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.2), transparent 14%, transparent 86%, rgba(0, 0, 0, 0.24)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 12%, transparent 88%, rgba(0, 0, 0, 0.16));
}
.il {
  display: block;
  width: calc(100% - 10px);
  aspect-ratio: 1;
  flex: none;
  background-size: 190% auto;
  background-repeat: no-repeat;
  border: 1px solid rgba(0, 0, 0, 0.4);
}
.sp .tt {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.sp .tt b {
  writing-mode: vertical-rl;
  font: 400 calc(var(--H) * var(--k, 0.04)) / 1.1 var(--serif);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  max-height: 100%;
}
.sp em {
  font: 600 max(6px, calc(var(--H) * 0.018)) / 1 var(--sans);
  font-style: normal;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.sp u, .cv u {
  text-decoration: none;
  font: 600 8px/1 var(--sans);
  letter-spacing: 0.08em;
  border: 1px solid currentColor;
  padding: 2px 4px;
}

.sp .stm {
  position: absolute;
  left: 50%;
  top: max(4px, calc(var(--H) * 0.01));
  transform: translateX(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: calc(var(--ws) * 0.34);
  height: calc(var(--ws) * 0.28);
  padding: 0 calc(var(--ws) * 0.06);
  border-radius: 99px;
  border: 0;
  font: 700 max(8px, calc(var(--ws) * 0.14)) / 1 var(--sans);
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  z-index: 2;
  pointer-events: none;
}
.sp .stm[data-s] { display: flex; }
.sp .stm[data-s="want"] { background: #3b82f6; }
.sp .stm[data-s="reading"] { background: #f59e0b; }
.sp .stm[data-s="done"] { background: #1f9d57; }
.sp .stm[data-s="none"] { background: #6b6a66; }

.sp .fav-sp {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  color: #141414;
  font: 700 9px/14px var(--sans);
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  display: none;
  z-index: 3;
}
.sp .fav-sp.on { display: block; }

.cv {
  width: var(--d);
  left: calc(var(--d) / -2);
  transform: rotateY(90deg) translateZ(calc(var(--ws) / 2));
  background-color: var(--c1);
  border: 2px solid var(--c2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 18px 12px;
  color: var(--c2);
  text-align: center;
}
.cv.lit { box-shadow: 0 32px 58px -22px rgba(20, 16, 10, 0.55); }
.ex { --sh: 0.26; background: #cbc0a6; border: 1px solid #8a7f68; }
.bk { width: var(--ws); left: calc(var(--ws) / -2); transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); }
.lf { width: var(--d); left: calc(var(--d) / -2); transform: rotateY(-90deg) translateZ(calc(var(--ws) / 2)); }
.tp, .bt { width: var(--ws); left: calc(var(--ws) / -2); height: var(--d); top: calc(var(--d) / -2); }
.tp { transform: translateY(calc(var(--H) / -2)) rotateX(90deg); }
.bt { transform: translateY(calc(var(--H) / 2)) rotateX(-90deg); }

.ar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: rgba(250, 248, 242, 0.65);
  display: grid;
  place-items: center;
  transition: background-color 0.2s, transform 0.2s;
}
html.theme-dark .ar { background: rgba(34, 40, 52, 0.72); }
.ar:hover { background: rgba(255, 255, 255, 0.92); transform: translateY(-50%) scale(1.06); }
html.theme-dark .ar:hover { background: rgba(54, 62, 78, 0.92); }
.ar-prev { left: 20px; }
.ar-next { right: 20px; }
.ar svg { width: 18px; height: 10px; stroke: currentColor; fill: none; stroke-width: 1.4; }

/* Row 4: Active Book Caption + Quick Actions */
.cap-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 2px 20px 8px;
  z-index: 20;
}
.cap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  pointer-events: none;
  text-align: center;
}
.m {
  display: grid;
  overflow: hidden;
  width: min(86vw, 720px);
  text-align: center;
}
.m > span { grid-area: 1 / 1; }
.c1 { font: 400 clamp(22px, 2.2vw, 30px) / 1.15 var(--serif); letter-spacing: -0.01em; }
.c2 { color: var(--cobalt); font-weight: 600; font-size: 10.5px; }
.c3 { font: 500 11px/1.2 var(--sans); letter-spacing: 0.08em; color: var(--muted); }

.cap-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.cap-btn {
  height: 30px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: rgba(250, 248, 242, 0.78);
  color: var(--ink);
  font: 600 11.5px/1 var(--sans);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: transform 0.18s, background-color 0.18s, border-color 0.18s;
}
html.theme-dark .cap-btn { background: rgba(34, 40, 52, 0.8); }
.cap-btn:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.96); }
html.theme-dark .cap-btn:hover { background: rgba(54, 62, 78, 0.96); }
.cap-btn.primary {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: #fff;
}
.cap-btn.primary:hover { filter: brightness(1.08); background: var(--cobalt); }
.cap-btn.fav-btn.on {
  background: #fff4cf;
  border-color: var(--gold);
  color: #7c5200;
}
html.theme-dark .cap-btn.fav-btn.on {
  background: rgba(245, 184, 46, 0.18);
  color: #ffd978;
}

/* Row 5: Bottom Dock (Search + Music + Request + Footer) */
.bottom-dock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 2px 28px 10px;
  z-index: 45;
}
.mu {
  position: relative;
  width: min(640px, calc(100vw - 48px));
  color: var(--ink);
}
.mu-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.sr {
  position: relative;
  flex: 1 1 200px;
  min-width: 150px;
}
.sr-box {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 8px 0 12px;
  border-radius: 18px;
  background: rgba(250, 248, 242, 0.82);
  border: 1px solid var(--rule);
  cursor: text;
}
html.theme-dark .sr-box { background: rgba(34, 40, 52, 0.85); }
.sr-box:focus-within { border-color: var(--cobalt); }
.sr-box svg { flex: none; width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.sr-box input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  font: 500 12.5px/1 var(--sans);
  color: var(--ink);
  user-select: text;
  -webkit-user-select: text;
}
.sr-box input::placeholder { color: var(--muted); opacity: 1; }
.sr-x {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 16px;
  color: var(--muted);
  display: grid;
  place-items: center;
}
.sr-x:hover { color: var(--ink); background: rgba(127, 127, 127, 0.14); }
.sr-list {
  position: absolute;
  left: 0;
  right: -80px;
  bottom: calc(100% + 8px);
  padding: 6px;
  border-radius: 16px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  max-height: min(44vh, 320px);
  overflow: auto;
  overscroll-behavior: contain;
  z-index: 9999;
}
.sr-list button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  font: 500 12.5px/1.2 var(--sans);
  text-align: left;
}
.sr-list button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-list button small { flex: none; color: var(--muted); font-size: 10.5px; }
.sr-list button.on, .sr-list button:hover { background: rgba(31, 63, 176, 0.12); color: var(--cobalt); }
.sr-list .none { padding: 10px; font-size: 12px; color: var(--muted); }

.mu-bar {
  flex: 1.35 1 250px;
  min-width: 0;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px 0 12px;
  border-radius: 18px;
  background: rgba(250, 248, 242, 0.82);
  border: 1px solid var(--rule);
}
html.theme-dark .mu-bar { background: rgba(34, 40, 52, 0.85); }
.eq { display: flex; align-items: flex-end; gap: 2px; height: 13px; flex: none; }
.eq i { display: block; width: 2.5px; height: 3px; border-radius: 2px; background: var(--cobalt); }
.mu.on .eq i { animation: eq 0.9s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: -0.3s; }
.eq i:nth-child(3) { animation-delay: -0.6s; }
@keyframes eq { from { height: 3px; } to { height: 13px; } }
.mu-t { flex: 1; min-width: 0; text-align: left; display: flex; flex-direction: column; gap: 1px; }
.mu-t b { font: 600 11.5px/1.1 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mu-t small { font: 500 9px/1 var(--sans); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mu-b { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.mu-b:hover { background: rgba(127, 127, 127, 0.14); }
.mu-b svg { width: 14px; height: 14px; fill: currentColor; stroke: currentColor; stroke-width: 1.5; }
.sw {
  flex: none;
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 14px;
  background: rgba(120, 120, 128, 0.34);
  transition: background 0.25s var(--ease);
}
.sw::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s var(--ease);
}
.sw.on { background: #34c759; }
.sw.on::after { transform: translateX(18px); }

.mu-list {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  padding: 8px;
  border-radius: 18px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  max-height: min(60vh, 420px);
  overflow: auto;
  overscroll-behavior: contain;
  z-index: 9998;
}
.mu-upload {
  padding: 6px 6px 10px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.mu-upload label {
  display: inline-flex;
  align-items: center;
  background: var(--cobalt);
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  font: 600 11.5px var(--sans);
  cursor: pointer;
}
.mu-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mu-upload small { flex-basis: 100%; font-size: 11px; color: var(--muted); }
.mu-upload #mubuiltin {
  font-size: 11px;
  padding: 7px 10px;
  border: 1px solid var(--rule);
  border-radius: 10px;
}
.mu-list .section-title {
  padding: 8px 10px 4px;
  font: 700 10px var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.mu-list button {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  font: 500 12px/1.2 var(--sans);
  text-align: left;
}
.mu-list button:hover { background: rgba(127, 127, 127, 0.1); }
.mu-list button.now { background: rgba(31, 63, 176, 0.14); color: var(--cobalt); font-weight: 600; }
.mu-list button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mu-list small { color: var(--muted); flex: none; }

.book-request-open {
  flex: none;
  height: 36px;
  padding: 0 12px;
  border-radius: 18px;
  border: 1px solid var(--rule);
  background: rgba(250, 248, 242, 0.82);
  color: var(--ink);
  font: 600 11.5px/1 var(--sans);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
html.theme-dark .book-request-open { background: rgba(34, 40, 52, 0.85); }
.book-request-open:hover { border-color: var(--cobalt); color: var(--cobalt); }
.bro-p { font-weight: 700; }

.foot {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  color: var(--muted);
  opacity: 0.85;
}

/* ==========================================================================
   PC FAVORITES GALLERY OVERLAY (#favPanel)
   ========================================================================== */
.fav-panel {
  position: fixed;
  left: 0;
  right: 0;
  top: 96px;
  bottom: 0;
  z-index: 35;
  background: var(--paper);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 36px 40px;
}
.fav-panel-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.fav-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 20px;
}
.fav-panel-head h2 {
  font: 500 28px/1.15 var(--serif);
}
.fav-panel-head p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.fav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 18px;
}
.fav-empty {
  grid-column: 1 / -1;
  padding: 56px 24px;
  text-align: center;
  border: 1px dashed var(--rule);
  border-radius: 20px;
  color: var(--muted);
}
.fav-empty b { display: block; font-size: 17px; color: var(--ink); margin-bottom: 6px; }
.fav-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--rule);
  content-visibility: auto;
  contain-intrinsic-size: 185px 320px;
  contain: layout style paint;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.fav-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}
.fav-card-cover {
  position: relative;
  aspect-ratio: 576 / 900;
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper);
  cursor: pointer;
}
.fav-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-star-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(20, 20, 20, 0.58);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.35);
  z-index: 2;
  transition: transform 0.15s, background-color 0.15s, color 0.15s;
}
.card-star-btn.on {
  background: var(--gold);
  color: #141414;
  border-color: transparent;
}
.card-star-btn:active { transform: scale(0.9); }
.fav-card-title {
  font: 600 14px/1.25 var(--serif);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fav-card-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-card-actions {
  margin-top: auto;
  display: flex;
  gap: 6px;
}
.fav-card-actions button {
  flex: 1;
  height: 30px;
  border-radius: 8px;
  font: 600 11px/1 var(--sans);
  border: 1px solid var(--rule);
}
.fav-card-actions .go-read {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: #fff;
}

/* ==========================================================================
   FILTER PANEL (#fltp) & TOAST
   ========================================================================== */
.fltp {
  position: fixed;
  right: 24px;
  top: 60px;
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100dvh - 100px);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.24);
  z-index: 950;
  color: var(--ink);
  overflow: hidden;
}
.fltp .fh {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--rule);
}
.fltp .fh b { font-size: 14px; }
.fltp .fh button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  border: 1px solid var(--rule);
}
.fltp .fb {
  padding: 10px 14px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overscroll-behavior: contain;
}
.fltp .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fltp .chips button {
  height: 28px;
  padding: 0 11px;
  border-radius: 99px;
  border: 1px solid var(--rule);
  font: 600 11.5px/1 var(--sans);
}
.fltp .chips button.on { background: var(--cobalt); color: #fff; border-color: var(--cobalt); }
.fltp .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fltp select, .fltp input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 9px;
  border-radius: 9px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font: 500 12px/1 var(--sans);
  user-select: text;
  -webkit-user-select: text;
}
.fltp .fsum { font-size: 12px; color: var(--muted); }
.fltp .flist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow: auto;
  overscroll-behavior: contain;
}
.fltp .flist button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 10px;
  text-align: left;
}
.fltp .flist button:hover { background: rgba(31, 63, 176, 0.1); }
.fltp .flist img { width: 28px; height: 40px; object-fit: cover; border-radius: 4px; flex: none; }
.fltp .flist span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fltp .flist b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fltp .flist small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fltp .flist em { font-style: normal; font-size: 11px; color: var(--gold); flex: none; }
.fltp .ff {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--rule);
}
.fltp .ff button {
  height: 32px;
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--rule);
  font: 600 11.5px/1 var(--sans);
}
.fltp .ff #frand { background: var(--cobalt); color: #fff; border-color: var(--cobalt); }
.fltoast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 980;
  padding: 10px 16px;
  border-radius: 99px;
  background: var(--ink);
  color: var(--paper);
  font: 600 12.5px/1.3 var(--sans);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  max-width: min(90vw, 480px);
  text-align: center;
}

/* ==========================================================================
   BOOK DETAIL MODAL (#dt) — SCROLLABLE DESCRIPTION + ZERO OVERLAP
   ========================================================================== */
.detail {
  position: fixed;
  inset: 0;
  z-index: 60;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: var(--sheet);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.28s var(--ease), visibility 0s 0.28s;
}
.detail.on {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.28s var(--ease);
}
.dt-topbar {
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: calc(14px + env(safe-area-inset-top, 0px)) clamp(16px, 4vw, 48px) 10px;
  border-bottom: 1px solid var(--rule);
  background: var(--sheet);
  z-index: 4;
}
.dt-topbar .cl { justify-self: start; }
.dt-topbar .dl { justify-self: center; }
.dt-top-fav {
  justify-self: end;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  font-size: 18px;
  display: grid;
  place-items: center;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.dt-top-fav.on {
  background: #fff4cf;
  border-color: var(--gold);
  color: #b57a00;
}
html.theme-dark .dt-top-fav.on {
  background: rgba(245, 184, 46, 0.22);
  color: #ffd978;
}

.dt-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  grid-template-rows: minmax(0, 1fr);
  gap: clamp(20px, 4vw, 56px);
  padding: clamp(20px, 3vw, 40px) clamp(24px, 6vw, 80px);
  align-items: center;
  overflow: hidden;
}
.detail .txt {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 560px;
  max-height: 100%;
  min-height: 0;
  align-items: flex-start;
}
.mk { flex: none; max-width: 100%; }
.txt .sub { color: var(--cobalt); font-weight: 600; }
.txt h2 {
  font: 400 clamp(30px, 4vw, 60px) / 1.06 var(--serif);
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}
.txt .meta { color: var(--muted); }

/* Status & 1-5 Star rating */
.stwrap { flex: none; width: 100%; }
.stbox { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.stc, .stars { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.stc button {
  height: 30px;
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--rule);
  font: 600 12px/1 var(--sans);
  color: var(--ink);
  transition: background-color 0.18s, color 0.18s;
}
.stc button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.stars button {
  height: 28px;
  padding: 0 2px;
  font-size: 22px;
  color: var(--muted);
  opacity: 0.45;
  line-height: 1;
}
.stars button.on { color: #e5a100; opacity: 1; }
.stars button.clr {
  font-size: 11.5px;
  opacity: 0.7;
  margin-left: 6px;
  padding: 0 8px;
  border: 1px solid var(--rule);
  border-radius: 99px;
  height: 24px;
}

/* Scrollable synopsis area */
.syn-wrap {
  position: relative;
  width: 100%;
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.syn-scroll {
  width: 100%;
  max-height: min(170px, 24vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 6px 12px 10px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
}
.syn-scroll:focus { outline: none; }
.syn-scroll.can-scroll {
  mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
}
.syn-scroll.at-bottom {
  mask-image: none;
  -webkit-mask-image: none;
}
.syn {
  font: 400 16.5px/1.58 var(--serif);
  max-width: 50ch;
  user-select: text;
  -webkit-user-select: text;
}
.syn-hint {
  margin-top: 4px;
  font: 600 10.5px/1 var(--sans);
  color: var(--cobalt);
  letter-spacing: 0.04em;
}

.cr { font: italic 400 14.5px/1.4 var(--serif); color: var(--muted); }
.dt-actions {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
.w {
  height: 42px;
  padding: 0 22px;
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: #fff;
}
.w:hover { background: var(--cobalt); filter: brightness(1.08); }
.dt-fav-btn {
  height: 42px;
  padding: 0 18px;
}
.dt-fav-btn.on {
  background: #fff4cf;
  border-color: var(--gold);
  color: #7c5200;
}
html.theme-dark .dt-fav-btn.on {
  background: rgba(245, 184, 46, 0.2);
  color: #ffd978;
}

.pos {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  min-height: 0;
}
.pos #coverDirect {
  position: relative;
  max-height: min(100%, 72vh);
  aspect-ratio: 576 / 900;
  width: auto;
  max-width: 100%;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
  z-index: 1;
  display: none;
}
.pos svg {
  position: relative;
  max-height: min(100%, 72vh);
  height: 100%;
  width: auto;
  max-width: 100%;
  aspect-ratio: 576 / 900;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   MOBILE STOREFRONT SHELL (< 900px) — DISTINCT NATIVE-APP UI
   ========================================================================== */
@media (max-width: 899px) {
  #bg, .pc-shell { display: none !important; }
  .mob-shell {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    width: 100%;
    overflow: hidden;
    background: var(--paper);
  }

  .mob-header {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
    background: var(--sheet);
    border-bottom: 1px solid var(--rule);
    z-index: 20;
  }
  .mob-brand {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
  }
  .mob-brand .brand-icon { width: 20px; height: 20px; color: var(--cobalt); flex: none; }
  .mob-brand span {
    font: 500 15.5px/1.1 var(--serif);
    letter-spacing: -0.015em;
    white-space: nowrap;
  }
  .mob-header-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: none;
  }
  .mob-icon-btn {
    min-width: 31px;
    height: 31px;
    padding: 0 7px;
    border-radius: 999px;
    border: 1px solid var(--rule);
    background: var(--paper);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
  }
  .mob-icon-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .mob-icon-btn .moon { display: none; }
  html.theme-dark .mob-icon-btn .sun { display: none; }
  html.theme-dark .mob-icon-btn .moon { display: block; }

  .mob-main {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 12px 14px 20px;
  }
  .mob-view { display: flex; flex-direction: column; gap: 12px; }

  .mob-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    background: var(--sheet);
    border: 1px solid var(--rule);
  }
  .mob-search-box svg { width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 1.8; flex: none; }
  .mob-search-box input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: none;
    color: var(--ink);
    font: 500 16px/1.2 var(--sans);
    user-select: text;
    -webkit-user-select: text;
  }
  .mob-search-box input::placeholder { font-size: 13.5px; color: var(--muted); }
  .mob-search-clear { width: 24px; height: 24px; border-radius: 50%; font-size: 18px; color: var(--muted); }

  .mob-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .mob-chips::-webkit-scrollbar { display: none; }
  .mob-chips button {
    flex: none;
    height: 32px;
    padding: 0 13px;
    border-radius: 999px;
    border: 1px solid var(--rule);
    background: var(--sheet);
    font: 600 12px/1 var(--sans);
    white-space: nowrap;
  }
  .mob-chips button.on {
    background: var(--cobalt);
    border-color: var(--cobalt);
    color: #fff;
  }

  .mob-subbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .mob-status-pills {
    display: flex;
    flex: 1;
    min-width: 0;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .mob-status-pills::-webkit-scrollbar { display: none; }
  .mob-status-pills button {
    flex: none;
    height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid var(--rule);
    font: 600 10.5px/1 var(--sans);
    color: var(--muted);
    white-space: nowrap;
  }
  .mob-status-pills button.on {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
  }
  .mob-count {
    flex: none;
    font: 600 11px/1 var(--sans);
    color: var(--muted);
  }

  .mob-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  @media (min-width: 600px) and (max-width: 899px) {
    .mob-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  }

  .mob-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border-radius: 14px;
    background: var(--card);
    border: 1px solid var(--rule);
    content-visibility: auto;
    contain-intrinsic-size: 165px 275px;
    contain: layout style paint;
  }
  .mob-card-cover {
    position: relative;
    aspect-ratio: 576 / 900;
    border-radius: 9px;
    overflow: hidden;
    background: var(--paper);
  }
  .mob-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .mob-card-status {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 3px 7px;
    border-radius: 99px;
    font: 700 10px/1 var(--sans);
    color: #fff;
    background: rgba(20, 20, 20, 0.72);
  }
  .mob-card-status[data-s="want"] { background: #2563eb; }
  .mob-card-status[data-s="reading"] { background: #d97706; }
  .mob-card-status[data-s="done"] { background: #16a34a; }

  .mob-card-title {
    font: 600 13.5px/1.25 var(--serif);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .mob-card-author {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mob-empty {
    grid-column: 1 / -1;
    padding: 38px 18px;
    text-align: center;
    border: 1px dashed var(--rule);
    border-radius: 16px;
    color: var(--muted);
  }
  .mob-empty b { display: block; font-size: 15px; color: var(--ink); margin-bottom: 6px; }
  .mob-empty button {
    margin-top: 12px;
    height: 34px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--cobalt);
    color: #fff;
    font: 600 12px/1 var(--sans);
  }

  .mob-section-head h2 { font: 500 22px/1.15 var(--serif); }
  .mob-section-head p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

  .mob-recent-list { display: flex; flex-direction: column; gap: 8px; }
  .mob-recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 14px;
    background: var(--card);
    border: 1px solid var(--rule);
    text-align: left;
    width: 100%;
  }
  .mob-recent-item img { width: 44px; height: 64px; border-radius: 7px; object-fit: cover; flex: none; }
  .mob-recent-item .info { flex: 1; min-width: 0; }
  .mob-recent-item b { display: block; font: 600 14px/1.25 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mob-recent-item small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 4px; }

  .mob-music-card, .mob-req-card {
    padding: 14px;
    border-radius: 16px;
    background: var(--card);
    border: 1px solid var(--rule);
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .mob-music-now { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .mob-music-title b { display: block; font-size: 15px; }
  .mob-music-title small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
  .mob-play-btn {
    height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--cobalt);
    color: #fff;
    font: 600 12.5px/1 var(--sans);
  }
  .mob-music-controls { display: flex; gap: 8px; flex-wrap: wrap; }
  .mob-music-controls button, .mob-mp3-btn {
    height: 32px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--rule);
    font: 600 11.5px/32px var(--sans);
    display: inline-flex;
    align-items: center;
    cursor: pointer;
  }
  .mob-playlist {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 16px;
    padding: 8px;
  }
  .mob-playlist button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 12.5px;
    text-align: left;
  }
  .mob-playlist button.now { background: rgba(31, 63, 176, 0.14); color: var(--cobalt); font-weight: 600; }
  .mob-playlist small { color: var(--muted); }
  .mob-req-card h3 { font: 600 15px/1.2 var(--sans); }
  .mob-req-card p { font-size: 12.5px; color: var(--muted); }
  .mob-req-btn {
    align-self: flex-start;
    height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--cobalt);
    color: #fff;
    font: 600 12px/1 var(--sans);
  }

  .mob-nav {
    flex: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--sheet);
    border-top: 1px solid var(--rule);
    z-index: 20;
  }
  .mob-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    font: 600 10.5px/1 var(--sans);
  }
  .mob-nav button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .mob-nav button.on { color: var(--cobalt); }
  .mob-nav-badge {
    font-style: normal;
    background: var(--gold);
    color: #141414;
    padding: 1px 5px;
    border-radius: 99px;
    font-size: 9.5px;
    font-weight: 700;
  }

  /* Mobile Detail Sheet (#dt) */
  .dt-topbar .brand-text b { font-size: 16px; }
  .dt-body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    gap: 18px;
    padding: 16px 18px 20px;
    align-items: stretch;
    justify-content: flex-start;
  }
  .detail .pos {
    order: -1;
    height: auto;
    flex: none;
  }
  .detail .pos #coverDirect, .detail .pos svg {
    max-height: 36svh;
    height: 36svh;
    width: auto;
  }
  .detail .txt {
    max-width: 100%;
    max-height: none;
    gap: 10px;
  }
  .detail .txt h2 { font-size: clamp(26px, 7vw, 36px); }
  .syn-scroll { max-height: 210px; }
  .dt-actions {
    position: sticky;
    bottom: 0;
    width: 100%;
    padding: 10px 0 calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--sheet);
    border-top: 1px solid var(--rule);
    z-index: 3;
  }
  .dt-actions .w { flex: 1; }
}

/* ==========================================================================
   BOOK REQUEST DIALOG
   ========================================================================== */
.book-request-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(18, 22, 22, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.book-request-dialog {
  width: min(360px, 100%);
  background: var(--sheet);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.book-request-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.book-request-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 18px;
  border: 1px solid var(--rule);
}
#bookRequestForm { display: grid; gap: 10px; }
#bookRequestForm input, #bookRequestForm textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  user-select: text;
  -webkit-user-select: text;
}
#bookRequestForm textarea { min-height: 86px; resize: vertical; }
.book-request-submit {
  height: 38px;
  border-radius: 999px;
  background: var(--cobalt);
  color: #fff;
  font-weight: 600;
}
.book-request-status { font-size: 12.5px; color: var(--cobalt); min-height: 18px; }

/* ==========================================================================
   BOOK READER (.rdr)
   ========================================================================== */
.rdr {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 35%, #4a3a2c, #17110c 78%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  overscroll-behavior: contain;
  transition: opacity 0.32s, visibility 0s 0.32s;
  user-select: none;
  --ph: min(calc(100dvh - 134px), calc(44vw * 1.4));
  --pw: calc(var(--ph) * 0.72);
}
.rdr.on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.32s;
}
html.theme-dark .rdr {
  background: radial-gradient(ellipse at 50% 35%, #2d3544, #0b0e14 78%);
}

#rdx {
  position: fixed;
  z-index: 112;
  left: max(14px, env(safe-area-inset-left, 0px));
  top: calc(14px + env(safe-area-inset-top, 0px));
  background: var(--sheet);
  color: var(--ink);
}
.rdzoom {
  position: fixed;
  z-index: 112;
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: max(14px, env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 5px;
  border-radius: 999px;
  background: rgba(249, 246, 238, 0.94);
  color: #30271f;
  border: 1px solid rgba(70, 55, 35, 0.2);
  box-shadow: 0 5px 22px rgba(0, 0, 0, 0.35);
  font: 600 11px/1 var(--sans);
}
html.theme-dark .rdzoom {
  background: rgba(35, 40, 50, 0.92);
  color: #f2eee7;
  border-color: rgba(255, 255, 255, 0.16);
}
.rdzoom button {
  height: 28px;
  min-width: 32px;
  padding: 0 7px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.rdzoom button:hover:not(:disabled) { background: rgba(127, 127, 127, 0.18); }
.rdzoom button:disabled { opacity: 0.3; cursor: default; }
.rdzoom b { font: 600 14px/1 var(--serif); }
.rdzoom i { font: 600 12px/1 var(--sans); font-style: normal; }
.rdzoom #rdzval { min-width: 44px; font-variant-numeric: tabular-nums; }

.rdr .bk {
  flex-shrink: 0;
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  perspective: 2800px;
  margin-bottom: 34px;
  transition: transform 0.55s var(--ease), opacity 0.18s ease;
}
.rdr .bk.two { width: calc(var(--pw) * 2); height: var(--ph); }
.rdr .bk.one { width: var(--pw); height: var(--ph); }
.rdr .bk::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 6px;
  box-shadow: 0 36px 72px rgba(0, 0, 0, 0.52);
  pointer-events: none;
}
.rdr .pg {
  flex: 0 0 var(--pw);
  min-width: var(--pw);
  width: var(--pw);
  height: var(--ph);
  position: relative;
  overflow: hidden;
  padding: calc(var(--pw) * 0.095) calc(var(--pw) * 0.085);
  background: #F6F1E4;
  color: #2b2218;
  font: 400 calc(var(--pw) * 0.043) / 1.55 var(--serif);
  display: flex;
  flex-direction: column;
}
.rdr .pg.l { border-radius: 5px 0 0 5px; background: linear-gradient(90deg, #F6F1E4 0, #F6F1E4 86%, #d8cdb4 100%); }
.rdr .pg.r { border-radius: 0 5px 5px 0; background: linear-gradient(90deg, #d8cdb4 0, #F6F1E4 14%, #F6F1E4 100%); }
.rdr .bk.one .pg { border-radius: 5px; background: #F6F1E4; }
.rdr .pg.no { visibility: hidden; }
html.theme-dark .rdr .pg, html.theme-dark .rdr .bk.one .pg { background: #252b35; color: #eee8dc; }
html.theme-dark .rdr .pg.l { background: linear-gradient(90deg, #252b35 0, #252b35 86%, #161b23 100%); }
html.theme-dark .rdr .pg.r { background: linear-gradient(90deg, #161b23 0, #252b35 14%, #252b35 100%); }

/* Reading lamp in dark mode */
html.theme-dark .rdr .pg { isolation: isolate; }
html.theme-dark .rdr .pg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle 105px at var(--lamp-x, -500px) var(--lamp-y, -500px), rgba(255, 244, 207, 0.56) 0%, rgba(255, 226, 163, 0.36) 30%, transparent 100%);
  transition: opacity 0.12s ease;
}
html.theme-dark .rdr .pg.lamp-active::after { opacity: 1; }

.rdr .flip {
  position: absolute;
  top: 0;
  width: var(--pw);
  height: var(--ph);
  transform-style: preserve-3d;
  z-index: 4;
}
.rdr .flip.fr { left: var(--pw); transform-origin: left center; }
.rdr .flip.fl { left: 0; transform-origin: right center; }
.rdr .flip .pg { position: absolute !important; inset: 0; backface-visibility: hidden; }
.rdr .flip .bf { transform: rotateY(180deg); }

.rk { font: 600 calc(var(--pw) * 0.026) / 1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: #7b6d58; }
.rt { font: 400 calc(var(--pw) * 0.092) / 1.08 var(--serif); margin: 0.5em 0 0.35em; letter-spacing: -0.01em; }
.rt.s { font-size: calc(var(--pw) * 0.068); }
.rg { margin: auto 0; text-align: center; }
.rg .big { font: 300 calc(var(--pw) * 0.4) / 1 var(--serif); color: #b9ab8f; }
.rp { margin: 0.4em 0; }
.rm { color: #6d604c; font-size: 0.9em; }
.rn { margin-top: auto; font: 600 calc(var(--pw) * 0.024) / 1 var(--sans); letter-spacing: 0.18em; color: #8a7c66; text-align: center; }
.rbody { flex: 0 0 auto; font-family: "Times New Roman", Times, var(--serif); line-height: 1.46; font-size: calc(var(--pw) * var(--rz, 1) * 0.043); }
.rtit { font-size: calc(var(--pw) * var(--rz, 1) * 0.068); line-height: 1.22; text-transform: uppercase; text-align: center; margin: 0 0 0.9em; }
.rtx { margin: 0; text-align: justify; text-indent: 1.5em; hyphens: auto; -webkit-hyphens: auto; }
.rtx.c { text-indent: 0; }

.kv-house-figure { width: 100%; display: flex; align-items: center; justify-content: center; margin: 10px auto 6px; }
.kv-house-figure img { max-width: 100%; max-height: calc(var(--ph) * 0.7); object-fit: contain; border-radius: 4px; }
.rdr .pg .rbody.kv-img-page { display: flex !important; flex-direction: column; align-items: center; justify-content: center; height: 100%; }
.rdr .pg .rbody.kv-img-page img { max-width: 100%; max-height: 92%; object-fit: contain; }
.kv-img-cap { font-size: 0.78em; color: var(--muted); margin-top: 6px; text-align: center; }

.toc-bookmark { font: 500 0.78em/1.45 var(--sans); margin: 0.7em 0 0.4em; padding: 0.55em 0.7em; border: 1px solid #cbbda7; border-radius: 6px; background: rgba(166, 113, 70, 0.07); }
.toc-bookmark strong { color: #a23d4a; }
.rul { list-style: none; padding: 0; margin: 0.6em 0 0; }
.rul li { display: flex; gap: 0.8em; padding: 0.4em 0; border-bottom: 1px dotted #bfb298; cursor: pointer; font-size: 0.92em; }
.rul li:hover { color: var(--cobalt); }
.rul b { font: 600 0.72em/1.9 var(--sans); color: #8a7c66; min-width: 1.8em; }
html.theme-dark .toc-bookmark { background: rgba(255, 255, 255, 0.06); border-color: #636a75; }
html.theme-dark .rul li { border-color: #59606a; }
html.theme-dark .rul b { color: #b0b7c5; }

.rnv {
  position: fixed;
  top: 50%;
  z-index: 105;
  width: 46px;
  height: 46px;
  margin-top: -23px;
  border-radius: 50%;
  border: 1px solid rgba(246, 241, 228, 0.55);
  background: rgba(20, 16, 12, 0.42);
  color: #F6F1E4;
  font-size: 20px;
}
.rnv:hover { background: rgba(246, 241, 228, 0.92); color: #17110c; }
.rnv.p { left: max(16px, calc(50% - var(--pw) - 72px)); }
.rnv.n { right: max(16px, calc(50% - var(--pw) - 72px)); }
.rnv[disabled] { opacity: 0.25; pointer-events: none; }

.rin {
  position: fixed;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(246, 241, 228, 0.78);
  pointer-events: none;
  z-index: 105;
}

.rdtools {
  position: fixed;
  z-index: 112;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100vw - 16px);
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(249, 246, 238, 0.94);
  color: #30271f;
  border: 1px solid rgba(70, 55, 35, 0.2);
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.45);
  font: 600 11px/1.2 var(--sans);
  overflow-x: auto;
  scrollbar-width: none;
}
.rdtools::-webkit-scrollbar { display: none; }
html.theme-dark .rdtools {
  background: rgba(35, 40, 50, 0.92);
  color: #f2eee7;
  border-color: rgba(255, 255, 255, 0.16);
}
.rdtools button {
  height: 30px;
  min-width: 30px;
  padding: 0 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 18px;
  white-space: nowrap;
  flex: none;
}
.rdtools button:hover { background: rgba(127, 127, 127, 0.16); }
.rdtools svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rdtools .rd-track { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; font-weight: 500; }
.rdtools .rd-split { height: 18px; width: 1px; background: rgba(127, 127, 127, 0.35); flex: none; }
.rdtools .rd-saved { color: var(--cobalt); }
.rdtools .rd-saved svg { fill: currentColor; }
.rdtools .rd-music-on { color: var(--cobalt); }
.rdtools #rdFav { font-size: 16px; }
.rdtools #rdFav.on { color: var(--gold); }
.rdtools .read-session-clock { height: 26px; padding: 0 8px; font-size: 10px; background: rgba(127, 127, 127, 0.12); border-color: transparent; }

.rdr.zoomed {
  overflow: auto !important;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 58px 24px 96px;
}
.rdr.zoomed .bk { margin: auto !important; }
.rdr.zoomed .rnv.p { left: 16px; }
.rdr.zoomed .rnv.n { right: 16px; }

@media (max-width: 767px) {
  .rdr {
    --pw: min(92vw, calc((100dvh - 150px) * 0.72));
    --ph: calc(var(--pw) / 0.72);
  }
  .rdr .bk { margin-bottom: 36px; }
  .rnv { width: 38px; height: 38px; top: auto; bottom: calc(52px + env(safe-area-inset-bottom, 0px)); margin: 0; font-size: 17px; }
  .rnv.p { left: 14px; }
  .rnv.n { right: 14px; }
  .rin { bottom: calc(60px + env(safe-area-inset-bottom, 0px)); font-size: 10px; }
  .rdtools { gap: 2px; padding: 4px 6px; }
  .rdtools .rd-track, .rdtools .read-session-clock { display: none; }
}

@media (orientation: landscape) and (max-height: 620px) {
  .rdr {
    --ph: min(calc(100dvh - 118px), calc(44vw * 1.4));
    --pw: calc(var(--ph) * 0.72);
  }
  .rdr .bk { margin-bottom: 24px; }
  .rin { bottom: calc(48px + env(safe-area-inset-bottom, 0px)); }
}

/* Highlights, Bookmarks & Progress panels */
.rdr .bk .pg, .rdr .bk .pg * { user-select: text !important; -webkit-user-select: text !important; }
.rdr .bk .pg::selection, .rdr .bk .pg *::selection { background: rgba(255, 207, 64, 0.45); }
.pg .reader-highlight { border-radius: 2px; cursor: pointer; }
::highlight(reader-yellow) { background-color: #ffe46b; color: inherit; }
::highlight(reader-green) { background-color: #a9e8ac; color: inherit; }
::highlight(reader-pink) { background-color: #ffc1d9; color: inherit; }
::highlight(reader-blue) { background-color: #b7d9ff; color: inherit; }

.hlbar, .hlact {
  position: fixed;
  z-index: 10010;
  left: 50%;
  bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
  background: #272522;
  color: #f2eee7;
  border: 1px solid #80776a;
  border-radius: 30px;
  padding: 8px 12px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.45);
}
.hlbar button { background: #fff; border-radius: 50%; width: 32px; height: 32px; font-size: 16px; }
.hlact button { background: #fff; color: #2b2218; border-radius: 17px; height: 32px; padding: 0 12px; font: 600 12px/1 var(--sans); }
.hlact button.del { background: #e5484d; color: #fff; }
.rdtools #rdhl b {
  font: 700 10px/1 var(--sans);
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 8px;
  background: #e5a100;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hlpanel {
  position: fixed;
  z-index: 10020;
  left: 50%;
  bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(400px, calc(100vw - 20px));
  max-height: min(62vh, 500px);
  display: flex;
  flex-direction: column;
  background: #272522;
  color: #f2eee7;
  border: 1px solid #80776a;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
  font: 13px/1.45 var(--sans);
  overflow: hidden;
}
.hlpanel .hh { display: flex; align-items: center; gap: 6px; padding: 8px; border-bottom: 1px solid #4a453d; }
.hlpanel .tabs { position: static; background: none; border: 0; padding: 0; margin: 0; display: flex; gap: 4px; flex: 1; }
.hlpanel .tabs button { background: #3b372f; color: #e9e3d6; height: 30px; padding: 0 10px; border-radius: 15px; font: 600 12px/1 var(--sans); }
.hlpanel .tabs button.on { background: #f2eee7; color: #272522; }
.hlpanel .hh > button { flex: 0 0 30px; background: #3b372f; color: #f2eee7; width: 30px; height: 30px; border-radius: 50%; }
.hlpanel .pane { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: hidden; }
.hlpanel .ph { padding: 9px 12px 4px; }
.hlpanel .ph b { display: block; font-size: 14px; }
.hlpanel .ph span { display: block; margin-top: 2px; color: #cfc6b6; font-size: 12px; }
.hlpanel .hl { overflow: auto; overscroll-behavior: contain; padding: 4px 0; }
.hlpanel .hr { display: flex; align-items: center; gap: 9px; padding: 8px 12px; cursor: pointer; }
.hlpanel .hr:hover { background: #34302a; }
.hlpanel .hr i { flex: 0 0 10px; width: 10px; height: 34px; border-radius: 5px; }
.hlpanel .hr .t { flex: 1; min-width: 0; }
.hlpanel .hr .t b { display: block; font-size: 12px; color: #ffd978; }
.hlpanel .hr .t span { display: block; color: #ece6da; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hlpanel .hr button { flex: 0 0 auto; background: #3b372f; color: #f2eee7; width: 30px; height: 30px; border-radius: 50%; }
.hlpanel .hempty { padding: 18px 14px; text-align: center; color: #cfc6b6; }
.hlpanel .hf { padding: 8px 12px; border-top: 1px solid #4a453d; display: flex; justify-content: flex-end; gap: 8px; }
.hlpanel .hf button { background: #3b372f; color: #ffb3b5; border-radius: 16px; height: 30px; padding: 0 12px; font: 600 12px/1 var(--sans); }
.hlpanel .hf button#bmadd { background: #f2eee7; color: #272522; }
.hlpanel .pgbody { padding: 12px; overflow: auto; overscroll-behavior: contain; }
.hlpanel .pgbig { display: flex; align-items: baseline; gap: 10px; }
.hlpanel .pgbig b { font-size: 30px; color: #ffd978; }
.hlpanel .pgbar { height: 8px; border-radius: 4px; background: #3b372f; overflow: hidden; margin: 6px 0 12px; }
.hlpanel .pgbar i { display: block; height: 100%; background: #e5a100; }
.hlpanel .pgli { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.hlpanel .pgli small { display: block; color: #cfc6b6; font-size: 11.5px; }
.hlpanel .pgli b { color: #ffd978; }
.hlpanel .pgweek { display: flex; align-items: flex-end; gap: 6px; height: 70px; margin-top: 14px; }
.hlpanel .pgweek div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 100%; font-size: 10px; color: #cfc6b6; }
.hlpanel .pgweek i { display: block; width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; background: #e5a100; }
.hlpanel .pgwk { margin-top: 6px; color: #cfc6b6; font-size: 11.5px; text-align: center; }

#rdprog { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 120; background: rgba(255, 255, 255, 0.1); pointer-events: none; }
#rdprog i { display: block; height: 100%; width: 0; background: #e5a100; transition: width 0.3s; }
.rdr .pg.has-reader-bookmark::after { content: ""; position: absolute; right: 11%; top: 0; width: 18px; height: 36px; background: #bd3f45; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); pointer-events: none; z-index: 3; }
.reader-context { position: fixed; z-index: 20000; width: 226px; padding: 6px; background: #fffaf0; border: 1px solid #b9a88f; border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45); color: #29231e; font: 13px/1.4 var(--sans); }
.reader-context button { display: block; width: 100%; text-align: left; padding: 9px 11px; border-radius: 8px; }
.reader-context button:hover { background: #eee3d2; }
.reader-context .context-caption { padding: 5px 10px; font-size: 11px; color: #7a6a58; border-bottom: 1px solid #e4d9c7; }

/* ==========================================================================
   FREE AUDIOBOOK DIALOG (#listenDialog)
   ========================================================================== */
#listenDialog {
  margin: auto;
  width: min(360px, calc(100vw - 28px));
  max-height: 90dvh;
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: 20px;
  background: var(--sheet);
  color: var(--ink);
  font: 14px/1.45 var(--sans);
  box-shadow: 0 18px 65px rgba(0, 0, 0, 0.35);
}
#listenDialog::backdrop { background: rgba(16, 20, 28, 0.52); }
#listenDialog header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
#listenDialog h2 { font: 500 22px/1.2 var(--serif); }
#listenDialog [data-close] { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--rule); font-size: 18px; }
#listenDialog [data-book-title] { font-weight: 600; margin-bottom: 10px; color: var(--cobalt); }
#listenDialog .action { display: block; width: 100%; padding: 10px; text-align: center; border: 1px solid var(--rule); border-radius: 12px; font-weight: 600; margin-bottom: 10px; }
#listenDialog .primary { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
#listenDialog label { display: grid; gap: 4px; margin-bottom: 11px; font-size: 13px; }
#listenDialog label:has(output) { display: flex; justify-content: space-between; align-items: center; }
#listenDialog input[type="range"] { accent-color: var(--cobalt); padding: 0; border: 0; height: 26px; background: transparent; width: 100%; }
#listenDialog select { width: 100%; font: inherit; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 9px; padding: 8px 10px; }
#listenDialog .kv-narrators { border: 0; padding: 0; margin: 10px 0; }
#listenDialog .kv-narrators legend { margin-bottom: 5px; font-size: 13px; }
#listenDialog .kv-narrators div { display: flex; gap: 8px; }
#listenDialog .kv-narrators button { flex: 1; min-height: 36px; border-radius: 9px; border: 1px solid var(--rule); }
#listenDialog .kv-narrators button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
#kvVoiceMix { border: 1px solid var(--rule); border-radius: 12px; margin: 10px 0; padding: 10px 12px; }
#kvVoiceMix small { display: block; margin-bottom: 8px; font-size: 11.5px; color: var(--muted); }
#listenDialog .minor { font-size: 12.5px; text-decoration: underline; padding: 4px 0; color: var(--muted); }
#listenDialog [role="status"]:not(:empty) { margin-top: 10px; color: var(--muted); font-size: 12.5px; }

/* ==========================================================================
   LANGUAGE SWITCHER & LITE HINT
   ========================================================================== */
.kv-lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 31px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: rgba(250, 248, 242, 0.72);
  color: var(--ink);
  font: 700 11px/1 var(--sans);
  flex: none;
}
html.theme-dark .kv-lang { background: rgba(34, 40, 52, 0.78); }
.kv-lang svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.kv-lang .o { opacity: 0.45; }
.kv-lang[data-l="vi"] .v, .kv-lang[data-l="en"] .e { opacity: 1; color: var(--cobalt); }
.kv-lang.busy svg { animation: kvspin 1s linear infinite; }
@keyframes kvspin { to { transform: rotate(360deg); } }
.rdtools .kv-lang { height: 30px; border: 0; background: transparent; padding: 0 6px; }
.kv-lang-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 2147483000;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(20, 20, 20, 0.9);
  color: #fff;
  font-size: 12.5px;
}

#liteHint {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
  font-size: 12px;
}
#liteHint [data-y] { padding: 5px 10px; border-radius: 999px; background: var(--cobalt); color: #fff; font-weight: 600; }

/* Lite & Reduced Motion overrides */
html.lite *, html.lite *::before, html.lite *::after {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .mu.on .eq i { animation: none; height: 8px; }
}
