/* === Почта отношений 2026 — Единая сенсорно бережная тёмная тема «Тёплый зимний вечер» === */

.advent-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.advent-theme-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--ink, #303a34);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.85;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.18s ease, background-color 0.18s ease;
}
.advent-theme-btn:hover {
  opacity: 1;
  background: rgba(131, 87, 111, 0.09);
}
.advent-theme-btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

html.advent-theme-ready body {
  transition: background-color 0.22s ease, color 0.22s ease;
}

.tour-overlay {
  background: transparent !important;
}

@media screen {
  html[data-theme="dark"] {
    color-scheme: dark;
    --paper: #18161a;
    --white: #222026;
    --surface-2: #2a272f;
    --surface-3: #322f38;
    --input-bg: #1d1b21;
    --ink: #eee7dc;
    --muted: #b5ada1;
    --line: #38343f;
    --forest: #88b59a;
    --forest-dark: #a6cdb5;
    --forest-btn: #355744;
    --forest-btn-hover: #426b54;
    --forest-soft: #212c26;
    --plum: #c79ab3;
    --plum-btn: #69445a;
    --plum-soft: #2d242c;
    --lavender: #2c2733;
    --rose: #b68ca3;
    --gold: #e2b678;
    --warm-soft: #2e2822;
    --tour-ink: #dfc0d2;
    --tour-bg: rgba(199, 154, 179, 0.14);
    --tour-border: rgba(199, 154, 179, 0.30);
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.42);

    /* House Rules tokens */
    --hc-bg: #18161a;
    --hc-surface: #222026;
    --hc-border: #38343f;
    --hc-text: #eee7dc;
    --hc-muted: #b5ada1;
    --hc-primary: #88b59a;
    --hc-primary-soft: #212c26;
    --hc-accent-a: #88b59a;
    --hc-accent-b: #c79ab3;
    --hc-good: #88b59a;
    --hc-danger: #df8394;
    --hc-gold: #e2b678;
    --hc-purple: #c79ab3;
    --hc-card-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
  }

  html[data-theme="dark"] .advent-theme-btn {
    background: transparent;
    border: none;
    color: var(--gold);
  }
  html[data-theme="dark"] .advent-theme-btn:hover {
    background: rgba(238, 231, 220, 0.08);
  }

  /* Header & Airmail stripes */
  html[data-theme="dark"] .postal-header {
    background: rgba(24, 22, 26, 0.92);
    border-bottom-color: var(--line);
  }
  html[data-theme="dark"] .postal-header::before {
    background: repeating-linear-gradient(110deg, #567864 0 14px, #18161a 14px 24px, #855d75 24px 38px, #18161a 38px 48px);
  }
  html[data-theme="dark"] .env-modal-stripe,
  html[data-theme="dark"] .hero-letter:before,
  html[data-theme="dark"] .peek-card:before,
  html[data-theme="dark"] .postal-tariff:before,
  html[data-theme="dark"] .cert-card:before,
  html[data-theme="dark"] .access-gate-card::before,
  html[data-theme="dark"] .compass-card::before,
  html[data-theme="dark"] .passport-card::before,
  html[data-theme="dark"] .intro-card::before,
  html[data-theme="dark"] .hero-card:before,
  html[data-theme="dark"] .face-back::before,
  html[data-theme="dark"] .desk-paper:before {
    background: repeating-linear-gradient(110deg, #567864 0 12px, #222026 12px 24px, #855d75 24px 36px, #222026 36px 48px) !important;
  }
  html[data-theme="dark"] .brand-stamp,
  html[data-theme="dark"] .postal-brand-stamp,
  html[data-theme="dark"] .brand-icon {
    background: var(--forest-soft);
    color: var(--forest);
  }
  html[data-theme="dark"] .header-nav {
    background: var(--surface-2);
    border-color: var(--line);
  }
  html[data-theme="dark"] .header-nav a:hover {
    background: var(--surface-3);
    color: var(--ink);
  }

  /* Primary filled buttons & CTAs */
  html[data-theme="dark"] .button-main,
  html[data-theme="dark"] .btn-main,
  html[data-theme="dark"] .header-pay-cta,
  html[data-theme="dark"] .pay-cta.primary,
  html[data-theme="dark"] .b-btn.active-do,
  html[data-theme="dark"] .toast {
    background: var(--forest-btn);
    border-color: var(--forest-btn);
    color: #f3ede2;
  }
  html[data-theme="dark"] .button-main:hover,
  html[data-theme="dark"] .btn-main:hover,
  html[data-theme="dark"] .header-pay-cta:hover,
  html[data-theme="dark"] .pay-cta.primary:hover {
    background: var(--forest-btn-hover);
    border-color: var(--forest-btn-hover);
  }
  html[data-theme="dark"] .button-outline,
  html[data-theme="dark"] .btn-outline,
  html[data-theme="dark"] .pay-cta.secondary {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--forest);
  }
  html[data-theme="dark"] .button-outline:hover,
  html[data-theme="dark"] .btn-outline:hover,
  html[data-theme="dark"] .pay-cta.secondary:hover {
    background: var(--surface-3);
    border-color: var(--forest);
  }
  html[data-theme="dark"] .button-light {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--ink);
  }
  html[data-theme="dark"] .dur-btn.active,
  html[data-theme="dark"] .room-header-button {
    background: var(--plum-btn);
    border-color: var(--plum-btn);
    color: #f5eef2;
  }

  /* Inputs & Form controls */
  html[data-theme="dark"] input[type="text"],
  html[data-theme="dark"] input[type="password"],
  html[data-theme="dark"] textarea,
  html[data-theme="dark"] select,
  html[data-theme="dark"] .mini-input,
  html[data-theme="dark"] .care-note,
  html[data-theme="dark"] .practice-textarea {
    background: var(--input-bg) !important;
    border-color: var(--line) !important;
    color: var(--ink) !important;
  }
  html[data-theme="dark"] .png-fallback {
    background: var(--white);
    border-color: var(--line);
  }

  /* Author Badge Footer & Spotlight Tour */
  html[data-theme="dark"] .exp-badge {
    background: #201e26;
    border-color: rgba(238, 231, 220, 0.12);
  }
  html[data-theme="dark"] .exp-context,
  html[data-theme="dark"] .exp-links a {
    color: #b7bae8;
  }
  html[data-theme="dark"] .tour-overlay {
    background: transparent !important;
  }
  html[data-theme="dark"] .tour-spot {
    box-shadow: 0 0 0 9999px rgba(10, 9, 13, 0.72);
  }
  html[data-theme="dark"] .tour-tip {
    background: var(--white);
    border-color: #4d3e4a;
    color: var(--ink);
  }
  html[data-theme="dark"] .btn-tour {
    background: var(--tour-bg);
    border-color: var(--tour-border);
    color: var(--tour-ink);
  }
  html[data-theme="dark"] .btn-tour:hover {
    background: rgba(199, 154, 179, 0.24);
    border-color: var(--plum);
  }

  /* Landing & Hero Envelope (Cozy Night Scene) */
  html[data-theme="dark"] .hero-under { color: var(--muted); }
  html[data-theme="dark"] .hero-orbit { background: #242129; }
  html[data-theme="dark"] .window-backdrop,
  html[data-theme="dark"] .window-art {
    border-color: #3c342e;
    background: linear-gradient(#1c2633 0 52%, #2a3438 53%);
  }
  html[data-theme="dark"] .window-backdrop:after,
  html[data-theme="dark"] .window-art:after {
    background: linear-gradient(90deg, transparent 45%, #3c342e 45% 55%, transparent 55%), linear-gradient(transparent 55%, #3c342e 55% 61%, transparent 61%);
  }
  html[data-theme="dark"] .window-moon { background: #f6e2b3; }
  html[data-theme="dark"] .envelope-back { background: #332b26; border-color: #4a3f38; }
  html[data-theme="dark"] .hero-letter { background: #26232a; border-color: #3e3946; color: var(--ink); }
  html[data-theme="dark"] .envelope-pocket {
    background: linear-gradient(180deg, #3c332c 0%, #312923 100%);
    border-color: #4d4239;
  }
  html[data-theme="dark"] .envelope-stamp {
    background: var(--forest-soft);
    outline-color: #222026;
    color: var(--forest);
  }
  html[data-theme="dark"] .env-modal {
    background: var(--white);
    border-color: var(--line);
  }
  html[data-theme="dark"] .env-modal-close,
  html[data-theme="dark"] .modal-x {
    background: var(--plum-soft);
    color: var(--plum);
  }
  html[data-theme="dark"] .env-note-card {
    background: var(--surface-2);
    border-color: var(--line);
    border-left-color: var(--plum);
  }

  /* Peek card, Tariffs, Program, Authors */
  html[data-theme="dark"] .peek-card {
    background-color: var(--white);
    background-image:
      linear-gradient(120deg, rgba(28, 26, 32, 0.94) 0%, rgba(28, 26, 32, 0.88) 58%, rgba(24, 22, 26, 0.82) 100%),
      url('calendar/assets/pochtovaya-komnata.webp');
    border-color: var(--line);
  }
  html[data-theme="dark"] .route-pill,
  html[data-theme="dark"] .pill,
  html[data-theme="dark"] .pill-btn,
  html[data-theme="dark"] .chip,
  html[data-theme="dark"] .chip-btn,
  html[data-theme="dark"] .b-btn,
  html[data-theme="dark"] .agree-toggle,
  html[data-theme="dark"] .bat-btn,
  html[data-theme="dark"] .format-btn,
  html[data-theme="dark"] .dur-btn,
  html[data-theme="dark"] .chip-toggle,
  html[data-theme="dark"] .support-pill {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--ink);
  }
  html[data-theme="dark"] .route-pill[aria-checked="true"][data-route="self"],
  html[data-theme="dark"] .route-pill[aria-checked="true"][data-letter-route="self"],
  html[data-theme="dark"] .pill.active,
  html[data-theme="dark"] .pill-btn.active,
  html[data-theme="dark"] .chip-btn.active,
  html[data-theme="dark"] .chip.active-green,
  html[data-theme="dark"] .agree-toggle.agreed,
  html[data-theme="dark"] .support-pill.active,
  html[data-theme="dark"] .bat-btn.active,
  html[data-theme="dark"] .format-btn.selected {
    background: var(--forest-soft);
    border-color: var(--forest);
    color: var(--forest-dark);
  }
  html[data-theme="dark"] .route-pill[aria-checked="true"][data-route="friend"],
  html[data-theme="dark"] .route-pill[aria-checked="true"][data-letter-route="friend"],
  html[data-theme="dark"] .b-btn.active-simple,
  html[data-theme="dark"] .chip-toggle.active,
  html[data-theme="dark"] .bat-btn[data-lvl="mid"].active {
    background: var(--warm-soft);
    border-color: var(--gold);
    color: var(--gold);
  }
  html[data-theme="dark"] .route-pill[aria-checked="true"][data-route="partner"],
  html[data-theme="dark"] .route-pill[aria-checked="true"][data-letter-route="partner"],
  html[data-theme="dark"] .chip.active-red,
  html[data-theme="dark"] .b-btn.active-skip,
  html[data-theme="dark"] .bat-btn[data-lvl="low"].active,
  html[data-theme="dark"] .quadrant[data-zone="low"] .format-btn.selected {
    background: var(--plum-soft);
    border-color: var(--plum);
    color: var(--plum);
  }
  html[data-theme="dark"] .peek-adapted,
  html[data-theme="dark"] .reader-context {
    background: var(--surface-2);
    border-color: var(--line);
    border-left-color: var(--forest);
  }
  html[data-theme="dark"] .peek-adapted[data-route="friend"],
  html[data-theme="dark"] .reader-context[data-route="friend"] {
    background: var(--warm-soft);
    border-left-color: var(--gold);
  }
  html[data-theme="dark"] .peek-adapted[data-route="partner"],
  html[data-theme="dark"] .reader-context[data-route="partner"] {
    background: var(--plum-soft);
    border-left-color: var(--plum);
  }
  html[data-theme="dark"] .currency-bar,
  html[data-theme="dark"] .mode-switch {
    background: var(--surface-2);
  }
  html[data-theme="dark"] .curr-btn.active,
  html[data-theme="dark"] .mode-tab.active {
    background: var(--surface-3);
    color: var(--ink);
  }
  html[data-theme="dark"] .postal-tariff,
  html[data-theme="dark"] .postal-tariff.muted-tariff,
  html[data-theme="dark"] .calendar-paper,
  html[data-theme="dark"] .form-card,
  html[data-theme="dark"] .hero-card,
  html[data-theme="dark"] .stat-box,
  html[data-theme="dark"] .task-card,
  html[data-theme="dark"] .summary-card,
  html[data-theme="dark"] .step-card,
  html[data-theme="dark"] .passport-card,
  html[data-theme="dark"] .axis-card,
  html[data-theme="dark"] .note-card,
  html[data-theme="dark"] .compass-card,
  html[data-theme="dark"] .intro-card,
  html[data-theme="dark"] .matrix-shell,
  html[data-theme="dark"] .composer-card,
  html[data-theme="dark"] .editor-card,
  html[data-theme="dark"] .support-card {
    background: var(--white) !important;
    border-color: var(--line) !important;
    color: var(--ink);
  }
  html[data-theme="dark"] .postal-tariff.featured { border-color: var(--forest) !important; }
  html[data-theme="dark"] .tariff-badge.early,
  html[data-theme="dark"] .mini-stamp,
  html[data-theme="dark"] .topic-status,
  html[data-theme="dark"] .cert-stamp,
  html[data-theme="dark"] .pass-stamp,
  html[data-theme="dark"] .back-stamp,
  html[data-theme="dark"] .task-ico,
  html[data-theme="dark"] .axis-ico {
    background: var(--forest-soft);
    color: var(--forest);
    outline-color: var(--white);
  }
  html[data-theme="dark"] .tariff-badge.regular,
  html[data-theme="dark"] .mini-stamp.plum-stamp,
  html[data-theme="dark"] .cert-card.theme-lavender .cert-stamp {
    background: var(--plum-soft);
    color: var(--plum);
  }
  html[data-theme="dark"] .tariff-tear { border-top-color: var(--line); }
  html[data-theme="dark"] .tariff-tear:before,
  html[data-theme="dark"] .tariff-tear:after { background: var(--paper); border-color: var(--line); }

  html[data-theme="dark"] .keepsakes,
  html[data-theme="dark"] .actions-box,
  html[data-theme="dark"] .calendar-final,
  html[data-theme="dark"] .window-pause,
  html[data-theme="dark"] .archive-inline,
  html[data-theme="dark"] .detail-finale,
  html[data-theme="dark"] .room-invite {
    background: var(--plum-soft);
    border-color: #463744;
  }
  html[data-theme="dark"] .keepsakes p,
  html[data-theme="dark"] .actions-box p,
  html[data-theme="dark"] .calendar-final p,
  html[data-theme="dark"] .room-invite-copy > p:not(.eyebrow) {
    color: var(--muted) !important;
  }
  html[data-theme="dark"] .authors-card,
  html[data-theme="dark"] .love-extra {
    background: #232624;
    border-color: #363d38;
  }
  html[data-theme="dark"] .authors-card p,
  html[data-theme="dark"] .love-extra-copy > p:not(.eyebrow),
  html[data-theme="dark"] .love-extra-list span {
    color: var(--muted);
  }
  html[data-theme="dark"] .love-extra-list,
  html[data-theme="dark"] .love-extra-list p {
    border-color: #363d38;
  }
  html[data-theme="dark"] .care-tag {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--ink);
  }

  /* Calendar & Envelopes */
  html[data-theme="dark"] .mobile-subbar {
    background: rgba(24, 22, 26, 0.96);
    border-top-color: var(--line);
  }
  html[data-theme="dark"] .status-chip {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--ink);
  }
  html[data-theme="dark"] .status-chip:hover {
    background: var(--surface-3);
    border-color: var(--plum);
  }
  html[data-theme="dark"] .topic-pair {
    background: var(--surface-2);
    border-color: var(--line);
  }
  html[data-theme="dark"] .topic-pair:has(.topic-status:not(.muted)) {
    background: var(--white);
    border-color: #3a4a40;
  }
  html[data-theme="dark"] .topic-pair.finale-card {
    background: var(--plum-soft);
    border-color: #4d3c4a;
  }
  html[data-theme="dark"] .pair-heading,
  html[data-theme="dark"] .calendar-top {
    color: var(--muted);
  }
  html[data-theme="dark"] .mini-env,
  html[data-theme="dark"] .pair-envelope {
    background: #2e2822;
    border-color: #4a4036;
    color: #dfc3a0;
  }
  html[data-theme="dark"] .pair-envelope .envelope-flap {
    background: #383029;
    border-color: #4f443a;
  }
  html[data-theme="dark"] .mini-env.practice,
  html[data-theme="dark"] .pair-envelope.practice {
    background: #2b2430;
    border-color: #483c50;
    color: #d6b6ca;
  }
  html[data-theme="dark"] .pair-envelope.practice .envelope-flap {
    background: #352d3c;
    border-color: #51435a;
  }
  html[data-theme="dark"] .choose-illustration {
    background: radial-gradient(circle at 43% 50%, #2b242d 0, #2b242d 40%, transparent 41%);
  }
  html[data-theme="dark"] .two-notes i {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--ink);
  }
  html[data-theme="dark"] .two-notes i + i {
    background: var(--plum-soft);
  }
  html[data-theme="dark"] .room-invite-picture > span {
    background: var(--white);
    color: var(--ink);
  }

  /* Room Mode & Modals */
  html[data-theme="dark"] .room-mode-header {
    background: var(--paper);
    color: var(--ink);
    border-bottom-color: var(--line);
  }
  html[data-theme="dark"] .room-mobile-menu {
    background: var(--paper);
    border-top: 1px solid var(--line);
  }
  html[data-theme="dark"] .room-mobile-menu button {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--plum);
  }
  html[data-theme="dark"] .room-detail {
    background: var(--paper);
    color: var(--ink);
  }
  html[data-theme="dark"] .detail-head {
    background: var(--white);
    border-bottom-color: var(--line);
  }
  html[data-theme="dark"] .detail-return { color: var(--plum); }
  html[data-theme="dark"] .detail-body p { color: var(--muted); }
  html[data-theme="dark"] .day-cell,
  html[data-theme="dark"] .detail-mailwall .day-cell {
    background: #2a2623;
    border-color: #423b35;
    color: var(--muted);
  }
  html[data-theme="dark"] .day-cell.practice,
  html[data-theme="dark"] .detail-mailwall .day-cell.practice {
    background: #2a2430;
    border-color: #463b4f;
  }
  html[data-theme="dark"] .day-cell.final {
    background: #33252f;
    border-color: #543e4e;
  }
  html[data-theme="dark"] .pin-note {
    background: var(--surface-2);
    color: var(--ink);
  }
  html[data-theme="dark"] .pin-note:nth-child(3n+2) { background: var(--plum-soft); }
  html[data-theme="dark"] .pin-note:nth-child(4n) { background: var(--forest-soft); }
  html[data-theme="dark"] .desk-paper,
  html[data-theme="dark"] .desk-link-btn,
  html[data-theme="dark"] .desk-note-stack > button {
    background: var(--white);
    border-color: var(--line);
    color: var(--ink);
  }
  html[data-theme="dark"] .desk-link-btn small,
  html[data-theme="dark"] .desk-note-stack button small { color: var(--muted); }
  html[data-theme="dark"] .archive-item {
    background: var(--white);
    border-color: var(--line);
    color: var(--ink);
  }
  html[data-theme="dark"] .archive-item:hover { background: var(--surface-3); }
  html[data-theme="dark"] .pause-progress-wrap { background: #3b3240; }

  html[data-theme="dark"] .modal {
    background: var(--white);
    border-color: var(--line);
    color: var(--ink);
  }
  html[data-theme="dark"] .letter-modal {
    background-color: var(--white);
    background-image:
      linear-gradient(180deg, rgba(30, 28, 34, 0.95) 0%, rgba(28, 26, 32, 0.93) 70%, rgba(24, 22, 26, 0.92) 100%),
      url('calendar/assets/pochtovaya-komnata.webp');
  }
  html[data-theme="dark"] .reader-sticky-top,
  html[data-theme="dark"] .reader-head,
  html[data-theme="dark"] .letter-actions {
    background: rgba(31, 29, 35, 0.96);
    border-color: var(--line);
  }
  html[data-theme="dark"] .reader-sticky-top::before {
    background: repeating-linear-gradient(110deg, #567864 0 12px, #222026 12px 24px, #855d75 24px 36px, #222026 36px 48px);
  }
  html[data-theme="dark"] .reader-postmark {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--muted);
  }
  html[data-theme="dark"] .reader-route-status {
    background: var(--forest-soft);
    color: var(--forest-dark);
  }
  html[data-theme="dark"] .reader-sticky-top[data-route="friend"] .reader-route-status {
    background: var(--warm-soft);
    color: var(--gold);
  }
  html[data-theme="dark"] .reader-sticky-top[data-route="partner"] .reader-route-status {
    background: var(--plum-soft);
    color: var(--plum);
  }
  html[data-theme="dark"] .letter-route-bar {
    background: var(--surface-2);
    border-color: var(--line);
  }
  html[data-theme="dark"] .route-bar-label,
  html[data-theme="dark"] .route-bar-hint {
    color: var(--muted);
  }
  html[data-theme="dark"] .route-lens-card {
    background: var(--surface-2);
    border-color: var(--line);
    border-left-color: var(--forest);
  }
  html[data-theme="dark"] .route-lens-card[data-route="friend"] {
    background: var(--warm-soft);
    border-left-color: var(--gold);
  }
  html[data-theme="dark"] .route-lens-card[data-route="partner"] {
    background: var(--plum-soft);
    border-left-color: var(--plum);
  }
  html[data-theme="dark"] .route-lens-pill {
    background: var(--surface-3);
    border-color: var(--line);
    color: var(--muted);
  }
  html[data-theme="dark"] .route-lens-artifact-preview {
    border-top-color: var(--line);
    color: var(--muted) !important;
  }
  html[data-theme="dark"] .route-task-card,
  html[data-theme="dark"] .artifact-card,
  html[data-theme="dark"] .archive-artifact-card {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--ink);
  }
  html[data-theme="dark"] .route-quick-box {
    background: var(--surface-3);
    border-color: var(--line);
    color: var(--ink);
  }
  html[data-theme="dark"] .artifact-saved-pill,
  html[data-theme="dark"] .archive-art-route {
    background: var(--forest-soft);
    color: var(--forest-dark);
  }
  html[data-theme="dark"] .archive-artifact-card[data-route="friend"] .archive-art-route {
    background: var(--warm-soft);
    color: var(--gold);
  }
  html[data-theme="dark"] .archive-artifact-card[data-route="partner"] .archive-art-route {
    background: var(--plum-soft);
    color: var(--plum);
  }
  html[data-theme="dark"] .route-option { border-color: var(--line); }
  html[data-theme="dark"] .route-option:has(input:checked) {
    background: var(--plum-soft);
    border-color: var(--plum);
  }
  html[data-theme="dark"] .route-symbol { background: var(--plum-soft); color: var(--plum); }
  html[data-theme="dark"] .draft-note { background: var(--plum-soft); color: var(--plum); }
  html[data-theme="dark"] .option-list label { border-color: var(--line); }
  html[data-theme="dark"] .option-list label:has(input:checked) {
    background: var(--forest-soft);
    border-color: var(--forest);
  }
  html[data-theme="dark"] .reveal-box {
    background: var(--surface-2);
    border-color: var(--line);
  }
  html[data-theme="dark"] .reveal-btn {
    background: var(--plum-soft);
    color: var(--plum);
  }
  html[data-theme="dark"] .reveal-body { border-top-color: var(--line); }
  html[data-theme="dark"] .letter-table {
    background: var(--surface-2);
    border-color: var(--line);
  }
  html[data-theme="dark"] .letter-table th {
    background: var(--surface-3);
    color: var(--ink);
  }
  html[data-theme="dark"] .letter-table th,
  html[data-theme="dark"] .letter-table td { border-bottom-color: var(--line); }
  html[data-theme="dark"] .access-gate { background: rgba(24, 22, 26, 0.96); }
  html[data-theme="dark"] .access-gate-card { background: var(--white); border-color: var(--line); }
  html[data-theme="dark"] .gate-error { color: #df8394 !important; }

  /* Gift Certificate */
  html[data-theme="dark"] .cert-card {
    background: var(--white);
    border-color: var(--line);
  }
  html[data-theme="dark"] .cert-card.theme-lavender {
    background: linear-gradient(145deg, #2a232c 0%, #222026 100%);
    border-color: #4a3b4d;
  }
  html[data-theme="dark"] .cert-card.theme-forest {
    background: linear-gradient(145deg, #1f2a24 0%, #222026 100%);
    border-color: #364a3e;
  }
  html[data-theme="dark"] .cert-message {
    background: rgba(24, 22, 26, 0.55);
    color: var(--ink);
  }
  html[data-theme="dark"] .cert-footer { border-top-color: var(--line); }

  /* Tools: Care Compass, Gift Guide, New Year Plan, Social Map, Postcard */
  html[data-theme="dark"] .translator-box,
  html[data-theme="dark"] .slider-box,
  html[data-theme="dark"] .pass-meter,
  html[data-theme="dark"] .pass-meta-box,
  html[data-theme="dark"] .mascot-tip,
  html[data-theme="dark"] .plan-output,
  html[data-theme="dark"] .quadrant {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--ink);
  }
  html[data-theme="dark"] .pass-meter-bar { background: var(--surface-3); }
  html[data-theme="dark"] .pass-meter-dot { border-color: var(--white); }
  html[data-theme="dark"] .pass-footer,
  html[data-theme="dark"] .selectors-grid,
  html[data-theme="dark"] .task-details { border-color: var(--line); }
  html[data-theme="dark"] .task-card.bucket-skip { background: #292229 !important; border-color: #463645 !important; }
  html[data-theme="dark"] .task-card.bucket-simple { background: #2b2620 !important; border-color: #4c4132 !important; }
  html[data-theme="dark"] .task-card.bucket-do { border-color: #395244 !important; }
  html[data-theme="dark"] .mascot-tip img { background: var(--surface-3); border-color: var(--line); }
  html[data-theme="dark"] .quadrant.highlighted { background: #1f2b25; border-color: var(--forest); }
  html[data-theme="dark"] .quadrant[data-zone="low"].highlighted { background: #2b222a; border-color: var(--plum); }
  html[data-theme="dark"] .quadrant[data-zone="mid"].highlighted { background: #2c261f; border-color: var(--gold); }
  html[data-theme="dark"] .quad-badge { background: var(--surface-3); color: var(--muted); }
  html[data-theme="dark"] .quadrant.highlighted .quad-badge { background: var(--forest-btn); color: #f3ede2; }
  html[data-theme="dark"] .quadrant[data-zone="low"].highlighted .quad-badge { background: var(--plum-btn); }
  html[data-theme="dark"] .quadrant[data-zone="mid"].highlighted .quad-badge { background: #8c5a20; }

  /* December Postcard */
  html[data-theme="dark"] .card-face { border-color: var(--line); }
  html[data-theme="dark"] .face-back { background: #25222a; color: var(--ink); }
  html[data-theme="dark"] .back-left,
  html[data-theme="dark"] .addr-line { border-color: var(--line); }
  html[data-theme="dark"] .face-front.theme-paper {
    background: linear-gradient(145deg, #2e2923 0%, #24201c 100%);
    color: var(--ink);
  }

  /* House Rules overrides */
  html[data-theme="dark"] .rule-card,
  html[data-theme="dark"] .panel,
  html[data-theme="dark"] .mode-card,
  html[data-theme="dark"] .player-box,
  html[data-theme="dark"] .custom-rules-collapsible,
  html[data-theme="dark"] .tour-modal {
    background: var(--white) !important;
    border-color: var(--line) !important;
    color: var(--ink);
  }
  html[data-theme="dark"] .filter-chip-ny {
    background: var(--plum-soft) !important;
    border-color: #543e4e !important;
    color: var(--plum) !important;
  }
  html[data-theme="dark"] .filter-chip-ny.active {
    background: var(--plum-btn) !important;
    border-color: var(--plum-btn) !important;
    color: #f5eef2 !important;
  }
  html[data-theme="dark"] .btn-primary,
  html[data-theme="dark"] .checklist-tab.active,
  html[data-theme="dark"] .filter-chip.active,
  html[data-theme="dark"] .relation-btn.selected,
  html[data-theme="dark"] .agreement-btn.selected {
    background: var(--forest-btn) !important;
    border-color: var(--forest-btn) !important;
    color: #f3ede2 !important;
  }

  /* Telegram Bot Banner & Pre-payment Strip */
  html[data-theme="dark"] .bot-banner {
    background: var(--white);
    border-color: var(--line);
  }
  html[data-theme="dark"] .bot-banner:before {
    background: repeating-linear-gradient(110deg, #567864 0 12px, #222026 12px 22px, #855d75 22px 34px, #222026 34px 44px) !important;
  }
  html[data-theme="dark"] .bot-pill {
    background: var(--forest-soft);
    border-color: #365242;
    color: var(--forest);
  }
  html[data-theme="dark"] .bot-mini-step {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--ink);
  }
  html[data-theme="dark"] .bot-mini-step strong,
  html[data-theme="dark"] .bot-prepay-title,
  html[data-theme="dark"] .bot-prepay-steps span strong,
  html[data-theme="dark"] .pay-after-note a {
    color: var(--forest);
  }
  html[data-theme="dark"] .bot-mini-step .bnum {
    background: var(--forest-btn);
    color: #f3ede2;
  }
  html[data-theme="dark"] .bot-art-card {
    border-color: var(--line);
  }
  html[data-theme="dark"] .bot-art-caption {
    background: var(--surface-2);
    border-top-color: var(--line);
    color: var(--ink);
  }
  html[data-theme="dark"] .bot-art-caption img,
  html[data-theme="dark"] .bot-prepay-avatar,
  html[data-theme="dark"] .keepsakes-avatar {
    border-color: var(--surface-3);
  }
  html[data-theme="dark"] .bot-prepay-strip {
    background: var(--forest-soft);
    border-color: #365242;
  }

  /* Upgraded New Year Plan & Illustrated December Postcard */
  html[data-theme="dark"] .roles-box {
    background: var(--surface-2);
    border-color: var(--line);
  }
  html[data-theme="dark"] .roles-head-title,
  html[data-theme="dark"] .add-role-btn,
  html[data-theme="dark"] .idea-chip {
    color: var(--forest);
  }
  html[data-theme="dark"] .idea-chip {
    background: var(--surface-3);
    border-color: var(--line);
  }
  html[data-theme="dark"] .idea-chip:hover {
    background: var(--forest-soft);
    border-color: var(--forest);
  }
  html[data-theme="dark"] .role-remove,
  html[data-theme="dark"] .del-task-btn {
    background: var(--surface-3);
    border-color: var(--line);
    color: var(--muted);
  }
  html[data-theme="dark"] .mini-textarea {
    background: var(--input-bg) !important;
    border-color: var(--line) !important;
    color: var(--ink) !important;
  }
  html[data-theme="dark"] .cover-thumb,
  html[data-theme="dark"] .swatch-pill {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--ink);
  }
  html[data-theme="dark"] .cover-thumb.active,
  html[data-theme="dark"] .swatch-pill.active {
    background: var(--forest-soft);
    border-color: var(--forest);
    color: var(--forest);
  }
  html[data-theme="dark"] .back-stamp {
    background: var(--forest-soft);
    outline-color: #25222a;
  }
  html[data-theme="dark"] .back-stamp small {
    color: var(--forest);
  }
}
