/**
 * TW-THEME-SYSTEM-RESTORE-001 + NIGHT + DAYLIGHT presets
 * Golden | Night Memory | Living Home | Family Archive
 */
@import url("site.css?v=restore004");
@import url("tokens/typography.css?v=page_title_001");

/* ── Golden — primary (slate + amber, app.timewoven.ru) ── */
html[data-theme="current_dark"] {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --surface: #0f172a;
  --surface-2: #111c33;
  --bg-0: #0f172a;
  --bg-1: #1e293b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-soft: rgba(245, 158, 11, 0.14);
  --accent-rail: rgba(245, 158, 11, 0.35);
  --rail: var(--accent-rail);
  --card: rgba(15, 23, 42, 0.78);
  --line: rgba(148, 163, 184, 0.22);
  --border: rgba(148, 163, 184, 0.22);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.25);
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-memory: Georgia, "Times New Roman", "Iowan Old Style", Palatino, serif;
  --tw-font-memory: var(--font-memory);
  --tw-bg-soft: var(--surface-2);
  --stage: 40rem;
  --whisper: #64748b;
  --radius: 16px;
  --radius-sm: 10px;
  --birth: #22c55e;
  --death: #6b7280;
  --memory: #818cf8;
  --wedding: #f472b6;
  --event: #38bdf8;
  --gd-btn-glow: linear-gradient(165deg, #e8a020 0%, #f59e0b 48%, #d97706 100%);
  /* TW-TOKEN-SYSTEM-MERGE-001: canonical runtime tokens (preset authority on html) */
  --tw-surface-primary: var(--card);
  --tw-surface-secondary: var(--surface);
  --tw-surface-tertiary: var(--surface-2);
  --tw-surface-memory: var(--card);
  --tw-text-primary: var(--text);
  --tw-text-secondary: var(--muted);
  --tw-text-muted: var(--muted);
  --tw-text-memory: var(--accent);
  --tw-action-primary: var(--accent);
  --tw-action-secondary: var(--muted);
  --tw-action-hover: var(--accent-dark);
  --tw-border-soft: var(--line);
  --tw-border-memory: var(--accent-rail);
  --tw-memory-presence: var(--accent-soft);
  --tw-memory-depth: var(--shadow-card);

}

/* Golden — CTA inner light (TW-THEME-PRESETS-REFINEMENT-002) */
html[data-theme="current_dark"] .btn-primary,
html[data-theme="current_dark"] header .btn.btn-primary {
  background: var(--gd-btn-glow);
  color: #1f2937;
  border: 1px solid rgba(245, 158, 11, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 235, 190, 0.18),
    0 8px 24px rgba(2, 6, 23, 0.32);
  transition: box-shadow 0.5s ease, filter 0.45s ease, border-color 0.45s ease;
}

html[data-theme="current_dark"] .btn-primary:hover,
html[data-theme="current_dark"] header .btn.btn-primary:hover {
  box-shadow:
    inset 0 0 24px rgba(255, 200, 100, 0.22),
    inset 0 1px 0 rgba(255, 240, 210, 0.2),
    0 0 28px rgba(245, 158, 11, 0.14),
    0 10px 28px rgba(2, 6, 23, 0.36);
  filter: brightness(1.04);
}

/* ── Night Memory — evening lamp light (TW-THEME-SYSTEM-RESTORE-002)
   Golden after sunset: living warm light, not flat yellow dark mode. ── */
