/*
 * Visual prototype layer (owner review). Loaded only by pages that pass `proto` to BaseLayout.
 * Everything is scoped to html[data-proto]; unlayered rules intentionally win over the Tailwind layers,
 * so the existing utility classes (bg-surface, text-gold, border-line ...) are re-themed through tokens.
 * No images, no extra fonts, no scripts here.
 */
html[data-proto] {
	/* Grand Archive theme: obsidian surfaces, warm parchment text, brass and ember-gold rules and actions */
	--pt-link: #f6d27a;
	--pt-action-bg: #d9a441;
	--pt-action-fg: #0a090c;
	--pt-focus: #f6d27a;
	--pt-ok: #8fdcae;
	--pt-warn: #e9c779;
	--pt-bad: #f2a9a9;
	--pt-gold-2: #f6d27a;
	--pt-ember: #c9521f;
	--pt-ember-2: #ff8a3d;
	--pt-read-font: Charter, 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
	--pt-ui-font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	--pt-editorial: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;

	--color-ink: #0a090c;
	--color-surface: #121016;
	--color-surface-2: #0d0b10;
	--color-surface-3: #1a161f;
	--color-line: rgb(217 164 65 / 0.22);
	--color-line-2: rgb(217 164 65 / 0.4);
	--color-heading: #f7eedb;
	--color-body: #e6dac3;
	--color-muted: #a99e88;
	--color-gold: #d9a441;
	--color-wine-950: #17110d;
	--color-wine-900: #2b1d12;
	--color-wine-800: #4a2e17;
	--color-wine-700: #7a4a1e;
	--color-wine-600: #9a5a22;
	--color-wine-500: #c9852a;
	color-scheme: dark;
}
html[data-proto][data-mode='paper'] {
	--pt-link: #245d79;
	--pt-action-bg: #7a263a;
	--pt-action-fg: #fffdf8;
	--pt-focus: #7a263a;
	--pt-ok: #1f6b3d;
	--pt-warn: #7a5200;
	--pt-bad: #8a1f2e;
	--pt-gold-2: #7a263a;
	--pt-ember: #9a3412;
	--pt-ember-2: #9a3412;

	--color-ink: #f6f1e7;
	--color-surface: #fffdf8;
	--color-surface-2: #f8f3e9;
	--color-surface-3: #eee6d6;
	--color-line: rgb(38 43 51 / 0.14);
	--color-line-2: rgb(38 43 51 / 0.24);
	--color-heading: #262b33;
	--color-body: #262b33;
	--color-muted: #58616d;
	--color-gold: #7a263a;
	--color-wine-950: #f1e4e4;
	--color-wine-900: #e6d2d6;
	--color-wine-800: #7a263a;
	--color-wine-700: #7a263a;
	--color-wine-600: #7a263a;
	--color-wine-500: #7a263a;
	color-scheme: light;
}

/* ---- Base surface: no wood, no gradients ---- */
html[data-proto] body { background: var(--color-ink); color: var(--color-body); font-family: var(--pt-ui-font); }
/* Depth without images: a soft canopy glow behind the top of every page (dark mode only) */
html[data-proto]:not([data-mode='paper']) body { background: radial-gradient(75rem 38rem at 10% -10%, rgb(201 82 31 / 0.14), transparent 60%), radial-gradient(56rem 32rem at 95% 0%, rgb(217 164 65 / 0.12), transparent 60%), var(--color-ink); background-repeat: no-repeat; }
html[data-proto] body::before { display: none; }
html[data-proto] ::selection { background: var(--pt-action-bg); color: var(--pt-action-fg); }
html[data-proto] :focus-visible { outline: 3px solid var(--pt-focus); outline-offset: 2px; }
html[data-proto] header.sticky { background: color-mix(in srgb, var(--color-ink) 94%, transparent); }
html[data-proto] #site-drawer { background: var(--color-surface); box-shadow: none; }

/* Flat surfaces: one hairline, no bevel, no shadow */
html[data-proto] .card,
html[data-proto] .codex-card,
html[data-proto] .scene-card,
html[data-proto] .prep-card {
	background: var(--color-surface);
	border: 1px solid var(--color-line);
	border-width: 1px;
	border-radius: 0.75rem;
	box-shadow: none;
	background-image: none;
}
html[data-proto] .card-hover:hover { transform: none; box-shadow: none; border-color: var(--pt-link); }

