/* The library app: shell, home, search, shorts, book page, more. Mobile first.
   Colours come from tokens.css so Light and Dark share one layout. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.4 var(--ui); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; color: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; }
.serif { font-family: var(--serif); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pad { padding: 0 16px; }
.note { color: var(--muted); padding: 12px 16px; margin: 0; }
.problem { margin: 16px; padding: 4px 12px; border-left: 4px solid var(--bad); }
.nosb { scrollbar-width: none; -ms-overflow-style: none; }
.nosb::-webkit-scrollbar { display: none; }
.snap { scroll-snap-type: x proximity; scroll-padding-left: 16px; }
.snap > * { scroll-snap-align: start; }
.it:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
main { display: block; max-width: 900px; margin: 0 auto; padding-bottom: 104px; outline: none; }
main.has-top { padding-top: 76px; }
main.has-top.pills-on { padding-top: 128px; }
main.flush { padding-top: 0; max-width: none; padding-bottom: 0; }

/* ---------- header ---------- */
.apphead { position: fixed; top: 0; left: 0; right: 0; z-index: 20; padding: 10px 16px 6px; background: var(--hdr); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--hdr-line); }
.apphead[hidden] { display: none; }
.apphead-row { display: flex; align-items: center; justify-content: space-between; height: 46px; max-width: 900px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--accent); }
.apphead h1 { font: 700 28px/1 var(--serif); letter-spacing: -.01em; color: var(--ink); }
:root[data-theme="dark"] .apphead h1 { font-family: var(--ui); font-weight: 700; }
.apphead.scrolled h1 { font-size: 22px; }
.top-tools { display: flex; gap: 6px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: transparent; color: var(--ink); position: relative; }
.icon-btn .dot { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.pills { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 8px; max-width: 900px; margin: 0 auto; }
.pills[hidden] { display: none; }
:root[data-theme="light"] .pills { display: none; }
.pill { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; height: 42px; padding: 0 18px; border-radius: 14px; font-size: 16px; font-weight: 600; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); color: #fff; }
.pill[aria-pressed="true"] { background: #fff; color: #000; border-color: #fff; }

/* ---------- tab bar ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; height: 84px; padding: 8px 8px 22px; background: var(--tabbg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--hdr-line); }
.tabs[hidden] { display: none; }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--faint); max-width: 200px; margin: 0 auto; }
.tabs a[aria-current="page"] { color: var(--ink); }
:root[data-theme="light"] .tabs a[aria-current="page"] { color: var(--accent); }

/* ---------- covers ---------- */
.cover { position: relative; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; border-radius: 6px; color: #fff; padding: 0 8px 16px; aspect-ratio: 2 / 3; width: 100%; }
:root[data-theme="light"] .cover { border-radius: 3px 7px 7px 3px; box-shadow: 0 6px 12px rgba(40, 30, 10, .3); }
.cover .spine { position: absolute; top: 0; bottom: 0; left: 0; width: 6px; background: linear-gradient(90deg, rgba(0, 0, 0, .34), rgba(255, 255, 255, .16) 45%, transparent); }
:root[data-theme="dark"] .cover .spine { display: none; }
.cover-title { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; text-align: center; font: 700 13px/1.1 var(--serif); text-shadow: 0 1px 6px rgba(0, 0, 0, .55); }
.cover.has-image .cover-title { display: none; }
.cover .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0, 0, 0, .45); }
.cover .prog i { display: block; height: 100%; background: var(--accent); }
:root[data-theme="light"] .cover .prog i { background: #fffdf8; }
.cover .badge { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); white-space: nowrap; padding: 3px 9px; border-radius: 3px 3px 0 0; background: var(--accent); color: var(--on-accent); font-size: 10.5px; font-weight: 800; }
.cover .mini { position: absolute; width: 26px; height: 26px; border-radius: 13px; background: var(--card); display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); bottom: 10px; }
.cover .mini.l { left: 6px; }
.cover .mini.r { right: 6px; color: var(--ok); }
.cover .new { position: absolute; top: 7px; right: 7px; padding: 2px 7px; border-radius: 9px; background: var(--card); color: var(--accent); font-size: 10.5px; font-weight: 800; letter-spacing: .04em; }