html[data-theme="night_memory"] {
  color-scheme: dark;
  --bg: #060a14;
  --bg-soft: #0e1524;
  --surface: #131b2c;
  --surface-2: #1a2438;
  --bg-0: #0f172a;
  --bg-1: #1a2233;
  --text: #f3f0ea;
  --muted: #a8b0bc;
  --accent: #d4a574;
  --accent-dark: #b8895a;
  --accent-soft: rgba(212, 165, 116, 0.09);
  --accent-rail: rgba(212, 165, 116, 0.22);
  --rail: var(--accent-rail);
  --card: rgba(18, 26, 42, 0.82);
  --line: rgba(180, 155, 120, 0.12);
  --border: rgba(148, 163, 184, 0.12);
  --shadow-card:
    0 18px 48px rgba(2, 6, 18, 0.42),
    inset 0 1px 0 rgba(255, 228, 190, 0.04);
  --nm-surface-warm: linear-gradient(
    148deg,
    rgba(24, 32, 50, 0.94) 0%,
    rgba(14, 20, 36, 0.9) 52%,
    rgba(20, 28, 44, 0.92) 100%
  );
  --nm-btn-base: linear-gradient(
    168deg,
    #1a2438 0%,
    #0f1628 46%,
    #141e32 100%
  );
  --nm-btn-hover: linear-gradient(
    158deg,
    rgba(36, 44, 62, 0.98) 0%,
    rgba(24, 32, 50, 0.96) 45%,
    rgba(30, 38, 56, 0.98) 100%
  );
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-memory: Georgia, "Times New Roman", "Iowan Old Style", Palatino, serif;
  --tw-font-memory: var(--font-memory);
  --tw-bg-soft: var(--surface-2);
  --stage: 40rem;
  --whisper: #7a8494;
  --radius: 16px;
  --radius-sm: 10px;
  --birth: #4d8a5c;
  --death: #7a828e;
  --memory: #9aa5b8;
  --wedding: #c88a9e;
  --event: #8aa0b4;
  /* TW-TOKEN-SYSTEM-MERGE-001: canonical runtime tokens (preset authority on html) */
  --tw-surface-primary: var(--card);
  --tw-surface-secondary: var(--surface);
  --tw-surface-tertiary: var(--surface-2);
  --tw-surface-memory: var(--card);
  --tw-text-primary: var(--text);
  --tw-text-secondary: var(--muted);
  --tw-text-muted: var(--muted);
  --tw-text-memory: var(--accent);
  --tw-action-primary: var(--accent);
  --tw-action-secondary: var(--muted);
  --tw-action-hover: var(--accent-dark);
  --tw-border-soft: var(--line);
  --tw-border-memory: var(--accent-rail);
  --tw-memory-presence: var(--accent-soft);
  --tw-memory-depth: var(--shadow-card);

}

/* TW-RUNTIME-THEMECSS-DECOMMISSION-001: body atmosphere → family_page_composition + ops presets */

html[data-theme="night_memory"] h1,
html[data-theme="night_memory"] h2,
html[data-theme="night_memory"] h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

html[data-theme="night_memory"] .year-heading,
html[data-theme="night_memory"] .reentry-heading,
html[data-theme="night_memory"] .mem-fragment,
html[data-theme="night_memory"] textarea.mem-fragment,
html[data-theme="night_memory"] .memory-text {
  font-family: var(--font-memory);
  font-weight: 500;
  line-height: 1.58;
}

html[data-theme="night_memory"] .cosmos-nav a {
  color: var(--accent-dark);
  font-weight: 500;
}

html[data-theme="night_memory"] .cosmos-nav a.active {
  color: var(--text);
}

html[data-theme="night_memory"] .mem-preview,
html[data-theme="night_memory"] .meta,
html[data-theme="night_memory"] .subtitle {
  color: var(--muted);
  line-height: 1.6;
}

/* Warm depth cards — night memory, not flat black panels */
html[data-theme="night_memory"] .welcome,
html[data-theme="night_memory"] .person-header,
html[data-theme="night_memory"] .workspace-shell,
html[data-theme="night_memory"] .memory,
html[data-theme="night_memory"] .mem,
html[data-theme="night_memory"] .reentry-card,
html[data-theme="night_memory"] .hero-stat,
html[data-theme="night_memory"] .tw-event-view {
  background: var(--nm-surface-warm);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}