/* Links: colour + underline (never colour alone) */
html[data-proto] main a:not(.pt-btn):not(.btn-wine):not(.btn-ghost):not(.btn-affiliate):not(.pt-card-link):not(.pt-toc-link) { color: var(--pt-link); text-decoration: none; }
/* Underline only where a link sits inside running text (never relying on colour alone there); cards, titles and lists stay clean. */
html[data-proto] main :is(p, dd, td, blockquote, .space-y-4 > li, .codex-list li) a:not(.pt-btn):not(.btn-wine):not(.btn-ghost):not(.btn-affiliate):not(.pt-card-link):not(.pill):not(.chip):not(.badge-gold) {
	text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px;
}
html[data-proto] main a:not(.pt-btn):not(.btn-wine):not(.btn-ghost):not(.btn-affiliate):hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
html[data-proto] main :is(h1, h2, h3, h4, .font-display) a { text-decoration: none; }
html[data-proto] main :is(h1, h2, h3, h4, .font-display) a:hover { text-decoration: underline; }
/* Editorial headings: readable serif, normal case (Cinzel stays on the brand only) */
html[data-proto] main :is(h1, h2, .font-display) { font-family: var(--pt-head-font, Charter, 'Iowan Old Style', 'Palatino Linotype', Georgia, serif); letter-spacing: 0; }
html[data-proto] main :is(h1, h2, .font-display) a { font-family: inherit; }
html[data-proto] .eyebrow { color: var(--color-muted); font-family: var(--pt-ui-font); letter-spacing: 0.03em; text-transform: none; font-size: 0.85rem; font-weight: 600; }
html[data-proto] .text-gold, html[data-proto] .badge-gold { color: var(--pt-link); }
html[data-proto] .badge-gold { background: transparent; border-color: var(--color-line-2); }

