/* nekokamap ダークテーマ: 色変数の再定義のみで実現する (filter 反転は使わない)。
   初期表示はライト固定。トグルで切り替えた選択だけを localStorage に記憶し、
   記憶がある場合のみ次回以降それを優先する (2026-11-28 本人仕様)。
   地図タイル・ピン・画像には一切触れない。 */
html[data-theme="dark"] {
  --ink: #ede8de;
  --ink-soft: #b5ac9d;
  --cream: #15120e;
  --paper: #201c16;
  --field: #1a1712;
  --surface-alt: #2b251d;
  --accent: #d98a63;
  --accent-hover: #eda97f;
  --accent-soft: #3a2a1c;
  --accent-muted: #7a5a3c;
  --on-accent: #23150a;
  --line: #4a4234;
  --control-border: #847768;
  --focus-ring: #8ab6e6;
  --danger: #e8937c;
  --danger-soft: #472a21;
  --shadow-color: rgba(0, 0, 0, 0.45);
  --map-none: var(--paper);
  --map-under: #54401f;
  --map-5-9: #68502a;
  --map-10-19: #7d6033;
  --map-20-49: #936f3c;
  --map-50-plus: #a87f46;
  --map-boundary: var(--ink-soft);
  --map-outline: var(--ink-soft);
  --map-selected: var(--accent-hover);
  color-scheme: dark;
}
/* ページ専用 CSS の「背景は白で固定 (!important)」に勝つため、背景だけ
   !important で指定する (v7 の変更点)。 */
html[data-theme="dark"] body { background: var(--cream) !important; color: var(--ink); }
/* 変数化されていない固定色の個別対応 */
html[data-theme="dark"] .directory-cards article { background: var(--paper); }
html[data-theme="dark"] [class*="_figure_"] img { background: #262019; }
html[data-theme="dark"] [class*="_kind_"] { color: #cfd8bd; background: #2e3626; }
html[data-theme="dark"] [class*="_kind_"][data-kind="comparison"] { color: #bfd4e4; background: #26333f; }
html[data-theme="dark"] [class*="_kind_"][data-kind="checklist"] { color: #e6cf9f; background: #3a2f1c; }
html[data-theme="dark"] .form-step select:disabled { color: #8d8272; background-color: #262019; }
html[data-theme="dark"] .area-map-picker-paper,
html[data-theme="dark"] .area-map-picker-shape { fill: var(--paper); }
html[data-theme="dark"] .area-map-picker-shape { stroke: var(--line); }
html[data-theme="dark"] .area-map-municipality-boundaries path { stroke: #6b5f4d; }
/* テーマ切替トグル (両テーマ共通) */
.theme-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; margin-left: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; color: var(--ink); cursor: pointer; font-size: 0.8rem; font-weight: 700; flex: none; }
.theme-toggle-track { width: 34px; height: 20px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--line); position: relative; flex: none; }
.theme-toggle-knob { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink-soft); transition: left 0.15s ease, background 0.15s ease; }
html[data-theme="dark"] .theme-toggle-knob { left: 16px; background: var(--accent); }

/* モバイルヘッダー配置 (2026-11-29): メニューを右端へ、ダーク切替と入替 */
@media (max-width: 700px) {
  .site-header .theme-toggle { order: 2; margin-left: auto; }
  .site-header nav { order: 3; margin-left: 0 !important; }
}
