/* ============ Record Book — design tokens ============ */
:root {
  --bg: #eef4ff;
  --bg-2: #f7faff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-2: #f2f6ff;
  --line: rgba(37, 99, 235, 0.12);
  --line-2: rgba(15, 30, 61, 0.08);
  --text: #0f1e3d;
  --text-2: #3b4a6b;
  --muted: #6a7a9b;
  --primary: #2563eb;
  --primary-2: #4f46e5;
  --primary-soft: #dbe7ff;
  --sky: #0ea5e9;
  --teal: #0d9488;
  --teal-soft: #d5f5f0;
  --violet: #7c3aed;
  --violet-soft: #ede4ff;
  --coral: #f97362;
  --coral-soft: #ffe4df;
  --amber: #f59e0b;
  --amber-soft: #fff1d6;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --grad: linear-gradient(135deg, #2563eb 0%, #4f46e5 55%, #7c3aed 100%);
  --grad-sky: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  --grad-warm: linear-gradient(135deg, #f97362 0%, #f59e0b 100%);
  --grad-teal: linear-gradient(135deg, #14b8a6 0%, #0ea5e9 100%);
  --shadow: 0 1px 2px rgba(15, 30, 61, .05), 0 8px 28px -10px rgba(37, 99, 235, .22);
  --shadow-lg: 0 24px 60px -20px rgba(30, 58, 138, .35);
  --radius: 18px;
  --radius-sm: 12px;
  --paper: #fffdf7;
  --paper-2: #f7f1e3;
  --ink: #2b2a33;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --is-dark: 1; }
}
:root[data-theme="dark"] {
  --bg: #070f24;
  --bg-2: #0b1530;
  --surface: rgba(17, 28, 58, 0.78);
  --surface-solid: #111c3a;
  --surface-2: #16234a;
  --line: rgba(129, 160, 255, 0.16);
  --line-2: rgba(255, 255, 255, 0.07);
  --text: #e8eeff;
  --text-2: #bac6e6;
  --muted: #8392b8;
  --primary: #5b8cff;
  --primary-2: #8b7bff;
  --primary-soft: rgba(91, 140, 255, .16);
  --teal-soft: rgba(20, 184, 166, .16);
  --violet-soft: rgba(139, 92, 246, .18);
  --coral-soft: rgba(249, 115, 98, .16);
  --amber-soft: rgba(245, 158, 11, .16);
  --green-soft: rgba(22, 163, 74, .18);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .7);
  --paper: #f4ecdc;
  --paper-2: #e6dcc6;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.55;
  overflow: hidden;
}
/* living background */
.bg-blobs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-blobs span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: drift 26s ease-in-out infinite alternate; }
.bg-blobs span:nth-child(1) { width: 520px; height: 520px; background: #93c5fd; top: -160px; left: -120px; }
.bg-blobs span:nth-child(2) { width: 440px; height: 440px; background: #a5b4fc; bottom: -160px; right: -80px; animation-delay: -8s; }
.bg-blobs span:nth-child(3) { width: 320px; height: 320px; background: #67e8f9; top: 40%; left: 45%; opacity: .3; animation-delay: -14s; }
.bg-blobs span:nth-child(4) { width: 260px; height: 260px; background: #fda4af; top: 10%; right: 18%; opacity: .22; animation-delay: -4s; }
:root[data-theme="dark"] .bg-blobs span { opacity: .18; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.08); } }

a { color: var(--primary); }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--text); }
::selection { background: rgba(37, 99, 235, .22); }

/* ============ Shell ============ */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: 248px 1fr; height: 100vh; }
.sidebar {
  display: flex; flex-direction: column; gap: 6px;
  padding: 22px 16px; border-right: 1px solid var(--line);
  background: var(--surface); backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px;
  box-shadow: 0 10px 24px -8px rgba(79, 70, 229, .7);
}
.brand b { display: block; font-size: 16px; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 12px; }
.nav-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: 0; background: transparent; padding: 11px 12px; border-radius: 12px;
  color: var(--text-2); font-weight: 600; text-align: left; transition: .2s;
}
.nav-btn .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; background: var(--surface-2); transition: .2s; }
.nav-btn:hover { background: var(--primary-soft); color: var(--text); }
.nav-btn.active { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -10px rgba(79, 70, 229, .8); }
.nav-btn.active .ico { background: rgba(255, 255, 255, .2); }
.nav-sep { height: 1px; background: var(--line); margin: 10px 6px; }
.sidebar-foot { margin-top: auto; display: grid; gap: 6px; }
.search-trigger {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-solid); color: var(--muted); font-size: 14px;
}
.kbd { margin-left: auto; font-size: 11px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); }