/* Buttons */
html[data-proto] .btn-wine,
html[data-proto] .pt-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
	min-height: 2.75rem; padding: 0.55rem 1.1rem;
	background: var(--pt-action-bg); color: var(--pt-action-fg);
	border: 1px solid transparent; border-radius: 0.5rem;
	font-weight: 700; font-size: 1rem; text-decoration: none; box-shadow: none; filter: none;
}
html[data-proto] .btn-wine:hover, html[data-proto] .pt-btn:hover { filter: brightness(1.08); }
html[data-proto] .btn-ghost,
html[data-proto] .pt-btn-quiet {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
	min-height: 2.75rem; padding: 0.5rem 0.9rem;
	background: transparent; color: var(--color-body);
	border: 1px solid var(--color-line-2); border-radius: 0.5rem; font-size: 0.95rem; text-decoration: none;
}
html[data-proto] .btn-ghost:hover, html[data-proto] .pt-btn-quiet:hover { border-color: var(--pt-link); color: var(--pt-link); }
html[data-proto] .btn-affiliate {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
	min-height: 2.75rem; padding: 0.55rem 1rem; border-radius: 0.5rem;
	font-weight: 600; font-size: 0.95rem; text-decoration: none;
	color: #f3ede0;
	background: linear-gradient(rgba(212, 168, 83, 0.08), rgba(212, 168, 83, 0.08)), #1e1c17;
	border: 1px solid rgba(212, 168, 83, 0.45);
	transition: border-color 150ms ease, background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
html[data-proto] .btn-affiliate svg { color: #d4a853; flex-shrink: 0; }
html[data-proto] .btn-affiliate:hover,
html[data-proto] .btn-affiliate:focus-visible {
	border-color: #e0b252;
	background: linear-gradient(rgba(212, 168, 83, 0.16), rgba(212, 168, 83, 0.10)), #24211a;
	transform: translateY(-1px);
	box-shadow: 0 6px 16px -8px rgba(212, 168, 83, 0.35);
	outline: none;
}
html[data-proto] .btn-affiliate:focus-visible { outline: 2px solid #e0b252; outline-offset: 2px; }
html[data-mode='paper'] .btn-affiliate {
	color: var(--color-heading);
	background: linear-gradient(rgba(168, 114, 24, 0.08), rgba(168, 114, 24, 0.04)), #faf5ea;
	border-color: rgba(168, 114, 24, 0.48);
}
html[data-mode='paper'] .btn-affiliate svg { color: #8a5a14; }
html[data-mode='paper'] .btn-affiliate:hover,
html[data-mode='paper'] .btn-affiliate:focus-visible {
	border-color: #8a5a14;
	background: linear-gradient(rgba(168, 114, 24, 0.15), rgba(168, 114, 24, 0.09)), #fffaf0;
	box-shadow: 0 6px 14px -8px rgba(138, 90, 20, 0.25);
}
html[data-proto] .pt-complete-btn { min-height: 2.75rem; padding: 0.4rem 1rem; font-size: 0.95rem; background: transparent; color: var(--color-body); border-color: var(--color-line-2); }
html[data-proto] .pt-complete-btn[data-done='1'] { color: var(--pt-ok); border-color: var(--pt-ok); background: transparent; }
html[data-proto] .ftc-note { color: var(--color-muted); }
html[data-proto] .ftc-note::before { background: var(--color-muted); }
html[data-proto] .pill, html[data-proto] .chip { background: var(--color-surface-3); border-color: var(--color-line-2); color: var(--color-body); }
html[data-proto] .field { background: var(--color-surface-2); color: var(--color-body); border-color: var(--color-line-2); min-height: 2.75rem; }

/* ---- Typography ---- */
html[data-proto] h1, html[data-proto] h2 { color: var(--color-heading); }
html[data-proto] .pt-read, html[data-proto] [data-pt-sections] {
	font-family: var(--pt-read-font);
	font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.25rem);
	line-height: 1.7;
	color: var(--color-body);
}
html[data-proto] .pt-read p, html[data-proto] .pt-read li, html[data-proto] [data-pt-sections] p, html[data-proto] [data-pt-sections] li { max-width: 68ch; }
html[data-proto] .pt-read p + p, html[data-proto] [data-pt-sections] p + p { margin-top: 1em; }
html[data-proto] .pt-read h2, html[data-proto] [data-pt-sections] h2 { font-family: var(--pt-head-font, Charter, 'Iowan Old Style', 'Palatino Linotype', Georgia, serif); font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.9rem); line-height: 1.25; margin: 0 0 1rem; color: var(--color-heading); letter-spacing: 0.01em; border: 0; padding: 0; }
html[data-proto] .pt-read h3, html[data-proto] [data-pt-sections] h3 { font-family: var(--pt-ui-font); font-size: 0.95rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-muted); margin: 1.75rem 0 0.5rem; }
html[data-proto] .pt-read strong, html[data-proto] [data-pt-sections] strong { color: var(--color-heading); }
html[data-proto] .codex-list { list-style: disc; padding-left: 1.25rem; }
html[data-proto] .codex-list li::marker { color: var(--color-muted); }

/* Reading sections: one continuous surface, separated by a hairline instead of nested bordered cards */
html[data-proto] [data-pt-sections] { background: var(--color-surface); border: 1px solid var(--color-line); border-radius: 0.75rem; padding: clamp(1.1rem, 4vw, 2.25rem); }
html[data-proto] [data-pt-sections] > .space-y-6 > * + * { margin-top: 0; }
html[data-proto] [data-pt-sections] .codex-card,
html[data-proto] [data-pt-sections] .scene-card { background: transparent; border: 0; border-radius: 0; padding: 0; border-top: 1px solid var(--color-line); padding-top: 2rem; margin-top: 2rem; }
html[data-proto] [data-pt-sections] .space-y-6 > :first-child .codex-card,
html[data-proto] [data-pt-sections] .space-y-6 > .codex-card:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
html[data-proto] [data-pt-sections] .codex-card h2, html[data-proto] [data-pt-sections] .scene-card h2 { border: 0; padding: 0; font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.9rem); color: var(--color-heading); }
html[data-proto] .codex-card h3 { color: var(--color-muted); font-family: var(--pt-ui-font); }
html[data-proto] .codex-card th { color: var(--color-muted); border-color: var(--color-line-2); }
html[data-proto] .codex-card td { border-color: var(--color-line); color: var(--color-body); }
html[data-proto] .codex-card td:first-child { color: var(--color-heading); }

