/* Shared reading and interaction scale for every room in the atelier. */
:root {
  --paper: #f7f6f2;
  --card: #fffefa;
  --ink: #293b40;
  --muted: #69766e;
  --line: #e1e4da;
  --brass: #a58a55;
  --navy: #263e47;
  --sage: #607863;
}
body { font-size:14px; line-height:1.85; letter-spacing:.02em; }
body.menu-open { overflow:hidden; }
.skip-link { left:16px; top:-100px; white-space:nowrap; }
.skip-link:focus { top:12px; }
button, a, input, select, textarea { -webkit-tap-highlight-color:transparent; }
input, select, textarea { color:var(--ink); }
input::placeholder, textarea::placeholder { color:#8a9386; opacity:1; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline:2px solid #967f4e; outline-offset:3px;
}
button:disabled { opacity:.45; transform:none; }
.button { min-height:44px; padding:10px 18px; font-size:12px; border-radius:6px; }
.button-light { background:#ecefe6; color:#4e6152; }
.button-dark { background:var(--navy); }
.text-button { font-size:12px; min-height:36px; display:inline-flex; align-items:center; gap:6px; }
.icon-button { min-width:40px; min-height:40px; display:inline-grid; place-items:center; border-radius:6px; }
.icon-button:hover { background:#e9ede3; }
.delete-button { font-size:11px; min-height:36px; padding:6px 9px; border-radius:5px; color:#976454; }
.delete-button:hover { background:#f5e9e2; color:#824c3d; }
.delete-text { color:#976454; }
.tag { font-size:10px; padding:3px 9px; color:#596e51; line-height:1.7; }
.subtle, .intro-sub { font-size:13px; color:var(--muted); line-height:1.95; }
.muted-small { font-size:11px; color:#73806e; }
.eyebrow, .small-label { font-size:10px; color:#7d876f; }
.multiline { overflow-wrap:anywhere; }

/* Navigation stays compact enough to leave room for backup and recovery. */
.sidebar { width:235px; padding:28px 20px 0; overflow:auto; background:#f0f1e9; }
.brand { margin:0 0 26px 7px; gap:12px; }
.brand strong { font-size:21px; }
.brand small { font-size:8px; }
.sidebar-label { font-size:10px; margin-bottom:8px; padding:0 11px; color:#74806d; }
.story-switch { margin:0 0 20px 5px; gap:5px; }
.story-switch select { width:100%; min-width:0; min-height:39px; font-size:12px; padding:7px 10px; background:#fffef9; border-color:#daddcf; }
.story-switch .icon-button { min-width:33px; min-height:39px; font-size:23px; color:#7b876d; }
.nav-main { gap:3px; }
.nav-main a { height:42px; min-height:42px; padding:0 12px; font-size:13px; color:#61705f; }
.nav-main a.active { background:#e0e7db; color:#294f3a; }
.nav-main a.active:before { content:""; width:3px; height:18px; border-radius:2px; background:#6d8767; position:absolute; left:0; }
.nav-main a { position:relative; }
.nav-count { font-size:11px; color:#74816c; }
.new-badge { font-size:9px; color:#7b846e; background:#e7ebdf; padding:1px 5px; border-radius:3px; }
.sidebar-divider { margin:21px 12px 18px; }
.book-spine { padding-left:14px; margin:0 0 20px 14px; }
.book-spine p { font-size:17px; overflow-wrap:anywhere; margin-bottom:5px; }
.book-spine small { font-size:10px; color:#7b8670; }
.book-spine .text-button { font-size:10px; min-height:29px; justify-content:flex-start; }
.sidebar-bottom { padding-top:8px; }
.private-label { font-size:10px; color:#72816a; margin:7px 10px; }
.backup-button { font-size:10px; min-height:32px; padding:6px 10px; color:#6f7f64; }
.profile { margin:12px -20px 0; padding:16px 20px; }
.profile b { font-size:11px; }
.profile small { font-size:9px; color:#7c8971; }
.app-shell { margin-left:235px; }
.topbar { min-height:70px; height:70px; padding:0 38px; background:#faf9f5; position:sticky; top:0; z-index:15; }
.topbar-left { gap:10px; font-size:12px; min-width:0; }
#header-scope { max-width:210px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.topbar-left b { color:#415345; }
.topbar-right { gap:14px; flex-shrink:0; }
.cloud-status { font-size:11px; min-height:34px; color:#5b7250; padding:6px 11px; }
.cloud-status[data-status="offline"] { background:#f4ecdb; border-color:#e6d9bd; color:#886c3e; }
.search-trigger { font-size:11px; min-height:35px; padding:7px 10px; color:#6d7a65; gap:7px; }
.search-trigger kbd { font-size:9px; margin-left:10px; }
.help-trigger { display:flex; align-items:center; gap:6px; min-height:36px; color:#738169; font-size:11px; }
.help-trigger span { width:18px; height:18px; border:1px solid #b5bea9; border-radius:50%; display:grid; place-items:center; line-height:1; }
.help-trigger b { font-weight:400; }
.sync-banner { font-size:12px; padding:10px 38px; color:#7b683e; line-height:1.8; }
.sync-banner a { text-underline-offset:3px; }
.page { padding:32px 38px 0; max-width:1560px; }
.page-intro { margin-bottom:26px; gap:20px; align-items:center; }
.page-intro h1 { font-size:28px; letter-spacing:.06em; color:var(--ink); }
.page-intro .eyebrow { margin-bottom:5px; }
.page-intro .subtle { margin:7px 0 0; }
.page-footer { font-size:10px; color:#7b876f; padding:20px 0 27px; flex-wrap:wrap; }
.page-footer .text-button { font-size:11px; }

/* Global entrance and book shelf. */
.entrance-hero { min-height:300px; grid-template-columns:1.12fr 1fr; border-radius:10px; }
.entrance-copy { padding:29px 0 31px 32px; }
.hero-eyebrow { font-size:10px; color:#d3d9ca; }
.entrance-copy h2 { font-size:32px; line-height:1.7; margin:17px 0 12px; letter-spacing:.06em; }
.entrance-copy>p { font-size:12px; line-height:2; color:#c5cfc2; }
.entrance-actions { gap:17px; flex-wrap:wrap; margin-top:21px; }
.entrance-continue { font-size:12px; min-height:42px; color:#e1e5d6; }
.entrance-art { height:290px; margin-right:24px; }
.art-caption { font-size:8px; top:8px; }
.art-footnote { font-size:10px; }
.library-summary { padding:21px 0; margin-bottom:24px; }
.library-summary strong { font-size:30px; color:#64735f; }
.library-summary span { font-size:11px; color:#6e7a66; }
.library-summary>a { font-size:11px; color:#7e886f; }
.section-heading { margin-bottom:16px; }
.section-heading h2 { font-size:19px; }
.section-heading>a { font-size:11px; }
.section-index { font-size:11px; }
.shelf-count { font-size:11px; color:#7d886d; }
.library-search { background:#fffef9; border-color:#dce1d3; }
.library-search input { font-size:12px; min-height:38px; color:#56694f; }
.library-books { gap:22px; grid-template-columns:repeat(3,minmax(0,1fr)); }
.library-book-card { border-radius:7px; border-color:#dfe3d6; background:#fffef9; box-shadow:0 2px 5px #30463404; }
.library-book-cover { min-height:220px; padding:23px; }
.cover-serial { font-size:9px; }
.cover-name { font-size:25px; line-height:1.75; overflow-wrap:anywhere; }
.cover-subtitle { font-size:11px; }
.cover-open { font-size:11px; }
.library-book-info { padding:17px 19px; }
.book-info-meta { font-size:10px; gap:9px; color:#718067; flex-wrap:wrap; }
.library-book-info>p { font-size:11px; color:#697b5e; min-height:2em; margin:9px 0; }
.book-card-actions { padding-top:8px; }
.book-card-actions .text-button { font-size:11px; }
.new-book-card { min-height:340px; border-color:#cbd5c1; border-radius:7px; gap:12px; background:#f0f1e8; }
.new-book-card:hover { background:#e9eee1; }
.new-book-card>b { font-size:14px; color:#5e7255; font-weight:500; }
.new-book-card>small { font-size:11px; color:#7d896f; }
.home-lower { gap:28px; margin-top:32px; }
.recent-manuscript { padding:17px; gap:15px; min-height:86px; }
.recent-manuscript b { font-size:14px; color:#42593b; }
.recent-manuscript small { font-size:11px; color:#7d8a70; }
.recent-date { font-size:10px; white-space:nowrap; }
.recent-empty { padding:25px; min-height:140px; }
.recent-empty p { font-size:12px; color:#7c886e; line-height:2; }
.home-notice { padding:25px; }
.home-notice h3 { font-size:23px; line-height:1.9; margin:10px 0 14px; }
.home-tools>a { font-size:12px; min-height:42px; color:#657958; }
.library-no-results { font-size:13px; }

/* Project desk: the active manuscript is the main action. */
.hero { height:330px; border-radius:9px; }
.hero-content { padding:30px 34px; max-width:85%; }
.hero h2 { font-size:37px; margin:15px 0 8px; line-height:1.65; max-width:90%; overflow-wrap:anywhere; }
.hero-content>p { font-size:14px; margin:0 0 12px; }
.hero-description { font-size:12px; line-height:1.95; max-width:520px; color:#c3cdc2; margin-bottom:19px; }
.hero-caption { font-size:10px; }
.hero-generic .hero-content { max-width:100%; }
.project-strip { padding:22px 0; margin-bottom:29px; }
.project-strip>div { padding:0 23px; }
.strip-number { font-size:30px; }
.project-strip>div>span:last-child { font-size:12px; }
.project-strip small { font-size:10px; color:#839174; }
.project-strip>a { font-size:11px; }
.home-columns { grid-template-columns:minmax(0,1.7fr) minmax(240px,1fr); gap:26px; }
.continue-card { padding:24px 25px; border-radius:7px; }
.continue-title { margin:18px 0 14px; }
.continue-title h3 { font-size:20px; line-height:1.8; }
.continue-title p { font-size:11px; color:#77856b; }
.continue-copy { font-size:13px; line-height:2; color:#65775a; }
.scene-links { margin-bottom:0; }
.scene-links button { min-height:43px; font-size:12px; padding:10px 12px; }
.shelf-book { padding:17px; }
.shelf-book b { font-size:16px; }
.shelf-book small, .shelf-book>span { font-size:10px; }
.quick-note-card { padding:22px; border-radius:7px; }
.quick-note-card>label { font-size:13px; color:#687754; }
.quick-note-card textarea { font-size:16px; height:140px; padding-top:15px; color:#4c6041; }
.note-card-bottom { font-size:10px; gap:12px; }
.round-button { width:38px; height:38px; flex-shrink:0; }
.guiding-note { margin-top:26px; }
.guiding-note h3 { font-size:21px; }
.guiding-note p { font-size:12px; color:#758568; }

/* Filters, search and lists share the same control scale. */
.toolbar { gap:15px; padding-bottom:18px; margin-bottom:20px; }
.segmented { padding:4px; gap:3px; flex-wrap:wrap; border-radius:7px; }
.segmented button { padding:7px 13px; min-height:35px; font-size:12px; border-radius:4px; }
.segmented button.selected { color:#35543b; }
.collection-tools, .terms-toolbar { display:flex; align-items:center; gap:12px; margin:0 0 21px; flex-wrap:wrap; }
.collection-tools select, .terms-toolbar select { min-height:43px; border:1px solid #dce2d2; border-radius:6px; background:#fffef9; padding:9px 32px 9px 12px; color:#51684a; font:inherit; font-size:12px; max-width:100%; }
.collection-search { display:flex; align-items:center; gap:9px; background:#fffef9; border:1px solid #dce2d2; border-radius:6px; flex:1; min-width:190px; padding:0 12px; }
.collection-search>span { color:#87927a; }
.collection-search svg { width:16px; height:16px; }
.collection-search input { width:100%; min-width:0; min-height:43px; border:0; background:transparent; font-size:12px; padding:9px 0; outline:none; }
.collection-search:focus-within { outline:2px solid #a58a55; outline-offset:2px; }
.collection-search input:focus-visible { outline:none; }
.result-count { font-size:11px; color:#7c886c; white-space:nowrap; padding:0 4px; }
.terms-toolbar label { font-size:12px; color:#78856c; }
.terms-toolbar input { flex:1; min-width:180px; min-height:43px; padding:9px 12px; border:1px solid #dce2d2; border-radius:6px; background:#fffef9; font-size:12px; }
.terms-toolbar>.muted-small { margin-left:auto; }
.list-caption { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; margin:0 0 13px; color:#7d896e; font-size:11px; }
.chapter-list { border-radius:7px; }
.chapter-row { grid-template-columns:35px minmax(0,1fr); padding:24px; gap:6px 17px; }
.chapter-index { font-size:27px; align-self:start; padding-top:5px; }
.chapter-row h3 { font-size:19px; line-height:1.9; margin-bottom:5px; overflow-wrap:anywhere; }
.chapter-row p { font-size:12px; line-height:1.9; color:#75866a; }
.chapter-row.interlude { padding:20px 24px; }
.chapter-row.interlude h3 { font-size:17px; }
.chapter-actions { grid-column:2; display:flex; align-items:center; flex-wrap:wrap; max-width:none; width:100%; justify-content:flex-end; gap:8px 12px; margin-top:12px; }
.chapter-action-meta { display:flex; align-items:center; flex-direction:row; gap:12px; margin-right:auto; font-size:11px; color:#7d886e; }
.chapter-action-meta>span { font-size:11px; }
.chapter-edit { min-height:38px; padding:7px 13px; font-size:12px; border-radius:5px; border-color:#d7dfcc; background:#edf1e5; color:#426239; }
.chapter-order { display:flex; gap:5px; border-left:1px solid var(--line); padding-left:12px; }
.move-button { min-width:32px; min-height:34px; font-size:14px; background:#f4f5ee; color:#758567; border-radius:4px; }
.move-button:disabled { opacity:.3; }

/* Reference cards and idea cards. */
.people-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.person-card { min-height:310px; padding:24px; border-radius:7px; }
.person-source { font-size:10px; color:#7f8a70; }
.person-mark { width:37px; height:37px; font-size:16px; }
.person-card h2 { font-size:23px; line-height:1.8; margin:16px 0 3px; overflow-wrap:anywhere; }
.person-role { font-size:12px; line-height:1.9; min-height:1.9em; color:#7c896c; }
.person-description { font-size:13px; line-height:2; color:#657759; -webkit-line-clamp:4; }
.record-actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:auto; padding-top:16px; }
.record-actions .text-button { font-size:11px; }
.record-actions .delete-button { margin-left:auto; }
.terms-grid, .themes-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.term-card, .theme-card { padding:26px; border-radius:7px; }
.term-category { font-size:11px; padding:3px 9px; color:#5b7350; }
.term-card h2, .theme-card h2 { font-size:24px; line-height:1.8; margin:14px 0 9px; overflow-wrap:anywhere; }
.term-card>p, .theme-card>p { font-size:13px; line-height:2.1; color:#627557; }
.term-card>p.term-notes { font-size:11px; color:#7f8b72; line-height:2; }
.theme-card>small { font-size:10px; color:#859074; }
.theme-card .card-edit { margin-top:12px; }
.theme-card .delete-button { margin-left:12px; }
.notes-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.note-card { padding:24px; border-radius:7px; min-height:260px; display:flex; flex-direction:column; }
.note-card h2 { font-size:20px; line-height:1.9; margin:15px 0 12px; overflow-wrap:anywhere; }
.note-card>p { font-size:13px; line-height:2.1; color:#637758; white-space:pre-wrap; overflow-wrap:anywhere; }
.note-card-footer { font-size:10px; color:#889276; margin-top:16px; }
.note-card>.tag { align-self:flex-start; }
.notes-grid .empty-state, .people-grid .empty-state, .terms-grid .empty-state, .themes-grid .empty-state { grid-column:1/-1; }

/* Archive and recovery: distinct explanations, identical list controls. */
.collection-guide { display:flex; align-items:flex-start; gap:14px; padding:19px 21px; background:#edf0e6; border:1px solid #dfe5d5; border-radius:7px; margin-bottom:22px; color:#6b7c5e; }
.collection-guide>span { padding-top:5px; }
.collection-guide svg { width:20px; height:20px; }
.collection-guide p { font-size:12px; line-height:2; margin:0; }
.collection-guide a { color:#557347; font-size:11px; }
.archive-summary { padding:0; border:0; background:none; gap:9px; display:flex; flex-wrap:wrap; margin:0 0 21px; }
.archive-category { display:flex; align-items:center; gap:15px; min-height:38px; padding:7px 13px; background:#f0f2e9; border:1px solid #e0e6d7; border-radius:5px; font-size:11px; color:#758467; }
.archive-category b { color:#55704c; font-size:13px; font-weight:500; }
.archive-category.selected { background:#dfe8d7; border-color:#bfcdb2; color:#3d6034; }
.archive-row, .trash-row { padding:22px 24px; gap:18px; background:#fffef9; }
.archive-row h2, .trash-row h2 { font-size:18px; line-height:1.8; overflow-wrap:anywhere; }
.archive-row p, .trash-row p { font-size:11px; line-height:1.9; color:#7f8b70; }
.trash-type { font-size:10px; padding:4px 9px; color:#6b7d5a; background:#edf0e6; border-radius:4px; }
.archive-view-label { background:#eeeadd; border-left:3px solid #b9a36f; color:#7f7254; font-size:12px; padding:13px 17px; border-radius:3px; }
.library-empty, .empty-state { padding:45px 25px; background:#fafaf4; border:1px dashed #d8dfcc; border-radius:7px; text-align:center; color:#74856a; }
.chapter-list .empty-state { border:0; }
.library-empty h2, .empty-state h2 { font-family:var(--serif); font-size:21px; font-weight:500; line-height:1.9; color:#627858; margin:12px 0 8px; }
.library-empty p, .empty-state p { font-size:12px; line-height:2; margin:0 0 19px; }
.empty-state { font-size:13px; }

/* Dialogs, including the writing surface and compact help. */
dialog { border-radius:10px; border-color:#d7decc; box-shadow:0 20px 80px #21382b33; }
dialog::backdrop { background:#20352e66; backdrop-filter:blur(3px); }
.note-dialog { width:min(620px,calc(100% - 40px)); padding:28px; max-height:90dvh; }
.note-dialog-header { margin-bottom:17px; align-items:flex-start; gap:20px; }
.note-dialog h2, .note-dialog-header h2 { font-size:24px; line-height:1.7; }
.note-dialog label { font-size:12px; color:#677c59; margin:19px 0 8px; }
.note-dialog label small { font-size:10px; color:#9a8c69; }
.note-dialog input, .note-dialog textarea, .note-dialog select { padding:11px 13px; width:100%; font-size:16px; line-height:1.8; color:#374e39; border:1px solid #d7dfcb; border-radius:5px; background:#fffef9; }
.note-dialog textarea { font-size:15px; min-height:110px; height:145px; max-height:45dvh; }
.note-actions { position:sticky; bottom:-28px; padding:17px 0 0; margin:20px 0 0; background:#fffef9; border-top:1px solid var(--line); display:flex; align-items:center; flex-wrap:wrap; gap:11px; }
.note-actions>.button { margin-left:auto; }
.note-actions .text-button { font-size:11px; }
.detail-dialog { width:min(650px,calc(100% - 40px)); padding:38px; max-height:88dvh; }
.detail-dialog h2 { font-size:29px; line-height:1.8; overflow-wrap:anywhere; }
.detail-role { font-size:13px; color:#738565; }
.detail-description { font-size:15px; line-height:2.2; color:#526c47; }
.detail-question { font-size:14px; line-height:2; background:#edf1e3; padding:17px; margin-bottom:23px; }
.editor-dialog { width:min(1100px,calc(100% - 50px)); height:calc(100dvh - 48px); max-height:1100px; margin:auto; border-radius:9px; }
.editor-header { padding:21px 29px 15px; gap:15px; }
.editor-header h2 { font-size:24px; line-height:1.7; overflow-wrap:anywhere; margin:0; }
.editor-header .eyebrow { font-size:9px; margin-bottom:4px; }
.editor-tools { padding:13px 29px 7px; gap:15px; flex-wrap:wrap; }
.editor-status { gap:14px; font-size:11px; color:#78876a; flex-wrap:wrap; }
.editor-status>span { font-size:11px; }
#word-count { color:#536d48; font-weight:500; }
.editor-meta { display:flex; justify-content:space-between; flex-wrap:wrap; gap:7px; padding:0 29px 10px; color:#8b957c; font-size:10px; }

/* Read-only room: the viewer gets the same sense of place as the editor, without edit controls. */
.viewer-body { background:#f7f6f2; color:#293b40; }
.viewer-gate { min-height:100dvh; display:grid; place-items:center; padding:28px 18px; background:radial-gradient(circle at 80% 12%,#e7ebe0 0,transparent 34%),#f7f6f2; }
.viewer-gate-card { width:min(540px,100%); padding:42px 42px 34px; background:#fffef9; border:1px solid #dfe4d8; border-radius:10px; box-shadow:0 18px 60px #28433b12; }
.viewer-gate-brand,.viewer-brand { display:flex; align-items:center; gap:12px; }
.viewer-gate-brand { margin-bottom:38px; }
.viewer-gate-brand .brand-symbol,.viewer-brand .brand-symbol { height:43px; width:36px; display:grid; place-items:center; border:1px solid #a58a55; color:#263e47; font-family:var(--serif); font-size:24px; position:relative; }
.viewer-gate-brand .brand-symbol:after,.viewer-brand .brand-symbol:after { content:""; position:absolute; inset:3px; border:1px solid #b5a17d66; }
.viewer-gate-brand strong,.viewer-brand strong { display:block; font-family:var(--serif); font-size:20px; font-weight:600; letter-spacing:.13em; line-height:1.45; }
.viewer-gate-brand small,.viewer-brand small { display:block; color:#8a8e85; font-size:8px; letter-spacing:.16em; }
.viewer-gate-label,.viewer-eyebrow { display:block; color:#8a9489; font-size:10px; font-weight:600; letter-spacing:.18em; }
.viewer-gate-card h1 { margin:11px 0 12px; font:500 30px/1.7 var(--serif); letter-spacing:.08em; }
.viewer-gate-card>p { margin:0; color:#69786d; font-size:13px; line-height:2; }
.viewer-gate-card form { margin-top:21px; }
.viewer-gate-card label { display:block; margin-bottom:7px; color:#5c6e5d; font-size:12px; }
.viewer-gate-card input { width:100%; min-height:48px; padding:10px 13px; border:1px solid #d2dccd; border-radius:5px; background:#fffefa; font-size:16px; }
.viewer-gate-card .button { width:100%; min-height:48px; margin-top:12px; }
.viewer-error { min-height:1.8em; margin:11px 0 0!important; color:#995f4b!important; font-size:12px!important; }
.viewer-gate-note { display:block; margin-top:21px; padding-top:17px; border-top:1px solid #e6e8df; color:#8c9588; font-size:10px; line-height:1.9; }
.viewer-shell { min-height:100dvh; }
.viewer-sidebar { width:246px; position:fixed; inset:0 auto 0 0; z-index:30; display:flex; flex-direction:column; padding:29px 20px 0; overflow:auto; background:#eef0e8; border-right:1px solid #dde2d8; }
.viewer-brand { margin:0 0 25px 7px; }
.viewer-mode { display:flex; align-items:center; gap:9px; margin:0 11px 26px; padding:10px 11px; background:#e3e9df; border:1px solid #d3ddce; border-radius:5px; color:#4f694f; }
.viewer-mode>span { width:8px; height:8px; border-radius:50%; background:#6e8e67; box-shadow:0 0 0 4px #d1dfce; }
.viewer-mode b { display:block; font-size:11px; font-weight:600; }
.viewer-mode small { display:block; margin-top:1px; color:#7a8975; font-size:8px; letter-spacing:.09em; }
.viewer-sidebar-label { display:block; margin:0 12px 8px; color:#75816e; font-size:10px; letter-spacing:.08em; }
.viewer-story-switch { margin:0 7px 20px; }
.viewer-story-switch select { width:100%; min-height:41px; padding:8px 11px; border:1px solid #d2dacd; border-radius:5px; background:#fffefa; color:#455b49; font:inherit; font-size:12px; }
.viewer-nav { display:flex; flex-direction:column; gap:3px; }
.viewer-nav a { position:relative; display:flex; align-items:center; gap:12px; min-height:43px; padding:0 13px; border-radius:5px; color:#627263; font-size:13px; }
.viewer-nav a span { width:18px; color:#81917e; text-align:center; font-family:Georgia,serif; font-size:17px; }
.viewer-nav a:hover { background:#e4e9e0; }
.viewer-nav a.active { background:#dfe8dc; color:#294f3a; font-weight:600; }
.viewer-nav a.active:before { content:""; position:absolute; left:0; width:3px; height:18px; border-radius:2px; background:#6d8767; }
.viewer-sidebar-spine { position:relative; display:flex; flex-direction:column; gap:4px; margin:24px 12px 0 17px; padding:2px 0 2px 16px; }
.viewer-sidebar-spine i { position:absolute; inset:4px auto 0 0; width:1px; background:#c6b993; }
.viewer-sidebar-spine p { margin:0; color:#5d6b5d; font:500 16px/1.75 var(--serif); overflow-wrap:anywhere; }
.viewer-sidebar-spine small { color:#85917f; font-size:10px; }
.viewer-sidebar-footer { margin-top:auto; padding:18px 10px 21px; border-top:1px solid #dce2d7; }
.viewer-sidebar-footer p { margin:0 0 13px; color:#7a8779; font-size:10px; line-height:1.9; }
.viewer-side-button { display:block; width:100%; min-height:38px; margin-top:7px; padding:8px 10px; border:1px solid #cbd8c6; border-radius:5px; background:#e6ede2; color:#486446; font-size:11px; text-align:left; }
.viewer-side-button:hover { background:#dce8d9; }
.viewer-side-button-muted { border-color:transparent; background:transparent; color:#7b8878; }
.viewer-side-button-muted:hover { background:#e5e9e0; }
.viewer-app-shell { min-height:100dvh; margin-left:246px; }
.viewer-topbar { position:sticky; top:0; z-index:20; min-height:70px; display:flex; align-items:center; justify-content:space-between; gap:15px; padding:0 38px; background:#faf9f5eF; border-bottom:1px solid #e2e5dd; backdrop-filter:blur(9px); }
.viewer-topbar-left,.viewer-topbar-right { display:flex; align-items:center; gap:11px; min-width:0; }
.viewer-topbar-left { color:#8a9587; font-size:12px; }
.viewer-topbar-left b { color:#b4baad; font-weight:400; }
.viewer-topbar-left strong { overflow:hidden; color:#44574a; font-weight:500; text-overflow:ellipsis; white-space:nowrap; }
.viewer-menu { display:none; min-width:39px; min-height:39px; border:1px solid #d5ddd0; border-radius:5px; background:#f5f7f0; color:#5c715b; font-size:18px; }
.viewer-status { display:flex; align-items:center; gap:7px; color:#668063; font-size:11px; white-space:nowrap; }
.viewer-status i { width:6px; height:6px; border-radius:50%; background:#70966c; }
.viewer-search-trigger { display:flex; align-items:center; gap:8px; min-height:36px; padding:7px 11px; border:1px solid #dde2d8; border-radius:5px; background:#fffefa; color:#758373; font-size:11px; }
.viewer-search-trigger:hover { background:#f0f3ea; }
.viewer-search-trigger span { color:#657a68; font-size:18px; line-height:1; }
.viewer-search-trigger kbd { margin-left:11px; padding:1px 4px; border:1px solid #e4e7df; border-radius:3px; color:#a0a99b; font-size:8px; }
.viewer-main { max-width:1480px; margin:auto; padding:34px 38px 55px; }
.viewer-page-intro { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:25px; }
.viewer-page-intro h1 { margin:6px 0 0; color:#293b40; font:500 29px/1.7 var(--serif); letter-spacing:.07em; }
.viewer-subtle { margin:7px 0 0; color:#6e7b70; font-size:13px; line-height:1.9; }
.viewer-hero { position:relative; min-height:318px; overflow:hidden; display:flex; align-items:stretch; border-radius:9px; background:linear-gradient(120deg,#2c474e,#5b786f); box-shadow:0 7px 20px #243d3a12; isolation:isolate; }
.viewer-hero:after { content:""; position:absolute; inset:0; background:radial-gradient(circle at 80% 15%,#c7d0b645,transparent 35%),linear-gradient(90deg,#20363eed 0%,#20363eaa 54%,#20363e0d 100%); z-index:-1; }
.viewer-hero-copy { max-width:760px; padding:39px 41px; color:#f4f2e5; }
.viewer-hero-eyebrow { margin:0; color:#d0d8c9; font-size:10px; letter-spacing:.18em; }
.viewer-hero-copy h2 { max-width:750px; margin:16px 0 8px; color:#f7f1dd; font:400 39px/1.65 var(--serif); letter-spacing:.08em; overflow-wrap:anywhere; }
.viewer-hero-subtitle { margin:0 0 9px; color:#e0e3d3; font:13px/1.9 var(--serif); letter-spacing:.08em; }
.viewer-hero-genre { display:inline-block; padding:3px 8px; border:1px solid #d6c89899; border-radius:3px; color:#e2d2a6; font-size:10px; }
.viewer-hero-summary { max-width:570px; margin:17px 0 0; color:#cbd3c7; font-size:12px; line-height:2.05; }
.viewer-hero-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:23px; }
.viewer-hero-actions .button { min-height:42px; }
.viewer-ghost-button { min-height:42px; padding:9px 15px; border:1px solid #d5ddcd66; border-radius:5px; color:#e2e8dc; font-size:11px; }
.viewer-ghost-button:hover { background:#ffffff14; }
.viewer-hero-mark { position:absolute; right:26px; bottom:24px; display:flex; flex-direction:column; align-items:flex-end; color:#d9ddcf; text-align:right; }
.viewer-hero-mark span { font-size:8px; letter-spacing:.18em; }
.viewer-hero-mark b { color:#e1d2a5; font:400 49px/1 Georgia,serif; letter-spacing:.04em; }
.viewer-hero-mark small { font-size:8px; letter-spacing:.16em; }
.viewer-hero-spy { background:linear-gradient(120deg,#15272d,#304944 62%,#806e4a); }
.viewer-hero-spy:after { background:linear-gradient(90deg,#101c21f5 0%,#101c21b8 54%,#101c2140 100%),repeating-linear-gradient(135deg,transparent 0 18px,#c3b27a0e 18px 19px); }
.viewer-spy-mode .viewer-sidebar { background:#e9ece5; }
.viewer-metrics { display:grid; grid-template-columns:repeat(3,1fr); margin:0 0 29px; border-bottom:1px solid #e1e4da; }
.viewer-metric { display:grid; grid-template-columns:auto 1fr; align-items:center; column-gap:11px; padding:19px 23px; border-right:1px solid #e1e4da; }
.viewer-metric:first-child { padding-left:5px; }
.viewer-metric:last-child { border-right:0; }
.viewer-metric strong { grid-row:span 2; color:#687a68; font:400 30px/1 Georgia,serif; }
.viewer-metric span { color:#647263; font-size:11px; }
.viewer-metric small { color:#9aa395; font-size:9px; }
.viewer-home-columns { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(290px,.9fr); gap:25px; }
.viewer-panel { min-width:0; }
.viewer-section-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:0 0 14px; }
.viewer-section-heading h2 { margin:0; color:#3c5143; font:500 19px/1.7 var(--serif); letter-spacing:.06em; }
.viewer-inline-link { color:#7f8c76; font-size:11px; }
.viewer-inline-link:hover { color:#395940; }
.viewer-latest-card,.viewer-world-panel { padding:24px; border:1px solid #dfe4d9; border-radius:7px; background:#fffef9; }
.viewer-card-label { margin:0 0 8px; color:#9d936f; font-size:9px; letter-spacing:.15em; }
.viewer-latest-card h3 { margin:0; color:#405442; font:500 22px/1.75 var(--serif); overflow-wrap:anywhere; }
.viewer-card-meta { margin:7px 0 14px; color:#879381; font-size:10px; }
.viewer-card-excerpt { max-height:168px; overflow:hidden; margin:0; color:#60755f; font:14px/2.1 var(--serif); white-space:pre-wrap; }
.viewer-read-button { min-height:40px; margin-top:20px; padding:8px 13px; border:1px solid #d0ddca; border-radius:5px; background:#ecf1e8; color:#466346; font-size:11px; }
.viewer-read-button:hover { background:#e1ebde; }
.viewer-world-panel { background:#f0f1e8; border-color:#e1e5d8; }
.viewer-world-preview { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.viewer-world-preview-card { min-height:101px; padding:13px 14px; border:1px solid #dce2d5; border-radius:5px; background:#f8f8f2; color:#5c715b; text-align:left; }
.viewer-world-preview-card:hover { background:#e9eee4; }
.viewer-world-preview-card small,.viewer-world-preview-card span { display:block; color:#83907d; font-size:10px; }
.viewer-world-preview-card strong { display:block; margin:6px 0 1px; color:#64765d; font:400 27px/1 Georgia,serif; }
.viewer-read-notice { display:flex; align-items:flex-start; gap:10px; margin:0 0 21px; padding:14px 17px; border-left:3px solid #b9a36f; border-radius:3px; background:#eeeadd; color:#7c7157; }
.viewer-read-notice span { padding-top:2px; font-size:15px; }
.viewer-read-notice p { margin:0; font-size:11px; line-height:1.9; }
.viewer-chapter-list { display:grid; gap:18px; }
.viewer-chapter-card { padding:26px 29px 30px; border:1px solid #dfe4d9; border-radius:7px; background:#fffef9; scroll-margin-top:92px; }
.viewer-chapter-head { display:grid; grid-template-columns:60px minmax(0,1fr); gap:16px; align-items:start; padding-bottom:18px; border-bottom:1px solid #eaebe4; }
.viewer-chapter-number { color:#b4a77f; font:400 33px/1 Georgia,serif; }
.viewer-chapter-head h2 { margin:0; color:#3e5345; font:500 22px/1.75 var(--serif); overflow-wrap:anywhere; }
.viewer-chapter-head small { color:#8d9986; font-size:10px; }
.viewer-chapter-body { padding:24px 9px 0 76px; color:#526c58; font:16px/2.3 var(--serif); white-space:pre-wrap; }
.viewer-world-tabs { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:22px; padding:4px; border:1px solid #e0e4da; border-radius:6px; background:#eff1e9; }
.viewer-world-tab { min-height:38px; padding:7px 15px; border-radius:4px; color:#788675; font-size:11px; }
.viewer-world-tab:hover { background:#e4e9de; }
.viewer-world-tab.selected { background:#dce8d7; color:#3e6045; font-weight:600; }
.viewer-record-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.viewer-record-card { min-height:205px; padding:22px; border:1px solid #dfe4d9; border-radius:7px; background:#fffef9; }
.viewer-record-label { display:inline-block; color:#7c8d70; font-size:10px; }
.viewer-record-card h2 { margin:12px 0 10px; color:#405442; font:500 21px/1.75 var(--serif); overflow-wrap:anywhere; }
.viewer-record-description { margin:0; color:#60755f; font-size:13px; line-height:2.05; white-space:pre-wrap; }
.viewer-record-meta { margin:15px 0 0; color:#879481; font-size:10px; }
.viewer-empty { grid-column:1/-1; padding:40px 23px; border:1px dashed #d6dfcf; border-radius:7px; background:#fafaf5; text-align:center; }
.viewer-empty-mark { display:block; color:#ad9f75; font:28px Georgia,serif; }
.viewer-empty h2 { margin:10px 0 7px; color:#5d745d; font:500 20px/1.8 var(--serif); }
.viewer-empty p { margin:0; color:#7b8978; font-size:12px; }
.viewer-search-dialog { width:min(650px,calc(100% - 34px)); padding:27px; border:1px solid #d6dfd0; border-radius:9px; background:#fffef9; box-shadow:0 22px 80px #233c2c30; }
.viewer-search-dialog::backdrop { background:#22382e66; backdrop-filter:blur(3px); }
.viewer-search-head { display:flex; justify-content:space-between; gap:15px; align-items:flex-start; margin-bottom:18px; }
.viewer-search-head h2 { margin:6px 0 0; color:#3e5345; font:500 23px/1.7 var(--serif); }
.viewer-search-head button { color:#82907e; font-size:23px; }
.viewer-search-dialog>input { width:100%; min-height:45px; padding:10px 13px; border:1px solid #d4dfd0; border-radius:5px; background:#fffefa; font-size:15px; }
.viewer-search-results { max-height:52dvh; overflow:auto; margin-top:15px; }
.viewer-search-hint { padding:17px 3px; color:#7b8978; font-size:12px; }
.viewer-search-result { display:block; width:100%; padding:13px 5px; border-top:1px solid #e8ebe4; text-align:left; }
.viewer-search-result:hover { background:#f1f3ec; }
.viewer-search-result small,.viewer-search-result strong,.viewer-search-result p { display:block; }
.viewer-search-result small { color:#8b987e; font-size:9px; }
.viewer-search-result strong { margin:3px 0; color:#47604a; font:500 15px/1.6 var(--serif); }
.viewer-search-result p { overflow:hidden; margin:0; color:#758472; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.viewer-editor-password-dialog { width:min(470px,calc(100% - 34px)); padding:28px; border:1px solid #d6dfd0; border-radius:9px; background:#fffef9; }
.viewer-editor-password-dialog::backdrop { background:#22382e66; backdrop-filter:blur(3px); }
.viewer-editor-password-dialog h2 { margin:0; color:#3e5345; font:500 23px/1.7 var(--serif); }
.viewer-editor-password-dialog p { color:#6f7d6e; font-size:12px; line-height:1.9; }
.viewer-editor-password-dialog label { display:block; margin:20px 0 7px; color:#5d705d; font-size:12px; }
.viewer-editor-password-dialog input { width:100%; min-height:46px; padding:10px 12px; border:1px solid #d4dfd0; border-radius:5px; background:#fffefa; font-size:16px; }
.viewer-dialog-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:9px; margin-top:20px; }
.viewer-dialog-actions .button,.viewer-dialog-actions .viewer-ghost-button { min-height:40px; }
@media(max-width:980px){.viewer-sidebar{width:220px}.viewer-app-shell{margin-left:220px}.viewer-main{padding-left:26px;padding-right:26px}.viewer-home-columns{grid-template-columns:1fr}.viewer-record-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.viewer-hero-copy h2{font-size:34px}}
@media(max-width:760px){.viewer-sidebar{transform:translateX(-100%);transition:transform .2s ease;box-shadow:10px 0 30px #253e2c22}.viewer-sidebar.open{transform:translateX(0)}.viewer-app-shell{margin-left:0}.viewer-topbar{padding:0 16px}.viewer-menu{display:block}.viewer-topbar-right{gap:8px}.viewer-status{font-size:10px}.viewer-search-trigger{font-size:0;padding:7px 10px}.viewer-search-trigger span{font-size:20px}.viewer-search-trigger kbd{display:none}.viewer-main{padding:25px 16px 40px}.viewer-page-intro{margin-bottom:20px}.viewer-page-intro h1{font-size:25px}.viewer-subtle{font-size:12px}.viewer-gate-card{padding:30px 23px 26px}.viewer-hero{min-height:430px}.viewer-hero-copy{padding:29px 24px}.viewer-hero-copy h2{font-size:31px}.viewer-hero-summary{font-size:11px}.viewer-hero-mark{right:19px;bottom:19px}.viewer-metrics{grid-template-columns:1fr}.viewer-metric,.viewer-metric:first-child{padding:14px 5px;border-right:0;border-bottom:1px solid #e1e4da}.viewer-metric:last-child{border-bottom:0}.viewer-home-columns{gap:21px}.viewer-latest-card,.viewer-world-panel{padding:19px}.viewer-chapter-card{padding:21px 18px 24px}.viewer-chapter-head{grid-template-columns:42px minmax(0,1fr);gap:11px}.viewer-chapter-number{font-size:27px}.viewer-chapter-head h2{font-size:19px}.viewer-chapter-body{padding:20px 2px 0;font-size:15px;line-height:2.15}.viewer-record-grid{grid-template-columns:1fr}.viewer-world-tab{flex:1 1 calc(50% - 7px);padding-left:8px;padding-right:8px}.viewer-world-preview{grid-template-columns:1fr 1fr}.viewer-sidebar-footer{padding-bottom:25px}}

/* Publication controls and reader feedback. */
.publication-warning { display:flex; align-items:flex-start; gap:13px; margin:0 0 21px; padding:17px 20px; border:1px solid #e2d8bd; border-left:3px solid #b4975d; border-radius:6px; background:#f5f0e3; color:#765f3d; }
.publication-warning.is-public { border-color:#d5e1cf; border-left-color:#76966d; background:#edf3e9; color:#4f6b50; }
.publication-warning svg { width:20px; height:20px; flex:none; margin-top:2px; }
.publication-warning strong { display:block; font-size:13px; }
.publication-warning p { margin:3px 0 0; color:#76816e; font-size:11px; line-height:1.8; }
.publication-controls { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px; margin-bottom:27px; }
.publication-switch { display:flex; align-items:flex-start; gap:11px; min-height:76px; padding:17px; border:1px solid #dfe5d9; border-radius:7px; background:#fffef9; cursor:pointer; }
.publication-switch:hover { background:#f1f4eb; }
.publication-switch input,.publication-item input { width:18px; height:18px; accent-color:#5d805e; flex:none; margin:2px 0 0; }
.publication-switch b { display:block; color:#496148; font-size:12px; }
.publication-switch small { display:block; margin-top:4px; color:#7f8d7b; font-size:10px; line-height:1.7; }
.publication-toolbar,.publication-group-head { display:flex; align-items:center; justify-content:space-between; gap:15px; }
.publication-toolbar { padding:15px 0 12px; border-bottom:1px solid #dfe4da; }
.publication-toolbar b { display:block; color:#405542; font:500 18px/1.6 var(--serif); }
.publication-toolbar small { display:block; color:#7e8b7a; font-size:11px; }
.publication-toolbar>div,.publication-group-head>div:last-child { display:flex; flex-wrap:wrap; gap:11px; }
.publication-groups { display:grid; gap:17px; margin-top:17px; }
.publication-group { padding:20px 21px; border:1px solid #e0e5db; border-radius:7px; background:#fffef9; }
.publication-group-head { padding-bottom:13px; border-bottom:1px solid #e9ece5; }
.publication-group-head h2 { margin:0; color:#435844; font:500 18px/1.6 var(--serif); }
.publication-group-head small { color:#819080; font-size:10px; }
.publication-group-head .text-button { min-height:30px; font-size:10px; }
.publication-items { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 12px; padding-top:14px; }
.publication-item { display:flex; align-items:flex-start; gap:9px; min-width:0; padding:10px 9px; border-radius:5px; cursor:pointer; }
.publication-item:hover { background:#f0f3eb; }
.publication-item b,.publication-item small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.publication-item b { color:#536b53; font-size:12px; }
.publication-item small { margin-top:2px; color:#8a9785; font-size:9px; }
.publication-empty { grid-column:1/-1; margin:0; padding:14px 9px; color:#859180; font-size:11px; }
.comments-summary { display:flex; align-items:stretch; gap:0; margin:0 0 22px; border-bottom:1px solid #dfe4da; }
.comments-summary>div { display:flex; flex-direction:column; justify-content:center; min-width:150px; padding:14px 22px; border-right:1px solid #e1e5dc; }
.comments-summary>div:first-child { padding-left:5px; }
.comments-summary strong { color:#64775f; font:400 27px/1 Georgia,serif; }
.comments-summary span { color:#7a8878; font-size:10px; }
.comments-summary .comment-cap { margin-left:auto; border:0; color:#5d7a5b; font-size:12px; }
.comments-summary .comment-cap.full { color:#9a644e; }
.comment-list { display:grid; gap:12px; }
.comment-row { padding:18px 20px; border:1px solid #dfe5db; border-radius:7px; background:#fffef9; }
.comment-row-head { display:flex; align-items:center; gap:10px; }
.comment-avatar { width:31px; height:31px; display:grid; place-items:center; border-radius:50%; background:#e7eee2; border:1px solid #ccd9c6; color:#557352; font:500 12px var(--serif); }
.comment-row-head strong,.comment-row-head small { display:block; }
.comment-row-head strong { color:#4b634e; font-size:12px; }
.comment-row-head small { margin-top:2px; color:#8c9889; font-size:9px; }
.comment-row-head .delete-button { margin-left:auto; }
.comment-row>p { margin:15px 0 0 41px; color:#5d725f; font-size:13px; line-height:2; }
.viewer-comments-summary { display:grid; grid-template-columns:1fr 1fr; gap:0; margin:0 0 20px; border-bottom:1px solid #e1e4da; }
.viewer-comments-summary .viewer-metric { border-right:1px solid #e1e4da; }
.viewer-comments-layout { display:grid; grid-template-columns:minmax(250px,.8fr) minmax(0,1.2fr); gap:22px; align-items:start; }
.viewer-comment-form-panel,.viewer-comment-list-panel { padding:23px; border:1px solid #dfe4d9; border-radius:7px; background:#fffef9; }
.viewer-comment-form-panel h2 { margin:0 0 17px; color:#445845; font:500 22px/1.75 var(--serif); }
.viewer-comment-form label { display:block; margin:14px 0 6px; color:#63745f; font-size:11px; }
.viewer-comment-form input,.viewer-comment-form textarea { width:100%; padding:10px 12px; border:1px solid #d5dfd0; border-radius:5px; background:#fffefa; color:#405542; font-size:14px; }
.viewer-comment-form input { min-height:43px; }
.viewer-comment-form textarea { min-height:145px; resize:vertical; line-height:1.9; }
.viewer-comment-form-row { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:13px; }
.viewer-comment-form-row .button { min-height:41px; }
.viewer-comment-status { color:#8b9788; font-size:10px; }
.viewer-comment-error { min-height:1.7em; margin:9px 0 0; color:#9a614d; font-size:11px; }
.viewer-comment-closed { color:#778474; font-size:13px; line-height:2; }
.viewer-comment-list-panel .viewer-section-heading { margin-bottom:13px; }
.viewer-comment-list { display:grid; gap:10px; }
.viewer-comment-card { padding:15px 16px; border:1px solid #e2e7df; border-radius:6px; background:#fafbf6; }
.viewer-comment-card-head { display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.viewer-comment-card-head strong { color:#4b634e; font-size:12px; }
.viewer-comment-card-head small { color:#8c9889; font-size:9px; }
.viewer-comment-card p { margin:9px 0 0; color:#5e725f; font-size:12px; line-height:1.95; white-space:pre-wrap; }
@media(max-width:900px){.publication-controls{grid-template-columns:1fr}.viewer-comments-layout{grid-template-columns:1fr}.viewer-comment-form-panel{order:0}}
@media(max-width:760px){.publication-items{grid-template-columns:1fr}.publication-group-head{align-items:flex-start;flex-direction:column}.publication-toolbar{align-items:flex-start;flex-direction:column}.comments-summary>div{min-width:0;flex:1;padding:14px 12px}.comments-summary .comment-cap{margin-left:0}.comment-row>p{margin-left:0}.viewer-comments-summary{grid-template-columns:1fr}.viewer-comments-summary .viewer-metric{border-right:0;border-bottom:1px solid #e1e4da}.viewer-comments-summary .viewer-metric:last-child{border-bottom:0}.viewer-comment-form-panel,.viewer-comment-list-panel{padding:19px}}
.editor-plan { padding:12px 19px; margin:0 29px; border-radius:5px; background:#f0f1e8; gap:9px; }
.editor-plan p { font-size:12px; line-height:1.9; color:#7a856b; margin:0; }
.editor-plan>span { flex-shrink:0; color:#a18f63; }
.editor-writing { margin:12px 0 0; min-height:100px; }
.editor-writing textarea, .original-reading { font-size:18px; line-height:2.25; letter-spacing:.045em; padding:20px max(30px,calc((100% - 780px)/2)) 45px; color:#354f38; background:#fffef9; overflow-wrap:anywhere; }
.editor-footer { padding:15px 25px; border-top:1px solid var(--line); gap:13px; flex-wrap:wrap; background:#fafaf4; }
.editor-footer>.text-button { font-size:11px; }
.editor-footer>div { display:flex; gap:10px; margin-left:auto; }
.search-dialog { width:min(740px,calc(100% - 40px)); top:12vh; max-height:75dvh; padding:0; }
.search-input-row { padding:16px 20px; gap:12px; position:sticky; top:0; background:#fffef9; z-index:1; }
.search-input-row input { font-size:16px; color:#3d573e; min-width:0; }
.search-result { padding:17px 23px; }
.search-result:hover { background:#f1f4e9; }
.search-result small { font-size:10px; color:#8a957b; }
.search-result b { font-size:16px; line-height:1.9; display:block; color:#4b6842; }
.search-result p { font-size:12px; color:#7a896c; line-height:1.9; }
.empty-search { font-size:13px; padding:26px; color:#7a896a; }
.conflict-actions { display:flex; flex-direction:column; align-items:stretch; gap:12px; margin-top:24px; }
.delete-confirm-actions { margin-top:24px; gap:12px; }
.toast { display:flex; align-items:center; justify-content:center; gap:20px; font-size:12px; left:calc(50% + 117px); max-width:calc(100vw - 290px); padding:13px 20px; border-radius:7px; background:#29483c; line-height:1.8; }
.toast.show { pointer-events:auto; }
.toast button { color:#f1d69e; border-bottom:1px solid #c7ad7a; font-size:12px; white-space:nowrap; min-height:32px; }
.help-dialog { width:min(650px,calc(100% - 40px)); max-height:90dvh; padding:28px; }
.help-dialog .note-dialog-header h2 { margin:0; font-family:var(--serif); font-weight:500; font-size:26px; }
.help-intro { font-family:var(--serif); color:#788667; font-size:14px; margin:12px 0 25px; }
.help-steps article { display:flex; gap:18px; padding:18px 0; border-top:1px solid var(--line); }
.help-steps article>span { font-family:var(--serif); color:#b0a079; font-size:22px; line-height:1.7; }
.help-steps h3, .help-save h3 { font-size:15px; font-weight:500; color:#4a663e; margin:0 0 7px; }
.help-steps p, .help-save p { font-size:12px; line-height:2; color:#7a886b; margin:0; }
.help-links { display:flex; gap:22px; font-size:12px; color:#587449; margin-top:9px; }
.help-save { padding:20px; border-radius:6px; background:#edf1e4; margin-top:12px; }
.help-shortcuts { display:flex; gap:18px; flex-wrap:wrap; padding:8px 0; }
.help-shortcuts>div { flex:1; min-width:130px; }
.help-shortcuts dt { font-size:10px; color:#8b957b; }
.help-shortcuts dd { font-size:12px; color:#6f805f; margin:3px 0 0; }
.help-ai { font-size:11px; color:#8a947b; line-height:1.9; border-top:1px solid var(--line); padding-top:15px; }

/* Chat remains honest about connection state, and readable before connection. */
.chat-layout { grid-template-columns:240px minmax(0,1fr); gap:25px; }
.chat-context { background:#eff1e8; padding:22px; border:1px solid #e1e6d8; border-radius:7px; align-self:start; }
.chat-context h2 { font-size:21px; line-height:1.8; margin:11px 0; overflow-wrap:anywhere; }
.chat-context p { font-size:12px; line-height:2; color:#718266; }
.chat-context>label { font-size:11px; color:#708261; display:block; margin:23px 0 8px; }
.chat-context select { min-height:44px; font-size:12px; width:100%; padding:10px; border:1px solid #d5dfc9; background:#fffef9; border-radius:5px; }
.chat-context small { font-size:10px; color:#879475; line-height:2; }
.chat-config { font-size:11px; margin:20px 0 12px; padding:8px 10px; background:#f4ebd9; color:#8b7347; border-radius:5px; }
.chat-config.ready { background:#e3edda; color:#537445; }
.context-counts { display:flex; flex-wrap:wrap; gap:12px; font-size:10px; color:#869274; margin:10px 0 17px; }
.context-counts b { color:#607a51; font-weight:500; margin-left:3px; }
.chat-panel { min-height:570px; height:calc(100dvh - 250px); max-height:950px; }
.chat-messages { padding:26px; }
.chat-message small { font-size:10px; color:#8a967b; }
.chat-message>div { font-size:14px; line-height:2.05; color:#516d43; white-space:pre-wrap; overflow-wrap:anywhere; }
.chat-message.user { background:#edf1e4; padding:15px 19px; border-radius:9px 9px 2px 9px; max-width:88%; }
.chat-message.assistant { padding:12px 0 22px; }
.chat-empty { padding:38px 10px 25px; }
.chat-empty h2 { font-size:27px; line-height:1.9; }
.chat-empty>p { font-size:12px; color:#859171; line-height:2; }
.prompt-chips { gap:9px; margin-top:25px; }
.prompt-chips button { min-height:40px; padding:9px 13px; font-size:11px; border-radius:5px; }
#chat-form { padding:17px 22px; background:#fbfbf5; }
#chat-input { min-height:90px; font-size:15px; line-height:1.9; color:#45643c; }
.chat-send-row { gap:14px; align-items:center; }
.chat-send-row>span { font-size:10px; color:#899574; }
.chat-thinking, .chat-error { font-size:12px; line-height:1.9; }

@media (min-width:1600px) {
  .page { padding:40px 56px 0; }
  .topbar { padding:0 56px; }
  .entrance-copy { padding-left:43px; }
  .entrance-copy h2 { font-size:38px; }
}
@media (max-width:1170px) {
  .sidebar { width:215px; padding-left:15px; padding-right:15px; }
  .app-shell { margin-left:215px; }
  .profile { margin-left:-15px; margin-right:-15px; padding-left:16px; padding-right:16px; }
  .topbar { padding:0 27px; }
  .topbar-right { gap:10px; }
  .help-trigger b, .search-trigger kbd { display:none; }
  .page { padding:29px 27px 0; }
  .entrance-copy { padding-left:27px; }
  .entrance-copy h2 { font-size:28px; }
  .entrance-art { margin-right:18px; }
  .library-books, .people-grid, .notes-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
  .home-columns { grid-template-columns:minmax(0,1.5fr) minmax(220px,1fr); gap:22px; }
  .scene-links { grid-template-columns:1fr; }
  .hero h2 { font-size:33px; }
  .hero-description { max-width:400px; }
  .project-strip>div { padding:0 17px; gap:9px; }
  .project-strip>div>span:last-child { font-size:11px; }
  .project-strip small { font-size:9px; }
  .chat-layout { grid-template-columns:210px minmax(0,1fr); gap:18px; }
  .chat-context { padding:19px; }
  .toast { left:calc(50% + 107px); }
}
@media (max-width:940px) {
  .topbar-left { font-size:11px; gap:8px; }
  #header-scope { max-width:140px; }
  .search-trigger>span:not([data-icon]) { display:none; }
  .search-trigger { min-width:35px; justify-content:center; padding:7px; }
  .entrance-hero { grid-template-columns:1fr; min-height:280px; }
  .entrance-copy { padding:27px; }
  .entrance-copy h2 { max-width:90%; font-size:30px; }
  .entrance-art { position:absolute; right:-42px; bottom:0; width:260px; opacity:.12; z-index:-1; }
  .art-caption, .art-footnote { display:none; }
  .library-summary>div { padding-right:17px; padding-left:17px; }
  .library-summary strong { font-size:27px; }
  .home-lower, .home-columns { grid-template-columns:1fr; gap:25px; }
  .scene-links { grid-template-columns:1fr 1fr; }
  .hero-content { padding:29px; max-width:100%; }
  .hero h2 { max-width:90%; }
  .hero-description { max-width:380px; }
  .project-strip { flex-wrap:wrap; gap:12px 0; }
  .project-strip>a { width:100%; text-align:right; }
  .project-strip>div { padding:0 13px; }
  .terms-grid, .themes-grid { grid-template-columns:1fr; }
  .archive-row, .trash-row { grid-template-columns:auto minmax(0,1fr); gap:12px; }
  .archive-row-actions, .trash-row>.button { grid-column:2; justify-self:end; }
  .chat-layout { grid-template-columns:1fr; }
  .chat-context { display:block; }
  .chat-context>p { margin:8px 0; }
  .chat-context>label { margin-top:15px; }
  .chat-panel { height:650px; max-height:none; }
}
@media (max-width:760px) {
  body { font-size:14px; }
  .app-shell { margin-left:0; }
  .sidebar { width:min(300px,86vw); padding:25px 22px 0; transform:translateX(-100%); z-index:40; box-shadow:12px 0 60px #1c332b26; }
  .sidebar.open { transform:translateX(0); }
  .sidebar-shade { z-index:35; background:#223a3059; backdrop-filter:blur(2px); }
  .sidebar .brand { margin-bottom:25px; }
  .sidebar .story-switch { margin-bottom:20px; }
  .sidebar .story-switch select { min-height:44px; font-size:16px; }
  .sidebar .nav-main a { min-height:45px; height:45px; font-size:14px; }
  .sidebar .book-spine { max-height:none; margin-top:3px; }
  .sidebar .book-spine p { font-size:19px; }
  .sidebar .book-spine .text-button { min-height:35px; font-size:12px; }
  .sidebar .private-label, .sidebar .backup-button { font-size:11px; min-height:33px; }
  .sidebar .profile { margin-left:-22px; margin-right:-22px; padding-left:23px; }
  .mobile-menu { display:inline-grid!important; min-width:34px; min-height:40px; }
  .topbar { height:64px; min-height:64px; padding:0 15px 0 9px; gap:8px; }
  .topbar-left { gap:6px; font-size:11px; flex:1; }
  #header-scope { display:none; }
  .crumb-slash { display:none; }
  .topbar-right { gap:9px; }
  .help-trigger { min-width:30px; min-height:40px; }
  .help-trigger span { width:20px; height:20px; font-size:12px; }
  .cloud-status { max-width:135px; min-height:33px; font-size:10px; white-space:normal; line-height:1.5; padding:6px 10px; }
  .search-trigger { min-width:35px; min-height:36px; }
  .sync-banner { font-size:11px; padding:10px 19px; }
  .page { padding:26px 20px 0; }
  .page-intro { align-items:flex-start; gap:14px; flex-wrap:wrap; margin-bottom:22px; }
  .page-intro h1 { font-size:26px; }
  .page-intro .subtle { font-size:12px; line-height:2; }
  .page-intro>.button { font-size:11px; min-height:40px; }
  .page-intro>.button:first-of-type { margin-top:0; }
  .page-footer { margin-top:26px; font-size:10px; gap:8px 15px; }
  .page-footer>span:nth-child(2) { display:none; }
  .entrance-hero { min-height:315px; border-radius:9px; }
  .entrance-copy { padding:27px 25px; }
  .entrance-copy h2 { font-size:clamp(21px,6.7vw,29px); line-height:1.8; max-width:100%; margin:19px 0 13px; }
  .entrance-copy>p { font-size:12px; line-height:2; }
  .hero-eyebrow { font-size:9px; }
  .entrance-actions { gap:7px 17px; margin-top:21px; }
  .entrance-actions>.button { font-size:11px; padding:11px 15px; min-height:43px; }
  .entrance-continue { font-size:11px; }
  .entrance-art { right:-30px; opacity:.1; bottom:-8px; }
  .library-summary { padding:20px 0; gap:8px 0; margin-bottom:22px; flex-wrap:wrap; }
  .library-summary>div { flex:1; min-width:0; padding:0 13px; gap:5px; flex-direction:column; align-items:flex-start; }
  .library-summary>div:first-child { padding-left:4px; }
  .library-summary strong { font-size:27px; }
  .library-summary span { font-size:10px; }
  .library-summary>a { width:100%; text-align:right; margin-top:8px; font-size:10px; }
  .library-heading { gap:12px; align-items:center; flex-wrap:wrap; }
  .library-heading h2 { font-size:19px; }
  .library-search { width:100%; }
  .library-search input { font-size:16px; width:100%; min-height:42px; }
  .library-books { grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px; }
  .library-book-cover { min-height:205px; padding:17px 15px; }
  .cover-name { font-size:22px; line-height:1.8; }
  .cover-serial { font-size:8px; }
  .cover-subtitle, .cover-open { font-size:10px; }
  .library-book-info { padding:13px 12px; }
  .book-info-meta { font-size:10px; gap:3px 10px; }
  .library-book-info>p { font-size:10px; line-height:1.9; margin:9px 0; min-height:3.8em; }
  .book-card-actions { gap:7px; flex-wrap:wrap; }
  .book-card-actions .text-button { font-size:10px; min-height:34px; }
  .book-card-actions .delete-button { font-size:10px; padding:6px; margin-left:0; min-height:34px; }
  .new-book-card { min-height:300px; padding:16px 10px; }
  .new-book-card>b { font-size:12px; line-height:2; }
  .new-book-card>small { font-size:10px; }
  .home-lower { margin-top:29px; gap:25px; }
  .home-notice { padding:23px; }
  .home-notice h3 { font-size:23px; }
  .recent-manuscript { padding:15px; gap:10px; }
  .recent-manuscript b { font-size:13px; }
  .recent-manuscript small { font-size:10px; }
  .recent-date { font-size:10px; }
  .hero { height:auto; min-height:340px; }
  .hero-image { width:100%; object-position:center; opacity:.58; }
  .hero-wash { background:linear-gradient(90deg,#203640f2,#203640ab 65%,#20364055),linear-gradient(0deg,#203640ae,transparent 60%); }
  .hero-content { padding:29px 25px 42px; max-width:100%; }
  .hero h2 { font-size:34px; max-width:100%; margin:18px 0 10px; line-height:1.8; }
  .hero-content>p { font-size:13px; line-height:1.9; }
  .hero-description { font-size:12px; max-width:100%; line-height:2; margin-bottom:20px; }
  .hero-caption { right:17px; bottom:15px; font-size:9px; }
  .project-strip { padding:21px 0; margin-bottom:26px; }
  .project-strip>div { padding:0 13px; flex-direction:column; gap:4px; align-items:flex-start; min-width:0; }
  .project-strip>div:first-child { padding-left:4px; }
  .strip-number { font-size:28px; }
  .project-strip>div>span:last-child { font-size:11px; white-space:normal; }
  .project-strip small { font-size:9px; }
  .project-strip>a { font-size:11px; }
  .home-columns { grid-template-columns:1fr; gap:28px; }
  .continue-card { padding:22px; }
  .continue-title h3 { font-size:19px; }
  .continue-copy { font-size:13px; }
  .scene-links { gap:9px; }
  .scene-links button { font-size:11px; padding:10px; min-height:44px; }
  .quick-note-card textarea { font-size:17px; }
  .toolbar { align-items:flex-start; flex-wrap:wrap; gap:9px; margin-bottom:19px; padding-bottom:15px; }
  .segmented { gap:2px; padding:3px; }
  .segmented button { min-height:37px; padding:6px 11px; font-size:11px; }
  .settings-tabs { width:100%; justify-content:space-between; }
  .settings-tabs button { flex:1; min-width:0; padding:7px 5px; font-size:11px; }
  .toolbar>#archive-toggle { margin-left:auto; font-size:11px; }
  .collection-tools, .terms-toolbar { gap:10px; margin-bottom:19px; }
  .collection-tools select, .terms-toolbar select { font-size:16px; min-height:44px; flex:1; min-width:0; }
  .collection-search { flex-basis:100%; order:2; min-width:0; }
  .collection-search input { font-size:16px; min-height:44px; }
  .collection-tools .result-count { margin-left:auto; font-size:11px; }
  .terms-toolbar label { font-size:11px; }
  .terms-toolbar input { flex-basis:100%; order:3; font-size:16px; min-height:44px; min-width:0; }
  .terms-toolbar>.muted-small { font-size:11px; }
  .list-caption { font-size:10px; margin-bottom:12px; }
  .chapter-row, .chapter-row.interlude { grid-template-columns:25px minmax(0,1fr); padding:20px 17px; gap:5px 12px; }
  .chapter-index { font-size:23px; padding-top:3px; }
  .chapter-row h3 { font-size:18px; line-height:1.9; }
  .chapter-row p { font-size:12px; }
  .chapter-actions { grid-column:1/-1; margin-top:14px; gap:7px 10px; }
  .chapter-action-meta { flex-basis:100%; margin-bottom:4px; gap:12px; }
  .chapter-edit { margin-right:auto; font-size:11px; min-height:41px; padding:9px 11px; }
  .chapter-actions>.text-button { font-size:11px; min-height:41px; }
  .chapter-actions .delete-button { font-size:11px; min-height:41px; }
  .chapter-order { padding-left:8px; gap:4px; }
  .move-button { min-width:32px; min-height:40px; }
  .people-grid, .terms-grid, .themes-grid, .notes-grid { grid-template-columns:1fr; gap:17px; }
  .person-card { min-height:270px; padding:24px; }
  .person-card h2 { font-size:25px; }
  .person-role { font-size:12px; }
  .person-description { font-size:14px; line-height:2.1; }
  .person-source { font-size:10px; }
  .record-actions .text-button { font-size:12px; min-height:40px; }
  .record-actions .delete-button { font-size:11px; min-height:40px; }
  .term-card, .theme-card, .note-card { padding:24px; }
  .term-card h2, .theme-card h2 { font-size:25px; }
  .term-card>p, .theme-card>p, .note-card>p { font-size:14px; line-height:2.1; }
  .term-card>p.term-notes { font-size:12px; }
  .note-card h2 { font-size:23px; }
  .collection-guide { padding:17px; gap:11px; }
  .collection-guide p { font-size:12px; }
  .archive-summary { gap:8px; }
  .archive-category { min-height:39px; padding:7px 11px; gap:10px; font-size:10px; }
  .archive-category b { font-size:13px; }
  .archive-row, .trash-row { padding:20px; grid-template-columns:1fr; gap:9px; }
  .archive-row>.trash-type, .trash-row>.trash-type { justify-self:start; }
  .archive-row h2, .trash-row h2 { font-size:19px; }
  .archive-row p, .trash-row p { font-size:11px; }
  .archive-row-actions, .trash-row>.button { grid-column:1; justify-self:end; margin-top:6px; }
  .archive-row-actions .button, .trash-row>.button { min-height:42px; font-size:12px; }
  .note-dialog, .detail-dialog, .help-dialog { width:calc(100% - 24px); padding:23px; border-radius:9px; max-height:90dvh; }
  .note-dialog h2, .note-dialog-header h2 { font-size:23px; }
  .note-dialog label { font-size:12px; margin-top:17px; }
  .note-dialog input, .note-dialog textarea, .note-dialog select { font-size:16px; }
  .note-dialog textarea { height:145px; }
  .note-actions { bottom:-23px; gap:10px; padding:15px 0 0; }
  .note-actions .text-button { font-size:11px; min-height:40px; }
  .detail-dialog h2 { font-size:27px; padding-right:15px; }
  .detail-description { font-size:16px; }
  .editor-dialog { width:100%; max-width:100%; height:100dvh; max-height:100dvh; margin:0; border:0; border-radius:0; }
  .editor-header { padding:17px 19px 12px; align-items:center; }
  .editor-header h2 { font-size:21px; line-height:1.7; }
  .editor-tools { padding:11px 18px 7px; gap:9px; }
  .editor-tools .segmented { flex-shrink:0; }
  .editor-tools .segmented button { font-size:11px; min-height:34px; }
  .editor-status { margin-left:auto; gap:10px; font-size:10px; }
  .editor-status>span { font-size:10px; }
  .editor-meta { padding:0 19px 9px; font-size:9px; }
  .editor-plan { margin:0 18px; padding:10px 12px; }
  .editor-plan p { font-size:11px; max-height:4em; overflow:auto; }
  .editor-writing textarea, .original-reading { padding:18px 23px 35px; font-size:18px; line-height:2.2; letter-spacing:.035em; }
  .editor-footer { padding:12px 17px max(12px,env(safe-area-inset-bottom)); gap:5px 14px; }
  .editor-footer>.text-button { font-size:10px; min-height:30px; }
  .editor-footer>div { flex-basis:100%; margin:3px 0 0; gap:10px; }
  .editor-footer>div .button { flex:1; min-height:43px; font-size:12px; }
  .search-dialog { top:6vh; width:calc(100% - 24px); max-height:85dvh; padding:0; }
  .search-input-row { padding:12px 15px; gap:10px; }
  .search-input-row input { font-size:16px; }
  .search-result { padding:15px 19px; }
  .search-result b { font-size:17px; }
  .search-result p { font-size:12px; }
  .toast { left:50%; max-width:calc(100vw - 30px); bottom:max(20px,env(safe-area-inset-bottom)); width:max-content; font-size:12px; gap:15px; padding:12px 17px; }
  .help-dialog .note-dialog-header h2 { font-size:25px; }
  .help-steps p, .help-save p { font-size:13px; }
  .help-save { padding:17px; }
  .help-shortcuts>div { min-width:115px; }
  .chat-layout { grid-template-columns:1fr; gap:18px; }
  .chat-context { padding:20px; }
  .chat-context h2 { font-size:22px; }
  .chat-context p { font-size:12px; }
  .chat-context select { font-size:16px; }
  .chat-context small { font-size:11px; line-height:2; }
  .chat-panel { height:auto; min-height:550px; max-height:none; }
  .chat-messages { padding:22px 19px; max-height:65dvh; min-height:320px; }
  .chat-empty { padding:28px 0 20px; }
  .chat-empty h2 { font-size:25px; }
  .chat-empty>p { font-size:12px; }
  .prompt-chips { flex-direction:column; align-items:stretch; }
  .prompt-chips button { font-size:12px; min-height:44px; }
  #chat-form { padding:15px 18px; }
  #chat-input { font-size:16px; min-height:100px; }
  .chat-send-row { gap:12px; }
  .chat-send-row>span { font-size:10px; }
  .chat-message>div { font-size:15px; }
}
@media (max-width:370px) {
  .page { padding-left:15px; padding-right:15px; }
  .topbar-right { gap:5px; }
  .cloud-status { max-width:110px; font-size:9px; }
  .topbar-left { font-size:10px; }
  .entrance-copy { padding:25px 21px; }
  .entrance-copy h2 { font-size:21px; }
  .library-books { gap:10px; }
  .cover-name { font-size:20px; }
  .hero h2 { font-size:30px; }
  .chapter-order { flex-basis:auto; }
  .chapter-actions { gap:6px; }
  .editor-status { width:100%; justify-content:space-between; margin-left:0; }
}
@media (prefers-reduced-motion:reduce) {
  *, *:before, *:after { scroll-behavior:auto!important; transition:none!important; animation:none!important; }
}

body.spy-mode{background:#10191c}body.spy-mode .page{background:#e7ebe4;color:#293b40}body.spy-mode .hero{background:linear-gradient(120deg,#0c1518,#233b3c);border:1px solid #68876f}body.spy-mode .hero-wash{background:transparent}body.spy-mode .hero-content,body.spy-mode .hero h2{color:#e4eadf}body.spy-mode .hero-eyebrow,body.spy-mode .hero-caption{color:#b4bf77;letter-spacing:.2em}body.spy-mode .hero:after{content:'CLASSIFIED / EYES ONLY';position:absolute;right:22px;top:22px;color:#aeb97e;font:11px monospace;letter-spacing:.2em}body.spy-mode .hero p,body.spy-mode .hero-description{color:#c5d4c6}body.spy-mode #manuscript-editor{background:#142125;color:#e0e8db;border-color:#5b7264}body.spy-mode .original-reading{background:#142125;color:#e0e8db;padding:24px;border-top:3px solid #a7af76}

/* Spy dossier treatment: a complete classified-file layer for the spy story. */
body.viewer-spy-mode { background:#0a1217; color:#cfd9d1; }
body.viewer-spy-mode .viewer-app-shell { background:radial-gradient(circle at 72% 5%,#203836 0,#0d181e 38%,#091116 100%); }
body.viewer-spy-mode .viewer-sidebar { background:linear-gradient(180deg,#101c21,#0b1419); border-right-color:#304846; box-shadow:8px 0 32px #02070a66; }
body.viewer-spy-mode .viewer-brand strong,body.viewer-spy-mode .viewer-brand small { color:#d8dfd3; }
body.viewer-spy-mode .viewer-mode { background:#172620; border-color:#42604f; color:#c9d6c3; }
body.viewer-spy-mode .viewer-mode>span { background:#c87555; box-shadow:0 0 0 4px #563a3044,0 0 14px #c87555aa; }
body.viewer-spy-mode .viewer-mode small,body.viewer-spy-mode .viewer-sidebar-label,body.viewer-spy-mode .viewer-sidebar-spine small { color:#8da38e; }
body.viewer-spy-mode .viewer-story-switch select { background:#101b20; border-color:#3b5550; color:#d5ddcf; }
body.viewer-spy-mode .viewer-nav a { color:#96a99a; }
body.viewer-spy-mode .viewer-nav a span { color:#a0b279; }
body.viewer-spy-mode .viewer-nav a:hover { background:#1b2d2d; }
body.viewer-spy-mode .viewer-nav a.active { background:#1b332f; color:#e0e7d9; }
body.viewer-spy-mode .viewer-nav a.active:before { background:#c57d5d; box-shadow:0 0 12px #c57d5d99; }
body.viewer-spy-mode .viewer-sidebar-spine i { background:#8c7652; }
body.viewer-spy-mode .viewer-sidebar-spine p { color:#d5ddcf; }
body.viewer-spy-mode .viewer-sidebar-footer { border-top-color:#304846; }
body.viewer-spy-mode .viewer-sidebar-footer p { color:#91a295; }
body.viewer-spy-mode .viewer-side-button { background:#172a29; border-color:#416254; color:#d2dfcc; }
body.viewer-spy-mode .viewer-side-button:hover { background:#203b35; }
body.viewer-spy-mode .viewer-side-button-muted { background:transparent; color:#8da095; }
body.viewer-spy-mode .viewer-topbar { background:#0c171ce8; border-bottom-color:#304846; }
body.viewer-spy-mode .viewer-topbar-left,body.viewer-spy-mode .viewer-topbar-left strong { color:#b9c8b9; }
body.viewer-spy-mode .viewer-topbar-left b { color:#916e55; }
body.viewer-spy-mode .viewer-status { color:#b6c99d; }
body.viewer-spy-mode .viewer-status i { background:#c87555; box-shadow:0 0 9px #c87555; }
body.viewer-spy-mode .viewer-search-trigger { background:#111f23; border-color:#36504c; color:#b9c8b9; }
body.viewer-spy-mode .viewer-main { background:repeating-linear-gradient(0deg,#ffffff00 0 4px,#d5d6b205 4px 5px),radial-gradient(circle at 50% -10%,#263e3b33,#0000 45%); }
body.viewer-spy-mode .viewer-page-intro h1 { color:#e1e7d9; }
body.viewer-spy-mode .viewer-subtle { color:#94a89a; }
body.viewer-spy-mode .viewer-hero { border:1px solid #6d6b4a; box-shadow:0 12px 35px #02060888,0 0 0 1px #c6a96a1c inset; }
body.viewer-spy-mode .viewer-hero-spy:before { content:""; position:absolute; inset:15px; border:1px solid #d2be7a2b; pointer-events:none; z-index:1; }
body.viewer-spy-mode .viewer-hero-spy:after { background:linear-gradient(90deg,#071015f7 0%,#0c1a1bb8 50%,#101b1736 100%),repeating-linear-gradient(135deg,transparent 0 18px,#d5c37b0d 18px 19px); }
body.viewer-spy-mode .viewer-hero-copy { position:relative; z-index:2; }
.viewer-spy-signal { display:flex; align-items:center; gap:8px; margin:0 0 16px; color:#d3c17d; font:600 9px/1 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing:.17em; }
.viewer-spy-signal small { margin-left:8px; color:#a9b9a5; font-size:8px; font-weight:400; letter-spacing:.08em; }
.viewer-spy-signal-dot { color:#cf7557; font-size:12px; text-shadow:0 0 12px #cf7557; animation:spy-pulse 1.8s ease-in-out infinite; }
.viewer-spy-seal { position:absolute; right:75px; top:36px; z-index:3; padding:7px 12px; border:1px solid #cf755799; color:#d68a6d; font:700 9px/1 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing:.19em; transform:rotate(-10deg); opacity:.88; }
.viewer-spy-crosshair { position:absolute; right:34px; top:35%; width:92px; height:92px; border:1px solid #d1bd6e42; border-radius:50%; opacity:.7; z-index:1; }
.viewer-spy-crosshair:before,.viewer-spy-crosshair:after { content:""; position:absolute; background:#d1bd6e55; }
.viewer-spy-crosshair:before { left:50%; top:-12px; bottom:-12px; width:1px; }
.viewer-spy-crosshair:after { top:50%; left:-12px; right:-12px; height:1px; }
body.viewer-spy-mode .viewer-hero-mark { z-index:3; }
body.viewer-spy-mode .viewer-hero-mark b { color:#d5c37b; text-shadow:0 0 20px #b38f4c66; }
body.viewer-spy-mode .viewer-metrics { border-bottom-color:#304846; }
body.viewer-spy-mode .viewer-metric { border-right-color:#304846; }
body.viewer-spy-mode .viewer-metric strong { color:#d0b974; }
body.viewer-spy-mode .viewer-metric span { color:#bbccb9; }
body.viewer-spy-mode .viewer-metric small { color:#7f9686; }
body.viewer-spy-mode .viewer-section-heading h2 { color:#d7e0d2; }
body.viewer-spy-mode .viewer-inline-link { color:#c4aa6c; }
body.viewer-spy-mode .viewer-latest-card,body.viewer-spy-mode .viewer-world-panel,body.viewer-spy-mode .viewer-chapter-card,body.viewer-spy-mode .viewer-record-card,body.viewer-spy-mode .viewer-comment-form-panel,body.viewer-spy-mode .viewer-comment-list-panel { background:#101d22; border-color:#304c4b; box-shadow:0 8px 22px #02060833; }
body.viewer-spy-mode .viewer-world-panel { background:#132324; }
body.viewer-spy-mode .viewer-latest-card h3,body.viewer-spy-mode .viewer-chapter-head h2,body.viewer-spy-mode .viewer-record-card h2,body.viewer-spy-mode .viewer-comment-form-panel h2,body.viewer-spy-mode .viewer-section-heading h2 { color:#dce5d6; }
body.viewer-spy-mode .viewer-card-meta,body.viewer-spy-mode .viewer-record-meta,body.viewer-spy-mode .viewer-comment-card-head small { color:#8da397; }
body.viewer-spy-mode .viewer-card-excerpt,body.viewer-spy-mode .viewer-record-description,body.viewer-spy-mode .viewer-comment-card p { color:#b2c4b4; }
body.viewer-spy-mode .viewer-read-button { background:#203d36; border-color:#55725a; color:#e0e6d3; }
body.viewer-spy-mode .viewer-world-preview-card { background:#172a2b; border-color:#365451; color:#c6d5bf; }
body.viewer-spy-mode .viewer-world-preview-card small,body.viewer-spy-mode .viewer-world-preview-card span { color:#91a595; }
body.viewer-spy-mode .viewer-world-preview-card strong { color:#d2bd76; }
body.viewer-spy-mode .viewer-read-notice { background:#1b2926; border-left-color:#c2a962; color:#c4d0ba; }
body.viewer-spy-mode .viewer-spy-briefing { box-shadow:0 0 0 1px #c2a9621c inset; }
body.viewer-spy-mode .viewer-spy-dossier-card { position:relative; border-left:3px solid #ae6851; }
body.viewer-spy-mode .viewer-spy-dossier-card:after { content:"EYES ONLY"; position:absolute; right:20px; top:20px; color:#bd7961; font:700 8px/1 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing:.16em; opacity:.72; }
body.viewer-spy-mode .viewer-spy-record-card { border-top:2px solid #8f7e4c; }
body.viewer-spy-mode .viewer-world-tabs { background:#122322; border-color:#365451; }
body.viewer-spy-mode .viewer-world-tab { color:#a0b19e; }
body.viewer-spy-mode .viewer-world-tab:hover { background:#1a3531; }
body.viewer-spy-mode .viewer-world-tab.selected { background:#25483d; color:#e1e5d1; }
body.viewer-spy-mode .viewer-comment-card { background:#152527; border-color:#365451; }
body.viewer-spy-mode .viewer-comment-card-head strong { color:#d6dfd0; }
body.viewer-spy-mode .viewer-comment-form input,body.viewer-spy-mode .viewer-comment-form textarea { background:#0d191e; border-color:#385451; color:#d9e3d3; }
body.viewer-spy-mode .viewer-comment-status { color:#8fa597; }
body.viewer-spy-mode .viewer-comment-error { color:#d78d70; }
body.viewer-spy-mode .viewer-empty { background:#101d22; border-color:#365451; }
body.viewer-spy-mode .viewer-empty h2,body.viewer-spy-mode .viewer-empty p { color:#b3c4b2; }

body.spy-mode .spy-hero { box-shadow:0 12px 35px #07101388,0 0 0 1px #c5b46c22 inset; }
body.spy-mode .spy-hero:before { content:""; position:absolute; inset:14px; border:1px solid #d0bd752f; pointer-events:none; }
body.spy-mode .spy-hero:after { content:"TOP SECRET / EYES ONLY"; right:23px; top:21px; color:#d07a5d; font:700 10px ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing:.16em; text-shadow:0 0 12px #d07a5d55; }
.spy-command-strip { display:flex; align-items:center; gap:8px; margin:0 0 14px; color:#d6c27b; font:700 9px/1 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing:.15em; }
.spy-command-strip small { margin-left:8px; color:#a6b9aa; font-size:8px; font-weight:400; letter-spacing:.08em; }
.spy-live-dot { width:7px; height:7px; border-radius:50%; background:#c96f56; box-shadow:0 0 0 4px #603b3044,0 0 13px #c96f56; animation:spy-pulse 1.8s ease-in-out infinite; }
.cover-spy { background:linear-gradient(145deg,#0b171d,#203e3b 58%,#806d43)!important; border-color:#6e7654!important; }
.cover-spy:before { border-color:#cfbd773d; }
.cover-spy:after { background:linear-gradient(90deg,#071014aa,#0000); }
.cover-spy .cover-serial { color:#d1c179; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }
.cover-spy .cover-name { color:#e8ead7; text-shadow:0 2px 18px #0008; }
.cover-spy .cover-subtitle { color:#c4d0be; }
.cover-spy .cover-open { color:#d4bb6d; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing:.12em; }
@keyframes spy-pulse { 0%,100%{opacity:.55} 50%{opacity:1} }
@media (max-width:760px) {
  .viewer-spy-seal { right:30px; top:24px; font-size:8px; }
  .viewer-spy-crosshair { right:13px; top:42%; width:70px; height:70px; }
  .viewer-spy-signal { font-size:8px; }
  .viewer-spy-signal small { font-size:7px; }
  body.viewer-spy-mode .viewer-hero-copy { padding:31px 24px; }
  body.viewer-spy-mode .viewer-hero-copy h2 { font-size:31px; }
  body.viewer-spy-mode .viewer-spy-dossier-card:after { right:16px; top:16px; }
}
