/* Shared color roles keep all pages, forms and dialogs in the same palette. */
:root{
  color-scheme:light;
  --muted:#646e60;--hover:#e9eee4;--accent-hover:#32604f;--on-accent:#fffdf7;
  --panel:#f0f1e8;--header:#f9f7f0;--secondary:#566052;--highlight:#f0ead9;--highlight-ink:#79613a;
  --nav-bg:#203d36;--nav-ink:#c2d2c4;--nav-muted:#a6b8aa;--nav-hover:#2b493f;--nav-active:#365247;--nav-line:#4b6356;
  --focus:#96733c;--art-filter:none;
}
:root[data-theme=mist]{
  --paper:#edf2f7;--surface:#fafdff;--ink:#24394b;--muted:#586d7e;--line:#ccd8e3;
  --green:#305d80;--dark:#1e3349;--gold:#8c6940;--soft:#dce8f2;--danger:#a3373e;
  --hover:#e0eaf3;--accent-hover:#254d70;--on-accent:#ffffff;--panel:#e3ebf3;--header:#f2f6fb;
  --secondary:#4a6379;--highlight:#e8e3d6;--highlight-ink:#755829;--focus:#356c98;
  --nav-bg:#1e3349;--nav-ink:#c4d5e6;--nav-muted:#a9bfd3;--nav-hover:#2c455e;--nav-active:#38556f;--nav-line:#506b84;
}
:root[data-theme=forest]{
  color-scheme:dark;
  --paper:#15231f;--surface:#1e3029;--ink:#e3eadf;--muted:#adbaad;--line:#40584a;
  --green:#a0cfb2;--dark:#101c18;--gold:#d6b780;--soft:#2d4336;--danger:#ffada0;
  --hover:#304a3c;--accent-hover:#badfc7;--on-accent:#122a1e;--panel:#192a23;--header:#192b24;
  --secondary:#becdbd;--highlight:#423c2b;--highlight-ink:#e6ca93;--focus:#d6b780;
  --nav-bg:#101c18;--nav-ink:#bdcebf;--nav-muted:#9eb3a3;--nav-hover:#24382d;--nav-active:#304b3b;--nav-line:#3c5545;
  --art-filter:brightness(.68) saturate(.8);
}
:root[data-theme=midnight]{
  color-scheme:dark;
  --paper:#191c2b;--surface:#23283b;--ink:#e6e6f3;--muted:#b1b6d0;--line:#454c6b;
  --green:#b8b9f2;--dark:#131622;--gold:#d5b995;--soft:#343b57;--danger:#ffadb9;
  --hover:#39415f;--accent-hover:#d0d0ff;--on-accent:#20203c;--panel:#1e2234;--header:#202438;
  --secondary:#c4c7df;--highlight:#443c47;--highlight-ink:#ebc7a9;--focus:#b8b9f2;
  --nav-bg:#131622;--nav-ink:#c6cae6;--nav-muted:#a8afce;--nav-hover:#2b3149;--nav-active:#3b4263;--nav-line:#454c6b;
  --art-filter:brightness(.65) saturate(.65);
}
button:focus-visible,a:focus-visible{outline-color:var(--focus)}
input:focus,textarea:focus,select:focus{outline-color:var(--focus)}
input,textarea,select,.composer-box,.item,.empty{border-color:var(--line)}
input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}
.btn:hover:not(:disabled),.icon:hover,.character-row:hover{background:var(--hover)}
.btn.primary{color:var(--on-accent)}
.btn.primary:hover:not(:disabled){background:var(--accent-hover)}
.topbar,.mobile-nav{background:var(--header)}
.right-panel{background:var(--panel)}
.item{background:var(--surface)}
.chapter-rule,.message-head time,.composer-hint,.profile-text,.item .qty,.lobby-footer,.lobby .brand small,.mobile-nav button{color:var(--muted)}
.message.action .message-text,.proposal pre,.style-example{color:var(--secondary)}
.mini-mark,.character-row.selected,.style-choice:has(input:checked),.info-box{background:var(--soft);color:var(--green)}
.character-row.selected,.info-box{border-color:var(--line)}
.character-row .mine-tag,.empty-symbol,.campaign-card .campaign-icon,.lobby-hero h1 em{color:var(--green)}
.message.narrator .mini-mark,.proposal .badge,.auto-badge,.player-notice{background:var(--highlight);color:var(--highlight-ink)}
.player-notice{border-color:var(--line)}
.message.narrator:before{background:var(--gold)}
.proposal{border-left-color:var(--gold)}
.item-icon,.busy-status{color:var(--highlight-ink)}
.scene-illustration img,.profile-hero{background:var(--panel)}
.composer-box:focus-within{border-color:var(--focus)}
.timeline{scrollbar-color:var(--line) transparent}
.turn-dot{border-color:var(--muted)}
.turn-dot.done,.status:before,.dot{background:var(--green);border-color:var(--green)}
.mobile-nav .count{background:var(--green);color:var(--on-accent)}
.mobile-nav button.active{color:var(--green)}
.sidebar{background:var(--nav-bg);color:var(--nav-ink)}
.sidebar .brand small,.sidebar .eyebrow,.sidebar-note{color:var(--nav-muted)}
.nav button,.nav .nav-icon{color:var(--nav-ink)}
.nav button:hover{background:var(--nav-hover)}
.nav button.active{background:var(--nav-active);color:#fffdf7}
.room-switch{background:var(--nav-hover);border-color:var(--nav-line);color:var(--nav-ink)}
.sidebar-bottom,.sidebar-bottom .btn{border-color:var(--nav-line);color:var(--nav-ink)}
.lobby-art svg,.profile-art{filter:var(--art-filter)}
#toast{background:var(--green);color:var(--on-accent)}
.appearance-settings{max-width:900px}
.theme-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:14px;margin:18px 0}
.theme-choice{display:flex;flex-direction:column;gap:8px;padding:18px;text-align:left;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--ink)}
.theme-choice:hover{background:var(--hover)}
.theme-choice[aria-pressed=true]{border-color:var(--green);box-shadow:0 0 0 1px var(--green)}
.theme-choice small{color:var(--muted)}
.theme-swatches{display:flex;gap:6px;margin-bottom:6px}
.theme-swatches i{width:32px;height:32px;border-radius:50%;border:1px solid #80808060}
.theme-choice[data-theme=parchment]{--swatch-1:#f6f4ed;--swatch-2:#fffdf8;--swatch-3:#244c40}
.theme-choice[data-theme=mist]{--swatch-1:#edf2f7;--swatch-2:#fafdff;--swatch-3:#305d80}
.theme-choice[data-theme=forest]{--swatch-1:#15231f;--swatch-2:#1e3029;--swatch-3:#a0cfb2}
.theme-choice[data-theme=midnight]{--swatch-1:#191c2b;--swatch-2:#23283b;--swatch-3:#b8b9f2}
.theme-choice[data-theme=system]{--swatch-1:#f6f4ed;--swatch-2:#15231f;--swatch-3:#a0cfb2}
.theme-swatches i:nth-child(1){background:var(--swatch-1)}
.theme-swatches i:nth-child(2){background:var(--swatch-2)}
.theme-swatches i:nth-child(3){background:var(--swatch-3)}
.theme-title{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;font-weight:600}
.theme-check{color:var(--green);visibility:hidden}
.theme-choice[aria-pressed=true] .theme-check{visibility:visible}
.lobby-header{gap:16px;flex-wrap:wrap}
