/* Virus — interface de bureau, priorité à la lecture en mode sombre. */
html[data-story-theme="virus"] {
  --paper:#eff0e8; --surface:#f8f9f5; --ink:#273027; --body:#485047;
  --muted:#687166; --line:#d0d6cc; --green:#566c53; --green-soft:#e6ebe3;
  --gold:#8b7254; --shadow:0 16px 48px #1821110b;
  --button-bg:#dbe2d7; --button-ink:#263026; --button-border:#aab6a5; --button-hover:#ccd7c7;
  --surface-raised:#fff; --virus-acid:var(--green);
}
html[data-story-theme="virus"][data-theme="dark"] {
  --paper:#101318; --surface:#181d24; --surface-raised:#202730;
  --ink:#edf0f4; --body:#ccd2db; --muted:#a2adbc; --line:#303a47;
  --green:#b8db75; --green-soft:#263025; --gold:#d0b68a;
  --button-bg:#b8db75; --button-ink:#17200f; --button-border:#b8db75; --button-hover:#cae997;
  --shadow:0 18px 50px #0004; color-scheme:dark;
}
html[data-story-theme="virus"] body {min-width:1100px; background:var(--paper); color:var(--body); font:15px/1.6 Arial,sans-serif;}
html[data-story-theme="virus"] :is(button,input,select,textarea) {font-family:Arial,sans-serif;}
html[data-story-theme="virus"] :is(.brand,.chapter-heading h1,.section-heading h2,.home-help h2,.my-stories h2,.story-card h2,.workshop-heading h2,.character-profile h2,.pdf-card h2,.author-dialog h2,.stories-dialog h2) {font-family:Arial,sans-serif;}
.site-header {background:var(--paper); border-bottom:1px solid var(--line); box-shadow:0 4px 24px #0002;}
.masthead,.chapter-nav {max-width:1440px; margin:auto; padding-inline:40px;}
.masthead {padding-block:16px; gap:20px;}
html[data-story-theme="virus"] .brand {font-size:26px; font-weight:800; letter-spacing:2px; gap:13px; color:var(--ink);}
.brand-sub {font:10px/1.5 Consolas,monospace; letter-spacing:1.6px; color:var(--muted); margin-top:3px;}
.brand .virus-brand-mark {width:34px; height:34px; stroke:var(--green); fill:none; stroke-width:1.8;}
.stories-switch,.theme-button {background:var(--surface); border:1px solid var(--line); border-radius:7px; padding:9px 14px; color:var(--body); font-size:13px;}
.chapter-nav {min-height:52px; padding-bottom:9px; gap:6px;}
.chapter-nav>a,.tools-menu>summary {padding:10px 16px; font:500 14px/1.4 Arial,sans-serif; border-radius:6px; color:var(--muted);}
.chapter-nav>a.active {background:var(--green-soft); color:var(--green); box-shadow:none;}
.chapter-nav>a:hover,.tools-menu>summary:hover {background:var(--surface-raised); color:var(--ink);}
.tools-popover {background:var(--surface-raised); border-radius:9px; box-shadow:var(--shadow);}
html[data-story-theme="virus"] :is(.primary-button,.codex-button,.chapter-nav .nav-create,.track-categories button[aria-pressed="true"]) {background:var(--button-bg); color:var(--button-ink); border:1px solid var(--button-border); border-radius:6px; box-shadow:none; font:600 14px/1.4 Arial,sans-serif; padding:12px 18px;}
html[data-story-theme="virus"] :is(.primary-button,.codex-button,.chapter-nav .nav-create,.track-categories button[aria-pressed="true"]):hover {background:var(--button-hover); color:var(--button-ink); filter:none;}
html[data-story-theme="virus"] .chapter-nav .nav-create {padding:9px 16px;}
main {max-width:1440px; padding-inline:48px; margin:auto;}
.eyebrow {font:11px/1.5 Consolas,monospace; letter-spacing:1.5px; color:var(--green);}
.virus-hero {display:grid; grid-template-columns:minmax(0,1fr) 390px; align-items:center; gap:72px; padding:36px 0 28px;}
.virus-kicker {display:flex; gap:10px; align-items:center; font:11px/1.5 Consolas,monospace; letter-spacing:2px; color:var(--green);}
.virus-kicker i {width:7px; height:7px; border-radius:50%; background:var(--green); box-shadow:0 0 15px #b8db7533;}
.virus-hero h1 {font:850 100px/.95 Arial,sans-serif; letter-spacing:-6px; margin:20px 0 18px; color:var(--ink); max-width:none;}
.virus-hero h1>span {display:block; font:400 32px/1.2 Arial,sans-serif; letter-spacing:-1px; margin-top:18px;}
.virus-hero h1 em {font-style:normal; color:var(--green);}
.virus-hero p {font-size:15px; line-height:1.8; color:var(--muted); max-width:590px; margin:0 0 21px;}
.virus-actions {display:flex; align-items:center; gap:24px;}
.virus-text-link {font-size:13px; color:var(--body);}
.virus-text-link:hover {color:var(--green);}
.virus-text-link span {margin-left:8px; color:var(--green);}
.virus-topics {display:flex; gap:8px; margin-top:21px;}
.virus-topics span {padding:4px 10px; background:var(--surface); border:1px solid var(--line); border-radius:4px; font:11px/1.5 Consolas,monospace; color:var(--muted);}
.virus-specimen {position:relative; aspect-ratio:1; border:1px solid var(--line); border-radius:12px; overflow:hidden; background:radial-gradient(ellipse at center,#b8db751a,transparent 68%),repeating-linear-gradient(0deg,transparent,transparent 35px,#899bab0b 36px),repeating-linear-gradient(90deg,transparent,transparent 35px,#899bab0b 36px),var(--surface); box-shadow:inset 0 0 70px #0002;}
.virus-specimen>svg {position:absolute; inset:0; width:100%; height:100%;}
.specimen-top {position:absolute; top:18px; left:20px; z-index:1; font:10px Consolas,monospace; letter-spacing:1px; color:var(--muted);}
.specimen-cross {position:absolute; right:19px; top:10px; color:var(--green); font:24px Consolas,monospace;}
.scan-rings {stroke:var(--green); stroke-width:.8; opacity:.32;}
.core {stroke:var(--green); stroke-width:1.6; fill:color-mix(in srgb,var(--green) 9%,transparent);}
.spikes {stroke:var(--green); stroke-width:2.4; stroke-linecap:round; opacity:.85;}
.cell-details {stroke:var(--green); stroke-width:1.5; opacity:.65;}
.specimen-bottom {position:absolute; bottom:18px; left:20px; font:9px Consolas,monospace; letter-spacing:1px; color:var(--muted);}
.specimen-bottom strong {display:block; color:var(--green); font-size:11px; font-weight:400; margin-top:6px;}
.specimen-side {position:absolute; right:14px; top:65px; writing-mode:vertical-rl; font:8px Consolas,monospace; letter-spacing:1.5px; color:var(--muted);}
.virus-signals {display:grid; grid-template-columns:repeat(3,1fr); border:1px solid var(--line); background:var(--surface); border-radius:8px; padding:16px 22px; margin-bottom:24px;}
.virus-signals>div {padding-left:24px; border-left:1px solid var(--line);}
.virus-signals>div:first-child {padding-left:0; border:0;}
.virus-signals span {font:10px Consolas,monospace; letter-spacing:1.4px; color:var(--muted);}
.virus-signals strong {display:block; font:500 15px/1.5 Arial,sans-serif; margin-top:4px; color:var(--ink);}
.virus-signals i {color:var(--green); font:8px Consolas,monospace; margin-left:8px;}
.continue-card {background:var(--surface); border:1px solid var(--line); border-left:3px solid var(--green); border-radius:8px; padding:21px 25px;}
html[data-story-theme="virus"] .continue-card h2 {font:600 25px/1.3 Arial,sans-serif; color:var(--ink); margin-top:8px;}
.continue-card p {font-size:14px; color:var(--muted);}
.home-columns {grid-template-columns:minmax(0,1fr) 330px; gap:28px; margin-top:28px;}
html[data-story-theme="virus"] :is(.section-heading h2,.home-help h2,.my-stories h2) {font:600 21px/1.4 Arial,sans-serif; color:var(--ink);}
.simple-home .chapter-library {scroll-margin-top:150px;}
.search-label {background:var(--surface); border:1px solid var(--line); border-radius:7px; padding:12px 15px;}
.search-label input {font-size:14px; color:var(--ink);}
.simple-home .chapter-grid {border-radius:8px;}
.simple-home .chapter-card {padding:20px; min-height:82px;}
html[data-story-theme="virus"] .simple-home .chapter-card h3 {font:500 20px/1.4 Arial,sans-serif; color:var(--ink);}
.simple-home .card-top {font:14px Consolas,monospace; color:var(--green);}
.simple-home .chapter-card:hover,.tracks-hub .chapter-card:hover {background:var(--surface-raised);}
.home-sidebar {gap:16px;}
.my-stories,.home-help {background:var(--surface); border-radius:8px; padding:20px;}
.stories-compact {max-height:280px; overflow:auto; padding-right:5px; scrollbar-width:thin;}
.story-card {background:var(--surface); border:1px solid var(--line); border-radius:8px;}
.stories-compact .story-card {background:var(--paper); border-radius:6px;}
.story-card.current {border-color:color-mix(in srgb,var(--green) 55%,var(--line));}
html[data-story-theme="virus"] .story-card h2 {font-weight:600;}
.home-sidebar p,.home-help a {font-size:13px; line-height:1.7;}
.chapter-heading {padding:32px 0 26px;}
html[data-story-theme="virus"] .chapter-heading h1 {font:600 44px/1.15 Arial,sans-serif; letter-spacing:-1.5px; color:var(--ink);}
.chapter-heading>p {max-width:800px; font-size:15px; line-height:1.8; color:var(--muted);}
.breadcrumb {font-size:13px; color:var(--muted);}
.chapter-meta {font-size:13px; gap:22px;}
.chapter-settings {background:var(--surface); border-radius:8px;}
.chapter-settings>summary {padding:16px 22px; color:var(--ink); font-size:14px;}
.reader-toolbar {background:var(--surface); padding:13px 18px; border:1px solid var(--line); border-radius:8px;}
.reader-toolbar button {background:var(--paper); border:1px solid var(--line); color:var(--body); padding:8px 12px;}
.author-toolbar {gap:8px; padding:15px 0 5px;}
.author-toolbar button {font-size:13px; border-radius:6px; padding:9px 13px; background:var(--surface);}
.reading-layout {grid-template-columns:minmax(0,860px) 270px; justify-content:space-between; gap:44px; padding-top:32px;}
.story {font-size:21px; line-height:1.95; max-width:860px; color:var(--body); padding-right:10px;}
.story>p {margin-bottom:1.3em;}
.story .dialogue {background:transparent; padding-block:14px;}
.reading-aside {top:calc(var(--header-height) + 24px);}
.voices {background:var(--surface); padding:23px; border:1px solid var(--line); border-radius:8px;}
html[data-story-theme="virus"] .voices h2 {font:600 20px/1.4 Arial,sans-serif;}
.voices>p,.voice-list li {font-size:13px; line-height:1.7;}
.scene-index {padding-top:20px; margin-top:24px;}
.scene-index summary,.scene-index a {font-size:13px;}
.chapter-notes {background:var(--surface); padding-inline:22px;}
.author-workshop,.new-prompt-form,.character-create,.character-profile,.document-viewer,.pdf-card {border-radius:8px; background:var(--surface);}
.new-prompt {max-width:1100px; margin:8px auto 50px;}
.new-prompt-form {padding:30px;}
html[data-story-theme="virus"] .editor-panel :is(label,input,select),html[data-story-theme="virus"] .new-prompt-form label {font-size:14px;}
html[data-story-theme="virus"] .editor-panel input {padding:13px 16px; font-family:Arial,sans-serif;}
.editor-panel textarea {background:var(--paper); color:var(--ink); border-radius:6px; font-size:18px; line-height:1.8;}
html[data-story-theme="virus"] :is(input,select,textarea):focus-visible {outline:2px solid var(--green); outline-offset:2px;}
html[data-story-theme="virus"] :is(input,textarea)::placeholder {color:var(--muted); opacity:.8;}
.character-form-grid {gap:20px;}
.characters-page .characters-layout {grid-template-columns:320px minmax(0,1fr); gap:28px;}
.characters-page .characters-hero h1 {font:600 44px/1.2 Arial,sans-serif; letter-spacing:-1.5px;}
.characters-page .character-search-input {padding:13px 16px;}
.characters-page .characters-directory {background:var(--surface); border:1px solid var(--line); border-radius:8px;}
.characters-page .character-profile {padding:30px;}
.tracks-hub .chapter-card {background:var(--surface); border-radius:8px; padding:22px;}
html[data-story-theme="virus"] .tracks-hub .chapter-card h3 {font:500 21px/1.4 Arial,sans-serif;}
.filter-details {background:var(--surface); border-radius:8px;}
.date-filters {background:var(--paper); border-radius:6px;}
.document-layout {grid-template-columns:340px minmax(0,1fr); gap:28px;}
.pdf-card {padding:19px;}
html[data-story-theme="virus"] .pdf-card h2 {font-size:16px;}
.document-viewer {min-height:700px;}
.author-dialog,.stories-dialog {background:var(--surface); color:var(--ink); border:1px solid var(--line); border-radius:12px; box-shadow:0 30px 100px #0008;}
.author-dialog::backdrop,.stories-dialog::backdrop {background:#080c12bb; backdrop-filter:blur(4px);}
.virus-dossier-grid {display:grid; grid-template-columns:1fr 1fr; gap:22px; margin:5px 0 45px;}
.virus-dossier {background:var(--surface); border:1px solid var(--line); border-radius:8px; padding:28px 32px;}
.virus-dossier.wide {grid-column:1/-1;}
.virus-dossier h2 {font:600 25px/1.4 Arial,sans-serif; margin:12px 0; color:var(--ink);}
.virus-dossier p {max-width:1050px; font-size:15px; line-height:1.9; color:var(--body);}
.site-footer {max-width:1344px; margin:36px auto 0; padding:24px 0; border-top:1px solid var(--line); color:var(--muted); font-size:12px;}
.brand-small {font:700 18px Arial,sans-serif; letter-spacing:2px; color:var(--ink);}
a:focus-visible,button:focus-visible,summary:focus-visible {outline:2px solid var(--green); outline-offset:4px;}
::selection {background:var(--green); color:var(--paper);}
html[data-story-theme="virus"] {scrollbar-color:var(--line) var(--paper); scrollbar-width:thin;}
@media (min-width:1100px) and (max-width:1280px) {
  .masthead,.chapter-nav {padding-inline:28px;} main {padding-inline:32px;}
  .virus-hero {grid-template-columns:minmax(0,1fr) 340px; gap:45px;} .virus-hero h1 {font-size:88px;}
  .reading-layout {grid-template-columns:minmax(0,1fr) 250px; gap:28px;}
  .site-footer {margin-inline:32px;}
}
@media print {
  html[data-story-theme="virus"] body {min-width:0; background:white; color:#222;}
  .virus-specimen,.virus-signals,.virus-topics {display:none;}
  .virus-hero {display:block;} .virus-hero h1 {font-size:50px;}
}
