/* Three locally rendered themes. All core controls share semantic colors. */
:root,:root[data-theme="forest"] {
  --paper:#f5f4ed;--panel:#fffef9;--ink:#263e35;--muted:#667568;--line:#dce2d2;
  --forest:#2f5645;--accent:#2f634d;--soft:#eaf0e3;--soft-strong:#d7e3cc;--gold:#9c7940;
  --sidebar-bg:#203b30;--sidebar-ink:#e3e9da;--sidebar-muted:#b6c5af;--red:#9d4d40;
  --shadow:0 12px 36px #293f3010;--field:#fffefa;--map-bg:#e1e5d2;--ring:#548267;
  color-scheme:light;
}
:root[data-theme="midnight"] {
  --paper:#101925;--panel:#192535;--ink:#e5eaf0;--muted:#acbbc9;--line:#354557;
  --forest:#d0b780;--accent:#dbc38b;--soft:#263648;--soft-strong:#3a4d60;--gold:#e3bc77;
  --sidebar-bg:#0b1320;--sidebar-ink:#e4eaf5;--sidebar-muted:#b7c4d5;--red:#f2a396;
  --shadow:0 12px 36px #00000028;--field:#141f2e;--map-bg:#273a43;--ring:#d1b877;
  color-scheme:dark;
}
:root[data-theme="parchment"] {
  --paper:#f0e5d1;--panel:#fff9ed;--ink:#513b2a;--muted:#80654e;--line:#d9c6a7;
  --forest:#875238;--accent:#874b32;--soft:#f2e5ce;--soft-strong:#e3cbaa;--gold:#976b30;
  --sidebar-bg:#412c21;--sidebar-ink:#f2e3ca;--sidebar-muted:#d5bea0;--red:#a04332;
  --shadow:0 12px 36px #5e3d2512;--field:#fffdf6;--map-bg:#e1d3b5;--ring:#a66a42;
  color-scheme:light;
}
html {scroll-padding-top:24px}
body {background:var(--paper);color:var(--ink);font-size:14px;line-height:1.65}
button,input,select,textarea {font:inherit}
button,a,input,select,textarea {touch-action:manipulation}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible {outline:3px solid var(--ring);outline-offset:3px}
button:disabled {opacity:.5;cursor:not-allowed}
button {transition:background .15s,color .15s,border-color .15s}
svg {width:20px;height:20px;flex-shrink:0}
h1,h2,h3,p {overflow-wrap:anywhere}
.sidebar {background:var(--sidebar-bg);color:var(--sidebar-ink);overflow-y:auto;scrollbar-width:thin}
.brand strong,.brand small,.sidebar .brand {color:var(--sidebar-ink)}
.sidebar .nav-item,.sidebar .side-adventure strong {color:var(--sidebar-ink)}
.sidebar .side-caption,.sidebar .tiny-label,.sidebar p,.sidebar .side-help,.sidebar .side-footnote,.sidebar #side-phase,.sidebar .status-indicator {color:var(--sidebar-muted)}
.nav-item {font-size:14px;min-height:46px}
.sidebar .nav-item.active {background:#ffffff12}
.brand-icon svg {width:29px;height:38px}
.brand small {font-size:9px}
.sidebar-bottom {margin-top:auto;padding-top:22px}
.topbar {background:var(--panel);border-color:var(--line)}
.top-actions {gap:10px}
.avatar-button {background:var(--soft);color:var(--ink);border-color:var(--line)}
.breadcrumb,.connection-badge {font-size:12px}
.page-heading h1 {font-size:32px;letter-spacing:1px}
.page-heading p {font-size:14px;color:var(--muted);line-height:1.8}
.eyebrow {font-size:10px;color:var(--muted);letter-spacing:2.4px}
.muted,.small-note,.field-hint,.form-note,.source-label,.search-status {color:var(--muted)!important}
.small-note,.form-note {font-size:12px;line-height:1.85}
.field-hint {font-size:11px!important;line-height:1.8!important}
.button {font-size:13px;min-height:40px;gap:7px;border-radius:7px;text-decoration:none}
.button.small {font-size:12px;min-height:36px}
.button.primary {background:var(--forest);color:var(--panel);border-color:var(--forest)}
:root[data-theme="midnight"] .button.primary {color:#17202c}
.button.secondary {background:var(--soft-strong);border-color:var(--soft-strong);color:var(--ink)}
.button.outline {background:transparent;border-color:var(--line);color:var(--ink)}
.button:hover:not(:disabled) {filter:brightness(.96)}
.button.outline:hover,.text-button:hover {background:var(--soft)}
.text-button,.icon-button {color:var(--accent);font-size:12px}
.icon-button {width:34px;height:34px}
label {color:var(--ink);font-size:13px;line-height:1.7}
input,select,textarea {background:var(--field);color:var(--ink);border:1px solid var(--line);font-size:14px;border-radius:7px;padding:10px 12px;max-width:100%}
input,select,textarea {font-weight:400}
.nav-item:not(.active) .nav-mark {visibility:hidden}
.gm-rule-hit {display:block;width:100%;text-align:left;padding:16px 0;border-bottom:1px solid var(--line);color:var(--ink)}
.gm-rule-hit strong,.gm-rule-hit small {display:block}
.gm-rule-hit small {color:var(--muted);font-size:12px;line-height:1.8;margin-top:6px}
.gm-rule-article {white-space:pre-wrap;overflow-wrap:anywhere;font:14px/1.95 var(--sans);margin:18px 0;max-height:55vh;overflow:auto}
input::placeholder,textarea::placeholder {color:var(--muted);opacity:.8}
textarea {resize:vertical;line-height:1.9}
input[type="checkbox"] {width:16px;height:16px;accent-color:var(--accent);flex:none}
input[type="color"] {width:70px;height:40px;padding:4px}
.checkbox-label {font-size:12px!important;color:var(--muted)!important;gap:9px!important}
.entry-mode-field,label:has(#entry-mode) {display:block}
#entry-mode-field {display:grid;gap:8px}
.entry-card,.map-card,.story-card,.panel,.character-form,.search-card,.journal-entry,.empty-card,.adventure-option {background:var(--panel);border-color:var(--line);box-shadow:var(--shadow)}
.entry-card h2 {font-size:24px}
.entry-description {font-size:13px}
.entry-tab {font-size:14px;color:var(--muted)}
.entry-tab.active {color:var(--accent);border-bottom-color:var(--accent)}
.entry-adventure {background:var(--soft);border-color:var(--line)}
.entry-adventure>strong {color:var(--ink)}
.entry-adventure>span,.entry-adventure>small {color:var(--muted)}
.entry-adventure small {font-size:12px}
.welcome-grid {align-items:stretch}
.welcome-art {min-height:540px}
.welcome-art-title h2 {font-size:32px;letter-spacing:2px}
.welcome-story-bottom {background:var(--panel);font-size:12px;color:var(--muted)}
.welcome-features p,.welcome-features h3,.lobby-footer {font-size:12px}
.welcome-features p,.lobby-footer {color:var(--muted)}
.edition-chip,.count-chip,.mode-chip,.live-label,.privacy-badge {background:var(--soft);border-color:var(--line);color:var(--accent)}
.catalog-heading p,.catalog-heading .edition-chip,.adventure-tagline,.adventure-meta,.adventure-source {color:var(--muted)}
.adventure-option {border-radius:11px;padding:22px}
.adventure-option.selected {background:var(--soft);border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
.adventure-option:hover {background:var(--soft)}
.adventure-option h3 {color:var(--ink);font-size:22px}
.adventure-meta,.adventure-source {font-size:11px}
.adventure-tagline {font-size:13px}
.adventure-kind {color:var(--accent);font-size:11px}
.adventure-symbol {background:var(--soft);color:var(--accent)}
.reference-catalog,.reference-item {border-color:var(--line);color:var(--muted)}
.reference-catalog {background:var(--panel)}
.reference-catalog summary,.reference-item strong {color:var(--ink)}
.reference-item p,.reference-item span {font-size:11px;color:var(--muted)}
.table-grid {grid-template-columns:minmax(0,1fr) 300px}
.map-toolbar {height:auto;min-height:51px;flex-wrap:wrap;padding:10px 16px}
.map-toolbar strong,.map-toolbar>div {font-size:12px}
.map-hint {font-size:11px}
.section-title h2 {font-size:15px;color:var(--ink)}
.section-title>span,.section-title>svg {color:var(--accent)}
.panel {padding:22px}
#host-title {font-size:23px;color:var(--ink)}
#host-description,.mode-select-label,.mode-select-label select,#ai-status,#start-button {font-size:12px;color:var(--muted)}
#start-button {color:var(--panel)}
:root[data-theme="midnight"] #start-button {color:#17202c}
#ai-status {line-height:1.8}
#host-description {line-height:1.9}
.mode-select-label select {color:var(--ink);background:var(--field);border-color:var(--line)}
.current-scene h3 {font-size:25px;color:var(--ink)}
.current-scene p,.message-body,.message.narration .message-body {font-size:15px;color:var(--ink);line-height:1.95}
.scene-subtitle {font-size:11px;color:var(--muted)}
.scene-objective {font-size:13px;background:var(--soft);color:var(--ink);border-color:var(--accent)}
.choice-button {font-size:12px;background:var(--soft);color:var(--accent);border-color:var(--line);padding:9px 12px}
.choice-button:hover {background:var(--soft-strong)}
.message {border-color:var(--line);padding:16px 0}
.message-heading {font-size:12px}
.message-author {color:var(--ink)}
.message-time {color:var(--muted);font-size:10px}
.message-type {background:var(--soft);color:var(--muted);font-size:10px}
.message.system .message-body {font-size:12px;color:var(--muted)}
.message.whisper {background:var(--soft);border:1px dashed var(--line);padding:12px;border-radius:8px;margin:9px 0}
.message-list {max-height:440px;border-color:var(--line)}
.roll-result {background:var(--soft);border-color:var(--line);color:var(--ink)}
.roll-result strong {color:var(--accent)}
.roll-result>span svg {width:36px;height:36px}
.message-form {border-color:var(--line)}
.composer-top {flex-wrap:wrap}
.composer-top select {font-size:12px;background:var(--soft);color:var(--ink)}
#composer-hint {font-size:11px;color:var(--muted)}
.composer-row textarea {background:transparent;font-size:14px;color:var(--ink)}
.send-button {background:var(--forest);color:var(--panel)}
.member {border-color:var(--line)}
.member-name {font-size:13px;color:var(--ink)}
.member-name small,.member-detail {font-size:11px;color:var(--muted)}
.member-avatar {background:var(--soft);color:var(--accent)}
.hp-track {background:var(--line)}
.hp-fill {background:var(--accent)}
.dice-display strong,.dice-display {color:var(--accent)}
.dice-types button {font-size:12px;background:transparent;border-color:var(--line);color:var(--muted);min-height:32px}
.dice-types button.active {background:var(--soft);border-color:var(--accent);color:var(--ink)}
.dice-input-row input,.dice-input-row .button,.session-footer {font-size:12px}
.check-card,.ai-connection-status,.dm-error,.settings-intro>span {background:var(--soft);border-color:var(--line);color:var(--ink)}
.check-title strong {color:var(--ink);font-size:14px}
.check-title span,.check-tag,.check-form label {color:var(--muted)}
.check-form input,.check-form select {background:var(--field);font-size:13px}
.check-form button {font-size:12px}
.journal-entry h2,.search-card h2,.empty-card h2 {color:var(--ink)}
.journal-entry p,.search-card p,.empty-card p,.character-form label {font-size:14px;color:var(--muted)}
.journal-entry time,.search-card small {font-size:11px;color:var(--muted)}
.library-search {background:var(--panel);border-color:var(--line)}
.search-suggestions button {background:var(--soft);border-color:var(--line);color:var(--accent);font-size:12px}
.search-suggestions {flex-wrap:wrap}
.search-card:hover {background:var(--soft)}
.source-label {background:var(--soft)}
.rule-text {color:var(--ink);font-size:14px}
dialog {background:var(--panel);border-color:var(--line);color:var(--ink);padding:28px;width:min(690px,calc(100vw - 28px));max-height:88dvh}
.modal-heading {border-color:var(--line)}
.modal-body p,.modal-body ul,.modal-body ol {font-size:14px;color:var(--muted)}
.modal-heading h2 {font-size:25px}
#ai-config-form>label,.advanced-settings label {color:var(--ink);font-size:13px}
#ai-config-form input,#ai-config-form select {font-size:14px;background:var(--field)}
.settings-intro strong,.ai-connection-status strong {color:var(--ink)}
.settings-privacy {font-size:12px;color:var(--muted)}
.advanced-settings {border-color:var(--line)}
.advanced-settings summary {font-size:13px;color:var(--accent)}
.ai-connection-status p {font-size:12px}
.toast {left:50%;background:var(--sidebar-bg);color:var(--sidebar-ink);border-color:var(--line);font-size:14px;max-width:min(90vw,640px)}
.danger-button {color:var(--red)!important;margin-top:0;border-color:var(--line)!important}
hr {border:0;border-top:1px solid var(--line);margin:22px 0}
/* DM workspace */
.gm-nav {margin-top:10px;border:1px solid #ffffff20}
.gm-nav-badge {margin-left:auto;font:10px var(--sans);padding:1px 5px;border:1px solid #ffffff35;border-radius:4px}
.gm-heading-tools {display:flex;gap:9px;align-items:center;flex-wrap:wrap}
.privacy-badge {display:inline-flex;align-items:center;gap:5px;padding:4px 9px;border-radius:20px;border:1px solid var(--line);font-size:11px;white-space:nowrap;font-style:normal}
.privacy-badge svg {width:13px;height:13px}
.privacy-badge.public {background:var(--soft);color:var(--accent)}
.gm-summary {display:grid;grid-template-columns:2fr 1fr 1fr 1.3fr;background:var(--panel);border:1px solid var(--line);border-radius:12px;margin-bottom:25px;padding:22px;gap:20px}
.gm-summary>div {border-right:1px solid var(--line);padding-right:15px;min-width:0}
.gm-summary>div:last-child {border:0}
.gm-summary small {display:block;font-size:11px;color:var(--muted);margin-bottom:6px}
.gm-summary strong {display:block;font:22px var(--serif);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;color:var(--ink)}
.gm-summary strong span {font:12px var(--sans)}
.gm-tabs {display:flex;gap:6px;margin-bottom:22px;overflow:auto;padding-bottom:8px;scrollbar-width:thin}
.gm-tabs button {display:flex;align-items:center;gap:7px;padding:11px 14px;white-space:nowrap;font-size:13px;border:1px solid transparent;border-radius:7px;color:var(--muted)}
.gm-tabs button.active {background:var(--forest);color:var(--panel);box-shadow:var(--shadow)}
:root[data-theme="midnight"] .gm-tabs button.active {color:#17202c}
.gm-tabs svg {width:16px;height:16px}
.gm-two-col {display:grid;grid-template-columns:minmax(280px,.85fr) minmax(0,1.3fr);gap:22px;align-items:start}
.gm-stack {display:flex;flex-direction:column;gap:22px;min-width:0}
.gm-card {padding:25px;background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);min-width:0;margin-bottom:22px}
.gm-stack>.gm-card {margin-bottom:0}
.gm-card>h2 {font:23px/1.6 var(--serif);margin:0 0 19px;color:var(--ink)}
.gm-card form,.gm-form {display:flex;flex-direction:column;gap:15px}
.gm-card label,.gm-form label {display:flex;flex-direction:column;gap:6px}
.gm-card .checkbox-label,.gm-form .checkbox-label {flex-direction:row;align-items:center}
.gm-card form .button,.gm-form .button {align-self:flex-start}
.gm-card form[data-dirty="true"]:after {content:'有未保存的修改';font-size:11px;color:var(--gold)}
.gm-actions,.gm-title-actions {display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.gm-actions {margin-top:4px}
.gm-title-actions {justify-content:space-between;margin-bottom:18px}
.gm-title-actions .small-note {flex:1;min-width:140px}
.private-field {border:1px dashed var(--line);background:var(--soft);border-radius:8px;padding:15px}
.private-field label {color:var(--muted)}
.gm-scene-list {display:flex;flex-direction:column;gap:8px;margin-bottom:16px}
.gm-scene-item {display:flex;flex-direction:column;text-align:left;padding:13px 15px;border:1px solid var(--line);border-radius:8px;background:var(--field)}
.gm-scene-item.selected {background:var(--soft);border-left:3px solid var(--accent)}
.gm-scene-item strong {font-size:14px;color:var(--ink)}
.gm-scene-item small {font-size:11px;color:var(--muted)}
.gm-entity-list {display:flex;flex-direction:column}
.gm-entity {width:100%;display:flex;gap:12px;align-items:center;text-align:left;border-bottom:1px solid var(--line);padding:15px 0;color:var(--ink)}
.gm-entity:last-child {border-bottom:0}
.gm-entity>span:nth-last-child(2) {flex:1;min-width:0}
.gm-entity strong {font-size:14px;display:block}
.gm-entity small {font-size:11px;color:var(--muted);display:block;overflow-wrap:anywhere}
.gm-entity>span:last-child {font-size:11px;color:var(--accent)}
.entity-avatar {display:grid;place-items:center;width:40px;height:42px;flex:none!important;background:var(--soft);color:var(--entity-color,var(--accent));border:1px solid var(--line);border-radius:9px;font:20px var(--serif)}
.gm-map-preview {height:230px;background:var(--soft);border:1px solid var(--line);border-radius:9px;margin-bottom:18px;overflow:hidden;display:grid;place-items:center}
.gm-map-preview img {width:100%;height:100%;object-fit:contain}
.gm-map-preview>span {display:flex;flex-direction:column;align-items:center;gap:14px;font-size:12px;color:var(--muted);padding:20px;text-align:center}
.gm-map-preview svg {width:46px;height:46px}
.upload-button {border:1px dashed var(--accent);padding:13px;border-radius:8px;color:var(--accent);cursor:pointer;display:flex!important;flex-direction:row!important;align-items:center;justify-content:center}
.upload-button input {width:100%;font-size:11px;max-width:250px;border:0;padding:4px}
.gm-stat-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.gm-stat-grid input {min-width:0}
.gm-check-row {display:flex;justify-content:space-between;gap:12px;padding:13px 0;border-bottom:1px solid var(--line)}
.gm-check-row strong,.gm-check-row small {display:block}
.gm-check-row strong {font-size:13px}
.gm-check-row small {color:var(--muted);font-size:11px}
.gm-result-list>div {padding:12px 0;border-bottom:1px solid var(--line)}
.gm-result-list strong,.gm-result-list small {display:block;font-size:13px}
.gm-result-list small {color:var(--muted);font-size:11px}
.initiative-list {display:flex;flex-direction:column;gap:7px;margin-top:18px}
.initiative-row {display:flex;gap:12px;align-items:center;padding:12px 10px;border:1px solid var(--line);border-radius:7px}
.initiative-row.current {background:var(--soft);border-left:3px solid var(--accent)}
.initiative-row input {width:65px;padding:6px;font-size:14px}
.initiative-row>button:first-of-type {flex:1;text-align:left;min-width:0}
.initiative-row strong,.initiative-row small {display:block;color:var(--ink);font-size:13px}
.initiative-row small {font-size:11px;color:var(--muted)}
.handout-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.handout-card {text-align:left;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:var(--field);padding:0 0 18px;min-width:0}
.handout-card>img,.handout-illustration {height:140px;width:100%;object-fit:cover;background:var(--soft);display:grid;place-items:center}
.handout-illustration svg {width:36px;height:36px;color:var(--accent);opacity:.8}
.handout-card h3 {font:20px var(--serif);color:var(--ink);margin:15px 18px 8px}
.handout-card p {font-size:12px;line-height:1.8;color:var(--muted);margin:0 18px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.handout-card .privacy-badge {margin:12px 18px 0}
.handout-full-image {max-width:100%;height:auto;border-radius:9px;margin-bottom:18px}
.preserve {white-space:pre-wrap;overflow-wrap:anywhere}
.gm-dossier {border-top:1px solid var(--line);padding:15px 0}
.gm-dossier summary {font-size:14px;color:var(--accent);cursor:pointer}
.gm-dossier pre {white-space:pre-wrap;overflow-wrap:anywhere;font:14px/1.95 var(--sans);max-height:650px;overflow:auto;background:var(--soft);padding:22px;border-radius:8px;margin-top:15px}
.gm-history article {border-bottom:1px solid var(--line);padding:18px 0}
.gm-history article>div {display:flex;align-items:center;justify-content:space-between;gap:12px}
.gm-history article strong {font-size:13px}
.gm-history article p {font-size:14px;white-space:pre-wrap;color:var(--ink);line-height:1.9;margin:9px 0}
.checkpoint-list article {display:flex;gap:12px;align-items:center;padding:16px 0;border-bottom:1px solid var(--line)}
.checkpoint-list article>div {flex:1}
.checkpoint-list strong,.checkpoint-list small {display:block;font-size:13px}
.checkpoint-list small {font-size:11px;color:var(--muted)}
.empty-hint {font-size:13px;color:var(--muted);padding:22px 0;line-height:1.9}
#gm-assign-form {margin-top:20px}
/* Player-facing human DM tools */
.human-status {display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:0 0 22px;padding:14px 18px;border:1px solid var(--line);border-radius:9px;background:var(--soft);font-size:12px;color:var(--muted)}
.human-presence {display:flex;align-items:center;gap:8px}
.human-presence strong {color:var(--ink)}
.pause-badge {color:var(--gold)}
.public-initiative>div {display:flex;align-items:center;gap:10px;padding:10px 8px;border-radius:5px}
.public-initiative>div.current {background:var(--soft);border-left:3px solid var(--accent)}
.public-initiative span {min-width:24px;font:18px var(--serif);color:var(--accent)}
.public-initiative strong {font-size:12px;flex:1}
.public-initiative small {font-size:10px;color:var(--muted)}
#gm-token-target {width:auto;max-width:220px;font-size:11px;padding:6px 9px}
.adventure-map.generic-map {background:var(--map-bg)}
.adventure-map.custom-map {background:#182825}
.adventure-map.custom-map>img {display:block;visibility:visible;object-fit:contain;filter:none;opacity:1}
.adventure-map.custom-map .map-caption,.adventure-map.custom-map .map-scale {display:none}
.human-map-grid {position:absolute;inset:0;background-image:linear-gradient(to right,#788d6e38 1px,transparent 1px),linear-gradient(to bottom,#788d6e38 1px,transparent 1px);pointer-events:none}
.map-cover {position:absolute;inset:0;background:var(--soft);display:flex;align-items:center;justify-content:center;flex-direction:column;gap:12px;z-index:4;pointer-events:none;color:var(--muted)}
.map-cover svg {width:48px;height:48px}
.map-cover strong {font:23px var(--serif);color:var(--ink)}
.map-cover span {font-size:12px}
#map-tokens,#npc-tokens {position:absolute;inset:0;pointer-events:none;z-index:5}
.npc-token {border-radius:9px}
.secret-token {opacity:.65;border-style:dashed}
.map-token small {background:var(--panel);color:var(--ink);font-size:10px;border:1px solid var(--line)}
.theme-options {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.theme-option {text-align:left;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:var(--field);padding:0 0 16px}
.theme-option.selected {border-color:var(--accent);outline:1px solid var(--accent)}
.theme-swatches {display:flex;height:100px}
.theme-swatches i:first-child {flex:1.4}
.theme-swatches i {flex:1}
.theme-option strong,.theme-option small,.theme-check {display:block;margin:12px 14px 0}
.theme-option strong {font:20px var(--serif);color:var(--ink)}
.theme-option small {font-size:11px;color:var(--muted);line-height:1.7}
.theme-check {font-size:11px;color:var(--accent)}
@media(max-width:1250px) {
  .gm-two-col {grid-template-columns:minmax(240px,.9fr) minmax(0,1.2fr);gap:16px}
  .gm-card {padding:21px}
  .gm-tabs button {padding:10px;font-size:12px}
  .table-grid {grid-template-columns:minmax(0,1fr) 270px}
  .handout-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
  .initiative-row {gap:8px}
  .initiative-row .text-button {font-size:11px}
}
@media(max-width:950px) {
  .gm-two-col {grid-template-columns:1fr}
  .gm-summary {grid-template-columns:2fr 1fr;gap:18px}
  .gm-summary>div:nth-child(2) {border:0}
  .gm-heading {align-items:flex-start;gap:15px;flex-wrap:wrap}
  .table-grid {grid-template-columns:1fr}
  .session-column {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
  .session-footer {grid-column:1/-1}
  .welcome-grid {grid-template-columns:1fr}
  .welcome-art {min-height:390px}
}
@media(max-width:760px) {
  main {padding:24px 16px 100px}
  .topbar {padding:12px 16px;min-height:65px;height:auto;gap:10px}
  .top-actions {gap:6px}
  .top-actions .button {min-height:34px;padding:7px 9px;font-size:11px}
  .theme-button span {display:none}
  .topbar .breadcrumb {font-size:11px;min-width:0}
  .crumb-slash,#breadcrumb-detail {display:none}
  .primary-nav {overflow-x:auto;justify-content:space-around}
  .primary-nav .nav-item {font-size:10px;min-width:58px;min-height:62px;flex:1}
  .primary-nav .gm-nav {margin:0;border:0}
  .gm-nav-badge {display:none}
  .page-heading h1 {font-size:28px}
  .page-heading p {font-size:13px}
  .compact h1 {font-size:26px}
  .welcome-art-title h2 {font-size:27px;letter-spacing:1px}
  .welcome-art {min-height:370px}
  .entry-card {padding:22px}
  .adventure-list {grid-template-columns:repeat(2,minmax(0,1fr))}
  .adventure-option {padding:17px}
  .adventure-option h3 {font-size:21px}
  .adventure-meta,.adventure-source {font-size:10px}
  .current-scene h3 {font-size:23px}
  .current-scene p,.message-body,.message.narration .message-body {font-size:14px}
  .session-column {display:flex}
  .gm-heading-tools {gap:7px}
  .gm-heading-tools .button {font-size:12px}
  .gm-summary {padding:18px;margin-bottom:18px}
  .gm-summary strong {font-size:19px}
  .gm-tabs {position:sticky;top:0;z-index:10;background:var(--paper);padding:8px 0 12px;margin-bottom:10px}
  .gm-tabs button {font-size:12px;padding:9px 10px}
  .gm-card {padding:20px;border-radius:10px}
  .gm-card>h2 {font-size:22px}
  .gm-two-col,.gm-stack {gap:17px}
  .gm-actions .button {font-size:12px;min-height:42px}
  .gm-stat-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
  .handout-grid {gap:12px}
  .handout-card h3 {font-size:18px;margin:12px}
  .handout-card p {margin:0 12px}
  .theme-options {grid-template-columns:1fr}
  .theme-option {display:grid;grid-template-columns:90px 1fr;grid-template-rows:auto auto auto;padding:0}
  .theme-swatches {grid-row:1/4;height:125px}
  .theme-option strong {font-size:22px}
  .theme-option small {margin-top:2px}
  .theme-check {margin-top:5px;margin-bottom:13px}
  dialog {padding:23px 20px;max-height:88dvh}
  .human-status {padding:13px 15px;gap:7px}
  .human-status>span:nth-child(2) {width:100%;order:3}
  .map-toolbar {gap:8px}
  #gm-token-target {max-width:100%;width:100%}
  .map-caption strong {font-size:17px}
  .map-token {width:28px;height:28px}
  .map-token small {top:32px;font-size:9px}
  .check-form {grid-template-columns:1fr 1fr}
  .check-form button {grid-column:1/-1;min-height:40px}
  .privacy-badge {font-size:10px}
}
@media(max-width:420px) {
  .adventure-list {grid-template-columns:1fr}
  .top-actions .avatar-button {display:none}
  .gm-summary {gap:16px 8px}
  .gm-summary>div {padding-right:8px}
  .gm-summary strong {font-size:17px}
  .handout-grid {grid-template-columns:1fr}
  .form-row {flex-wrap:wrap}
  .form-row>label {flex-basis:130px}
}
@media(prefers-reduced-motion:reduce) {
  *,*:before,*:after {animation:none!important;transition:none!important;scroll-behavior:auto!important}
}