/* ---------- home blocks ---------- */
.block { padding-top: 22px; }
.rail-head { display: flex; align-items: center; gap: 6px; padding: 0 16px; margin-bottom: 12px; }
.rail-head h2 { font-size: 20px; font-weight: 700; line-height: 1.2; }
:root[data-theme="light"] .rail-head h2 { font-family: var(--serif); }
.rail-head svg { color: var(--muted); }
.rail { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px; }
.rail > a { flex: 0 0 var(--w, 104px); display: block; min-width: 0; }
.rail.tall { gap: 10px; }
.rail.tall > a { flex-basis: 168px; }
.rail.tall .cover { aspect-ratio: 10 / 17; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 0 12px 24px; border-radius: 8px; }
.rail.tall .mono { position: absolute; top: 22px; left: 0; right: 0; text-align: center; font: 700 72px var(--serif); opacity: .3; }
.rail.tall .cover-title { font-size: 22px; line-height: 1.05; -webkit-line-clamp: 5; }
.rail.tall .by { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; opacity: .9; text-align: center; }
.rail.land > a { flex-basis: var(--cw, 214px); border-radius: 8px; overflow: hidden; background: var(--card); border: 1px solid var(--line); }
.land .shot { position: relative; height: 122px; display: flex; align-items: center; justify-content: center; color: #fff; }
.land .shot .mono { font: 700 54px var(--serif); opacity: .4; }
.land .shot .play { position: absolute; right: 8px; bottom: 8px; display: flex; align-items: center; gap: 10px; }
.land .shot .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0, 0, 0, .45); }
.land .shot .prog i { display: block; height: 100%; background: var(--accent); }
.land .cap { padding: 10px 12px 13px; }
.land .cap b { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.land .cap span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail.top { gap: 6px; }
.rail.top > a { display: flex; align-items: flex-end; flex: 0 0 auto; }
.rail.top .num { flex: 0 0 auto; margin-right: -14px; text-align: right; font: 800 var(--ns, 148px)/.76 var(--ui); letter-spacing: -.06em; color: var(--top-fill); -webkit-text-stroke: 3px var(--top-stroke); }
.rail.top .cover { position: relative; z-index: 1; flex: 0 0 var(--w, 104px); width: var(--w, 104px); }
.hero { position: relative; margin: 4px 16px 8px; height: 468px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
:root[data-theme="light"] .hero { box-shadow: 0 8px 22px rgba(40, 30, 10, .14); }
.hero .face { position: absolute; left: 50%; top: 44px; width: 176px; height: 264px; margin-left: -88px; transform: rotate(-3deg); border-radius: 8px; overflow: hidden; box-shadow: 0 18px 40px rgba(0, 0, 0, .5); display: flex; align-items: flex-end; justify-content: center; padding: 16px 12px; color: #fff; }
.hero .face .cover { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; box-shadow: none; aspect-ratio: auto; padding: 16px 12px; }
.hero .face .cover-title { font-size: 25px; line-height: 1.05; -webkit-line-clamp: 6; }
.hero .eyebrow-pill { position: absolute; left: 12px; top: 12px; display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; background: rgba(0, 0, 0, .45); color: #fff; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
:root[data-theme="light"] .hero .eyebrow-pill { background: rgba(255, 253, 248, .92); color: #231f18; font-weight: 700; }
.hero .foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 56px 14px 14px; background: linear-gradient(0deg, rgba(0, 0, 0, .88) 0%, rgba(0, 0, 0, .6) 55%, rgba(0, 0, 0, 0) 100%); color: #fff; }
:root[data-theme="light"] .hero .foot { background: linear-gradient(0deg, rgba(255, 253, 248, .98) 0%, rgba(255, 253, 248, .9) 60%, rgba(255, 253, 248, 0) 100%); color: #231f18; }
.hero .tagline { text-align: center; font-size: 15px; line-height: 1.35; margin-bottom: 12px; }
.hero .btns { display: flex; gap: 10px; }
.hero .btns .b { flex: 1; }
.b { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 16px; border: 0; border-radius: 6px; font-size: 16px; font-weight: 700; background: var(--btn); color: var(--on-btn); }
:root[data-theme="light"] .b { border-radius: 8px; }
.b.accent { background: var(--accent); color: var(--on-accent); }
.b.ghost { background: var(--ghost-btn); color: var(--on-ghost); }
:root[data-theme="light"] .hero .b:not(.ghost) { background: var(--accent); color: #fff; }
:root[data-theme="light"] .b.ghost { border: 1.5px solid #231f18; }
.b.outline { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.b[disabled] { opacity: .4; cursor: default; }
.b.full { width: 100%; height: 50px; font-size: 17px; border-radius: 8px; }
.promo { position: relative; height: 340px; margin: 18px 0 4px; overflow: hidden; }
.promo .t { position: absolute; width: 112px; height: 168px; border-radius: 7px; box-shadow: 0 14px 30px rgba(0, 0, 0, .45); overflow: hidden; }
.promo .t .cover { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
.promo .t1 { right: 92px; top: 62px; transform: rotate(-9deg); }
.promo .t2 { right: 34px; top: 92px; transform: rotate(3deg); }
.promo .t3 { right: -28px; top: 128px; transform: rotate(14deg); }
.promo .copy { position: absolute; left: 20px; top: 0; bottom: 0; width: 200px; display: flex; flex-direction: column; justify-content: center; gap: 10px; color: #fff; }
:root[data-theme="light"] .promo { background: linear-gradient(160deg, #efe6d2, #dfd2b6) !important; }
:root[data-theme="light"] .promo .copy { color: #231f18; }
.promo .copy .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.promo .copy .headline { font-size: 30px; font-weight: 800; line-height: 1.1; }
.promo .copy .sub { font-size: 15px; line-height: 1.4; opacity: .85; }
.promo .copy .b { align-self: flex-start; height: 44px; margin-top: 6px; font-size: 15px; }
.foot-note { margin: 34px 16px 0; color: var(--faint); font-size: 12px; line-height: 1.5; }

/* ---------- bottom sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; }
.scrim { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--scrim); animation: scrimIn .2s ease-out; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto; max-height: 86vh; overflow-y: auto; padding: 10px 16px 30px; border-radius: 20px 20px 0 0; background: var(--card); box-shadow: 0 -10px 30px rgba(0, 0, 0, .2); animation: sheetUp .24s cubic-bezier(.2, .8, .2, 1); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line2); margin: 0 auto 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet-head h2 { font: 600 24px var(--serif); }
.sheet .done { height: 44px; padding: 0 6px; border: 0; background: transparent; color: var(--accent); font-size: 16px; font-weight: 700; }
.sheet .sub { font-size: 14px; color: var(--muted); margin: 0 0 14px; }
.lbl { font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
@keyframes scrimIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }

/* ---------- chips, fields, segmented ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 20px; font-size: 14.5px; font-weight: 600; background: var(--card2); border: 1px solid var(--line); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip .n { font-size: 12.5px; opacity: .75; }
.field { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card); color: var(--ink); font-size: 15px; }
.formrow { display: flex; gap: 8px; }
.seg { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--card2); margin-bottom: 20px; }
.seg button { flex: 1; height: 42px; border: 0; border-radius: 9px; font-size: 15px; font-weight: 600; background: transparent; color: var(--soft); }
.seg button[aria-pressed="true"] { background: var(--btn); color: var(--on-btn); }
.sel { height: 46px; padding: 0 12px; border-radius: 10px; border: 0; background: var(--card2); color: var(--ink); font-size: 15px; }
.tool { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--card2); color: var(--ink); font-size: 15px; }
.radio-row { width: 100%; display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 12px; border-radius: 10px; border: 1.5px solid transparent; background: transparent; color: var(--ink); text-align: left; }
.radio-row[aria-checked="true"] { border-color: var(--accent); background: var(--card2); }
.radio-row .txt { flex: 1; min-width: 0; }
.radio-row .txt b { display: block; font-size: 16px; font-weight: 700; }
.radio-row .txt span { display: block; margin-top: 1px; font-size: 13px; color: var(--muted); }
.radio-row .dot { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 11px; border: 2px solid var(--line2); }
.radio-row[aria-checked="true"] .dot { border-color: var(--accent); background: radial-gradient(var(--accent) 0 44%, transparent 46%); }
.btn-line { width: 100%; height: 46px; margin-top: 10px; border: 1px solid var(--line2); border-radius: 10px; background: transparent; color: var(--muted); font-size: 15px; font-weight: 600; }
.btn-fill { width: 100%; height: 50px; border: 0; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 16px; font-weight: 700; }
.btn-danger { background: var(--bad); color: #fff; }
.tier svg { display: block; }

/* ---------- search ---------- */
.search-head { position: fixed; top: 0; left: 0; right: 0; z-index: 20; padding: 10px 16px 0; background: var(--hdr); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--hdr-line); }
.search-head .in { max-width: 900px; margin: 0 auto; }
.search-head h1 { font: 700 32px/1 var(--serif); height: 46px; display: flex; align-items: center; }
.searchbox { position: relative; margin-top: 4px; }
.searchbox svg { position: absolute; left: 14px; top: 14px; color: var(--faint); }
.searchbox input { width: 100%; height: 48px; padding: 0 48px 0 44px; border-radius: 12px; border: 1.5px solid var(--line2); background: var(--card); color: var(--ink); font-size: 16px; }
.searchbox .clr { position: absolute; right: 2px; top: 2px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--faint); display: flex; align-items: center; justify-content: center; }
.controls { display: flex; align-items: center; gap: 8px; padding: 10px 0; }
.ctl { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 14px; border-radius: 10px; font-size: 15px; font-weight: 700; border: 1.5px solid var(--line2); background: var(--card); color: var(--ink); }
.ctl.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ctl.grow { flex: 1; min-width: 0; font-weight: 600; font-size: 14.5px; text-align: left; }
.ctl.grow span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctl .cnt { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--card); color: var(--ink); font-size: 12.5px; line-height: 20px; text-align: center; }
.viewseg { flex: 0 0 auto; display: flex; padding: 3px; border-radius: 10px; background: var(--card2); }
.viewseg button { width: 40px; height: 38px; border: 0; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: transparent; color: var(--soft); }
.viewseg button[aria-pressed="true"] { background: var(--btn); color: var(--on-btn); }
.active-chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 10px; }
.achip { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px 0 14px; border-radius: 20px; border: 0; background: var(--card2); color: var(--accent); font-size: 14px; font-weight: 700; }
.clearall { flex: 0 0 auto; height: 40px; padding: 0 6px; border: 0; background: transparent; color: var(--muted); font-size: 14px; font-weight: 700; }
.count { padding: 2px 18px 10px; font-size: 13.5px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 12px; padding: 0 16px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(5, 1fr); } }
.grid .head { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 8px 2px 2px; }
.head .letter { font: 700 22px var(--serif); color: var(--accent); }
.head .rule { flex: 1; height: 1px; background: var(--line); }
.gcell { display: block; min-width: 0; }
.gcell .ttl { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 9px; font: 600 14.5px/1.2 var(--serif); }
.gcell .st { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); }
.lrow .cover { flex: 0 0 56px; width: 56px; height: 84px; aspect-ratio: auto; padding: 0 4px 6px; }
.lrow .cover-title { display: none; }
.lrow .body { flex: 1; min-width: 0; }
.lrow .ttl { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font: 600 17px/1.2 var(--serif); }
.lrow .au { margin-top: 3px; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .meta { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 13px; color: var(--muted); }
.lrow .meta b { color: var(--ink); font-weight: 600; }
.lrow .mini-bar { flex: 0 0 64px; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.lrow .mini-bar i { display: block; height: 100%; background: var(--accent); }
.empty { padding: 50px 28px; text-align: center; color: var(--muted); }
.empty h2 { margin-top: 10px; font: 600 21px var(--serif); color: var(--ink); }
.empty p { margin: 6px 0 16px; font-size: 15px; line-height: 1.45; }

/* ---------- book page ---------- */
.book-top { position: fixed; top: 12px; z-index: 20; width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 22px; background: rgba(28, 28, 30, .9); color: #fff; display: flex; align-items: center; justify-content: center; }
:root[data-theme="light"] .book-top { background: rgba(255, 253, 248, .92); color: #231f18; border-color: var(--line); }
.book-top.l { left: 12px; }
.book-top.r { right: 12px; }
.bk-hero { position: relative; height: 352px; overflow: hidden; }
.bk-hero .face { position: absolute; left: 50%; top: 70px; width: 152px; height: 228px; margin-left: -76px; border-radius: 3px 8px 8px 3px; overflow: hidden; box-shadow: 0 14px 26px rgba(0, 0, 0, .4); }
.bk-hero .face .cover { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; padding: 0 12px 22px; }
.bk-hero .face .cover .spine { display: block; width: 11px; }
.bk-hero .face .cover-title { font-size: 26px; line-height: 1.05; -webkit-line-clamp: 6; }
.bk-hero .shelf { position: absolute; left: 0; right: 0; top: 298px; height: 14px; background: var(--plank); box-shadow: 0 6px 10px rgba(0, 0, 0, .22); }
.bk-hero .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .14); }
.bk-hero .bar i { display: block; height: 100%; background: var(--accent); }
.bk-body { padding: 16px 16px 0; max-width: 900px; margin: 0 auto; }
.bk-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.bk-body h1 { margin: 4px 0 0; font: 700 32px/1.08 var(--serif); letter-spacing: -.01em; }
.bk-sub { margin-top: 4px; font: 500 15.5px/1.35 var(--serif); color: var(--soft); }
.metarow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; font-size: 15px; }
.ring { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; }
.ring svg { position: absolute; left: 0; top: 0; transform: rotate(-90deg); }
.ring span { font-size: 10.5px; font-weight: 700; }
.fmt { display: inline-flex; gap: 6px; }
.fmt span { padding: 1px 6px; border: 1.5px solid var(--muted); border-radius: 3px; font-size: 11px; font-weight: 700; color: var(--soft); }
.bk-lead { margin-top: 16px; font: 600 19px/1.2 var(--serif); }
.bk-body .b.full { margin-top: 12px; }
.pair { margin-top: 10px; display: flex; gap: 10px; }
.pair .b { flex: 1; min-width: 0; height: 50px; font-size: 17px; border-radius: 8px; }
.where { margin-top: 22px; font-size: 16px; font-weight: 700; line-height: 1.3; }
.synopsis { margin: 6px 0 0; font-size: 15.5px; line-height: 1.5; }
.facts { margin-top: 12px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.facts b { color: var(--soft); font-weight: 600; }
.acts { display: flex; justify-content: space-between; margin: 20px 0 0; }
.act { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0; border: 0; background: transparent; color: var(--ink); font-size: 13px; font-weight: 600; }
.tabrow { display: flex; gap: 6px; margin-top: 18px; padding: 0 16px; overflow-x: auto; border-bottom: 1px solid var(--line); max-width: 900px; margin-left: auto; margin-right: auto; }
.tabrow button { flex: 0 0 auto; height: 48px; padding: 0 10px; border: 0; background: transparent; font-size: 16.5px; font-weight: 700; color: var(--faint); }
.tabrow button[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); }
.pane { max-width: 900px; margin: 0 auto; padding: 16px 16px 0; }
.partbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.partbar select { flex: 0 1 auto; max-width: 280px; height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card); color: var(--ink); font-size: 15px; font-weight: 600; }
.infobtn { width: 44px; height: 44px; border: 0; border-radius: 22px; background: var(--btn); color: var(--on-btn); font: italic 700 20px var(--serif); }
.infobox { margin-top: 12px; padding: 14px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 14px; line-height: 1.7; color: var(--soft); }
.chrow { padding: 14px 0; border-top: 1px solid var(--line); }
.chrow:first-child { margin-top: 8px; }
.chrow .line { display: flex; align-items: center; gap: 12px; }
.chtile { position: relative; flex: 0 0 104px; height: 66px; border: 0; border-radius: 4px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #fff; font: 700 26px var(--serif); background: var(--card2); }
.chrow .tt { flex: 1; min-width: 0; font: 600 16px/1.25 var(--serif); }
.chrow .mm { margin-top: 3px; font: 400 13px var(--ui); color: var(--muted); }
.chtest { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 22px; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--line2); background: transparent; color: var(--muted); }
.card { padding: 18px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.card .kick { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.card .big { margin-top: 4px; font: 600 26px/1.15 var(--serif); }
.card p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.card .b { margin-top: 14px; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.stats3 > div { padding: 14px 8px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); text-align: center; }
.stats3 b { display: block; font: 700 22px var(--serif); }
.stats3 span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.h3 { margin-top: 18px; font: 600 19px var(--serif); }
.lrow2 { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 0; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.lrow2 .ic { flex: 0 0 40px; height: 40px; border-radius: 10px; background: var(--card2); display: flex; align-items: center; justify-content: center; font: 700 16px var(--serif); color: var(--accent); }
.lrow2 .tx { flex: 1; min-width: 0; }
.lrow2 .tx b { display: block; font-size: 16px; font-weight: 600; }
.lrow2 .tx span { display: block; margin-top: 1px; font-size: 13px; color: var(--muted); }
.sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: 10px; padding: 12px 16px 26px; background: var(--hdr); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.sticky .b { flex: 1; height: 48px; font-size: 16px; border-radius: 8px; }
.more-rail { display: flex; gap: 14px; overflow-x: auto; padding: 6px 16px 4px; }
.more-rail > a { flex: 0 0 108px; }
.plank { height: 9px; margin: 0 -7px; background: var(--plank); border-radius: 0 0 2px 2px; box-shadow: 0 4px 7px rgba(0, 0, 0, .2); }
.more-rail .st { margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); min-height: 18px; }

/* status tab (admin) */
.adm { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.adm .tag { padding: 5px 12px; border: 1.5px solid var(--accent); border-radius: 16px; font-size: 13px; font-weight: 700; color: var(--accent); }
.step { margin-top: 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); padding: 14px; display: flex; align-items: center; gap: 12px; }
.step .num { flex: 0 0 40px; height: 40px; border-radius: 20px; display: flex; align-items: center; justify-content: center; font: 700 18px var(--serif); background: var(--card2); }
.step.ok .num { background: var(--ok-bg); color: var(--ok); }
.step.todo .num { background: var(--warn-bg); color: var(--warn); }
.step .nm { font: 600 21px/1.2 var(--serif); }
.step .ds { margin-top: 4px; font-size: 14px; color: var(--muted); }

/* ---------- shorts ---------- */
.feed { position: fixed; inset: 0; overflow-y: auto; scroll-snap-type: y mandatory; background: var(--bg); }
.slide { position: relative; height: 100vh; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; }
.slide .glyph { position: absolute; top: 120px; right: -30px; font: 700 300px/1 var(--serif); opacity: .1; }
.slide .content { position: absolute; left: 20px; right: 76px; top: 112px; bottom: 250px; display: flex; flex-direction: column; justify-content: center; max-width: 560px; }
.slide .kind { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 13px; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--accent); color: var(--on-accent); }
.slide .where { margin: 0 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.slide .hd { font: 700 32px/1.14 var(--serif); letter-spacing: -.01em; margin-top: 14px; }
.slide .bd { margin: 16px 0 0; font-size: 17px; line-height: 1.5; color: var(--soft); }
.slide .rail-r { position: absolute; right: 10px; bottom: 104px; width: 56px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.slide .rail-r button, .slide .rail-r a { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: transparent; color: var(--ink); font-size: 12px; font-weight: 700; }
.slide .rail-r .c { width: 48px; height: 48px; border-radius: 24px; display: flex; align-items: center; justify-content: center; background: var(--card2); }
.slide .info { position: absolute; left: 20px; right: 84px; bottom: 104px; display: flex; align-items: center; gap: 12px; }
.slide .info .cover { flex: 0 0 42px; width: 42px; height: 62px; aspect-ratio: auto; padding: 0; border-radius: 2px 5px 5px 2px; }
.slide .info .cover-title { display: none; }
.slide .info b { display: block; font: 600 17px/1.2 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slide .info span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.slide .info i { display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; height: 28px; padding: 0 11px; border-radius: 14px; font-style: normal; font-size: 12.5px; font-weight: 700; background: var(--card2); }
.nudge { position: absolute; left: 0; right: 0; bottom: 92px; text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.timerbar { position: fixed; top: 10px; left: 12px; right: 12px; height: 4px; z-index: 30; display: flex; gap: 4px; }
.timerbar div { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.shorts-top { position: fixed; top: 20px; left: 12px; right: 12px; z-index: 30; display: flex; justify-content: space-between; align-items: center; }
.shorts-top h1 { font: 700 24px var(--serif); }

/* ---------- more ---------- */
.more-title { padding: 0 16px; font: 600 34px/1.1 var(--serif); }
.account { margin: 18px 16px 0; padding: 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.account .who { display: flex; align-items: center; gap: 14px; }
.avatar { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 26px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font: 600 24px var(--serif); }
.account .who b { display: block; font: 600 21px/1.2 var(--serif); }
.account .who span { display: block; margin-top: 3px; font-size: 14px; color: var(--muted); }
.account .nums { display: flex; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.account .nums > div { flex: 1; text-align: center; }
.account .nums b { display: block; font: 600 24px var(--serif); }
.account .nums span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.mgroup { margin-top: 22px; }
.mgroup h2 { margin: 0 0 8px; padding: 0 20px; font: 700 13px var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mlist { margin: 0 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.mrow { width: 100%; display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 8px 14px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.mrow:first-child { border-top: 0; }
.mrow .ic { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 9px; background: var(--card2); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.mrow .tx { flex: 1; min-width: 0; }
.mrow .tx b { display: block; font-size: 16px; font-weight: 600; }
.mrow .tx span { display: block; margin-top: 1px; font-size: 13px; color: var(--muted); }
.mrow .val { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14.5px; }
.mnote { margin: 8px 20px 0; font-size: 12.5px; color: var(--faint); }
.mver { margin: 26px 16px 0; text-align: center; font-size: 12.5px; color: var(--faint); }
.subrow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); width: 100%; background: transparent; border-left: 0; border-right: 0; border-bottom: 0; color: var(--ink); text-align: left; }
.subrow .cover { flex: 0 0 40px; width: 40px; height: 60px; aspect-ratio: auto; padding: 0; }
.subrow .cover-title { display: none; }
.subrow .tx { flex: 1; min-width: 0; }
.subrow .tx b { display: block; font: 600 16px/1.25 var(--serif); }
.subrow .tx span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.preview { padding: 18px; border-radius: 14px; border: 1px solid var(--line); margin-bottom: 16px; }
.step-note { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }

/* ---------- sign-in, skeleton ---------- */
.signin { padding: 80px 24px; text-align: center; }
.signin .btn { display: inline-flex; margin-top: 16px; }
.skel { background: linear-gradient(90deg, var(--card2), var(--card), var(--card2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 6px; }
.skel.line { height: 22px; width: 160px; margin: 0 16px 12px; }
.skel.cover-skel { flex: 0 0 104px; aspect-ratio: 2 / 3; }
@keyframes shimmer { to { background-position: -200% 0; } }
.toast { position: fixed; left: 16px; right: 16px; bottom: 100px; z-index: 50; max-width: 420px; margin: 0 auto; padding: 12px 16px; border-radius: 12px; background: var(--btn); color: var(--on-btn); font-size: 14.5px; text-align: center; }
.now { position: absolute; top: 0; left: 6px; padding: 3px 6px 6px; background: var(--accent); color: var(--on-accent); font: 700 9.5px var(--ui); letter-spacing: .06em; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%); }
.chtile { cursor: pointer; }
.slide.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 0 36px; text-align: center; }
.slide.empty h2 { font: 600 24px var(--serif); }
.slide.empty p { margin: 0; font-size: 15px; color: var(--muted); }
:root[data-theme="light"] main.has-top.pills-on { padding-top: 76px; }
.clr[hidden] { display: none; }