/* Tables: contained, never widen the page */
html[data-proto] [data-pt-sections] table, html[data-proto] .pt-table-wrap { display: block; max-width: 100%; overflow-x: auto; font-family: var(--pt-ui-font); font-size: 0.95rem; line-height: 1.5; }
html[data-proto] [data-pt-sections] table { margin-top: 0.5rem; }
html[data-proto] [data-pt-sections] td, html[data-proto] [data-pt-sections] th { padding: 0.55rem 0.9rem 0.55rem 0; vertical-align: top; }

/* Disclosures: visible arrow + descriptive label, 44px target */
html[data-proto] .pt-disclosure { margin-top: 1rem; }
html[data-proto] .pt-disclosure > summary {
	display: flex; align-items: center; gap: 0.75rem; min-height: 2.75rem; padding: 0.55rem 0.9rem;
	background: var(--color-surface-2); border: 1px solid var(--color-line-2); border-radius: 0.5rem;
	color: var(--color-heading); font-family: var(--pt-ui-font); font-size: 0.975rem; font-weight: 600; cursor: pointer; list-style: none;
}
html[data-proto] .pt-disclosure > summary:hover { border-color: var(--pt-link); }
html[data-proto] .pt-disclosure > summary::before {
	content: ''; flex: none; width: 0.6rem; height: 0.6rem;
	border-right: 2px solid var(--pt-link); border-bottom: 2px solid var(--pt-link); transform: rotate(-45deg); transition: transform 0.15s ease;
}
html[data-proto] .pt-disclosure[open] > summary::before { transform: rotate(45deg); }
html[data-proto] .pt-disclosure > summary .pt-disclosure-hint { margin-left: auto; font-weight: 400; font-size: 0.85rem; color: var(--color-muted); }
html[data-proto] .pt-disclosure > summary::after { content: 'Show'; margin-left: auto; font-size: 0.8rem; font-weight: 600; color: var(--color-muted); }
html[data-proto] .pt-disclosure[open] > summary::after { content: 'Hide'; }
html[data-proto] .pt-disclosure > summary:has(.pt-disclosure-hint)::after { content: none; }
html[data-proto] .pt-disclosure > :not(summary) { margin-top: 0.9rem; }

/* Two-tier reading layout: Tier 1 (Quick Refresher, Where It Leaves Off, What Happened) reads straight through;
   Tier 2 reference material sits in collapsed drawers so it no longer stacks into one long wall. */
html[data-proto] [data-pt-sections] .pt-ref-drawers-label { border-top: 1px solid var(--color-line); padding-top: 2rem; margin: 2rem 0 0; max-width: none; }
html[data-proto] [data-pt-sections] .pt-ref-drawer, html[data-proto] [data-pt-sections] #wwlt.pt-ref-drawer { border-top: 0; padding-top: 0; margin-top: 0.75rem; }
html[data-proto] [data-pt-sections] .pt-ref-drawer > summary { min-height: 3.25rem; padding: 0.7rem 1rem; background: var(--color-surface-2); }
html[data-proto] [data-pt-sections] .pt-ref-drawer[open] > summary { border-color: var(--pt-link); }
html[data-proto] [data-pt-sections] .pt-ref-drawer > summary h2 { margin: 0; font-family: var(--pt-ui-font); font-size: 1.1rem; font-weight: 700; letter-spacing: 0; }
html[data-proto] [data-pt-sections] .pt-ref-drawer > :not(summary) { margin-top: 0; padding: 0.5rem 0.25rem 1.25rem; }
html[data-proto] [data-pt-sections] .pt-leaves-off { border-left: 4px solid var(--pt-link); padding-left: 1rem; }
@media (max-width: 30rem) { html[data-proto] [data-pt-sections] .pt-ref-drawer > summary .pt-disclosure-hint { display: none; } }

/* ---- Spoiler veil ---- */
html[data-proto] .spoiler[data-locked] .spoiler-veil { background: color-mix(in srgb, var(--color-ink) 62%, transparent); color: var(--color-heading); font-family: var(--pt-ui-font); font-size: 1rem; font-weight: 700; min-height: 2.75rem; }
html[data-proto] .spoiler[data-page-reveal][data-locked] .spoiler-veil { padding-top: 5rem; }
html[data-proto] .spoiler-veil::before { content: '🔒 '; }

