/* ==========================================================================
   LoreBox — ночная тема
   Включается атрибутом <html data-theme="dark"> (кнопка в боковом меню, см. theme.js).
   Светлую тему здесь не трогаем: файл только переопределяет цвета.
   Блок «Автогенерация» собран скриптом из style.css (серые переворачиваются, цветные остаются),
   дальше — ручные правки по макетам.
   ========================================================================== */

/* Кнопка переключения темы в боковом меню (работает в обеих темах) */
.sidebar-theme { width: 100%; border: 0; background: none; text-align: left; font-family: inherit; cursor: pointer; }
.sidebar-theme .theme-icon-sun { display: none; }
html[data-theme="dark"] .sidebar-theme .theme-icon-sun { display: block; }
html[data-theme="dark"] .sidebar-theme .theme-icon-moon { display: none; }

/* Картинки с двумя версиями: светлая и ночная */
.is-dark { display: none; }
html[data-theme="dark"] .is-dark { display: block; }
html[data-theme="dark"] .is-light { display: none; }

/* ============ Токены ============ */
html[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #282826;
  --ink: #f5f5f5;
  --ink-muted: #a9a9a7;
  --ink-faint: #7b7b79;
  --sidebar-bg: #42423f;
  --card-bg: #363633;
  --tile-bg: #282826;
  --dark-bg: #363633;
  --dark-btn: #282826;
  --sheet-text: #d4d4d2;
  --sheet-card: #282826;
}

