/* Light parchment needs ink colors even on screens originally built for dark mode. */
body[data-world-theme="western"] {
  --theme-text-min-opacity:.85;
  --muted:#59412c;
}
body[data-world-theme][data-world-theme="western"] .nav-section-label {
  color:#c5aa81;
}
body[data-world-theme][data-world-theme="western"] .ttrpg-shell {
  background:linear-gradient(#f0dab1eb,#ecd4a9eb),var(--paper) center/720px auto #edd8af;
  color:var(--text);
  margin:20px;
  border:1px solid var(--line);
  min-width:0;
}
body[data-world-theme][data-world-theme="western"] :is(
  .ttrpg-hero,.ttrpg-card,.ttrpg-metric,.ttrpg-meta-card,.ttrpg-tabs,
  .ttrpg-row,.ttrpg-note,.ttrpg-panel-note,.ttrpg-mini-item,.ttrpg-feature-item,
  .ttrpg-detail-card,.ttrpg-showcase-frame,.ttrpg-showcase-stat,
  .ttrpg-showcase-rule-card,.ttrpg-stat-card,.ttrpg-review-card,
  .ttrpg-option-card,.ttrpg-selector-card,.ttrpg-source-option,.ttrpg-source-tile
) {
  background:var(--bg2);
  color:var(--text);
  border-color:var(--line);
  box-shadow:0 3px 10px #37201112;
}
body[data-world-theme][data-world-theme="western"] :is(
  .ttrpg-highlight,.ttrpg-highlight strong,.ttrpg-tab.active,.ttrpg-step.is-active,
  .ttrpg-option-crest,.ttrpg-avatar,.ttrpg-ability-mod,.ttrpg-showcase-conditional strong,
  .ttrpg-selector-thumb-fallback
) {color:var(--text);}
body[data-world-theme][data-world-theme="western"] :is(
  .ttrpg-highlight,.ttrpg-tab.active,.ttrpg-step.is-active,.ttrpg-option-card.selected,
  .ttrpg-selector-card.active,.ttrpg-source-tile.active,.ttrpg-option-crest,.ttrpg-avatar
) {background:var(--card2);border-color:var(--accent);}
/* Portrait captions sit on a dark overlay, unlike the surrounding paper. */
body[data-world-theme][data-world-theme="western"] .ttrpg-showcase-overlay {
  --text:#fff0cd;--text-rgb:255,240,205;
  color:var(--text);
  background:linear-gradient(transparent,#21170ef5 25%);
  padding-top:40px;
}
body[data-world-theme][data-world-theme="western"] :is(.cat-add-btn,.cat-tree-row.active,.cat-tree-row.selected,.cat-tree-count) {
  color:var(--text);
}
body[data-world-theme][data-world-theme="western"] .session-chip.is-active {
  color:#304320;background:#e1e6c4;border-color:#667642;
}
/* Keep health numbers legible without changing the colored health bar. */
body[data-world-theme][data-world-theme="western"] .char-stat-pill.hp-pill :is(.hp-value-main,.hp-value-max) {
  color:var(--text);
}
body[data-world-theme][data-world-theme="western"] :is(.lib-char-dropdown,.lib-char-group-label,.entity-create-modal) {
  background:var(--bg2);color:var(--text);border-color:var(--line);
}
body[data-world-theme][data-world-theme="western"] #storyPreview strong {color:var(--text);}
body[data-world-theme][data-world-theme="western"] :is(.lib-pill.active,.lib-view-btn.active,.lib-length-btn.active,.lib-filter-chip.active) {
  background:var(--card2);color:var(--text);border-color:var(--accent);
}
body[data-world-theme][data-world-theme="western"] :is(.entity-mention,.entity-badge) {
  color:var(--accent);border-color:var(--line);
}
body[data-world-theme][data-world-theme="western"] :is(.lib-icon,.lib-char-type-icon) {
  filter:brightness(.3);opacity:1;
}
/* Clean, quiet paper behind the book covers and controls. */
body[data-world-theme][data-world-theme="western"] .storyteller-page .lib-browser {
  background:#f0ddb9;border:1px solid #967044;border-image:none;
  box-shadow:0 4px 12px #37201118;border-radius:4px;
}
body[data-world-theme][data-world-theme="western"] .storyteller-page .book-tile {
  background:#f7e8cb;border:1px solid #b89a70;
  box-shadow:0 3px 8px #37201114;border-radius:4px;
}
body[data-world-theme][data-world-theme="western"] .book-tile .book-tile-actions .btn {
  font-size:13px;min-height:44px;padding:10px 8px;line-height:1.3;
}
body[data-world-theme][data-world-theme="western"] .shelf-progress {
  color:var(--muted);
}
body[data-world-theme][data-world-theme="western"] .shelf-progress progress {
  accent-color:var(--accent);
}
body[data-world-theme][data-world-theme="western"] .shelf-progress progress::-webkit-progress-bar {
  background:#dfc69a;border-radius:10px;
}
body[data-world-theme][data-world-theme="western"] .shelf-progress progress::-webkit-progress-value {
  background:var(--accent);border-radius:10px;
}
body[data-world-theme][data-world-theme="western"] .shelf-progress progress::-moz-progress-bar {
  background:var(--accent);border-radius:10px;
}
body[data-world-theme][data-world-theme="western"] .storyteller-page :is(a,button,input,select):focus-visible {
  outline:3px solid var(--accent);outline-offset:3px;
}
@media(max-width:700px) {
  body[data-world-theme][data-world-theme="western"] .ttrpg-shell {margin:10px;padding:12px;}
}

body[data-world-theme][data-world-theme="western"] :is(.ed-relation-type,.ed-content .mention-link,.mention-option-type,.ed-hover-preview-type,.inv-slots-badge,.btm-status[data-state="running"],.char-tab.active,.ed-thumb-add) {color:var(--text);}
body[data-world-theme][data-world-theme="western"] :is(.char-level-badge,.btm-status[data-state="done"]) {color:#304320;background:#e1e6c4;border-color:#667642;}
body[data-world-theme][data-world-theme="western"] :is(.ed-relation-delete,.ed-tag-remove,.char-cond-remove,.btm-status[data-state="error"],.btm-error) {color:#702719;}
/* This legacy delete button declares its pale red inline. */
body[data-world-theme][data-world-theme="western"] .ed-topbar button[onclick="confirmDelete()"] {color:#702719!important;}

body[data-world-theme][data-world-theme="western"] #charTabBar .char-tab.active {color:var(--text);}
body[data-world-theme][data-world-theme="western"] .entity-modal-type {color:var(--text)!important;background:var(--card2)!important;}

/* Keep user-selected category colors as an accent, with readable label ink. */
body[data-world-theme][data-world-theme="western"] .cat-node-label.with-color {
 -webkit-text-fill-color:var(--text);border-inline-start:3px solid currentColor;padding-inline-start:8px;
}

/* The map canvas stays unchanged; its editor chrome uses readable paper. */
body[data-world-theme][data-world-theme="western"] .map-page-top {
 background:var(--bg2);border:1px solid var(--line);padding:14px;align-items:center;
}
body[data-world-theme][data-world-theme="western"] :is(.map-panel-head,.map-panel .panel-tabs,.map-panel .entry-ref-results) {
 background:var(--bg2);color:var(--text);border-color:var(--line);
}
body[data-world-theme][data-world-theme="western"] :is(.tb-field label,.tb-val,.tb-tool-label,.tb-filter-check span,.map-panel .panel-tab,.map-panel .insp-header,.map-panel .insp-row>label,.map-panel .panel-list-header) {
 color:var(--text);font-size:12px;
}
body[data-world-theme][data-world-theme="western"] :is(.map-panel .insp-empty-text,.map-panel .insp-empty-hint,.map-panel .mg-list-sub) {color:var(--muted);opacity:1;}
body[data-world-theme][data-world-theme="western"] :is(.map-panel .panel-tab.active,.map-toolbar .tb-btn.active) {
 color:var(--text);background:var(--card2);border-color:var(--accent);
}
body[data-world-theme][data-world-theme="western"] .map-page .btn-danger {color:#702719;background:#efd0b8;border-color:#a16651;}

body[data-world-theme][data-world-theme="western"] :is(.leaflet-popup-content-wrapper,.leaflet-popup-tip) {background:var(--bg2);color:var(--text);border-color:var(--line);}
body[data-world-theme][data-world-theme="western"] .leaflet-control-zoom a span {color:var(--text);}
/* Leaflet's base dark controls use important declarations. */
body[data-world-theme][data-world-theme="western"] .leaflet-control-zoom a {background:var(--bg2)!important;color:var(--text)!important;border-color:var(--line)!important;}
body[data-world-theme][data-world-theme="western"] .leaflet-control-zoom a:hover {background:var(--card2)!important;}