html[data-theme="night_memory"] .memory {
  background: linear-gradient(
    150deg,
    rgba(20, 28, 44, 0.88) 0%,
    rgba(14, 20, 34, 0.82) 100%
  );
}

html[data-theme="night_memory"] .hero-stat {
  background: linear-gradient(160deg, rgba(12, 18, 30, 0.55), rgba(22, 30, 46, 0.5));
}

html[data-theme="night_memory"] .year-block {
  margin-bottom: 3rem;
}

html[data-theme="night_memory"] .year-rail::after {
  opacity: 0.34;
  background: var(--accent-rail);
}

html[data-theme="night_memory"] .timeline-nav {
  background: linear-gradient(180deg, rgba(212, 165, 116, 0.07), rgba(14, 20, 34, 0.4));
  border-color: var(--line);
}

/* CTA — lit from within (evening lamp), not flat yellow */
html[data-theme="night_memory"] .btn,
html[data-theme="night_memory"] .btn-primary,
html[data-theme="night_memory"] header .btn {
  color: #f0e4d4;
  font-weight: 500;
  background: var(--nm-btn-base);
  border: 1px solid rgba(200, 160, 105, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 230, 195, 0.07),
    0 6px 20px rgba(2, 6, 16, 0.32);
  filter: none;
  transform: none;
  transition:
    background 0.55s ease,
    border-color 0.55s ease,
    box-shadow 0.7s ease,
    color 0.45s ease;
}

html[data-theme="night_memory"] .btn-primary:hover,
html[data-theme="night_memory"] .btn:hover:not(.btn-ghost):not(.btn-secondary),
html[data-theme="night_memory"] header .btn:hover {
  background: var(--nm-btn-hover);
  border-color: rgba(220, 175, 115, 0.38);
  color: #faf4ea;
  box-shadow:
    inset 0 0 22px rgba(220, 170, 100, 0.1),
    inset 0 1px 0 rgba(255, 235, 200, 0.12),
    0 0 24px rgba(200, 150, 85, 0.1),
    0 0 40px rgba(180, 130, 70, 0.05),
    0 8px 26px rgba(2, 6, 16, 0.38);
  filter: none;
  transform: none;
}

html[data-theme="night_memory"] .btn-ghost,
html[data-theme="night_memory"] .btn-secondary {
  background: linear-gradient(165deg, rgba(16, 22, 36, 0.7), rgba(12, 18, 30, 0.65));
  color: var(--muted);
  border-color: var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 228, 190, 0.03);
  transition: background 0.5s ease, border-color 0.5s ease, color 0.4s ease, box-shadow 0.55s ease;
}

html[data-theme="night_memory"] .btn-ghost:hover,
html[data-theme="night_memory"] .btn-secondary:hover {
  color: var(--text);
  border-color: rgba(200, 160, 105, 0.22);
  background: linear-gradient(165deg, rgba(22, 30, 46, 0.75), rgba(16, 22, 36, 0.7));
  box-shadow:
    inset 0 0 14px rgba(200, 155, 95, 0.05),
    0 4px 16px rgba(2, 6, 16, 0.25);
  transform: none;
}

html[data-theme="night_memory"] .label {
  color: rgba(240, 220, 185, 0.92);
  border-color: rgba(200, 160, 105, 0.32);
  background: rgba(212, 165, 116, 0.08);
  box-shadow: inset 0 0 12px rgba(200, 150, 85, 0.04);
}

html[data-theme="night_memory"] .avatar {
  border-color: rgba(200, 160, 105, 0.3);
  box-shadow: 0 0 20px rgba(180, 130, 75, 0.08);
}

html[data-theme="night_memory"] audio,
html[data-theme="night_memory"] video {
  border-radius: var(--radius-sm);
  border-color: var(--line);
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.15);
}