.main { overflow-y: auto; overflow-x: hidden; height: 100vh; }
.view { max-width: 1240px; margin: 0 auto; padding: 28px 32px 80px; animation: viewIn .35s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: 30px; letter-spacing: -.025em; line-height: 1.15; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .spacer { flex: 1; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ============ Components ============ */
.card {
  background: var(--surface); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px;
}
.card h3 { margin: 0 0 10px; font-size: 16px; letter-spacing: -.01em; }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-title h3 { margin: 0; }
.card-title .spacer { flex: 1; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line);
  background: var(--surface-solid); padding: 9px 14px; border-radius: 11px; font-weight: 600; font-size: 14px;
  transition: .18s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.btn.primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 8px 20px -8px rgba(79, 70, 229, .75); }
.btn.primary:hover { color: #fff; filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.danger:hover { border-color: var(--coral); color: var(--coral); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-solid); transition: .18s; }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn.on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }

.input, .textarea, .select {
  width: 100%; border: 1px solid var(--line); background: var(--surface-solid);
  border-radius: 11px; padding: 10px 12px; outline: none; transition: .18s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
label.lbl { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 6px; }
.field { margin-bottom: 14px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--primary-soft); color: var(--primary); white-space: nowrap; }
.chip.teal { background: var(--teal-soft); color: var(--teal); }
.chip.violet { background: var(--violet-soft); color: var(--violet); }
.chip.coral { background: var(--coral-soft); color: var(--coral); }
.chip.amber { background: var(--amber-soft); color: #b45309; }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.gray { background: var(--surface-2); color: var(--muted); }
:root[data-theme="dark"] .chip.amber { color: var(--amber); }

.tabs { display: flex; gap: 4px; padding: 5px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(12px); overflow-x: auto; scrollbar-width: none; margin-bottom: 20px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: transparent; padding: 9px 14px; border-radius: 10px; font-weight: 600; color: var(--text-2); white-space: nowrap; display: flex; align-items: center; gap: 7px; transition: .18s; }
.tab:hover { background: var(--primary-soft); }
.tab.active { background: var(--surface-solid); color: var(--primary); box-shadow: var(--shadow); }

.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width .6s ease; }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 26px; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13px; }
.stat-card { position: relative; overflow: hidden; }
.stat-card .orb { position: absolute; right: -18px; top: -18px; width: 90px; height: 90px; border-radius: 50%; opacity: .16; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* ring */
.ring { --p: 0; --c: var(--primary); width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0); position: relative; flex-shrink: 0; }
.ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--surface-solid); }
.ring > div { position: relative; text-align: center; }
.ring b { font-size: 28px; display: block; letter-spacing: -.02em; }
.ring span { font-size: 12px; color: var(--muted); }