/* ---- Hero ---- */
.pt-hero { display: grid; grid-template-columns: minmax(6.5rem, 9rem) 1fr; gap: 0 1.75rem; align-items: start; }
.pt-hero-cover { grid-row: span 2; }
.pt-hero-rest { min-width: 0; }
.pt-hero-cover img, .pt-hero-cover > div { width: 100%; height: auto; aspect-ratio: 2 / 3; border-radius: 0.375rem; box-shadow: 0 6px 18px -8px rgb(0 0 0 / 0.55); border: 1px solid var(--color-line-2); object-fit: cover; }
.pt-hero h1 { font-family: Charter, 'Iowan Old Style', 'Palatino Linotype', Georgia, serif; font-size: clamp(1.55rem, 1.15rem + 1.9vw, 2.35rem); line-height: 1.15; margin: 0.25rem 0 0; letter-spacing: 0.01em; }
.pt-hero-meta { margin-top: 0.5rem; color: var(--color-muted); font-size: 1rem; }
.pt-hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; align-items: center; }
.pt-boundary {
	margin-top: 1.25rem; padding: 0.85rem 1rem; border: 1px solid var(--color-line-2); border-left: 4px solid var(--pt-action-bg);
	border-radius: 0.5rem; background: var(--color-surface); font-size: 1rem; line-height: 1.5; color: var(--color-body);
}
.pt-boundary strong { color: var(--color-heading); }
/* Phones: cover + title share one compact row; trope pills, shortcut and controls then use the full width. */
@media (max-width: 40rem) {
	.pt-hero { grid-template-columns: 4.25rem 1fr; gap: 0 0.85rem; }
	.pt-hero-cover { grid-row: auto; }
	.pt-hero h1 { font-size: clamp(1.3rem, 1.05rem + 1.2vw, 1.55rem); margin-top: 0.15rem; }
	.pt-hero-meta { margin-top: 0.3rem; font-size: 0.92rem; line-height: 1.4; }
	.pt-hero-rest { grid-column: 1 / -1; }
	.pt-hero-actions { display: grid; grid-template-columns: 1.35fr 1fr; gap: 0.5rem; margin-top: 0.75rem; }
	.pt-hero-actions .pt-btn { grid-column: 1 / -1; }
	.pt-hero-actions .pt-btn-quiet, .pt-hero-actions .pt-complete-btn, .pt-hero-actions button { min-height: 2.75rem; padding-inline: 0.4rem; font-size: 0.88rem; line-height: 1.2; justify-content: center; }
	.pt-hero-rest .pt-trope-badges { margin-top: 0.65rem; }
}

/* On this page */
html[data-proto] .pt-toc { background: transparent; border: 0; padding: 0; gap: 0.5rem; }
html[data-proto] .pt-toc a { background: var(--color-surface); border: 1px solid var(--color-line-2); color: var(--color-body); text-decoration: none; min-height: 2.75rem; border-radius: 999px; padding: 0 1rem; }
html[data-proto] .pt-toc a:hover { border-color: var(--pt-link); color: var(--pt-link); }
html[data-proto] .shield-bar { background: var(--color-surface); backdrop-filter: none; font-family: var(--pt-ui-font); }

/* Volume strip */
html[data-proto] nav[aria-label$='primers'] { background: transparent; border: 0; padding: 0; box-shadow: none; }
html[data-proto] nav[aria-label$='primers'] a { min-height: 2.75rem; display: inline-flex; align-items: center; text-decoration: none; border-radius: 999px; }
html[data-proto] main nav[aria-label$='primers'] a[aria-current='page'] { background: var(--pt-action-bg) !important; color: var(--pt-action-fg) !important; border-color: transparent !important; text-decoration: none !important; }

