:root {
  color-scheme: dark;
  --color-surface-base: oklch(12% 0.01 265);
  --color-surface-elevated: oklch(16% 0.01 265);
  --color-surface-divider: oklch(27% 0.01 265);
  --color-text-primary: oklch(95% 0.01 265);
  --color-text-secondary: oklch(75% 0.02 265);
  --color-text-muted: oklch(60% 0.02 265);
  --color-brand-primary: oklch(55% 0.12 265);
  --color-brand-accent: oklch(80% 0.1 265);
  --font-guide-title: 'Playfair Display', Georgia, serif;
  --font-master: 'Playfair Display', Georgia, serif;
  --font-interface: Inter, system-ui, sans-serif;
  --font-reading: 'Libre Baskerville', Georgia, serif;
  --spacing-1: 4px;
  --spacing-2: 8px;
  --spacing-3: 12px;
  --spacing-4: 16px;
  --spacing-6: 24px;
  --spacing-8: 32px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --guide-content-width: 680px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--color-surface-base); color: var(--color-text-primary); font: 1rem/1.6 var(--font-interface); }
a { color: var(--color-brand-accent); text-underline-offset: 4px; }
button, input, select { font: inherit; color: inherit; }
button, select, input[type=search], input[readonly] { min-height: 48px; border: 1px solid var(--color-surface-divider); border-radius: var(--radius-sm); background: var(--color-surface-elevated); padding: var(--spacing-2) var(--spacing-3); }
button { cursor: pointer; }
button:disabled { opacity: .3; cursor: default; }
button:hover:not(:disabled), a.entity-card:hover { border-color: var(--color-brand-accent); }
:focus-visible { outline: 2px solid var(--color-brand-accent); outline-offset: 4px; }
.skip { position: fixed; top: -100px; left: 16px; z-index: 20; background: var(--color-surface-elevated); padding: 12px; }
.skip:focus { top: 8px; }
.topbar { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: minmax(0, 1fr) auto 48px; gap: var(--spacing-2); align-items: center; height: 56px; border-bottom: 1px solid var(--color-surface-divider); padding: 0 var(--spacing-4); background: var(--color-surface-base); }
.brand { display: flex; gap: var(--spacing-2); align-items: center; min-width: 0; min-height: 48px; color: var(--color-text-primary); text-decoration: none; font: 600 .9375rem/1.2 var(--font-guide-title); }
.brand > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand small { display: block; font: .75rem/1.3 var(--font-interface); color: var(--color-text-secondary); }
.monogram { display: grid; place-content: center; width: 24px; height: 36px; flex-shrink: 0; background: var(--color-surface-elevated); border: 1px solid var(--color-surface-divider); border-radius: 3px; color: var(--color-brand-accent); }
.cover-thumb { width: 24px; height: 36px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--color-surface-divider); border-radius: 3px; }
.masthead-cover { display: none; }
.position-pill { font-size: .8125rem; border-radius: 24px; padding-inline: 12px; }
.share { font-size: 1.5rem; }
main, footer { width: min(100%, var(--guide-content-width)); padding: var(--spacing-6) var(--spacing-4); margin-inline: auto; }
main { min-height: 60vh; }
@media (max-width: 699px) { main { padding-top: 12px; } }
h1, h2, h3 { font-family: var(--font-master); line-height: 1.25; font-weight: 600; overflow-wrap: anywhere; }
.masthead h1 { font-family: var(--font-guide-title); }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin: 8px 0 16px; }
h2 { font-size: 1.375rem; margin: 0 0 16px; }
h3 { font-size: 1.25rem; margin: 0 0 8px; }
p { margin: 0 0 16px; }
.kicker { color: var(--color-brand-accent); font: 600 .6875rem/1.3 var(--font-interface); letter-spacing: .08em; text-transform: uppercase; margin: 0 0 4px; }
.masthead { margin-bottom: var(--spacing-4); }
.masthead h1 { font-size: 1.25rem; margin: 4px 0; }
.author { font-size: .8125rem; margin: 0; color: var(--color-text-secondary); }
.edition { font-size: .6875rem; color: var(--color-text-secondary); margin: 4px 0 0; }
.muted, .intro { color: var(--color-text-secondary); }
.small { font-size: .8125rem; }
.picker { padding: var(--spacing-4); background: var(--color-surface-elevated); border: 1px solid var(--color-surface-divider); border-radius: var(--radius-lg); max-width: 560px; }
.picker > label { display: block; font: 600 1.125rem/1.3 var(--font-master); }
.picker-heading { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; max-width: 560px; margin-bottom: 8px; }
.picker-heading h2 { font-size: 1.125rem; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.picker .small { margin: 4px 0 8px; }
.stepper { display: grid; grid-template-columns: 48px 1fr 48px; gap: var(--spacing-2); }
.stepper select { width: 100%; min-width: 0; text-align: center; font: 600 1.125rem var(--font-master); }
.readout-control { min-width: 0; display: grid; place-items: center; }
[data-readout], [data-number] { width: 100%; border: 0; border-radius: 0; padding: 4px 0; text-align: center; font: 600 2rem/1.2 var(--font-master); min-height: 56px; }
[data-readout] { background: transparent; }
[data-number] { background: transparent; border-bottom: 2px solid var(--color-brand-primary); min-width: 0; max-width: 120px; outline-offset: 4px; }
[data-step] { border-radius: 50%; align-self: center; font-size: 1.25rem; width: 48px; padding: 0; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.number-feedback { text-align: center; color: var(--color-text-secondary); font-size: .8125rem; margin: 12px 0; }
.number-choices button { display: block; width: 100%; text-align: left; margin-bottom: 4px; }
input[type=range] { width: 100%; height: 48px; margin: 0; accent-color: var(--color-brand-accent); touch-action: none; }
.slider-labels { display: flex; justify-content: space-between; color: var(--color-text-secondary); font-size: .75rem; }
.finish-chip { font-size: .8125rem; display: block; margin: 8px 0 8px auto; min-height: 48px; border-radius: 24px; }
.finish-chip[aria-pressed=true] { border-color: var(--color-brand-accent); color: var(--color-brand-accent); }
.consequence { font-size: .8125rem; margin-bottom: 12px; color: var(--color-text-secondary); }
.primary { display: block; width: 100%; background: var(--color-brand-primary); border-color: transparent; color: var(--color-text-on-sapphire, white); font-weight: 600; }
.how { margin-top: var(--spacing-8); }
.how ol { padding-left: 24px; color: var(--color-text-secondary); font-size: .875rem; }
.how li { padding: 4px 0; }
.search-label { display: block; font-size: .875rem; margin-bottom: 8px; }
input[type=search] { width: 100%; margin-bottom: 12px; }
.entity-grid { display: grid; gap: var(--spacing-4); }
.entity-card { display: block; text-decoration: none; color: inherit; background: var(--color-surface-elevated); border: 1px solid var(--color-surface-divider); border-radius: var(--radius-lg); padding: var(--spacing-6); }
.shelf-card { display: flex; gap: 24px; align-items: center; }
.shelf-card img { width: 96px; height: 144px; object-fit: cover; border-radius: var(--radius-sm); }
.entity-card p { font: .875rem/1.75 var(--font-reading); margin: 16px 0 8px; }
.source { display: inline-block; color: var(--color-text-muted); font: .75rem/1.4 var(--font-interface); white-space: nowrap; }
.source-loud { color: var(--color-brand-accent); font-weight: 600; }
.card-action { display: block; color: var(--color-brand-accent); font-size: .8125rem; margin-top: 24px; }
.back-link { display: inline-flex; align-items: center; min-height: 48px; font-size: .875rem; margin-bottom: 16px; }
.dossier { margin-top: 32px; max-width: 720px; }
.dossier section { padding: 24px 0; border-bottom: 1px solid var(--color-surface-divider); }
.dossier h2 { font: 600 .8125rem var(--font-interface); color: var(--color-text-secondary); }
.dossier p { font: 1rem/1.8 var(--font-reading); margin-bottom: 12px; }
.empty { padding: 32px 16px; border: 1px solid var(--color-surface-divider); border-radius: var(--radius-lg); }
.alert { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; border: 1px solid var(--color-surface-divider); padding: 12px; border-radius: var(--radius-sm); margin-bottom: 24px; font-size: .8125rem; }
.alert button { color: var(--color-brand-accent); }
footer { border-top: 1px solid var(--color-surface-divider); margin-top: 32px; padding-bottom: 48px; font-size: .875rem; color: var(--color-text-secondary); }
footer a { display: inline-flex; align-items: center; min-height: 48px; }
footer > section + section { margin-top: 24px; }
.footer-author h2 { font: 600 1.125rem/1.3 var(--font-guide-title); color: var(--color-text-primary); margin: 0 0 8px; }
.footer-author .small { margin-bottom: 4px; }
.footer-row { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding: 12px 0; color: var(--color-text-primary); background: transparent; border: 0; border-radius: 0; text-decoration: none; font-size: .9375rem; text-align: left; }
.footer-author .footer-row { border-bottom: 1px solid var(--color-surface-divider); }
.footer-share button { justify-content: flex-start; gap: 12px; }
.footer-trust > p { font-size: .8125rem; margin-bottom: 4px; }
.footer-trust .report-trigger { margin: 0; padding-inline: 0; font-size: .9375rem; color: var(--color-text-secondary); }
.maker { font-size: .75rem; color: var(--color-text-muted); margin-top: 16px; }
@media (min-width: 1024px) { .masthead-with-cover { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 24px; } .masthead-cover { display: block; object-fit: cover; border: 1px solid var(--color-surface-divider); border-radius: var(--radius-sm); } }
dialog { border: 1px solid var(--color-surface-divider); border-radius: 20px 20px 0 0; background: var(--color-surface-base); color: inherit; width: min(100%, 600px); max-height: 90dvh; margin: auto auto 0; padding: 24px 16px max(24px, env(safe-area-inset-bottom)); }
dialog::backdrop { background: rgb(0 0 0 / .7); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.dialog-header h2 { margin: 0; }
.dialog-header button { width: 48px; }
dialog .picker { max-width: none; }
[data-picker-dialog][open], [data-preview-dialog][open] { display: flex; flex-direction: column; overflow: hidden; animation: sheet-open 240ms cubic-bezier(.4, 0, .2, 1); }
[data-picker-dialog][open] { max-height: 85dvh; }
[data-picker-dialog] .picker { display: flex; flex-direction: column; min-height: 0; padding: 0; border: 0; background: transparent; }
[data-picker-dialog] .picker-controls { overflow-y: auto; min-height: 0; padding: 4px; }
[data-picker-dialog] [data-commit] { flex-shrink: 0; margin-top: 12px; }
[data-picker-dialog] .dialog-header { flex-shrink: 0; }
.sheet-grabber { flex-shrink: 0; height: 24px; width: 100%; display: grid; place-content: center; touch-action: none; }
.sheet-grabber::after { content: ''; width: 32px; height: 4px; border-radius: 4px; background: var(--color-surface-divider); }
[data-preview-dialog][open] { max-height: 60dvh; background: var(--color-surface-elevated); }
[data-preview-dialog]::backdrop { background: rgb(0 0 0 / .4); }
.preview-close { display: flex; justify-content: flex-end; flex-shrink: 0; }
.preview-close button { width: 48px; }
[data-preview-body] h2 { font-size: 1.5rem; margin: 0 0 4px; }
[data-preview-body] { display: flex; flex-direction: column; min-height: 0; }
.preview-content { overflow-y: auto; min-height: 0; padding: 4px; }
.preview-subline, .preview-role { font-size: .8125rem; margin: 4px 0; }
.preview-subline { color: var(--color-text-secondary); }
.preview-role { font-weight: 600; }
.preview-description { font-size: .9375rem; line-height: 1.5; margin: 16px 0 0; }
.preview-page { display: flex; flex-shrink: 0; align-items: center; justify-content: center; min-height: 48px; width: 100%; border: 1px solid var(--color-brand-primary); border-radius: var(--radius-sm); text-decoration: none; margin: 24px 0 0; }
@keyframes sheet-open { from { transform: translateY(100%); } to { transform: translateY(0); } }
dialog > button, [data-share-options] > button { width: 100%; margin-bottom: 12px; }
.share-position { border-color: transparent; background: transparent; color: var(--color-text-secondary); }
dialog input[readonly] { width: 100%; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: 90vw; padding: 12px 16px; border: 1px solid var(--color-surface-divider); border-radius: var(--radius-sm); background: var(--color-surface-elevated); z-index: 10; }
.skeleton { padding: 48px 0; color: var(--color-text-secondary); }
.report-trigger { display: block; background: transparent; border-color: transparent; color: var(--color-text-muted); font-size: .8125rem; min-height: 48px; margin-top: 12px; }
[data-preview-body] > .report-trigger { flex-shrink: 0; margin-top: 4px; align-self: flex-start; }
[data-report-dialog][open], [data-reporting][open] { display: flex; flex-direction: column; max-height: 85dvh; overflow: hidden; }
[data-report-body], [data-reporting] [data-preview-body] { overflow-y: auto; min-height: 0; padding: 4px; display: block; }
[data-report-title] { font-size: 1.25rem; margin-bottom: 8px; }
.report-about { font-size: .8125rem; color: var(--color-text-muted); }
.report-reasons { border: 1px solid var(--color-surface-divider); border-radius: var(--radius-sm); overflow: hidden; background: var(--color-surface-sunken); }
.report-reasons button { display: grid; grid-template-columns: 24px 1fr; gap: 12px; text-align: left; width: 100%; min-height: 56px; background: transparent; border: 0; border-bottom: 1px solid var(--color-surface-divider); border-radius: 0; padding: 12px 16px; }
.report-reasons button:last-child { border-bottom: 0; }
.report-reasons strong, [data-reason-subtitle] { display: block; }
[data-reason-subtitle] { font-size: .8125rem; color: var(--color-text-secondary); }
.report-reasons button:disabled { opacity: .4; }
.report-reasons button[data-sending] { opacity: 1; }
.report-glyph { color: var(--color-text-secondary); }
[data-detail-form] label { display: block; font-size: .875rem; margin-bottom: 8px; }
[data-detail-form] textarea { font: 1rem/1.5 var(--font-interface); width: 100%; padding: 12px; color: inherit; background: var(--color-surface-sunken); border: 1px solid var(--color-surface-divider); border-radius: var(--radius-sm); resize: vertical; }
.detail-counter { text-align: right; color: var(--color-text-muted); font-size: .75rem; margin: 4px 0 12px; }
.detail-send, .report-close { width: 100%; min-height: 48px; }
.detail-send { border-color: var(--color-brand-primary); color: var(--color-brand-accent); }
.report-close { border-color: transparent; background: transparent; margin-top: 8px; }
[data-report-error], [data-detail-error] { font-size: .875rem; margin-top: 12px; }
[data-report-error] button, [data-detail-error] button { color: var(--color-brand-accent); background: transparent; border-color: transparent; }
@media (min-width: 700px) { .topbar { padding-inline: max(24px, calc((100vw - var(--guide-content-width) + 48px) / 2)); } main, footer { padding-inline: 24px; } .entity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .masthead { margin-top: 24px; } .masthead h1 { font-size: 2.5rem; } .picker { margin-top: 24px; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; } }

.panel-next { width: 100%; min-height: 48px; margin: 0 0 32px; background: transparent; color: var(--color-brand-accent); border: 1px solid var(--color-surface-divider); border-radius: var(--radius-md); }

body { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
.bottom-tabs { position: fixed; z-index: 20; inset: auto 0 0; display: flex; height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--color-surface-elevated); border-top: 1px solid var(--color-surface-divider); }
.bottom-tabs a { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 48px; color: var(--color-text-secondary); text-decoration: none; font: 500 .6875rem/1.1 var(--font-interface); text-align: center; }
.bottom-tabs a > span:first-child { font-size: 20px; line-height: 20px; }
.bottom-tabs [aria-current] { color: var(--color-brand-accent); font-weight: 600; }
.bottom-tabs [aria-current]::before { content: ''; position: absolute; top: 0; width: 24px; height: 3px; border-radius: 3px; background: var(--color-brand-primary); }
.end-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.door { display: inline-flex; align-items: center; min-height: 48px; color: var(--color-brand-accent); text-decoration: none; font-size: .875rem; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.entity-chip { display: inline-flex; align-items: center; min-height: 48px; padding: 8px 12px; border: 1px solid var(--color-surface-divider); border-radius: var(--radius-pill); text-decoration: none; color: var(--color-brand-accent); font: 500 .875rem/1.4 var(--font-interface); }
.prose-chip { display: inline; min-height: unset; padding: 6px 0; margin-block: -6px; border: 0; border-radius: 0; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.group-label { margin: 16px 0 8px; font: 600 .8125rem/1.4 var(--font-interface); }
.scene-rail { list-style: none; padding: 0 0 0 24px; margin: 16px 0; }
.scene-rail > li { position: relative; padding-bottom: 16px; }
.scene-rail > li::before { content: ''; position: absolute; left: -20px; top: 5px; width: 8px; height: 8px; border: 1px solid var(--color-brand-primary); border-radius: 50%; background: var(--color-surface-base); }
.scene-rail > li:not(:last-child)::after { content: ''; position: absolute; left: -16px; top: 16px; bottom: 0; border-left: 1px solid var(--color-surface-divider); }
.scene-rail p, .reading { font: .9375rem/1.6 var(--font-reading); margin: 4px 0 0; }
.scene-meta { font-size: .75rem; color: var(--color-text-muted); }
.thread-row, .thread-card, .timeline-row { display: block; min-height: 48px; padding: 12px 0; color: var(--color-text-primary); text-decoration: none; border-bottom: 1px solid var(--color-surface-divider); }
.thread-row small { display: block; margin-top: 4px; color: var(--color-text-muted); }
.thread-card h2 { font: 500 .9375rem/1.5 var(--font-interface); margin: 0; }
.thread-card p[lang] { font: .875rem/1.6 var(--font-reading); }
.tension { margin: 16px 0; font-size: .75rem; color: var(--color-text-muted); }
.tension svg { width: 100%; height: 64px; color: var(--color-brand-accent); }
.plot-labels { display: flex; justify-content: space-between; }
.app-bridge { border: 1px solid var(--color-surface-divider); border-radius: var(--radius-lg); padding: 16px; }
.app-bridge h2 { font-size: 1.125rem; }
.outline { display: flex; min-height: 48px; align-items: center; justify-content: center; border: 1px solid var(--color-brand-primary); border-radius: var(--radius-md); color: var(--color-brand-accent); text-decoration: none; }
.ficha { border: 1px solid var(--color-surface-divider); border-radius: var(--radius-lg); padding: 16px; margin-top: 24px; }
.ficha > div { display: grid; grid-template-columns: 112px 1fr; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--color-surface-divider); }
.ficha > div:last-child { border: 0; }
.ficha > .stacked { grid-template-columns: 1fr; }
.ficha dt { color: var(--color-text-secondary); font-size: .8125rem; }
.ficha dd { margin: 0; font-size: .9375rem; overflow-wrap: anywhere; }
.appearances { width: 100%; height: 24px; fill: var(--color-brand-accent); }
.appearances path { stroke: var(--color-surface-divider); fill: none; }
.filter-chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0; }
.filter-chips a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; border: 1px solid var(--color-surface-divider); border-radius: var(--radius-pill); color: var(--color-text-secondary); text-decoration: none; font-size: .8125rem; }
.filter-chips [aria-current] { border-color: var(--color-brand-primary); color: var(--color-brand-accent); }
.hub-search { display: flex; gap: 8px; align-items: center; }
.hub-search input[type=search] { min-width: 0; flex: 1; scroll-margin-top: 64px; }
.hub-list { list-style: none; padding: 0; min-height: 240px; }
.hub-list li > a { display: block; padding: 16px 0; border-bottom: 1px solid var(--color-surface-divider); color: var(--color-text-primary); text-decoration: none; }
.hub-list h2 { font: 600 1rem/1.4 var(--font-interface); margin: 0 0 4px; }
.hub-list p { margin: 4px 0; font-size: .875rem; }
.chapter-nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 32px 0 16px; }
.source-quote { margin: 16px 0; }
.source-quote blockquote { border-left: 2px solid var(--color-surface-divider); margin: 0; padding-left: 12px; font: italic .9375rem/1.6 var(--font-reading); }
.source-quote figcaption { color: var(--color-text-muted); font-size: .75rem; margin: 4px 0 0 12px; }
.about img { float: left; margin: 0 16px 12px 0; }

.preview-card, .review-strip { margin: 0 0 16px; padding: 16px; border: 1px solid var(--color-surface-divider); border-radius: var(--radius-lg); background: var(--color-surface-elevated); }
.preview-card .primary { display: flex; align-items: center; justify-content: center; text-decoration: none; margin: 16px 0 8px; }
.review-strip .end-row { margin: 0; font-size: .8125rem; }
.review-strip button[data-picker-draft] { display: inline; padding: 0; background: transparent; color: var(--color-brand-accent); border: 0; }
.view-all { min-width: 48px; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--color-text-secondary); text-decoration: none; }
.view-all small { font-size: .6875rem; }
.invitation { border: 1px dashed var(--color-surface-divider); border-radius: var(--radius-md); padding: 16px; }
.approval-choice { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.approval-choice input { width: 20px; height: 20px; accent-color: var(--color-brand-primary); }
[data-approval-form] fieldset { border: 0; padding: 0; margin: 0 0 16px; }
[data-approval-form] fieldset:disabled { opacity: .4; }
[data-approval-form] legend { margin-bottom: 8px; }
[data-approval-form] > [data-approve-submit] { position: sticky; bottom: 0; }
.masthead h1 .kicker, .masthead h1 .title { display: block; }
.demo-banner { border: 1px solid var(--color-surface-divider); border-radius: var(--radius-md); padding: 8px 12px; margin-bottom: 16px; font: .8125rem/1.4 var(--font-interface); color: var(--color-text-secondary); }
.demo-banner button { display: inline; padding: 0; min-height: 48px; border: 0; background: transparent; color: inherit; text-decoration: underline; font: inherit; }

.marketing-page { padding-bottom: 0; }
.marketing-header { display: flex; justify-content: space-between; gap: 16px; padding: 16px; min-height: 64px; border-bottom: 1px solid var(--color-surface-divider); font-size: .8125rem; }
.marketing-page main { width: min(100%, 1048px); max-width: 1048px; }
.marketing-page .primary { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 24px; border-radius: var(--radius-md); text-decoration: none; }
.marketing-page section { border-bottom: 1px solid var(--color-surface-divider); padding-bottom: 32px; margin-bottom: 32px; }
.showcase-card { border: 1px solid var(--color-surface-divider); border-radius: var(--radius-lg); padding: 16px; }
.showcase-card img { float: left; margin: 0 16px 12px 0; }
.showcase-card .outline { clear: both; }
.marketing-page figure { margin: 16px 0; }
.marketing-page figcaption { margin-top: 8px; color: var(--color-text-muted); font-size: .75rem; font-style: italic; }
.marketing-page video { max-width: 100%; }
.marketing-page .still-link img { max-width: 270px; height: auto; margin-inline: auto; display: block; }
.printed-mock { padding: 24px; background: #faf9f6; color: #222536; border: 1px solid var(--color-surface-divider); max-width: 320px; }
.printed-mock img { display: block; margin: 24px auto 0; }
.printed-mock figcaption { color: #50546a; }
.desktop-copy { display: none; }
.fictional-example img { width: 100%; max-width: 480px; height: auto; border: 1px solid var(--color-surface-divider); border-radius: var(--radius-lg); }
.showcase-grid { display: grid; gap: 16px; }
@media (min-width: 1024px) { .showcase-hero, .try-guide { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; } .showcase-grid { grid-template-columns: repeat(3, 1fr); } .desktop-copy { display: block; } .mobile-copy { display: none; } }

.shelf-page main { padding-top: 24px; }
.shelf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; row-gap: 24px; list-style: none; padding: 0; margin-top: 24px; }
.shelf-tile { display: block; color: var(--color-text-primary); text-decoration: none; }
.shelf-tile > img, .title-tile { display: block; width: 100%; aspect-ratio: 2/3; height: auto; object-fit: cover; border: 1px solid var(--color-surface-divider); border-radius: var(--radius-sm); background: var(--color-surface-elevated); }
.title-tile { display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; font: 600 1.125rem/1.25 var(--font-master); }
.shelf-tile h2 { font: 600 1rem/1.25 var(--font-master); margin: 8px 0 2px; }
.shelf-tile p { margin: 0; font-size: .8125rem; color: var(--color-text-secondary); }
.authors-line { display: inline-flex; align-items: center; min-height: 48px; white-space: nowrap; color: var(--color-text-muted); }
.authors-page main { width: min(100%, 1008px); max-width: 1008px; }
.authors-page .authors-hero { padding-top: 8px; }
.authors-hero h1 { font-size: 1.75rem; line-height: 1.2; margin: 4px 0 8px; }
.authors-hero .intro, .authors-hero p { font-size: .9375rem; margin: 8px 0; }
.authors-hero .primary { width: 100%; margin-top: 24px; }
.author-example { display: flex; gap: 12px; padding: 12px; margin-top: 16px; border: 1px solid var(--color-surface-divider); border-radius: var(--radius-lg); background: var(--color-surface-elevated); }
.author-example img { flex: 0 0 64px; width: 64px; height: 96px; object-fit: cover; }
.author-example > div, .author-example figcaption { min-width: 0; margin: 0; font-style: normal; }
.author-example h2 { font-size: 1rem; margin: 4px 0; }
.author-example p { font-size: .8125rem; margin: 4px 0; }
.author-example .kicker { font-size: .6875rem; }
.author-example .door { font-size: .8125rem; }
.authors-faq h3 { font: 600 1rem/1.4 var(--font-interface); margin-top: 24px; }
@media (min-width: 1024px) { .shelf-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 24px; row-gap: 32px; } .shelf-page main { width: min(100%, 912px); } .authors-hero { max-width: 680px; } }

.hub-group-label{font-size:.75rem;font-weight:600;margin:1rem 0 .25rem}.hub-group-label.muted{font-weight:400}.hub-list mark{background:var(--color-sapphire-alpha-15, #4879c926);color:inherit;border-radius:3px;padding:0 1px}

.metric-sentinel{display:block;width:1px;height:1px;pointer-events:none}

@media(min-width:1024px){
  .authors-page .authors-hero{display:grid;grid-template-columns:minmax(0,520px) minmax(0,280px);gap:48px;max-width:880px;margin-inline:auto;padding-top:48px}
  .authors-hero h1{font-size:2.5rem;line-height:1.15}
  .authors-hero .intro,.authors-pitch>p{font-size:1.0625rem}
  .authors-pitch{grid-column:1;grid-row:1}
  .authors-hero-example{grid-column:2;grid-row:1/span 2}
  .authors-hero-cta{grid-column:1;grid-row:2}
  .authors-page .authors-hero{row-gap:16px}
  .authors-hero-example .author-example{display:block;border:0;background:none;padding:0;margin-top:0}
  .authors-hero-example .author-example img{width:160px;height:240px;margin-bottom:16px}
  .authors-page main>section:not(.authors-hero){max-width:680px;margin-inline:auto}
}

a.primary{border-radius:var(--radius-md)}
.author-example .door{gap:4px}
@media(min-width:1024px){.authors-hero-cta .primary{width:auto;min-width:200px}}

/* The reader keeps its compact controls on phones; desktop uses header navigation. */
@media (min-width: 1024px) {
  .reader-page { padding-bottom: 0; }
  .reader-page .topbar { height: 72px; grid-template-columns: minmax(140px, 260px) minmax(0, 1fr) auto 48px; gap: 16px; padding-inline: max(24px, calc((100vw - 1280px) / 2)); }
  .reader-page .brand { font-size: 1rem; }
  .reader-page .bottom-tabs { position: static; display: flex; flex-direction: row; justify-content: center; height: 72px; width: auto; max-width: none; margin: 0; padding: 0; background: transparent; border: 0; }
  .reader-page .bottom-tabs a { flex: 0 1 auto; flex-direction: row; gap: 0; padding: 0 14px; font-size: .875rem; white-space: nowrap; }
  .reader-page .bottom-tabs a > span:first-child { display: none; }
  .reader-page .bottom-tabs [aria-current] { color: var(--color-text-primary); }
  .reader-page .bottom-tabs [aria-current]::before { top: auto; bottom: 0; width: calc(100% - 28px); height: 2px; }
  .reader-page main { padding-top: 40px; padding-bottom: 40px; }
  .reader-page:has(.gate-layout) main,
  .reader-page[data-page-type=gate] main,
  .reader-page[data-page-type=painel] main,
  .reader-page[data-page-type=mundo] main,
  .reader-page[data-page-type=misterios] main { width: min(100% - 48px, 1120px); padding-inline: 0; }
  .gate-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 72px; align-items: start; }
  .gate-primary .masthead { margin-bottom: 32px; }
  .gate-primary .masthead h1 { font-size: 2.25rem; }
  .gate-primary .picker, .gate-primary .picker-heading { max-width: none; }
  .gate-secondary { padding-top: 8px; }
  .gate-secondary .how { margin-top: 0; }
  .gate-secondary section + section { margin-top: 32px; }
  .panel-layout { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(280px, 1fr); gap: 56px; align-items: start; }
  .panel-recap { min-width: 0; }
  .panel-recap > h2 { font-size: 1.75rem; margin-bottom: 24px; }
  .panel-aside { min-width: 0; display: grid; gap: 20px; }
  .panel-aside > section { padding: 24px; border: 1px solid var(--color-surface-divider); border-radius: var(--radius-lg); background: var(--color-surface-elevated); }
  .panel-aside h2 { font-size: 1.25rem; }
  .panel-aside .end-row { margin-bottom: 0; }
  .reader-page .hub-search { max-width: 680px; }
  .reader-page .filter-chips { flex-wrap: wrap; overflow: visible; }
  .reader-page .hub-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; min-height: 0; margin-top: 12px; margin-bottom: 32px; }
  .reader-page .hub-list li > a { height: 100%; padding: 20px; border: 1px solid var(--color-surface-divider); border-radius: var(--radius-md); background: var(--color-surface-elevated); }
  .reader-page .hub-list li > a:hover { border-color: var(--color-brand-accent); }
  .reader-page .thread-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
  .reader-page .thread-card { height: 100%; padding: 24px; border: 1px solid var(--color-surface-divider); border-radius: var(--radius-lg); background: var(--color-surface-elevated); }
  .reader-page footer { width: min(100% - 48px, 1120px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; padding: 32px 0 48px; }
  .reader-page footer > section + section { margin-top: 0; }
  .reader-page dialog { width: 480px; max-height: 80dvh; margin: auto; padding: 24px; border-radius: 20px; }
  .reader-page [data-picker-dialog][open], .reader-page [data-preview-dialog][open] { max-height: 80dvh; animation: desktop-dialog-open 160ms ease-out; }
  .reader-page .sheet-grabber { display: none; }
  .reader-page .toast { bottom: 24px; }
  .reader-page .scene-rail p, .reader-page .reading { max-width: 65ch; }
}
@keyframes desktop-dialog-open { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 767px) { .reader-page .toast { bottom: calc(72px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .reader-page dialog[open] { animation: none; } }


/* Tablet: CSS viewport width, independent of device identity and JavaScript. */
@media (min-width: 768px) and (max-width: 1023px) {
  .reader-page { padding-bottom: 0; }
  .reader-page .topbar { height: 113px; grid-template-rows: 56px 56px; row-gap: 0; padding-inline: 24px; }
  .reader-page .brand { grid-column: 1; grid-row: 1; }
  .reader-page .position-pill { grid-column: 2; grid-row: 1; }
  .reader-page .topbar > .share, .reader-page .topbar > .view-all { grid-column: 3; grid-row: 1; }
  .reader-page .bottom-tabs { position: static; grid-column: 1 / -1; grid-row: 2; height: 56px; width: auto; max-width: none; margin: 0; padding: 0; border: 0; background: transparent; justify-content: center; }
  .reader-page .bottom-tabs a { flex: 0 1 auto; flex-direction: row; gap: 0; padding-inline: 24px; font-size: .875rem; white-space: nowrap; }
  .reader-page .bottom-tabs a > span:first-child { display: none; }
  .reader-page .bottom-tabs [aria-current]::before { top: auto; bottom: 0; width: calc(100% - 48px); height: 2px; }
  .reader-page main { padding: 32px 0; }
  .reader-page:has(.gate-layout) main,
  .reader-page[data-page-type=painel] main,
  .reader-page[data-page-type=mundo] main,
  .reader-page[data-page-type=misterios] main { width: calc(100% - 48px); }
  .gate-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .gate-primary .masthead { margin-top: 0; }
  .gate-primary .masthead h1 { font-size: 2rem; }
  .gate-primary .picker { margin-top: 12px; }
  .gate-secondary .how { margin-top: 0; }
  .gate-secondary section + section { margin-top: 24px; }
  .panel-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
  .panel-aside > section { min-width: 0; padding: 20px; border: 1px solid var(--color-surface-divider); border-radius: var(--radius-lg); background: var(--color-surface-elevated); }
  .reader-page .hub-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; min-height: 0; }
  .reader-page .hub-list li > a { height: 100%; padding: 16px; border: 1px solid var(--color-surface-divider); border-radius: var(--radius-md); }
  .reader-page .filter-chips { flex-wrap: wrap; overflow: visible; }
  .reader-page .thread-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .reader-page .thread-card { height: 100%; }
  .reader-page dialog { width: 480px; max-height: 80dvh; margin: auto; padding: 24px; border-radius: 20px; }
  .reader-page [data-picker-dialog][open], .reader-page [data-preview-dialog][open] { max-height: 80dvh; animation: desktop-dialog-open 160ms ease-out; }
  .reader-page .sheet-grabber { display: none; }
  .reader-page .toast { bottom: 24px; }
}

/* Anchor/focus offsets follow the CSS header at every viewport size. */
.reader-page { --reader-header-height: 56px; }
.reader-page :is([tabindex="-1"], section[id], li[id], input[type=search]) { scroll-margin-top: calc(var(--reader-header-height) + 16px); }
.reader-page :is(.reading, .scene-rail p) { max-width: 65ch; }
@media (min-width: 768px) and (max-width: 1023px) { .reader-page { --reader-header-height: 113px; } }
@media (min-width: 1024px) { .reader-page { --reader-header-height: 72px; } }
