/* OcherMountain Papers — dark stone + ocher */
:root {
  --font-display: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --font-read: 'Source Serif 4', 'Iowan Old Style', Georgia, serif;
  --font-ui: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --stone-950: #0c0a09;
  --stone-900: #161311;
  --stone-850: #1d1916;
  --stone-800: #26211d;
  --stone-700: #3a332d;
  --stone-500: #8a7f75;
  --stone-300: #cfc6bc;
  --stone-100: #f2ece4;

  --ocher: #e0892b;
  --ocher-hi: #f2b04a;
  --ocher-deep: #b5531c;
  --oxide: #8f2a14;

  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.85rem + 0.15vw, 0.9375rem);
  --text-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --text-read: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  --text-lg: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --text-xl: clamp(1.6rem, 1.3rem + 1.2vw, 2.25rem);
  --text-2xl: clamp(2.1rem, 1.5rem + 2.6vw, 3.6rem);

  --radius: 10px;
  --ease: cubic-bezier(.2,.7,.2,1);
  --maxw: 1240px;
  --readw: 70ch;
}

[data-theme="dark"] {
  --bg: var(--stone-950);
  --surface: var(--stone-900);
  --surface-2: var(--stone-850);
  --line: #2e2823;
  --text: #ece5dc;
  --text-2: #b9afa4;
  --text-3: #8a7f75;
  --accent: var(--ocher-hi);
  --accent-strong: var(--ocher);
  --link: #f0b45a;
  --mark: rgba(224,137,43,.16);
  --mark-line: var(--ocher);
  --fig-bg: #f4efe8;
}
[data-theme="light"] {
  --bg: #f6f1ea;
  --surface: #fffdf9;
  --surface-2: #efe8de;
  --line: #e0d6c9;
  --text: #221c17;
  --text-2: #4f453c;
  --text-3: #7b6f63;
  --accent: #a6491a;
  --accent-strong: #b5531c;
  --link: #9a3f14;
  --mark: rgba(224,137,43,.18);
  --mark-line: #b5531c;
  --fig-bg: #ffffff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 140px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-ui); font-size: var(--text-base); line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; display: flex; flex-direction: column;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
main { flex: 1; outline: none; }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ocher-hi); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ocher); color: #000; padding: 8px 12px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }

/* Top bar — always the brand's dark stone so the logo sits on its native ground */
.topbar { position: sticky; top: 0; z-index: 40; background: rgba(12,10,9,.94); backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid #2a241f; color: #ece5dc; }
.topbar-inner { max-width: var(--maxw); margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 14px; }
.brand { display: block; line-height: 0; }
.brand img { height: 46px; width: auto; display: block; }
.brand-sep { width: 1px; height: 26px; background: #3a332d; }
.brand-label { font-family: var(--font-display); font-size: 1.55rem; color: #f2ece4; text-decoration: none; letter-spacing: .01em; line-height: 1; }
.topnav { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: var(--text-sm); }
.topnav a { color: #cfc6bc; text-decoration: none; }
.topnav a:hover { color: #f2b04a; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid transparent; background: transparent; cursor: pointer; color: inherit; transition: background-color .15s, border-color .15s; }
.icon-btn:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.1); }
[data-theme="light"] main .icon-btn:hover { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.08); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: var(--text-sm); font-weight: 500; cursor: pointer; text-decoration: none; transition: border-color .15s, background-color .15s, color .15s, transform .15s; white-space: nowrap; }
.btn:hover { border-color: var(--accent-strong); color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn svg { flex: none; }
.btn-primary { background: var(--ocher); border-color: var(--ocher); color: #1a0f06; }
.btn-primary:hover { background: var(--ocher-hi); border-color: var(--ocher-hi); color: #1a0f06; }
.btn-ghost { background: transparent; }
.btn[aria-pressed="true"] { border-color: var(--ocher); color: var(--accent); background: var(--mark); }

.eyebrow { font-family: var(--font-ui); font-size: var(--text-xs); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); font-weight: 600; }

/* ---------- Library ---------- */
.lib { max-width: var(--maxw); margin: 0 auto; padding: 56px 24px 80px; }
.lib-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: start; padding-bottom: 36px; border-bottom: 1px solid var(--line); }
.lib-hero h1 { font-family: var(--font-display); font-weight: 400; font-size: var(--text-2xl); line-height: 1.02; margin: 14px 0 0; letter-spacing: -.005em; }
.lib-hero h1 em { color: var(--accent); }
.lib-hero p { color: var(--text-2); margin: 0; max-width: 46ch; font-size: var(--text-base); }
.lib-stats { display: flex; gap: 28px; margin-top: 18px; color: var(--text-3); font-size: var(--text-sm); }
.lib-stats b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.9rem; color: var(--text); line-height: 1; margin-bottom: 4px; }

.lib-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 22px 0; }
.search { position: relative; }
.search input { width: 280px; max-width: 100%; min-height: 40px; padding: 0 14px 0 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.search input::placeholder { color: var(--text-3); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); }

.empty { padding: 60px 0; color: var(--text-3); text-align: center; }

/* ---------- Reader ---------- */
.reader { max-width: var(--maxw); margin: 0 auto; padding: 36px 24px 120px; display: grid; grid-template-columns: 240px minmax(0, var(--readw)) 1fr; column-gap: 56px; row-gap: 0; }
.reader-head { grid-column: 2 / 4; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: var(--text-sm); text-decoration: none; margin-bottom: 26px; }
.back:hover { color: var(--accent); }
.reader-head h1 { font-family: var(--font-display); font-weight: 400; font-size: var(--text-2xl); line-height: 1.04; margin: 12px 0 14px; max-width: 22ch; letter-spacing: -.005em; }
.reader-head .sub { font-family: var(--font-read); font-style: italic; font-size: var(--text-lg); color: var(--text-2); margin: 0 0 18px; max-width: 46ch; line-height: 1.35; }
.byline { color: var(--text-2); font-size: var(--text-sm); display: flex; flex-wrap: wrap; gap: 6px 16px; }
.byline b { color: var(--text); font-weight: 600; }

.actionbar { grid-column: 2 / 4; grid-row: 2; align-self: start; position: sticky; top: 65px; z-index: 30; margin: 14px 0 18px; padding: 12px 0; background: linear-gradient(var(--bg) 78%, transparent); display: flex; flex-wrap: wrap; gap: 10px; }
.reader-head { grid-row: 1; }
.toc { grid-column: 1; grid-row: 3 / span 3; }
.paper { grid-row: 3; }
.paper-end { grid-row: 4; }
.next-up { grid-row: 5; }
.toc-inner { position: sticky; top: 150px; max-height: calc(100vh - 180px); overflow: auto; padding-right: 6px; }
.toc h3 { font-size: var(--text-xs); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); margin: 0 0 12px; font-weight: 600; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--text-3); text-decoration: none; font-size: var(--text-sm); line-height: 1.35; }
.toc a:hover { color: var(--text); }
.toc a.on { color: var(--accent); border-left-color: var(--ocher); }
.toc .sub-item a { padding-left: 26px; font-size: var(--text-xs); }

