/* Shared palette: night stays the default, independent of OS preference. */
:root {
  color-scheme: dark;
  /* Forum roles retain the original night colors and use warm day borders. */
  --forum-border-faint: rgba(var(--accent-rgb), 0.05);
  --forum-border-subtle: rgba(var(--accent-rgb), 0.06);
  --forum-border-soft: rgba(var(--accent-rgb), 0.08);
  --forum-border: rgba(var(--accent-rgb), 0.12);
  --forum-border-hover: rgba(var(--accent-rgb), 0.16);
  --forum-field-border: rgba(var(--accent-rgb), 0.18);
  --forum-field-border-hover: rgba(var(--accent-rgb), 0.28);
  --forum-row-hover: rgba(var(--accent-rgb), 0.03);
  --forum-field-focus: rgba(var(--accent-rgb), 0.18);
  /* Content dividers and field outlines are separate from decorative borders. */
  --forum-divider: var(--forum-border-soft);
  --forum-divider-faint: var(--forum-border-faint);
  --forum-divider-subtle: var(--forum-border-subtle);
  --forum-input-border: var(--forum-border-soft);
  --texture-image: url("../img/Texture_Felina_Arcana_notte.svg");
  --texture-opacity: 0.6;
  --bg: #0d0c10;
  --bg-2: #15131b;
  --page-background:
    radial-gradient(circle at top, rgba(140, 110, 220, 0.08), transparent 30%),
    radial-gradient(circle at bottom, rgba(110, 80, 170, 0.08), transparent 28%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  --panel: rgba(30, 26, 38, 0.82);
  --surface-panel: rgba(30, 26, 38, 0.62);
  --surface-button: rgba(30, 26, 38, 0.7);
  --surface-terminal: rgba(18, 17, 22, 0.82);
  --surface-inset: rgba(18, 16, 24, 0.72);
  --surface-glaze: rgba(255, 255, 255, 0.02);
  --surface-log-entry: var(--surface-panel);
  --inset-highlight: rgba(255, 255, 255, 0.02);
  --surface-hover: rgba(var(--accent-rgb), 0.12);
  --surface-pill-hover: rgba(var(--accent-rgb), 0.08);
  --surface-logout-hover: rgba(var(--accent-rgb), 0.14);
  --border: rgba(214, 195, 255, 0.12);
  --soft-line: rgba(255, 255, 255, 0.05);
  --heading-border: rgba(183, 174, 200, 0.14);
  --text: #f3eef8;
  --muted: #b7aec8;
  --button-text: var(--muted);
  --text-note: #e0d8f1;
  --text-path: #8c78ba;
  --text-path-dim: rgba(140, 120, 186, 0.58);
  --text-slash: rgba(183, 174, 200, 0.55);
  --accent: #c5a7ff;
  --accent-rgb: 197, 167, 255;
  --accent-soft: rgba(var(--accent-rgb), 0.08);
  --accent-text: #c5a7ff;
  --section-accent: #b796ff;
  --nav-accent: #8bb8ff;
  --sage: #9dbf9e;
  --sage-text: #9ee7d7;
  --wisteria: #8e7cc3;
  --wisteria-text: #c5a7ff;
  --important: rgba(255, 207, 123, 0.8);
  --status-neutral: #6d648e;
  --status-open: #8fd7df;
  --status-open-rgb: 143, 215, 223;
  --status-closed: #d06b6b;
  --status-closed-rgb: 208, 107, 107;
  --status-archived: #8d3737;
  --shadow: rgba(0, 0, 0, 0.32);
  --focus-ring: #c5a7ff;
  --text-heading: rgba(243, 238, 248, 0.94);
  --text-strong: rgba(243, 238, 248, 0.92);
  --text-emphasis: rgba(243, 238, 248, 0.9);
  --text-link: rgba(243, 238, 248, 0.88);
  --text-field: rgba(243, 238, 248, 0.85);
  --text-body: rgba(243, 238, 248, 0.78);
  --text-label: rgba(243, 238, 248, 0.76);
  --text-panel: rgba(243, 238, 248, 0.74);
  --text-caption: rgba(243, 238, 248, 0.72);
  --text-status: rgba(243, 238, 248, 0.7);
  --text-meta: rgba(243, 238, 248, 0.62);
  --text-date: rgba(243, 238, 248, 0.58);
  --text-table: rgba(243, 238, 248, 0.54);
  --text-role: rgba(243, 238, 248, 0.52);
  --text-description: rgba(243, 238, 248, 0.48);
  --text-mobile-label: rgba(243, 238, 248, 0.45);
  --text-avatar: rgba(243, 238, 248, 0.4);
  --text-separator: rgba(243, 238, 248, 0.28);
}

/* Color accents have separate, darker text roles for small labels and links. */
:root[data-theme="day"] {
  color-scheme: light;
  --forum-border-faint: var(--soft-line);
  --forum-border-subtle: var(--soft-line);
  --forum-border-soft: var(--soft-line);
  --forum-border: var(--border);
  --forum-border-hover: var(--accent-text);
  --forum-field-border: var(--border);
  --forum-field-border-hover: var(--focus-ring);
  --forum-row-hover: var(--surface-pill-hover);
  --forum-field-focus: var(--focus-ring);
  --forum-divider: #cbbba8;
  --forum-divider-faint: var(--forum-divider);
  --forum-divider-subtle: var(--forum-divider);
  --forum-input-border: var(--border);
  --texture-image: url("../img/Texture_Felina_Arcana_giorno.svg");
  --texture-opacity: 0.8;
  --bg: #f7f2e8;
  --bg-2: #f7f2e8;
  --page-background: #f7f2e8;
  --panel: #fffdf8;
  /* Subtle warm layers: cream frame, light veil, inset cards, deeper terminal. */
  --surface-panel: #faf5ec;
  --surface-button: #f7f1e7;
  --surface-terminal: #f2e9dc;
  --surface-inset: #f5ede1;
  --surface-glaze: #f7f1e7;
  --surface-log-entry: #f5ede1;
  --inset-highlight: rgba(255, 255, 255, 0.35);
  --surface-hover: #f0e5d4;
  --surface-pill-hover: var(--surface-hover);
  --surface-logout-hover: var(--surface-hover);
  --border: #d8c8b4;
  --soft-line: #e4d8c8;
  --heading-border: #e4d8c8;
  --text: #3a2a21;
  --muted: #716153;
  --button-text: #3a2a21;
  --text-note: #3a2a21;
  --text-path: #675096;
  --text-path-dim: #7a6a5c;
  --text-slash: #7a6a5c;
  --accent: #c48a2c;
  --accent-rgb: 196, 138, 44;
  --accent-soft: #fbf6ed;
  --accent-text: #805211;
  --section-accent: #8a5a15;
  --nav-accent: #675096;
  --sage: #6f9b6a;
  --sage-text: #466a42;
  --wisteria: #8e7cc3;
  --wisteria-text: #675096;
  --important: #8a5a15;
  --status-neutral: #675096;
  --status-open: #466a42;
  --status-open-rgb: 70, 106, 66;
  --status-closed: #a33f36;
  --status-closed-rgb: 163, 63, 54;
  --status-archived: #7a6a5c;
  --shadow: rgba(58, 42, 33, 0.12);
  --focus-ring: #8a5a15;
  --text-heading: var(--text);
  --text-strong: var(--text);
  --text-emphasis: var(--text);
  --text-link: var(--text);
  --text-field: var(--text);
  --text-body: var(--text);
  --text-label: var(--text);
  --text-panel: var(--text);
  --text-caption: var(--muted);
  --text-status: var(--muted);
  --text-meta: var(--muted);
  --text-date: var(--muted);
  --text-table: var(--muted);
  --text-role: var(--muted);
  --text-description: var(--muted);
  --text-mobile-label: var(--muted);
  --text-avatar: var(--muted);
  --text-separator: var(--muted);
}