html[data-theme="night_memory"] .tw-companion,
html[data-theme="night_memory"] .companion-panel {
  background: linear-gradient(165deg, rgba(18, 26, 42, 0.85), rgba(12, 18, 30, 0.8));
  border-color: var(--line);
  box-shadow: var(--shadow-card);
}

html[data-theme="night_memory"] #companion-content,
html[data-theme="night_memory"] .companion-hint {
  color: var(--muted);
  line-height: 1.62;
}

html[data-theme="night_memory"] #companion-content .companion-chip {
  border-color: var(--line);
  background: var(--accent-soft);
}

/* Memory create: TW-THEME-WAVE-1 — see memory_contract_tokens.css + memory_object_layers.css */

/* ── Daylight Home — tertiary (warm living family daytime) ── */
html[data-theme="daylight_home"] {
  color-scheme: light;
  /* TW-THEME-ATMOSPHERE-TUNING-001: living home — sunlit room, cream paper */
  --bg: #f2ebe0;
  --bg-soft: #ebe3d6;
  --surface: #faf6ee;
  --surface-2: #f0e8dc;
  --bg-0: #f5efe4;
  --bg-1: #e8dece;
  --text: #3d3830;
  --muted: #736a5e;
  --accent: #a67f4e;
  --accent-dark: #85653c;
  --accent-soft: rgba(166, 127, 78, 0.12);
  --accent-rail: rgba(166, 127, 78, 0.22);
  --rail: var(--accent-rail);
  --card: #fffcf6;
  --line: rgba(150, 120, 85, 0.11);
  --border: rgba(150, 120, 85, 0.11);
  --shadow-card:
    0 6px 26px rgba(100, 78, 52, 0.07),
    inset 0 1px 0 rgba(255, 252, 245, 0.65);
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-memory: "Iowan Old Style", Palatino, Georgia, "Times New Roman", serif;
  --tw-font-memory: var(--font-memory);
  --tw-bg-soft: var(--surface-2);
  --stage: 40rem;
  --whisper: #8a8278;
  --radius: 15px;
  --radius-sm: 10px;
  --birth: #5d8a62;
  --death: #8a8580;
  --memory: #7a7268;
  --wedding: #a67c7e;
  --event: #7a8494;
  /* TW-TOKEN-SYSTEM-MERGE-001: canonical runtime tokens (preset authority on html) */
  --tw-surface-primary: var(--card);
  --tw-surface-secondary: var(--surface);
  --tw-surface-tertiary: var(--surface-2);
  --tw-surface-memory: var(--card);
  --tw-text-primary: var(--text);
  --tw-text-secondary: var(--muted);
  --tw-text-muted: var(--muted);
  --tw-text-memory: var(--accent);
  --tw-action-primary: var(--accent);
  --tw-action-secondary: var(--muted);
  --tw-action-hover: var(--accent-dark);
  --tw-border-soft: var(--line);
  --tw-border-memory: var(--accent-rail);
  --tw-memory-presence: var(--accent-soft);
  --tw-memory-depth: var(--shadow-card);

}

html[data-theme="daylight_home"] h1,
html[data-theme="daylight_home"] h2,
html[data-theme="daylight_home"] h3,
html[data-theme="daylight_home"] .year-heading,
html[data-theme="daylight_home"] .reentry-heading,
html[data-theme="daylight_home"] .mem-title,
html[data-theme="daylight_home"] .memory-text {
  font-family: var(--font-memory);
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.012em;
}

html[data-theme="daylight_home"] .subtitle,
html[data-theme="daylight_home"] .hero-sub,
html[data-theme="daylight_home"] .hero-kicker,
html[data-theme="daylight_home"] .mem-preview,
html[data-theme="daylight_home"] .meta,
html[data-theme="daylight_home"] .timeline-flow-note {
  color: var(--muted);
  line-height: 1.6;
}

html[data-theme="daylight_home"] a {
  color: var(--accent-dark);
}