/* hero */
.hero {
  border-radius: 24px; padding: 28px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.22), transparent 40%), var(--grad);
  box-shadow: var(--shadow-lg);
}
.hero::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero h2 { margin: 6px 0 8px; font-size: 26px; letter-spacing: -.02em; }
.hero p { margin: 0; opacity: .9; max-width: 640px; }
.hero .btn { background: rgba(255,255,255,.95); color: var(--primary-2); border-color: transparent; }
.hero .btn.ghost { background: rgba(255,255,255,.15); color: #fff; }

/* modal / drawer */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(8, 15, 40, .45); backdrop-filter: blur(4px); display: flex; justify-content: flex-end; animation: fade .2s; }
.overlay.center { justify-content: center; align-items: flex-start; padding: 6vh 16px; }
@keyframes fade { from { opacity: 0; } }
.drawer { width: min(760px, 100%); height: 100%; background: var(--bg-2); box-shadow: var(--shadow-lg); overflow-y: auto; animation: slideIn .3s cubic-bezier(.2,.8,.2,1); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { position: sticky; top: 0; z-index: 2; padding: 20px 24px 14px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.drawer-body { padding: 20px 24px 60px; }
.modal { width: min(640px, 100%); max-height: 86vh; overflow-y: auto; background: var(--bg-2); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 24px; animation: pop .22s ease; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; background: #0f1e3d; color: #fff; padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; animation: pop .2s; }

/* ============ Home ============ */
.home-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; margin-top: 18px; }
.module-card { cursor: pointer; transition: .25s; position: relative; overflow: hidden; }
.module-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.module-card .mi { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; color: #fff; margin-bottom: 12px; }
.quote-card { font-family: var(--serif); font-size: 17px; line-height: 1.5; font-style: italic; }

/* ============ Studio ============ */
.today-card { display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: center; }
.beat { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.beat:last-child { border-bottom: 0; }
.beat .tag { font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--primary); padding-top: 3px; }
.beat.hook .tag { color: var(--coral); }
.beat.cta .tag { color: var(--teal); }
.beat p { margin: 0; }

.cal-week { margin-bottom: 18px; }
.cal-week-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cal-week-head b { font-size: 14px; }
.cal-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day-tile {
  border: 1px solid var(--line); background: var(--surface-solid); border-radius: 14px; padding: 10px; text-align: left;
  min-height: 92px; display: flex; flex-direction: column; gap: 4px; transition: .2s; position: relative;
}
.day-tile:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow); }
.day-tile .dn { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .06em; }
.day-tile .dt { font-size: 12.5px; font-weight: 600; line-height: 1.3; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.day-tile .dot { position: absolute; top: 10px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.day-tile.today { outline: 2px solid var(--primary); outline-offset: 2px; }
.st-0 .dot { background: #cbd5e1; } .st-1 .dot { background: var(--sky); } .st-2 .dot { background: var(--violet); }
.st-3 .dot { background: var(--amber); } .st-4 .dot { background: var(--teal); }
.st-5 { background: linear-gradient(160deg, var(--green-soft), var(--surface-solid) 70%); }
.st-5 .dot { background: var(--green); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

.stage-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.stage-step { flex: 1; min-width: 90px; border: 1px solid var(--line); background: var(--surface-solid); border-radius: 10px; padding: 8px 6px; font-size: 12px; font-weight: 700; text-align: center; color: var(--muted); transition: .2s; }
.stage-step.done { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.stage-step.cur { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -6px rgba(79,70,229,.7); }

.check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; cursor: pointer; transition: .15s; }
.check:hover { background: var(--primary-soft); }
.check input { display: none; }
.check .box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); flex-shrink: 0; display: grid; place-items: center; transition: .2s; background: var(--surface-solid); }
.check input:checked + .box { background: var(--grad); border-color: transparent; }
.check input:checked + .box::after { content: "✓"; color: #fff; font-size: 13px; font-weight: 800; }
.check input:checked ~ span { color: var(--muted); text-decoration: line-through; }

.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kanban { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.kcol { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px; min-height: 300px; }
.kcol.drop { outline: 2px dashed var(--primary); }
.kcol h4 { margin: 4px 6px 10px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.kcard { background: var(--surface-solid); border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; cursor: grab; font-size: 13px; transition: .15s; }
.kcard:hover { border-color: var(--primary); }
.kcard b { display: block; font-size: 11px; color: var(--muted); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface-solid); }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line-2); }
.tbl tr:hover td { background: var(--primary-soft); }
.tbl-wrap { overflow: auto; max-height: 560px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-solid); }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 180px; padding: 10px 0; }
.bars .b { flex: 1; min-width: 4px; background: var(--grad-sky); border-radius: 4px 4px 0 0; position: relative; transition: .3s; opacity: .85; }
.bars .b:hover { opacity: 1; }

/* teleprompter */
.prompter { position: fixed; inset: 0; z-index: 90; background: #060b1a; color: #fff; display: flex; flex-direction: column; }
.prompter-body { flex: 1; overflow: hidden; position: relative; }
.prompter-text { position: absolute; left: 50%; transform: translateX(-50%); width: min(820px, 92%); font-size: 40px; line-height: 1.45; font-weight: 600; text-align: center; padding: 50vh 0; }
.prompter-text .lab { display: block; font-size: 15px; letter-spacing: .2em; color: #7aa2ff; margin-top: 28px; }
.prompter-bar { display: flex; gap: 10px; align-items: center; padding: 14px 20px; background: rgba(255,255,255,.06); }
.prompter-bar .btn { background: rgba(255,255,255,.1); color: #fff; border-color: transparent; }
.prompter::before { content: ""; position: absolute; left: 0; right: 0; top: 46%; height: 70px; border-top: 1px solid rgba(122,162,255,.4); border-bottom: 1px solid rgba(122,162,255,.4); pointer-events: none; z-index: 2; }

/* sticky board */
.board { position: relative; min-height: 640px; border-radius: 20px; border: 1px dashed var(--line); background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 22px 22px; overflow: hidden; }
.sticky {
  position: absolute; width: 210px; min-height: 170px; padding: 14px 14px 30px; border-radius: 4px 4px 16px 4px;
  box-shadow: 0 12px 24px -10px rgba(15,30,61,.35); font-size: 14px; color: #1f2937; cursor: grab;
  transform: rotate(var(--rot, 0deg)); transition: box-shadow .2s, transform .2s;
}
.sticky:hover { box-shadow: 0 20px 34px -12px rgba(15,30,61,.45); transform: rotate(0deg) scale(1.02); z-index: 5; }
.sticky.dragging { cursor: grabbing; z-index: 10; transform: rotate(0) scale(1.05); }
.sticky textarea { width: 100%; min-height: 110px; border: 0; background: transparent; resize: none; outline: none; color: #1f2937; font-family: var(--font); font-size: 14px; line-height: 1.5; }
.sticky .s-title { font-weight: 800; border: 0; background: transparent; width: 100%; outline: none; font-size: 14px; color: #111827; margin-bottom: 4px; }
.sticky .s-tools { position: absolute; bottom: 6px; left: 10px; right: 10px; display: flex; gap: 4px; align-items: center; opacity: 0; transition: .2s; }
.sticky:hover .s-tools { opacity: 1; }
.sticky .sw { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(0,0,0,.15); cursor: pointer; }
.sticky .x { margin-left: auto; border: 0; background: rgba(0,0,0,.08); border-radius: 6px; padding: 0 6px; font-size: 13px; color: #1f2937; }
.sticky .pin { position: absolute; top: -8px; left: 50%; width: 16px; height: 16px; border-radius: 50%; transform: translateX(-50%); background: radial-gradient(circle at 35% 35%, #fff, #ef4444 60%); box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.c-yellow { background: #fff3a8; } .c-blue { background: #bfe0ff; } .c-pink { background: #ffd1dc; } .c-green { background: #c8f5d2; } .c-violet { background: #e2d6ff; } .c-peach { background: #ffd9b8; }

/* video library */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.video-card { overflow: hidden; padding: 0; }
.video-card video, .video-card .vthumb { width: 100%; aspect-ratio: 9/12; object-fit: cover; background: #0b1530; display: grid; place-items: center; color: #fff; font-size: 36px; }
.video-card .vb { padding: 12px 14px; }

/* ============ Library (books) ============ */
.shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px; padding: 20px 6px 40px; perspective: 1400px; }
.book3d { cursor: pointer; position: relative; }
.book3d .cover-wrap { position: relative; transform-style: preserve-3d; transform: rotateY(-18deg) rotateX(4deg); transition: transform .6s cubic-bezier(.2,.8,.2,1); aspect-ratio: 3/4.2; }
.book3d:hover .cover-wrap { transform: rotateY(-4deg) rotateX(0) translateY(-10px); }
.book3d .cover {
  position: absolute; inset: 0; border-radius: 4px 14px 14px 4px; padding: 22px 20px 20px 28px; color: #fff;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: inset 6px 0 10px -4px rgba(0,0,0,.35), 18px 22px 40px -14px rgba(15,30,61,.55);
}
.book3d .cover::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.25); }
.book3d .cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, rgba(255,255,255,.18) 0%, transparent 30%, transparent 70%, rgba(0,0,0,.12)); pointer-events: none; }
.book3d .pages-edge { position: absolute; top: 6px; bottom: 6px; right: -12px; width: 14px; background: repeating-linear-gradient(90deg, #f6f1e4 0 1px, #e3dbc6 1px 2px); transform: rotateY(90deg) translateZ(-1px); transform-origin: left; border-radius: 0 3px 3px 0; }
.cover .cv-num { font-family: var(--serif); font-size: 64px; line-height: 1; opacity: .3; font-weight: 600; }
.cover .cv-kicker { font-size: 10.5px; letter-spacing: .18em; font-weight: 800; opacity: .85; margin-top: auto; }
.cover .cv-title { font-family: var(--serif); font-size: 22px; line-height: 1.15; font-weight: 600; margin: 6px 0 10px; }
.cover .cv-line { height: 3px; width: 42px; background: rgba(255,255,255,.7); border-radius: 2px; }
.hue-blue { background: linear-gradient(150deg, #1d4ed8, #0b2a73); }
.hue-teal { background: linear-gradient(150deg, #0f9f94, #0b4f63); }
.hue-indigo { background: linear-gradient(150deg, #4f46e5, #23206b); }
.hue-violet { background: linear-gradient(150deg, #8b5cf6, #3b1a78); }
.book-meta { margin-top: 18px; }
.book-meta b { display: block; font-size: 15px; }

/* Reader */
.reader { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: radial-gradient(ellipse at top, #1e3a8a 0%, #0b1530 70%); color: #fff; }
.reader-top { display: flex; align-items: center; gap: 10px; padding: 12px 18px; flex-wrap: wrap; }
.reader-top .title { font-weight: 700; font-size: 15px; }
.rtools { display: flex; align-items: center; gap: 10px; }
.reader-top .icon-btn, .reader-top .btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); color: #fff; }
.reader-top .icon-btn:hover, .reader-top .btn:hover { background: rgba(255,255,255,.18); color: #fff; }
.reader-top .icon-btn.on { background: #fff; color: var(--primary-2); }
.reader-top .select { width: auto; max-width: 260px; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #fff; padding: 8px 10px; }
.reader-top .select option { color: #0f1e3d; }
.reader-stage { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; position: relative; padding: 10px 70px 18px; min-height: 0; }
.reader-body { flex: 1; display: flex; min-height: 0; }
.flip-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; font-size: 20px; z-index: 6; transition: .2s; }
.flip-nav:hover { background: rgba(255,255,255,.2); }
.flip-nav.prev { left: 14px; } .flip-nav.next { right: 14px; }
.reader-foot { display: flex; align-items: center; gap: 14px; padding: 4px 24px 16px; font-size: 13px; color: rgba(255,255,255,.75); }
.reader-foot input[type=range] { flex: 1; accent-color: #93c5fd; }

.book-el { position: relative; perspective: 2400px; display: flex; filter: drop-shadow(0 30px 40px rgba(0,0,0,.45)); }
.book-el .page-slot { position: relative; overflow: hidden; }
.page {
  position: absolute; inset: 0; background: var(--paper); color: var(--ink);
  padding: 44px 46px 50px; font-family: var(--serif); font-size: var(--fs, 16.5px); line-height: 1.68;
  overflow: hidden;
}
.page.left { border-radius: 10px 2px 2px 10px; background: linear-gradient(270deg, #e9e0cb 0%, var(--paper) 7%, var(--paper) 100%); }
.page.right { border-radius: 2px 10px 10px 2px; background: linear-gradient(90deg, #e9e0cb 0%, var(--paper) 7%, var(--paper) 100%); }
.page.single { border-radius: 4px 10px 10px 4px; background: linear-gradient(90deg, #e9e0cb 0%, var(--paper) 5%, var(--paper) 100%); }
.page .p-head { position: absolute; top: 18px; left: 46px; right: 46px; font-family: var(--font); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #9a8f78; display: flex; justify-content: space-between; }
.page .p-num { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; font-family: var(--font); font-size: 12px; color: #9a8f78; }
.page .p-content > *:first-child { margin-top: 0; }
.page h1.ch-title { font-size: 30px; line-height: 1.15; margin: 10px 0 6px; color: #1e293b; font-weight: 600; letter-spacing: -.01em; }
.page .ch-kicker { font-family: var(--font); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: #2563eb; margin-top: 10px; }
.page .ch-rule { width: 60px; height: 3px; background: linear-gradient(90deg, #2563eb, #7c3aed); border-radius: 2px; margin: 12px 0 20px; }
.page h3 { font-family: var(--font); font-size: 15.5px; color: #0f766e; margin: 18px 0 6px; letter-spacing: -.01em; }
.page p { margin: 0 0 12px; text-align: left; hyphens: auto; }
.page ul { margin: 0 0 12px; padding-left: 20px; }
.page li { margin-bottom: 5px; }
.page .callout { background: #eef5ff; border-left: 4px solid #2563eb; padding: 10px 14px; border-radius: 0 10px 10px 0; margin: 0 0 14px; white-space: pre-line; font-size: .96em; }
.page .practice { background: #e9fbf6; border: 1px solid #a7e9d9; padding: 12px 14px; border-radius: 12px; margin: 0 0 14px; font-size: .95em; }
.page .practice b.lbl2, .page .keybox b.lbl2, .page .deepbox b.lbl2, .page .askbox b.lbl2 { display: block; font-family: var(--font); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 4px; }
.page .practice b.lbl2 { color: #0f766e; }
.page .keybox { background: #fff7e6; border: 1px solid #f6d79a; padding: 12px 14px; border-radius: 12px; margin: 0 0 14px; font-size: .95em; }
.page .keybox b.lbl2 { color: #b45309; }
.page .keybox ul { margin: 0; }
.page .deepbox { background: #f2edff; border: 1px solid #d6c8ff; padding: 12px 14px; border-radius: 12px; margin: 0 0 14px; font-size: .95em; }
.page .deepbox b.lbl2 { color: #6d28d9; }
.page .askbox { background: #ffeef0; border: 1px solid #ffc9d1; padding: 12px 14px; border-radius: 12px; margin: 0 0 14px; font-size: .95em; }
.page .askbox b.lbl2 { color: #be123c; }
.page mark.hl { border-radius: 3px; padding: 0 1px; color: inherit; cursor: pointer; }
.hl-yellow { background: #fde68a; } .hl-blue { background: #bfdbfe; } .hl-green { background: #bbf7d0; } .hl-pink { background: #fbcfe8; }
.page .bm-ribbon { position: absolute; top: -4px; right: 34px; width: 26px; height: 64px; background: var(--rib, #ef4444); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%); box-shadow: 0 4px 6px rgba(0,0,0,.2); z-index: 3; }
.page.left .bm-ribbon { right: auto; left: 34px; }
.page .cover-page { display: flex; flex-direction: column; height: 100%; justify-content: center; text-align: center; font-family: var(--serif); }
.page .cover-page .big-num { font-size: 120px; line-height: 1; color: #e5dcc5; font-weight: 600; }
.page .cover-page h1 { font-size: 34px; margin: 0 0 12px; color: #1e293b; }
.page .toc-item { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dotted #d9cfb8; font-family: var(--font); font-size: 14px; cursor: pointer; color: #1e293b; }
.page .toc-item:hover { color: #2563eb; }
.page .toc-item span { color: #9a8f78; margin-left: auto; }

/* flipping leaf */
.leaf { position: absolute; top: 0; bottom: 0; z-index: 5; transform-style: preserve-3d; will-change: transform; }
.leaf .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.leaf .face.back { transform: rotateY(180deg); }
.leaf .shade { position: absolute; inset: 0; pointer-events: none; z-index: 4; opacity: 0; }
.leaf .face.front .shade { background: linear-gradient(90deg, rgba(0,0,0,.0), rgba(0,0,0,.25)); }
.leaf .face.back .shade { background: linear-gradient(270deg, rgba(0,0,0,.0), rgba(0,0,0,.25)); }
.spine { position: absolute; top: 0; bottom: 0; left: 50%; width: 30px; transform: translateX(-50%); z-index: 4; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(0,0,0,.18) 45%, rgba(0,0,0,.25) 50%, rgba(0,0,0,.18) 55%, transparent); }
.corner { position: absolute; bottom: 0; width: 70px; height: 70px; z-index: 7; cursor: grab; }
.corner.r { right: 0; } .corner.l { left: 0; }
.corner::after { content: ""; position: absolute; bottom: 0; width: 0; height: 0; transition: .25s; }
.corner.r::after { right: 0; border-left: 0 solid transparent; background: linear-gradient(135deg, transparent 50%, #e8dfc9 50%, #fffdf7 100%); width: 0; height: 0; box-shadow: -3px -3px 8px rgba(0,0,0,.12); }
.corner.l::after { left: 0; background: linear-gradient(225deg, transparent 50%, #e8dfc9 50%, #fffdf7 100%); box-shadow: 3px -3px 8px rgba(0,0,0,.12); }
.corner:hover::after { width: 38px; height: 38px; }

/* side panel in reader */
.rpanel { width: 360px; background: var(--bg-2); color: var(--text); border-left: 1px solid var(--line); display: flex; flex-direction: column; animation: slideIn .25s; }
.rpanel-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.rpanel-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.rp-item { padding: 12px; border-radius: 12px; background: var(--surface-solid); border: 1px solid var(--line); margin-bottom: 10px; font-size: 14px; cursor: pointer; transition: .15s; }
.rp-item:hover { border-color: var(--primary); }
.rp-item .q { font-family: var(--serif); border-left: 3px solid var(--amber); padding-left: 10px; margin-bottom: 6px; }

.sel-pop { position: fixed; z-index: 80; display: flex; gap: 6px; align-items: center; padding: 6px; border-radius: 12px; background: #0f1e3d; box-shadow: var(--shadow-lg); animation: pop .15s; }
.sel-pop .sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); cursor: pointer; }
.sel-pop button.t { border: 0; background: rgba(255,255,255,.12); color: #fff; padding: 5px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; }

/* ============ Marketing ============ */
.notes-layout { display: grid; grid-template-columns: 220px 320px 1fr; gap: 16px; min-height: 620px; }
.cat-list button { display: flex; width: 100%; align-items: center; gap: 8px; border: 0; background: transparent; padding: 9px 12px; border-radius: 10px; text-align: left; font-weight: 600; color: var(--text-2); }
.cat-list button:hover { background: var(--primary-soft); }
.cat-list button.active { background: var(--primary-soft); color: var(--primary); }
.cat-list button .n { margin-left: auto; font-size: 12px; color: var(--muted); }
.note-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 680px; padding-right: 4px; }
.note-item { padding: 12px 14px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--line); cursor: pointer; transition: .15s; }
.note-item:hover { border-color: var(--primary); }
.note-item.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.note-item b { display: block; font-size: 14px; margin-bottom: 3px; }
.note-item p { margin: 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.editor-title { font-size: 22px; font-weight: 800; border: 0; background: transparent; width: 100%; outline: none; letter-spacing: -.02em; padding: 4px 0; }
.editor-body { min-height: 400px; border: 0; background: transparent; width: 100%; outline: none; resize: none; font-size: 15px; line-height: 1.7; }
.fw-card { cursor: pointer; transition: .2s; display: flex; flex-direction: column; gap: 6px; }
.fw-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.fw-card .fi { font-size: 26px; }
.fw-card h4 { margin: 0; font-size: 15px; }
.fw-card p { margin: 0; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--primary), var(--violet)); border-radius: 2px; }
.tl-item { position: relative; margin-bottom: 16px; }
.tl-item::before { content: ""; position: absolute; left: -24px; top: 18px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface-solid); border: 3px solid var(--primary); }
.score-pill { font-weight: 800; font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--grad); color: #fff; }

/* search palette */
.palette { width: min(680px, 100%); background: var(--bg-2); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .2s; }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 18px 20px; font-size: 17px; background: transparent; outline: none; }
.palette .results { max-height: 58vh; overflow-y: auto; padding: 8px; }
.res { display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; border-radius: 12px; cursor: pointer; }
.res:hover, .res.sel { background: var(--primary-soft); }
.res .rt { font-weight: 700; font-size: 14px; }
.res .rs { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.res mark { background: var(--amber-soft); color: inherit; border-radius: 3px; }

/* mobile nav */
.mobile-nav { display: none; }

@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notes-layout { grid-template-columns: 1fr; }
  .cal-days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.m-only { display: none !important; }
.grid > *, .notes-layout > *, .home-grid > * { min-width: 0; }
.main { overflow-x: hidden; }

/* ============ Phone-first layout ============ */
@media (max-width: 860px) {
  .m-only { display: inline-flex !important; }
  .d-only { display: none !important; }
  body { -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
  .app { grid-template-columns: 1fr; height: 100vh; height: 100dvh; }
  .sidebar { display: none; }
  .main { height: calc(100vh - 64px - env(safe-area-inset-bottom)); height: calc(100dvh - 64px - env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    height: calc(64px + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom);
    background: var(--surface); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--line); justify-content: space-around; align-items: center;
  }
  .mobile-nav button { flex: 1; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; font-size: 10.5px; font-weight: 700; color: var(--muted); gap: 3px; padding: 6px 0; border-radius: 14px; }
  .mobile-nav button span { font-size: 21px; line-height: 1; transition: transform .2s; }
  .mobile-nav button.active { color: var(--primary); background: var(--primary-soft); }
  .mobile-nav button.active span { transform: translateY(-2px) scale(1.1); }

  .view { padding: 16px 14px 40px; }
  .page-head { margin-bottom: 14px; gap: 10px; }
  .page-head h1 { font-size: 25px; }
  .page-head p { font-size: 14px; }
  .page-head .spacer { display: none; }
  .home-grid, .g2, .g3 { grid-template-columns: 1fr; }
  .grid { gap: 12px; }
  .home-grid { gap: 12px; margin-top: 12px; }
  .card { padding: 16px; border-radius: 16px; }
  .hero { padding: 20px; border-radius: 20px; }
  .hero h2 { font-size: 22px; }
  .hero .row .btn { flex: 1 1 auto; justify-content: center; }
  .today-card { grid-template-columns: 1fr auto; gap: 12px; }
  .ring { width: 96px; height: 96px; }
  .ring::before { inset: 9px; }
  .ring b { font-size: 21px; }
  .stat b { font-size: 21px; }

  /* tabs stick under the top edge and scroll sideways */
  .tabs { position: sticky; top: 0; z-index: 6; margin: 0 -14px 14px; border-radius: 0; border-left: 0; border-right: 0; padding: 6px 10px; }
  .tab { padding: 9px 12px; font-size: 14px; }

  /* bigger touch targets, no iOS zoom on focus */
  .input, .textarea, .select { font-size: 16px; padding: 11px 12px; }
  .btn { padding: 11px 14px; min-height: 42px; }
  .btn.sm { min-height: 36px; }
  .icon-btn { width: 42px; height: 42px; }
  .check { padding: 12px 10px; }

  /* dialogs become bottom sheets */
  .overlay.center { align-items: flex-end; padding: 0; }
  .modal, .palette { width: 100%; max-height: 90dvh; border-radius: 22px 22px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); animation: sheetUp .28s cubic-bezier(.2,.8,.2,1); }
  .palette { padding: 0 0 env(safe-area-inset-bottom); }
  .palette .results { max-height: 62dvh; }
  .modal::before, .palette::before { content: ""; display: block; width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
  .palette::before { margin: 10px auto 0; }
  .drawer { width: 100%; animation: sheetUp .3s cubic-bezier(.2,.8,.2,1); }
  .drawer-head { padding: 12px 14px 8px; }
  .drawer-head h2 { font-size: 20px; }
  .drawer-body { padding: 14px 14px calc(40px + env(safe-area-inset-bottom)); }
  .stage-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .stage-bar::-webkit-scrollbar { display: none; }
  .stage-step { min-width: 86px; padding: 10px 6px; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); width: max-content; max-width: 90vw; text-align: center; }

  /* studio */
  .bars { gap: 1px; height: 140px; }
  .bars .b { min-width: 0; }
  .beat { grid-template-columns: 1fr; gap: 2px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .cal-days { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .day-tile { min-height: 84px; padding: 8px; border-radius: 12px; }
  .day-tile .dt { font-size: 12px; }
  .kanban { grid-template-columns: repeat(6, 80vw); scroll-snap-type: x mandatory; margin: 0 -14px; padding: 0 14px 10px; }
  .kcol { scroll-snap-align: center; min-height: 220px; }
  .video-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .prompter-text { font-size: 30px; }
  .prompter-bar { flex-wrap: wrap; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .prompter-bar b { flex-basis: 100%; }
  .prompter-bar input[type=range] { flex: 1; }

  /* sticky board becomes a tidy two-column wall */
  .board { min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 16px 10px; background-image: none; border: 0; overflow: visible; }
  .sticky { position: relative; left: auto !important; top: auto !important; width: auto; min-height: 150px; padding: 14px 12px 40px; cursor: default; }
  .sticky:hover { transform: rotate(var(--rot, 0deg)); }
  .sticky .s-tools { opacity: 1; }
  .sticky .sw { width: 20px; height: 20px; }
  .sticky .x { padding: 2px 8px; }

  /* marketing notes: list ⇄ full-screen editor */
  .notes-layout { grid-template-columns: 1fr; min-height: 0; gap: 10px; }
  .notes-layout > .card:first-child { padding: 0; background: transparent; border: 0; box-shadow: none; backdrop-filter: none; }
  .cat-list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px 4px; }
  .cat-list::-webkit-scrollbar { display: none; }
  .cat-list button { width: auto; white-space: nowrap; border: 1px solid var(--line); background: var(--surface-solid); border-radius: 999px; padding: 8px 14px; }
  .cat-list button .n { margin-left: 4px; }
  #nnew { position: fixed; right: 18px; bottom: calc(80px + env(safe-area-inset-bottom)); width: 56px !important; height: 56px; border-radius: 50%; padding: 0; z-index: 30; font-size: 0; margin: 0 !important; }
  #nnew::before { content: "＋"; font-size: 26px; }
  .notes-layout:not(.m-edit) #ned { display: none; }
  .notes-layout.m-edit > :not(#ned) { display: none; }
  .note-list { max-height: none; }
  .editor-body { min-height: 55dvh; font-size: 16px; }
  .notes-layout.m-edit #ned { min-height: 70dvh; }

  /* books: shelf */
  .shelf { gap: 22px 18px; padding: 8px 4px 24px; }
  .book3d .cover { padding: 16px 14px 14px 22px; }
  .cover .cv-num { font-size: 46px; }
  .cover .cv-title { font-size: 17px; }

  /* books: reader */
  .reader { height: 100dvh; }
  /* row 1: back + chapter picker · row 2: all reading tools, evenly spaced */
  .reader-top { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; }
  .reader-top .title, .reader-top .spacer, .reader-top .lbl-t { display: none; }
  .reader-top .select { width: 100%; min-width: 0; max-width: none; font-size: 14px; padding: 9px 10px; }
  .reader { overflow: hidden; }
  .reader-top [data-x] { width: 42px; height: 40px; }
  .rtools { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .rtools .icon-btn, .rtools .btn.sm { width: 100%; min-width: 0; justify-content: center; height: 40px; min-height: 40px; padding: 0; font-size: 15px; }
  .reader-stage { padding: 4px 6px 6px; }
  .book-el { touch-action: pan-y; filter: drop-shadow(0 18px 24px rgba(0,0,0,.45)); }
  .flip-nav { display: none; }
  .corner { display: none; }
  .page { padding: 34px 20px 38px; line-height: 1.62; }
  .page .p-head { left: 20px; right: 20px; top: 13px; font-size: 9.5px; }
  .page .p-num { bottom: 12px; }
  .page h1.ch-title { font-size: 25px; }
  .page .bm-ribbon { right: 18px; width: 22px; height: 52px; }
  .reader-foot { padding: 4px 14px calc(10px + env(safe-area-inset-bottom)); gap: 10px; }
  .reader-foot #pinfo, .reader-foot #pct { white-space: nowrap; font-size: 12px; }
  .reader-foot input[type=range] { min-width: 0; }
  .reader .reader-foot .tap-nav { display: flex; gap: 8px; }
  .rpanel { position: absolute; left: 0; right: 0; bottom: 0; top: 18%; width: auto; z-index: 20; border-left: 0; border-radius: 22px 22px 0 0; box-shadow: 0 -20px 50px rgba(0,0,0,.4); animation: sheetUp .28s cubic-bezier(.2,.8,.2,1); }
  .rpanel-body { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .sel-pop { padding: 8px; gap: 8px; border-radius: 16px; }
  .sel-pop .sw { width: 32px; height: 32px; }
  .sel-pop button.t { padding: 8px 12px; font-size: 14px; }
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
@media (max-width: 520px) {
  .g4 { grid-template-columns: 1fr 1fr; }
  .shelf { grid-template-columns: 1fr 1fr; }
  .cal-days { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.reader-foot .tap-nav { display: none; }
.reader-foot .tap-nav button { width: 40px; height: 34px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; font-size: 18px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