.paper { grid-column: 2; font-family: var(--font-read); font-size: var(--text-read); line-height: 1.72; color: var(--text); min-width: 0; }
.paper > :first-child { margin-top: 0; }
.paper p { margin: 0 0 1.15em; hanging-punctuation: first; }
.paper h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.7rem, 1.4rem + 1vw, 2.15rem); line-height: 1.12; margin: 2.1em 0 .6em; letter-spacing: -.003em; }
.paper h3 { font-family: var(--font-ui); font-weight: 600; font-size: 1.05rem; letter-spacing: .01em; margin: 1.9em 0 .5em; line-height: 1.35; }
.paper h4 { font-family: var(--font-ui); font-weight: 600; font-size: .95rem; margin: 1.6em 0 .4em; }
.paper hr { border: 0; height: 1px; background: var(--line); margin: 2.4em 0; }
.paper blockquote { margin: 1.6em 0; padding: .2em 0 .2em 1.3em; border-left: 3px solid var(--ocher); color: var(--text-2); }
.paper blockquote p:last-child { margin-bottom: 0; }
.paper ul, .paper ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.paper li { margin: .35em 0; }
.paper strong { font-weight: 600; }
.paper sup { font-size: .68em; line-height: 0; color: var(--accent); font-family: var(--font-ui); font-weight: 600; }
.paper code { font-size: .88em; }
.paper a { word-break: break-word; }
.paper figure { margin: 2.2em 0; }
.paper figure img, .paper p > img { display: block; width: 100%; border-radius: 6px; background: var(--fig-bg); }
.paper figure img + img { margin-top: 10px; }
.paper figcaption { font-family: var(--font-ui); font-size: var(--text-sm); line-height: 1.55; color: var(--text-2); margin-top: 12px; }
.paper p:has(> img) { margin: 2.2em 0 .8em; }
.paper p:has(> img) + p { font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text-2); line-height: 1.55; }
.paper .table-wrap { overflow-x: auto; margin: 1.6em 0; border: 1px solid var(--line); border-radius: 8px; }
.paper table { border-collapse: collapse; width: 100%; font-family: var(--font-ui); font-size: var(--text-sm); line-height: 1.45; }
.paper th, .paper td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.paper th { background: var(--surface-2); font-weight: 600; font-size: var(--text-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.paper tr:last-child td { border-bottom: 0; }

/* read-aloud highlight */
.paper [data-say] { transition: background-color .25s var(--ease), box-shadow .25s var(--ease); border-radius: 4px; }
.paper .saying { background: var(--mark); box-shadow: -10px 0 0 var(--mark), 10px 0 0 var(--mark), inset 3px 0 0 transparent; }

.paper-end { grid-column: 2; margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.paper-end p { width: 100%; margin: 0 0 10px; color: var(--text-3); font-size: var(--text-sm); }
.next-up { grid-column: 2; margin-top: 44px; }
.next-up a { display: block; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); background: var(--surface); transition: border-color .2s; }
.next-up a:hover { border-color: var(--ocher); }
.next-up .t { font-family: var(--font-display); font-size: var(--text-lg); line-height: 1.15; margin-top: 6px; display: block; }

/* skeleton */
.skel { height: 1em; border-radius: 4px; background: linear-gradient(90deg, var(--surface) 0, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.4s infinite; margin: 0 0 .9em; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Dock ---------- */
.dock { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; width: min(880px, calc(100% - 24px)); background: #1b1714; color: #ece5dc; border: 1px solid #3a332d; border-radius: 18px; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.dock-inner { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 18px; align-items: center; padding: 12px 14px 12px 20px; }
.dock-title { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-status { font-size: var(--text-xs); color: #a99d91; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-bar { height: 3px; background: #3a332d; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.dock-bar span { display: block; height: 100%; width: 0; background: var(--ocher); transition: width .3s var(--ease); }
.dock-controls { display: flex; align-items: center; gap: 6px; }
.play-btn { width: 48px; height: 48px; border-radius: 999px; border: 0; background: var(--ocher); color: #1a0f06; display: grid; place-items: center; cursor: pointer; }
.play-btn:hover { background: var(--ocher-hi); }
.dock-opts { display: flex; align-items: center; gap: 8px; }
.dock select { min-height: 36px; background: #26211d; border: 1px solid #3a332d; border-radius: 999px; padding: 0 10px; color: #ece5dc; font-size: var(--text-xs); max-width: 170px; }

/* ---------- Share sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(5,4,3,.6); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; }
.sheet-backdrop[hidden] { display: none; }
.sheet { width: min(520px, 100%); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.4); animation: pop .22s var(--ease); }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.sheet-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.sheet h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; line-height: 1.15; margin: 6px 0 18px; }
.share-link { display: flex; gap: 8px; }
.share-link input { flex: 1; min-width: 0; min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text-2); font-size: var(--text-sm); }
.share-grid { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.share-logo { --brand: var(--text-2); width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; border: 1px solid transparent; text-decoration: none; cursor: pointer; transition: transform .18s var(--ease), box-shadow .18s; }
.share-logo:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.share-logo:focus-visible { outline: 2px solid var(--ocher); outline-offset: 3px; }
.share-logo svg { width: 22px; height: 22px; }
.share-logo.s-x { background: #000; border-color: rgba(255,255,255,.18); }
.share-logo.s-email, .share-logo.s-more { background: var(--surface); color: var(--text); border-color: var(--line); }
.share-cite { width: 100%; justify-content: center; border-radius: 12px; }

.toast { position: fixed; left: 50%; top: 84px; transform: translate(-50%, -12px); background: #ece5dc; color: #161311; padding: 10px 16px; border-radius: 999px; font-size: var(--text-sm); font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90; max-width: calc(100% - 32px); width: max-content; text-align: center; border-radius: 14px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* footer */
.site-foot { border-top: 1px solid var(--line); color: var(--text-3); font-size: var(--text-xs); }
.foot-inner { max-width: var(--maxw); margin: 0 auto; padding: 26px 24px 30px; display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; }
.foot-inner p { margin: 0; }
.foot-inner a { color: var(--text-2); }
body.has-dock .site-foot { padding-bottom: 96px; }

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
  .reader { grid-template-columns: minmax(0, 1fr); max-width: calc(var(--readw) + 48px); gap: 0; }
  .reader-head, .paper, .paper-end, .next-up, .actionbar { grid-column: 1; }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .lib-hero { grid-template-columns: 1fr; gap: 18px; }
  .topnav a:not(:first-child) { display: none; }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 8px 14px; gap: 10px; }
  .brand img { height: 36px; }
  .brand-label { font-size: 1.3rem; }
  .topnav a { display: none; }
  .lib { padding: 34px 16px 60px; }
  .reader { padding: 22px 16px 120px; }
  .actionbar { top: 52px; gap: 6px; flex-wrap: nowrap; }
  .actionbar .btn { padding: 0 12px; min-height: 40px; font-size: .84rem; gap: 6px; }
  .actionbar .btn .lbl-long { display: none; }
  .search, .search input { width: 100%; }
  .dock { bottom: 10px; border-radius: 16px; }
  .dock-inner { grid-template-columns: minmax(0,1fr) auto; gap: 10px 12px; padding: 12px 12px 12px 16px; }
  .dock-opts { grid-column: 1 / -1; justify-content: space-between; }
  .dock select { flex: 1; max-width: none; }
  .share-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; gap: 6px; justify-items: center; }
  .share-logo { width: 100%; max-width: 42px; height: auto; aspect-ratio: 1; }
  .share-logo svg { width: 20px; height: 20px; }
  .paper .saying { box-shadow: -6px 0 0 var(--mark), 6px 0 0 var(--mark); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- tabs ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 18px; border-radius: 999px; color: var(--text-2); text-decoration: none; font-size: var(--text-sm); font-weight: 500; white-space: nowrap; transition: background .2s, color .2s; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--ocher); color: #1a0f05; }
.tab .count { font-size: var(--text-xs); opacity: .7; font-variant-numeric: tabular-nums; }

/* ---------- paper cards ---------- */
.grid { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); transition: border-color .25s, transform .25s var(--ease); }
.card:hover { border-color: rgba(224,137,43,.45); }
.card-banner { display: block; aspect-ratio: 2.5 / 1; overflow: hidden; background: #000; }
.card-banner img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease); }
.card:hover .card-banner img { transform: scale(1.025); }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.card-meta { color: var(--accent); font-size: var(--text-xs); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.card h2, .episode h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--text-xl); line-height: 1.1; margin: 0 0 10px; }
.card h2 a { color: var(--text); text-decoration: none; }
.card h2 a:hover { color: var(--accent); }
.card .dek, .episode .dek { color: var(--text-2); margin: 0 0 18px; font-family: var(--font-read); font-size: var(--text-base); line-height: 1.6; }
.card-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.card-actions .btn { min-height: 38px; padding: 0 13px; font-size: var(--text-sm); }

/* ---------- reader banner ---------- */
.reader-head .banner { margin: 6px 0 26px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.reader-head .banner img { display: block; width: 100%; height: auto; }

/* ---------- podcast ---------- */
.episodes { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 28px; }
.episode { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.ep-art { background: #000; }
.ep-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep-art.ep-cover { display: flex; align-items: center; background: #191814; }
.ep-art.ep-cover img { height: auto; object-fit: contain; }
.ep-body { padding: 26px 28px; }
.episode .sub { font-family: var(--font-read); font-style: italic; color: var(--text-2); margin: -2px 0 12px; font-size: var(--text-lg); }
.player { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.player .play-btn { flex: none; }
.pl-track { flex: 1; min-width: 0; }
.pl-seek { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px; background: linear-gradient(var(--ocher), var(--ocher)) 0 / var(--p, 0%) 100% no-repeat, var(--line); cursor: pointer; }
.pl-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--ocher); border: 0; }
.pl-seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ocher); border: 0; }
.pl-time { display: flex; justify-content: space-between; margin-top: 6px; font-size: var(--text-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.pl-rate { flex: none; min-height: 34px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 0 8px; font-size: var(--text-xs); }

@media (max-width: 900px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .episode { grid-template-columns: minmax(0, 1fr); }
  .ep-art { aspect-ratio: 1376 / 768; }
}
@media (max-width: 640px) {
  .lib-tools { flex-direction: column; align-items: stretch; }
  .tabs { width: 100%; }
  .tab { flex: 1; justify-content: center; padding: 0 10px; font-size: .82rem; }
  .card-body, .ep-body { padding: 18px 16px 18px; }
  .player { border-radius: 16px; padding: 12px; gap: 10px; }
  .card .card-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .card .card-actions .btn { padding: 0 4px; gap: 5px; font-size: .78rem; justify-content: center; }
  .card .card-actions .btn svg { width: 15px; height: 15px; flex: none; }
}

.paper .rule { font-size: 0; line-height: 0; height: 0; border-top: 1px solid var(--line); margin: 2.2em auto; width: 40%; overflow: hidden; }
.paper p, .paper li { overflow-wrap: break-word; }