html[data-theme="daylight_home"] .welcome,
html[data-theme="daylight_home"] .person-header,
html[data-theme="daylight_home"] .workspace-shell,
html[data-theme="daylight_home"] .card,
html[data-theme="daylight_home"] .mem,
html[data-theme="daylight_home"] .reentry-card,
html[data-theme="daylight_home"] .tl-card,
html[data-theme="daylight_home"] .memory,
html[data-theme="daylight_home"] .bio,
html[data-theme="daylight_home"] .person-card,
html[data-theme="daylight_home"] .tw-event-view,
html[data-theme="daylight_home"] .hero-stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  color: var(--text);
}

html[data-theme="daylight_home"] .memory {
  background: var(--surface);
}

html[data-theme="daylight_home"] .mem,
html[data-theme="daylight_home"] .reentry-card {
  background: var(--surface);
  padding: 18px 20px;
}

html[data-theme="daylight_home"] .mem-thumb,
html[data-theme="daylight_home"] .reentry-thumb,
html[data-theme="daylight_home"] .avatar {
  border-color: rgba(154, 115, 72, 0.28);
  background: var(--surface-2);
}

html[data-theme="daylight_home"] .hero-stat {
  background: var(--surface-2);
  border-color: var(--line);
}

html[data-theme="daylight_home"] .hero-stat-line {
  color: var(--text);
}

html[data-theme="daylight_home"] .year-block {
  margin-bottom: 3.25rem;
}

html[data-theme="daylight_home"] .year-rail::after {
  background: var(--accent-rail);
  opacity: 0.5;
}

html[data-theme="daylight_home"] .period-label {
  color: var(--muted);
  font-weight: 500;
}

html[data-theme="daylight_home"] .timeline-nav {
  background: var(--accent-soft);
  border-color: var(--line);
}

html[data-theme="daylight_home"] .timeline-nav a {
  color: var(--accent-dark);
  font-weight: 400;
}

html[data-theme="daylight_home"] .cosmos-nav a {
  color: var(--muted);
  font-weight: 400;
  font-size: 14px;
}

html[data-theme="daylight_home"] .cosmos-nav a:hover,
html[data-theme="daylight_home"] .cosmos-nav a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

html[data-theme="daylight_home"] .btn,
html[data-theme="daylight_home"] .btn-primary,
html[data-theme="daylight_home"] header .btn {
  background: rgba(154, 115, 72, 0.14);
  color: var(--text);
  border: 1px solid rgba(154, 115, 72, 0.28);
  font-weight: 500;
  box-shadow: none;
  filter: none;
}

html[data-theme="daylight_home"] .btn:hover,
html[data-theme="daylight_home"] .btn-primary:hover {
  background: rgba(154, 115, 72, 0.22);
  border-color: rgba(154, 115, 72, 0.38);
  transform: none;
}

html[data-theme="daylight_home"] .btn-ghost,
html[data-theme="daylight_home"] .btn-secondary {
  background: var(--surface);
  color: var(--muted);
  border-color: var(--line);
}

html[data-theme="daylight_home"] .btn-ghost:hover,
html[data-theme="daylight_home"] .btn-secondary:hover {
  color: var(--text);
  background: var(--surface-2);
}

html[data-theme="daylight_home"] .label {
  color: var(--accent-dark);
  border-color: rgba(154, 115, 72, 0.32);
  background: var(--accent-soft);
}

html[data-theme="daylight_home"] audio,
html[data-theme="daylight_home"] video {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
}

html[data-theme="daylight_home"] .tw-companion,
html[data-theme="daylight_home"] .companion-panel {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-card);
}

html[data-theme="daylight_home"] #companion-content,
html[data-theme="daylight_home"] .companion-hint {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.66;
}

html[data-theme="daylight_home"] #companion-content .companion-chip {
  border-color: var(--line);
  background: var(--accent-soft);
  color: var(--text);
}