/* ============ Автогенерация ============ */
html[data-theme="dark"] .login-card { background: rgba(40, 40, 38, 0.8); }
html[data-theme="dark"] .login-submit { color: #282826; }
html[data-theme="dark"] .login-submit:hover { background: #282826; color: #f5f5f5; }
html[data-theme="dark"] .dashboard-quote { color: #dcdcda; }
html[data-theme="dark"] .session-tile small { color: #dcdcda; }
html[data-theme="dark"] .widget-empty { color: #bebebc; }
html[data-theme="dark"] .player-name { color: #ececea; }
html[data-theme="dark"] .dice-buttons button:hover:not(.is-active) { background: #373734; }
html[data-theme="dark"] .activity-list time { color: #cbcbc9; }
html[data-theme="dark"] .notes-list:empty::before,
html[data-theme="dark"] .memo-list:empty::before { color: #a7a7a5; }
html[data-theme="dark"] .notes-format button { background: #2c2c2a; }
html[data-theme="dark"] .notes-editor textarea::placeholder { color: #828280; }
html[data-theme="dark"] .notes-add { color: #282826; }
html[data-theme="dark"] .next-campaign { color: #848482; }
html[data-theme="dark"] .next-actions button { color: #343432; }
html[data-theme="dark"] .next-actions button:hover { background: #282826; }
html[data-theme="dark"] .next-none { color: #5b5b59; }
html[data-theme="dark"] .memo-new input::placeholder { color: #828280; }
html[data-theme="dark"] .memo-new button { color: #282826; }
html[data-theme="dark"] .hero-info small { color: #dcdcda; }
html[data-theme="dark"] .profile-random { color: #282826; }
html[data-theme="dark"] .profile-random:hover { background: #282826; }
html[data-theme="dark"] .profile-hint { color: #cbcbc9; }
html[data-theme="dark"] .profile-save { color: #282826; }
html[data-theme="dark"] .profile-save:hover { background: #282826; }
html[data-theme="dark"] .sheet-window { --accent-soft: color-mix(in srgb, var(--accent) 68%, #2c2c2a); --accent-line: color-mix(in srgb, var(--accent) 60%, #474745); --sheet-text: #dfdfdd; --sheet-card: #2c2c2a; background: #363634; }
html[data-theme="dark"] .sheet-close, html[data-theme="dark"] .sheet-theme { background: #363634; color: #eeeeec; }
html[data-theme="dark"] .sheet-close:hover, html[data-theme="dark"] .sheet-theme:hover { background: #282826; }
html[data-theme="dark"] .sheet-theme .theme-icon-sun { display: block; }
html[data-theme="dark"] .sheet-theme .theme-icon-moon { display: none; }
html[data-theme="dark"] .sheet-portrait { background: #dfdfdd; }
html[data-theme="dark"] .sheet-level { border: 0.3rem solid #41413f; background: #363634; }
html[data-theme="dark"] .sheet-xp-bar { background: #30302e; }
html[data-theme="dark"] .sheet-hp-head em { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .sheet-hp-head small { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .sheet-hp-bar { background: #30302e; }
html[data-theme="dark"] .sheet-hp-controls input { background: #424240; }
html[data-theme="dark"] .sheet-score { background: #424240; }
html[data-theme="dark"] .sheet-mod { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .sheet-ability li.is-save { border-bottom: 0.2rem solid #535351; }
html[data-theme="dark"] .sheet-tabs button { color: #efefed; }
html[data-theme="dark"] .sheet-tabs button:hover { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .sheet-tabs button.is-active { background: #282826; color: #f5f5f3; }
html[data-theme="dark"] .sheet-attacks { background: #282826; }
html[data-theme="dark"] .sheet-attacks-body { scrollbar-color: #4c4c4a transparent; }
html[data-theme="dark"] .sheet-attacks-body::-webkit-scrollbar-thumb { background: #2c2c2a; }
html[data-theme="dark"] .sheet-attack-name b { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .sheet-cond-pop { border: 0.1rem solid #50504e; background: #262624; }
html[data-theme="dark"] #panel-view .sheet-empty-pad { background: #282826; }
html[data-theme="dark"] .sheet-card { background: #282826; }
html[data-theme="dark"] .sheet-card-text b { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .sheet-detail { background: #282826; }
html[data-theme="dark"] .sheet-detail h3 { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .sheet-glyph { background: color-mix(in srgb, var(--accent) 50%, #ffd8cc); }
html[data-theme="dark"] .sheet-detail-text { color: #efefed; }
html[data-theme="dark"] .sheet-detail-text strong { color: #f5f5f3; }
html[data-theme="dark"] .sheet-info-btn { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .sheet-info-pop { border: 0.1rem solid #50504e; background: #262624; }
html[data-theme="dark"] .ed-suggest { border: 0.1rem solid #50504e; background: #262624; }
html[data-theme="dark"] .ed-suggest button { color: #f5f5f3; }
html[data-theme="dark"] .ed-suggest button:hover { background: #2c2c2a; }
html[data-theme="dark"] .ed-suggest small { color: #cacac8; }
html[data-theme="dark"] .sheet-use:disabled { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .sheet-form { background: #282826; }
html[data-theme="dark"] .sheet-form-art { background: #363634; }
html[data-theme="dark"] .sheet-form-main h3 { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .sheet-form-stats div { background: #2c2c2a; }
html[data-theme="dark"] .sheet-form-features { color: #efefed; }
html[data-theme="dark"] .sheet-form-features b { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .sheet-form-go.is-on { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .sheet-item { background: #282826; }
html[data-theme="dark"] .sheet-item b { color: #efefed; }
html[data-theme="dark"] .sheet-item-remove { background: #363634; color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .sheet-item.is-add { background: #2c2c2a; color: #eeeeec; }
html[data-theme="dark"] .sheet-item.is-add:hover { background: #2c2c2a; }
html[data-theme="dark"] .sheet-item.is-adding input { background: #242422; }
html[data-theme="dark"] .sheet-box { background: #282826; }
html[data-theme="dark"] .sheet-box h3 { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .sheet-coin { background: #363634; }
html[data-theme="dark"] .sheet-coin input { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .sheet-box dl div { border-bottom: 0.1rem solid #474745; }
html[data-theme="dark"] .sheet-box dt { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .sheet-box dd { color: #efefed; }
html[data-theme="dark"] .sheet-story { background: #282826; }
html[data-theme="dark"] .sheet-story h3 { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .sheet-story p { color: #efefed; }
html[data-theme="dark"] .sheet-compose { background: #282826; }
html[data-theme="dark"] .sheet-compose h3 { color: #e4e4e2; }
html[data-theme="dark"] .sheet-compose select { background: #363634; color: #efefed; }
html[data-theme="dark"] .sheet-compose textarea { background: #363634; color: #efefed; }
html[data-theme="dark"] .sheet-compose textarea::placeholder,
html[data-theme="dark"] .sheet-journal-filter input::placeholder { color: #a3a3a1; }
html[data-theme="dark"] .sheet-pills button { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .sheet-journal-filter input { background: #2c2c2a; color: #efefed; }
html[data-theme="dark"] .sheet-tag-filter button { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .sheet-day h3 { color: #efefed; }
html[data-theme="dark"] .sheet-entry { background: #2c2c2a; }
html[data-theme="dark"] .sheet-entry-body p { color: #efefed; }
html[data-theme="dark"] .sheet-entry-tools button { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .sheet-modal-card { background: #363634; }
html[data-theme="dark"] .sheet-rest-pick button { background: #2c2c2a; }
html[data-theme="dark"] .sheet-rest-pick input { background: #282826; }
html[data-theme="dark"] .sheet-modal-actions button { background: #2c2c2a; }
html[data-theme="dark"] .is-edit input:focus,
html[data-theme="dark"] .is-edit textarea:focus,
html[data-theme="dark"] .is-edit select:focus { background: #242422; }
html[data-theme="dark"] .is-edit input::placeholder,
html[data-theme="dark"] .is-edit textarea::placeholder { color: #929290; }
html[data-theme="dark"] .ed-x { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .ed-add { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .is-edit .ed-hp { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .is-edit .sheet-tile input { background: rgba(40, 40, 38, 0.14); }
html[data-theme="dark"] .is-edit .sheet-tile input:hover { background: rgba(40, 40, 38, 0.24); }
html[data-theme="dark"] .is-edit .sheet-tile input:focus { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .is-edit .ed-score { background: #424240; }
html[data-theme="dark"] .is-edit .ed-mod { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .is-edit .ed-attack .sheet-attack-name input { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .is-edit .ed-attack .sheet-attack-bonus input:focus { background: #242422; color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .ed-switch i { background: #424240; }
html[data-theme="dark"] .ed-switch i::after { background: #242422; }
html[data-theme="dark"] .sheet-card.is-add { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .ed-detail h3 input { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .ed-format button { background: #2c2c2a; color: #f5f5f3; }
html[data-theme="dark"] .is-edit .ed-form h3 input { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .is-edit .sheet-form-tiles input { background: rgba(40, 40, 38, 0.14); }
html[data-theme="dark"] .is-edit .sheet-form-tiles input:focus { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .is-edit .sheet-form-attack .sheet-attack-name input { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .is-edit .sheet-coin input { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .is-edit .sheet-box dt input { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .is-edit .ed-story h3 input { color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .is-edit .sheet-tile small input { background: rgba(40, 40, 38, 0.12); }
html[data-theme="dark"] .is-edit .sheet-tile small input:hover { background: rgba(40, 40, 38, 0.22); }
html[data-theme="dark"] .is-edit .sheet-tile small input:focus { background: #242422; color: color-mix(in srgb, var(--accent) 52%, #ffd8cc); }
html[data-theme="dark"] .emoji-picker { background: #282826; color: #efefed; }
html[data-theme="dark"] .emoji-tabs button { background: #363634; }
html[data-theme="dark"] .emoji-tabs button:hover { background: #2c2c2a; }
html[data-theme="dark"] .emoji-tabs button.is-active { background: #242422; }
html[data-theme="dark"] .emoji-title { color: #c2c2c0; }
html[data-theme="dark"] .emoji-grid button:hover { background: #363634; }
html[data-theme="dark"] .emoji-foot { border-top: 0.1rem solid #474745; }
html[data-theme="dark"] .emoji-foot input { background: #363634; }
html[data-theme="dark"] .emoji-foot input:focus { background: #242422; }
html[data-theme="dark"] .emoji-foot button[data-auto] { background: #2c2c2a; color: #efefed; }
html[data-theme="dark"] .chars-new { color: #282826; }
html[data-theme="dark"] .chars-note { color: #dcdcda; }
html[data-theme="dark"] .chars-controls input::placeholder { color: #929290; }
html[data-theme="dark"] .chars-sort button.is-on { color: #282826; }
html[data-theme="dark"] .hero-owner { color: #a3a3a1; }
html[data-theme="dark"] .char-delete button { color: #a3a3a1; }
html[data-theme="dark"] .chars-empty { color: #a3a3a1; }
html[data-theme="dark"] .chars-party.is-on { color: #282826; }
html[data-theme="dark"] .acc-seen { background: #2c2c2a; color: #bbbbb9; }
html[data-theme="dark"] .acc-chip { color: #a3a3a1; }
html[data-theme="dark"] .acc-chip.is-admin { color: #282826; }
html[data-theme="dark"] .acc-chip.is-empty { color: #878785; }
html[data-theme="dark"] .acc-close:hover { background: #242422; }
html[data-theme="dark"] .acc-label { color: #a3a3a1; }
html[data-theme="dark"] .acc-input::placeholder { color: #878785; }
html[data-theme="dark"] .acc-nochars { color: #a3a3a1; }
html[data-theme="dark"] .acc-char-main small { color: #cbcbc9; }
html[data-theme="dark"] .acc-party-form input { background: #242422; }
html[data-theme="dark"] .acc-btn.is-dark { color: #282826; }
html[data-theme="dark"] .acc-pick small { color: #a3a3a1; }
html[data-theme="dark"] .acc-pick p { color: #a3a3a1; }
html[data-theme="dark"] .acc-body hr { background: #4a4a48; }
html[data-theme="dark"] .acc-self { color: #a3a3a1; }
html[data-theme="dark"] .acc-modal-card label { color: #c8c8c6; }
html[data-theme="dark"] .acc-modal-card small { color: #929290; }
html[data-theme="dark"] .dm-btn.is-dark { color: #282826; }
html[data-theme="dark"] .dm-btn.is-line:hover { background: #242422; }
html[data-theme="dark"] .chars-sort a.is-on { color: #282826; }
html[data-theme="dark"] .dm-badge.is-done { background: #4d4d4b; }
html[data-theme="dark"] .dm-badge.is-planned { color: #cbcbc9; }
html[data-theme="dark"] .dm-world { color: #f3f3f1; }
html[data-theme="dark"] .dm-bars i { background: #4c4c4a; }
html[data-theme="dark"] .dm-caption { color: #a3a3a1; }
html[data-theme="dark"] .dm-ava.is-more { color: #cbcbc9; }
html[data-theme="dark"] .dm-crumbs { color: #a3a3a1; }
html[data-theme="dark"] .dm-crumbs a { color: #a3a3a1; }
html[data-theme="dark"] .dm-label { color: #a3a3a1; }
html[data-theme="dark"] .dm-in::placeholder,
html[data-theme="dark"] .dm-ta::placeholder { color: #878785; }
html[data-theme="dark"] .dm-field.is-dark .dm-ta { color: #282826; }
html[data-theme="dark"] .dm-field.is-dark .dm-ta::placeholder { color: #777775; }
html[data-theme="dark"] .dm-tb button { background: #2c2c2a; }
html[data-theme="dark"] .dm-tb button:hover { background: #424240; }
html[data-theme="dark"] .dm-empty { color: #a3a3a1; }
html[data-theme="dark"] .dm-hint { color: #a3a3a1; }
html[data-theme="dark"] .dm-swatches.is-inline .dm-swatch { background: color-mix(in srgb, var(--c) 30%, #282826); }
html[data-theme="dark"] .dm-chip.is-done { background: #40403e; color: #a3a3a1; }
html[data-theme="dark"] .dm-char-main small { color: #cbcbc9; }
html[data-theme="dark"] .dm-party-main small { color: #a3a3a1; }
html[data-theme="dark"] .dm-add { border: 0.1rem dashed #868684; }
html[data-theme="dark"] .dm-add:hover { background: rgba(40, 40, 38, 0.6); }
html[data-theme="dark"] .dm-side-name { color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .dm-tab.is-on { color: #282826; }
html[data-theme="dark"] .dm-panel-head small { color: #a3a3a1; }
html[data-theme="dark"] .dm-tag { color: #dcdcda; }
html[data-theme="dark"] .dm-tag:hover { background: #242422; }
html[data-theme="dark"] .dm-tag.is-on { color: #282826; }
html[data-theme="dark"] .dm-foot { border-top: 0.1rem solid #4d4d4b; }
html[data-theme="dark"] .dm-pc-main small { color: #cbcbc9; }
html[data-theme="dark"] .dm-pc-main em { color: #a3a3a1; }
html[data-theme="dark"] .dm-pc-tools a { color: #a3a3a1; }
html[data-theme="dark"] .dm-ib { color: #dcdcda; }
html[data-theme="dark"] .dm-handle { color: #929290; }
html[data-theme="dark"] .dm-in.is-bare:hover { background: rgba(40, 40, 38, 0.5); }
html[data-theme="dark"] .dm-block .dm-in,
html[data-theme="dark"] .dm-block .dm-ta { background: #242422; }
html[data-theme="dark"] .dm-block-title { color: #dcdcda; }
html[data-theme="dark"] .dm-block.is-text { background: #2c2c2a; }
html[data-theme="dark"] .dm-block.is-text .dm-block-head .dm-label { color: #cbcbc9; }
html[data-theme="dark"] .dm-block.is-text .dm-tb button { background: #363634; }
html[data-theme="dark"] .dm-block.is-highlight { background: color-mix(in srgb, var(--c) 22%, #282826); }
html[data-theme="dark"] .dm-block.is-highlight .dm-ta { background: rgba(40, 40, 38, 0.55); }
html[data-theme="dark"] .dm-block.is-note { background: #dededc; }
html[data-theme="dark"] .dm-block.is-note .dm-block-title,
html[data-theme="dark"] .dm-block.is-note .dm-ib { color: #5a5a58; }
html[data-theme="dark"] .dm-block.is-note .dm-ta { background: #282826; color: #282826; }
html[data-theme="dark"] .dm-block.is-note .dm-ta::placeholder { color: #878785; }
html[data-theme="dark"] .dm-block.is-note .dm-tb button { background: #282826; color: #282826; }
html[data-theme="dark"] .dm-block.is-hidden { background: repeating-linear-gradient(135deg, #282826 0 0.7rem, #f2e0e3 0.7rem 1.4rem); }
html[data-theme="dark"] .dm-hidden-top .dm-in { background: rgba(40, 40, 38, 0.7); }
html[data-theme="dark"] .dm-block.is-hidden .dm-block { background: rgba(40, 40, 38, 0.6); }
html[data-theme="dark"] .dm-drop { border: 0.1rem dashed #868684; }
html[data-theme="dark"] .dm-drop:hover { background: rgba(40, 40, 38, 0.6); }
html[data-theme="dark"] .dm-pill:hover { background: #242422; }
html[data-theme="dark"] .dm-addblock { border: 0.1rem dashed #959593; color: #cbcbc9; }
html[data-theme="dark"] .dm-addblock:hover { background: rgba(40, 40, 38, 0.6); }
html[data-theme="dark"] .dm-npc-head .is-role { color: #bebebc; }
html[data-theme="dark"] .dm-portrait { border: 0.1rem dashed #868684; }
html[data-theme="dark"] .dm-portrait:hover { background: rgba(40, 40, 38, 0.6); }
html[data-theme="dark"] .dm-stat-head .dm-ib:hover:not(:disabled) { background: rgba(40, 40, 38, 0.18); }
html[data-theme="dark"] .dm-stat-names .dm-in:hover { background: rgba(40, 40, 38, 0.14); }
html[data-theme="dark"] .dm-stat-names .dm-in:focus { background: rgba(40, 40, 38, 0.22); }
html[data-theme="dark"] .dm-stat-body .dm-in,
html[data-theme="dark"] .dm-stat-body .dm-ta { background: #242422; }
html[data-theme="dark"] .dm-diff .dm-chip { background: #353533; }
html[data-theme="dark"] .dm-stat small { color: #dcdcda; }
html[data-theme="dark"] .dm-actions-title { color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .dm-block.is-check { background: color-mix(in srgb, var(--ck) 9%, #282826); }
html[data-theme="dark"] .dm-block.is-check [data-bind$=".skill"],
html[data-theme="dark"] .dm-block.is-check [data-bind$=".ability"] { color: color-mix(in srgb, var(--ck) 52%, #f0f0ee); }
html[data-theme="dark"] .dm-block.is-check .dm-in { background: rgba(40, 40, 38, 0.75); }
html[data-theme="dark"] .dm-spill.is-on { color: #282826; }
html[data-theme="dark"] .dm-block.is-hidden { border: 0.1rem dashed #60605e; }
html[data-theme="dark"] .dm-hpill { background: #242422; }
html[data-theme="dark"] .dm-hpill:hover { background: #282826; }
html[data-theme="dark"] .dm-hpill.is-on { color: #282826; }
html[data-theme="dark"] .dm-hidden-view { background: rgba(40, 40, 38, 0.55); }
html[data-theme="dark"] .dm-golink { color: #282826; }
html[data-theme="dark"] .dm-npcw-text small,
html[data-theme="dark"] .dm-statw small { color: #cbcbc9; }
html[data-theme="dark"] .dm-statw span { color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .dm-modal-card { background: #282826; }
html[data-theme="dark"] .dm-dossier-title p { color: #cbcbc9; }
html[data-theme="dark"] .dm-dossier-body h4 { color: #a3a3a1; }
html[data-theme="dark"] .dm-r-text { background: #282826; }
html[data-theme="dark"] .dm-r-hl { background: color-mix(in srgb, var(--c) 24%, #282826); }
html[data-theme="dark"] .dm-r-note { background: #dfdfdd; color: #3c3c3a; }
html[data-theme="dark"] .dm-r-quote { background: #282826; }
html[data-theme="dark"] .dm-r-quote cite { color: #cbcbc9; }
html[data-theme="dark"] .dm-r-check { background: color-mix(in srgb, var(--ck) 22%, #282826); }
html[data-theme="dark"] .dm-r-check-head b { color: color-mix(in srgb, var(--ck) 52%, #f0f0ee); }
html[data-theme="dark"] .dm-r-check-head span { background: #282826; }
html[data-theme="dark"] .dm-r-out { background: #282826; }
html[data-theme="dark"] .dm-r-out b { color: color-mix(in srgb, var(--ck) 52%, #f0f0ee); }
html[data-theme="dark"] .dm-r-go { background: #dfdfdd; color: #282826; }
html[data-theme="dark"] .dm-r-go:hover { background: #282826; }
html[data-theme="dark"] .dm-r-map img { background: #242422; }
html[data-theme="dark"] .dm-r-map figcaption,
html[data-theme="dark"] .dm-r-image figcaption { color: #cbcbc9; }
html[data-theme="dark"] .dm-hpill { background: #282826; }
html[data-theme="dark"] .dm-hpill:hover { background: #242422; }
html[data-theme="dark"] .dm-hpill.is-on { color: #282826; }
html[data-theme="dark"] .dm-sv { background: #363634; }
html[data-theme="dark"] .dm-sv-badge { background: rgba(40, 40, 38, 0.28); }
html[data-theme="dark"] .dm-sv-box small { color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .dm-sv-box b { color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .dm-sv-mod { background: #282826; color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .dm-sv-rowlabel { color: #7c7c7a; }
html[data-theme="dark"] .dm-sv-save { color: #7c7c7a; }
html[data-theme="dark"] .dm-sv-val { background: #282826; }
html[data-theme="dark"] .dm-sv-title-act { color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .dk-btn.is-dark { color: #282826; }
html[data-theme="dark"] .dk-btn.is-gray { background: #4a4a48; color: #282826; }
html[data-theme="dark"] .dk-hint { color: #a3a3a1; }
html[data-theme="dark"] .dk-crumbs { color: #c4c4c2; }
html[data-theme="dark"] .dk-pc:hover { background: #242422; }
html[data-theme="dark"] .dk-pc-main small { color: #cbcbc9; }
html[data-theme="dark"] .dk-bar { background: #2c2c2a; }
html[data-theme="dark"] .dk-scene-title p { color: #ececea; }
html[data-theme="dark"] .dk-scroll { scrollbar-color: #636361 transparent; }
html[data-theme="dark"] .dk-pic img { background: #242422; }
html[data-theme="dark"] .dk-pic figcaption { color: #cbcbc9; }
html[data-theme="dark"] .dk-combat { background: rgba(40, 40, 38, 0.5); }
html[data-theme="dark"] .dk-init,
html[data-theme="dark"] .dk-amt { background: #242422; }
html[data-theme="dark"] .dk-name small { color: #dcdcda; }
html[data-theme="dark"] .dk-hp-nums em { color: #dcdcda; }
html[data-theme="dark"] .dk-hp-nums > span { color: #dcdcda; }
html[data-theme="dark"] .dk-hpmax { color: #dcdcda; }
html[data-theme="dark"] .dk-hpnow:hover,
html[data-theme="dark"] .dk-hpmax:hover { background: rgba(40, 40, 38, 0.6); }
html[data-theme="dark"] .dk-hp .dk-bar { background: rgba(40, 40, 38, 0.55); }
html[data-theme="dark"] .dk-map-head { border-bottom: 0.1rem solid #797977; }
html[data-theme="dark"] .dk-map-scenes button:hover { background: #242422; }
html[data-theme="dark"] .dk-mapbox img { border: 0.4rem solid #797977; }
html[data-theme="dark"] .dk-token { border: 0.3rem solid #3e3e3c; }
html[data-theme="dark"] .dk-mpanel.is-chars { background: #2c2c2a; }
html[data-theme="dark"] .dk-mrow small { color: #a3a3a1; }
html[data-theme="dark"] .dk-madd:hover { color: #282826; }
html[data-theme="dark"] .dk-hbtn:hover { color: #282826; }
html[data-theme="dark"] .dk-paused { color: #282826; }
html[data-theme="dark"] .dk-pause-card p { color: #dcdcda; }
html[data-theme="dark"] .lib-tab:hover { background: #2c2c2a; }
html[data-theme="dark"] .lib-tab.is-on { color: #282826; }
html[data-theme="dark"] .lib-muted { color: #a3a3a1; }
html[data-theme="dark"] .lib-empty { color: #a3a3a1; }
html[data-theme="dark"] .lib-md.has-detail .lib-list { scrollbar-color: #636361 transparent; }
html[data-theme="dark"] .lib-detail .lib-card { scrollbar-color: #636361 transparent; }
html[data-theme="dark"] .lib-tile:hover { background: #242422; }
html[data-theme="dark"] .lib-tile small { color: #a3a3a1; }
html[data-theme="dark"] .lib-src { background: #2c2c2a; color: #cbcbc9; }
html[data-theme="dark"] .lib-name { border-bottom: 0.1rem solid #4d4d4b; }
html[data-theme="dark"] .lib-circle { color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .lib-gray { color: #9f9f9d; }
html[data-theme="dark"] .lib-use { border-bottom: 0.1rem solid color-mix(in srgb, var(--c) 35%, #474745); }
html[data-theme="dark"] .lib-use-name { color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .lib-name-lvl { color: #a3a3a1; }
html[data-theme="dark"] .lib-card { --soft: color-mix(in srgb, var(--c) 13%, #282826); }
html[data-theme="dark"] .lib-edit { background: #363634; color: #a3a3a1; }
html[data-theme="dark"] .lib-edit:hover { color: #282826; }
html[data-theme="dark"] .lib-close { border: 0.1rem solid #5c5c5a; color: #bebebc; }
html[data-theme="dark"] .lib-close:hover { color: #282826; }
html[data-theme="dark"] .lib-d-head h2 { color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .lib-d-sub { color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .lib-sep { border-top: 0.15rem solid color-mix(in srgb, var(--c) 60%, #41413f); }
html[data-theme="dark"] .lib-card h3 { color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .lib-card h4 { color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .lib-card h5 { color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .lib-card .lib-acc-body hr { border-top: 0.15rem solid color-mix(in srgb, var(--c) 55%, #41413f); }
html[data-theme="dark"] .lib-source { color: #a3a3a1; }
html[data-theme="dark"] .lib-spell { color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .lib-skill { color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .lib-tip { border: 0.1rem solid #50504e; background: #262624; color: #f5f5f3; }
html[data-theme="dark"] .lib-tip h4 span { color: #cacac8; }
html[data-theme="dark"] .lib-kv th { border-right: 0.1rem solid color-mix(in srgb, var(--c) 75%, #41413f); }
html[data-theme="dark"] .lib-kv tr + tr th,
html[data-theme="dark"] .lib-kv tr + tr td { border-top: 0.1rem solid color-mix(in srgb, var(--c) 75%, #41413f); }
html[data-theme="dark"] .lib-box { --box: color-mix(in srgb, var(--c) 9%, #2c2c2a); }
html[data-theme="dark"] .lib-box-scroll { scrollbar-color: color-mix(in srgb, var(--c) 45%, #41413f) transparent; }
html[data-theme="dark"] .lib-feat b { background: #282826; color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .lib-grid th { color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .lib-grid td { border-top: 0.1rem solid color-mix(in srgb, var(--c) 22%, #474745); }
html[data-theme="dark"] .lib-grid td + td,
html[data-theme="dark"] .lib-grid th + th { border-left: 0.1rem solid color-mix(in srgb, var(--c) 14%, #464644); }
html[data-theme="dark"] .lib-lvl { background: #282826; color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .lib-acc-head { color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .lib-card .lib-ttl { color: #f0f0ee; }
html[data-theme="dark"] .lib-ttl b { color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .lib-table th { background: #2c2c2a; }
html[data-theme="dark"] .lib-table tbody tr:nth-child(even) { background: #2c2c2a; }
html[data-theme="dark"] .lib-table tr.lib-cat td { background: #323230; color: #dcdcda; }
html[data-theme="dark"] .lib-table tr.is-click:hover td { background: #242422; }
html[data-theme="dark"] .lib-f label,
html[data-theme="dark"] .lib-f-title { color: #a3a3a1; }
html[data-theme="dark"] .lib-f small { color: #a3a3a1; }
html[data-theme="dark"] .lib-in { border: 0.1rem solid #4d4d4b; background: #242422; }
html[data-theme="dark"] .lib-color { background: #242422; }
html[data-theme="dark"] .lib-f.is-list { border: 0.1rem dashed #565654; }
html[data-theme="dark"] .lib-li-tools button { background: #363634; color: #dcdcda; }
html[data-theme="dark"] .lib-li-tools button:hover { color: #282826; }
html[data-theme="dark"] .lib-rt-b { border: 0.1rem solid #4d4d4b; background: #242422; }
html[data-theme="dark"] .lib-rt-b:hover { background: #2a2a28; }
html[data-theme="dark"] .lib-prose .rich-h2 { color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .lib-prose .rich-h3 { color: color-mix(in srgb, var(--c) 52%, #f0f0ee); }
html[data-theme="dark"] .lib-tbl-wrap { border: 0.1rem solid #4d4d4b; background: #242422; }
html[data-theme="dark"] .lib-tbl-grid td { border-bottom: 0.1rem solid #484846; }
html[data-theme="dark"] .lib-tbl-grid td + td { border-left: 0.1rem solid #484846; }
html[data-theme="dark"] .lib-tbl-grid tr.is-head td { background: #2a2a28; }
html[data-theme="dark"] .lib-tc:focus { background: #282826; }
html[data-theme="dark"] .lib-tc::placeholder { color: #737371; }
html[data-theme="dark"] .lib-tbl-grid td.lib-tc-x { background: #272725; }
html[data-theme="dark"] .lib-tc-x button { color: #929290; }
html[data-theme="dark"] .lib-li-sum { color: #9f9f9d; }
html[data-theme="dark"] .lib-li-sum:hover { color: #dcdcda; }
html[data-theme="dark"] .lib-link { color: #c6c6c4; }
html[data-theme="dark"] .lib-link:hover { color: #f5f5f3; }
html[data-theme="dark"] .lib-add { border: 0.1rem dashed #797977; color: #dcdcda; }
html[data-theme="dark"] .lib-add:hover { background: #242422; }
html[data-theme="dark"] .lib-hint { color: #a3a3a1; }
html[data-theme="dark"] .lib-btn.is-dark { color: #282826; }
html[data-theme="dark"] .lib-btn.is-line:hover { background: #242422; }

/* ============ Ручные правки ============ */

/* Фон окон: тёмная облачная текстура сверху, как светлая */
html[data-theme="dark"] .app-main::before,
html[data-theme="dark"] .page-desk .site-main::before { background-image: url('/assets/img/ui/window-bg-dark.webp'); }

/* Аватарка в боковом меню остаётся светлой, как в макете */
html[data-theme="dark"] .sidebar-user .avatar { background: #f5f5f5; box-shadow: 0 0 0 0.3rem #42423f; }

/* Вход: тёмная карточка, персонажи с мягким светлым ореолом */
html[data-theme="dark"] .login-art {
  filter: drop-shadow(0 0 0.5rem rgba(255, 255, 255, 0.28)) drop-shadow(0 0 3rem rgba(255, 255, 255, 0.12));
}
html[data-theme="dark"] .login-card { background: rgba(30, 30, 28, 0.86); }
html[data-theme="dark"] .login-form input:not([type="checkbox"]) { background: #363633; color: #f5f5f5; }
html[data-theme="dark"] .login-forgot { color: #b9b9b5; }
html[data-theme="dark"] .login-footnote { color: #a9a9a7; }

/* Полоски хитов и опыта: светлая дорожка, как в макете ночного листа */
html[data-theme="dark"] .sheet-xp-bar,
html[data-theme="dark"] .sheet-hp-bar { background: #cdcdcd; }
html[data-theme="dark"] .sheet-hp-bar i { background: color-mix(in srgb, var(--accent) 68%, #d8d8d8); }

/* Библиотека и «Прошлая партия»: ссылки и статусы на тёмном фоне */
html[data-theme="dark"] .recap-more { color: #c4c394; }
html[data-theme="dark"] .rc-status.is-done, html[data-theme="dark"] .rc-chip.is-on { color: #fff; }