/* ---- Character cards ---- */
.pt-cast { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); list-style: none; padding: 0; margin: 1rem 0 0; }
.pt-cast-card { display: flex; flex-direction: column; gap: 0.6rem; background: var(--color-surface-2); border: 1px solid var(--color-line); border-radius: 0.6rem; padding: 1rem 1.1rem; font-family: var(--pt-ui-font); font-size: 1rem; line-height: 1.55; }
.pt-cast-head { display: flex; gap: 0.75rem; align-items: center; }
.pt-cast-mono { flex: none; width: 2.5rem; height: 2.5rem; border-radius: 999px; display: grid; place-items: center; font-family: 'Cinzel', ui-serif, Georgia, serif; font-weight: 700; background: var(--color-surface-3); border: 1px solid var(--color-line-2); color: var(--color-heading); }
html[data-proto] .pt-cast-card h3 { margin: 0; font-family: var(--pt-ui-font); font-size: 1.1rem; letter-spacing: 0; text-transform: none; color: var(--color-heading); }
html[data-proto] [data-pt-sections] #wwlt, html[data-proto] [data-pt-sections] #what-happened { border-top: 1px solid var(--color-line); padding-top: 2rem; margin-top: 2rem; }
.pt-status { margin-left: auto; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.15rem 0.55rem; border: 1px solid currentColor; border-radius: 999px; }
.pt-status[data-status='alive'] { color: var(--pt-ok); }
.pt-status[data-status='recovering'], .pt-status[data-status='missing'] { color: var(--pt-warn); }
.pt-status[data-status='dead'] { color: var(--pt-bad); }
.pt-status[data-status='unknown'] { color: var(--color-muted); }
.pt-cast-card dl { display: grid; gap: 0.45rem; margin: 0; }
.pt-cast-card dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-muted); }
.pt-cast-card dd { margin: 0.1rem 0 0; color: var(--color-body); }
.pt-cast-foot { margin-top: auto; font-size: 0.85rem; color: var(--color-muted); }
.pt-cast-note { color: var(--color-muted); font-family: var(--pt-ui-font); font-size: 0.95rem; max-width: 62ch; }

/* ---- Next book ---- */
.pt-next { display: grid; gap: 0.75rem; padding: 1.4rem; background: var(--color-surface); border: 1px solid var(--color-line-2); border-radius: 0.75rem; text-align: left; }
.pt-next h2 { margin: 0; font-family: var(--pt-head-font, Charter, 'Iowan Old Style', 'Palatino Linotype', Georgia, serif); font-size: 1.5rem; color: var(--color-heading); }
.pt-next .pt-next-secondary { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: 0.95rem; color: var(--color-muted); align-items: center; }
html[data-proto] .pt-next-primary { justify-self: start; }

/* ---- Series page ---- */
.pt-series-hero { display: grid; grid-template-columns: minmax(8rem, 13rem) 1fr; gap: 1.5rem 2.25rem; align-items: start; padding: clamp(1rem, 3vw, 1.75rem); background: var(--color-surface); border: 1px solid var(--color-line); border-radius: 0.9rem; }
.pt-series-hero .pt-hero-cover img { box-shadow: 0 10px 26px -12px rgb(0 0 0 / 0.6); }
.pt-series-hero h1 { font-family: var(--pt-head-font, Charter, 'Iowan Old Style', 'Palatino Linotype', Georgia, serif); font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem); line-height: 1.1; margin: 0.3rem 0 0; }
.pt-order { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.pt-book { display: flex; flex-direction: column; gap: 0.5rem; min-height: 11.5rem; padding: 1rem 1.1rem; background: var(--color-surface); border: 1px solid var(--color-line); border-radius: 0.7rem; position: relative; }
.pt-book-num { font-family: 'Cinzel', ui-serif, Georgia, serif; font-size: 2rem; line-height: 1; color: var(--color-muted); }
.pt-book h3 { margin: 0; font-size: 1.1rem; line-height: 1.3; font-family: var(--pt-ui-font); color: var(--color-heading); }
.pt-book-meta { color: var(--color-muted); font-size: 0.9rem; }
.pt-book-state { align-self: flex-start; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.15rem 0.55rem; border: 1px solid var(--color-line-2); border-radius: 999px; color: var(--color-body); }
.pt-book[data-state='recap'] .pt-book-state { color: var(--pt-ok); border-color: var(--pt-ok); }
.pt-book[data-state='upcoming'] .pt-book-state { color: var(--pt-warn); border-color: var(--pt-warn); }
.pt-book[data-state='published'] .pt-book-state { color: var(--color-muted); }
.pt-book .pt-btn, .pt-book .pt-btn-quiet { margin-top: auto; }
.pt-book[data-pt-last-read], .pt-book.pt-last-read { border-color: var(--pt-link); box-shadow: none; }
.pt-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-top: 0.75rem; font-size: 0.9rem; color: var(--color-muted); }
@media (max-width: 36rem) {
	.pt-series-hero { grid-template-columns: 6.5rem 1fr; gap: 1rem; }
	.pt-order { grid-template-columns: 1fr; }
	.pt-book { min-height: 0; }
}