html[data-theme="daylight_home"] .tl-card,
html[data-theme="daylight_home"] .tw-event-view {
  background: var(--surface);
}

html[data-theme="daylight_home"] .graph-chip {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="daylight_home"] .graph-chip:hover {
  background: var(--accent-soft);
  border-color: rgba(154, 115, 72, 0.35);
}

/* ── Family Archive — living chronicle (TW-THEME-ARCHIVE-001)
   Warm parchment, literary type, preservation — not retro UI. ── */
html[data-theme="family_archive"] {
  color-scheme: light;
  /* TW-THEME-ATMOSPHERE-TUNING-001: archive — aged parchment, chronicle weight */
  --bg: #d8cfc0;
  --bg-soft: #cfc4b4;
  --surface: #ebe4d6;
  --surface-2: #dfd6c6;
  --bg-0: #e6dfd0;
  --bg-1: #d4caba;
  --text: #342e26;
  --muted: #645c52;
  --accent: #7a6040;
  --accent-dark: #5c482e;
  --accent-soft: rgba(122, 96, 64, 0.1);
  --accent-rail: rgba(122, 96, 64, 0.2);
  --rail: var(--accent-rail);
  --card: #f2eadc;
  --line: rgba(72, 62, 50, 0.17);
  --border: rgba(72, 62, 50, 0.17);
  --shadow-card:
    0 10px 36px rgba(38, 32, 24, 0.12),
    inset 0 1px 0 rgba(255, 248, 235, 0.28);
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-memory: Georgia, "Iowan Old Style", Palatino, "Times New Roman", serif;
  --tw-font-memory: var(--font-memory);
  --tw-bg-soft: var(--surface-2);
  --stage: 40rem;
  --whisper: #8a8276;
  --radius: 16px;
  --radius-sm: 10px;
  --birth: #5a7a5e;
  --death: #8a8480;
  --memory: #6e6860;
  --wedding: #9a7078;
  --event: #6e7a88;
  /* TW-TOKEN-SYSTEM-MERGE-001: canonical runtime tokens (preset authority on html) */
  --tw-surface-primary: var(--card);
  --tw-surface-secondary: var(--surface);
  --tw-surface-tertiary: var(--surface-2);
  --tw-surface-memory: var(--card);
  --tw-text-primary: var(--text);
  --tw-text-secondary: var(--muted);
  --tw-text-muted: var(--muted);
  --tw-text-memory: var(--accent);
  --tw-action-primary: var(--accent);
  --tw-action-secondary: var(--muted);
  --tw-action-hover: var(--accent-dark);
  --tw-border-soft: var(--line);
  --tw-border-memory: var(--accent-rail);
  --tw-memory-presence: var(--accent-soft);
  --tw-memory-depth: var(--shadow-card);

}

html[data-theme="family_archive"] h1,
html[data-theme="family_archive"] h2,
html[data-theme="family_archive"] h3,
html[data-theme="family_archive"] .year-heading,
html[data-theme="family_archive"] .reentry-heading,
html[data-theme="family_archive"] .memory-text,
html[data-theme="family_archive"] .mem-title a {
  font-family: var(--font-memory);
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.02em;
}

html[data-theme="family_archive"] .subtitle,
html[data-theme="family_archive"] .hero-sub,
html[data-theme="family_archive"] .mem-preview,
html[data-theme="family_archive"] .meta,
html[data-theme="family_archive"] .timeline-flow-note {
  color: var(--muted);
  line-height: 1.62;
}

html[data-theme="family_archive"] a {
  color: var(--accent-dark);
}

html[data-theme="family_archive"] .memory,
html[data-theme="family_archive"] .mem,
html[data-theme="family_archive"] .reentry-card {
  background: var(--card);
  border-color: var(--line);
  box-shadow: var(--shadow-card);
}

html[data-theme="family_archive"] .memory {
  background: var(--surface);
}