/* Mode toggle */
.pt-mode { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0.4rem 0.9rem; background: transparent; color: var(--color-body); border: 1px solid var(--color-line-2); border-radius: 999px; font: 600 0.95rem var(--pt-ui-font); cursor: pointer; }
.pt-mode:hover { border-color: var(--pt-link); }
.pt-mode-dot { width: 0.9rem; height: 0.9rem; border-radius: 50%; border: 2px solid var(--color-body); background: linear-gradient(90deg, var(--color-body) 50%, transparent 50%); }

/* Paper-mode fixes for hard-coded dark-mode utility colours still used by shared components */
html[data-proto][data-mode='paper'] .text-emerald-300\/90 { color: var(--pt-ok); }
html[data-proto][data-mode='paper'] .text-amber-300\/90 { color: var(--pt-warn); }
html[data-proto][data-mode='paper'] .text-rose-300\/90, html[data-proto][data-mode='paper'] .text-rose-100 { color: var(--pt-bad); }
html[data-proto][data-mode='paper'] [class*='bg-emerald-950'], html[data-proto][data-mode='paper'] [class*='bg-amber-950'], html[data-proto][data-mode='paper'] [class*='bg-wine-950'] { background: var(--color-surface-3); }
html[data-proto][data-mode='paper'] .bg-black\/50 { background: rgb(38 43 51 / 0.4); }
html[data-proto][data-mode='paper'] .text-\[\#e2dce0\] { color: var(--color-body); }

@media (prefers-reduced-motion: reduce) {
	html[data-proto] *, html[data-proto] *::before, html[data-proto] *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

html[data-proto] article.pt-article { max-width: 46rem; }

/* ---- Sticky mobile Kindle / Audible bar: follows the active reading mode ---- */
html[data-proto] .pt-sticky-cta {
	background: color-mix(in srgb, var(--color-surface) 96%, transparent);
	border-top: 1px solid var(--color-line-2);
	box-shadow: 0 -6px 18px rgb(0 0 0 / 0.18);
}
html[data-proto] .pt-sticky-cta p { color: var(--color-muted); font-size: 0.7rem; }
html[data-proto] .pt-sticky-cta .btn-ghost { background: var(--color-surface-2); color: var(--color-body); border-color: var(--color-line-2); }

/* Utility-coloured text (status accents) is tuned for dark; remap to AA-safe darker tones on the paper surface. */
html[data-mode='paper'] [class*='text-emerald-'], html[data-mode='paper'] [class*='text-green-'], html[data-mode='paper'] [class*='text-lime-'] { color: #1f6b3d; }
html[data-mode='paper'] [class*='text-red-'], html[data-mode='paper'] [class*='text-rose-'], html[data-mode='paper'] [class*='text-pink-'] { color: #8a1f2e; }
html[data-mode='paper'] [class*='text-amber-'], html[data-mode='paper'] [class*='text-orange-'], html[data-mode='paper'] [class*='text-yellow-'] { color: #7a5200; }
html[data-mode='paper'] [class*='text-sky-'], html[data-mode='paper'] [class*='text-blue-'], html[data-mode='paper'] [class*='text-cyan-'], html[data-mode='paper'] [class*='text-teal-'], html[data-mode='paper'] [class*='text-slate-'], html[data-mode='paper'] [class*='text-indigo-'] { color: #245d79; }
html[data-mode='paper'] [class*='text-violet-'], html[data-mode='paper'] [class*='text-purple-'] { color: #5b3a8c; }
html[data-proto] [class*='text-rose-400/70'] { color: var(--pt-bad); }
html[data-mode='paper'] [class*='text-[#'] { color: var(--color-heading); }
@media (max-width: 21rem) { .pt-hero-actions { grid-template-columns: 1fr; } }