html[data-theme="family_archive"] .mem-thumb,
html[data-theme="family_archive"] .reentry-thumb,
html[data-theme="family_archive"] .avatar {
  border-color: rgba(143, 112, 72, 0.22);
  background: var(--surface-2);
}

html[data-theme="family_archive"] .year-block {
  margin-bottom: 3.75rem;
}

html[data-theme="family_archive"] .year-rail::after {
  background: var(--accent-rail);
  opacity: 0.45;
}

html[data-theme="family_archive"] .period-label {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.06em;
}

html[data-theme="family_archive"] .timeline-nav {
  background: var(--accent-soft);
  border-color: var(--line);
}

html[data-theme="family_archive"] .cosmos-nav a {
  color: var(--accent-dark);
  font-weight: 500;
}

html[data-theme="family_archive"] .btn-primary,
html[data-theme="family_archive"] header .btn {
  background: rgba(143, 112, 72, 0.16);
  color: var(--text);
  border: 1px solid rgba(143, 112, 72, 0.28);
  font-weight: 500;
  box-shadow: none;
}

html[data-theme="family_archive"] .btn-primary:hover,
html[data-theme="family_archive"] header .btn:hover {
  background: rgba(143, 112, 72, 0.24);
  transform: none;
}

html[data-theme="family_archive"] .btn-ghost,
html[data-theme="family_archive"] .btn-secondary {
  background: var(--surface);
  color: var(--muted);
  border-color: var(--line);
}

html[data-theme="family_archive"] .label {
  color: var(--accent-dark);
  border-color: rgba(143, 112, 72, 0.3);
  background: var(--accent-soft);
}

html[data-theme="family_archive"] .hero-stat {
  background: var(--surface-2);
  border-color: var(--line);
}

html[data-theme="family_archive"] audio,
html[data-theme="family_archive"] video {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
}

html[data-theme="family_archive"] .tw-companion,
html[data-theme="family_archive"] .companion-panel {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
}

html[data-theme="family_archive"] #companion-content,
html[data-theme="family_archive"] .companion-hint {
  color: var(--muted);
  font-family: var(--font-memory);
  line-height: 1.68;
}

html[data-theme="family_archive"] #companion-content .companion-chip {
  border-color: var(--line);
  background: var(--accent-soft);
  color: var(--text);
}

html[data-theme="family_archive"] .tl-card,
html[data-theme="family_archive"] .tw-event-view {
  background: var(--surface);
  border-color: var(--line);
}

/* Timeline cards (shared) */
.tw-event-view {
  border-radius: 16px;
  padding: 14px 16px;
}
.tw-event-view__date {
  margin-bottom: 6px;
}
.tw-event-view__author {
  margin-bottom: 6px;
}
.tw-event-view__meta {
  font-size: 12px;
  opacity: 0.92;
  letter-spacing: 0.01em;
}
.tw-event-view__title {
  margin-bottom: 6px;
}
.tw-event-view__meaning {
  margin-top: 2px;
}
.tw-event-view__meaning-text {
  opacity: 0.85;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tl-link {
  letter-spacing: 0.01em;
}

/* TW-ADMIN-THEME-SIMPLIFICATION-001: admin picker swatch preview tokens */
:root {
  --tw-swatch-current_dark-bg: #0f172a;
  --tw-swatch-current_dark-text: #f8fafc;
  --tw-swatch-current_dark-accent: #f59e0b;
  --tw-swatch-night_memory-bg: #131b2c;
  --tw-swatch-night_memory-text: #f3f0ea;
  --tw-swatch-night_memory-accent: #d4a574;
  --tw-swatch-daylight_home-bg: #faf6ee;
  --tw-swatch-daylight_home-text: #3d3830;
  --tw-swatch-daylight_home-accent: #a67f4e;
  --tw-swatch-family_archive-bg: #ebe4d6;
  --tw-swatch-family_archive-text: #342e26;
  --tw-swatch-family_archive-accent: #7a6040;
}
