/* ─── Premium "ledger" look ────────────────────────────────────────────────
   Adapted from the H101 tracker: hairlines, forest buttons, brass detail,
   depth on the dark papers. Beam keeps its own IBM Plex font. Loaded after styles.css, so
   removing this file (and its <link> tags) restores the previous look.

   Theme ids stay silver / warm / cyberdeck so saved preferences carry over;
   only their display names change (Stone / Dusk / Ink).

   Why --primary is not the forest green: --primary is also used for text and
   icons, and forest is unreadable on the dark papers. Filled buttons get their
   own --btn-primary token instead.
─────────────────────────────────────────────────────────────────────────── */

:root, :root[data-theme="cyberdeck"] {
  --bg: #0D1117; --bg-alt: #10151B;
  --card: #141A21; --card-inner: #10151B;
  --surface-1: #181F27; --surface-2: #1C242D; --surface-3: #27313B;
  --text: #CBD2D8; --text-strong: #F2F5F7; --text-muted: #8D98A1; --text-dim: #66717B;
  --line: rgba(214, 222, 230, 0.12); --line-strong: rgba(214, 222, 230, 0.24);
  --primary: #6FBF97; --primary-strong: #58A980;
  --primary-soft: rgba(111, 191, 151, 0.13); --on-primary: #08140E;
  --accent: #C9A96A; --accent-soft: rgba(201, 169, 106, 0.14);
  --danger: #E5766C; --success: #6FBF97; --warning: #C9A96A;
  --btn-primary: #105034; --btn-primary-hover: #146542; --btn-primary-text: #F4F1E6;
  --paper-top: #161D25; --paper-bottom: #10161D;
  --body-light: #17222E;
  --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 20px 48px rgba(0, 0, 0, 0.42);
  --glow: none;
  --bg-glow-a: transparent; --bg-glow-b: transparent;
}

/* Dusk: the middle paper */
:root[data-theme="warm"] {
  --bg: #1F262D; --bg-alt: #232B33;
  --card: #28313A; --card-inner: #232B33;
  --surface-1: #2E3741; --surface-2: #333D47; --surface-3: #3E4954;
  --text: #D5DADF; --text-strong: #F4F6F8; --text-muted: #A3ADB6; --text-dim: #7E8993;
  --line: rgba(222, 228, 234, 0.14); --line-strong: rgba(222, 228, 234, 0.26);
  --primary: #7CC9A2; --primary-strong: #66B48D;
  --primary-soft: rgba(124, 201, 162, 0.14); --on-primary: #0B1811;
  --accent: #D4B67A; --accent-soft: rgba(212, 182, 122, 0.15);
  --danger: #EC8378; --success: #7CC9A2; --warning: #D4B67A;
  --btn-primary: #14593A; --btn-primary-hover: #187048; --btn-primary-text: #F4F1E6;
  --paper-top: #2B3540; --paper-bottom: #232C35;
  --body-light: #2C3744;
  --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 20px 48px rgba(0, 0, 0, 0.26);
  --glow: none;
  --bg-glow-a: transparent; --bg-glow-b: transparent;
}

/* Stone: flat daylight paper */
:root[data-theme="silver"] {
  --bg: #F4F1EA; --bg-alt: #EDE9DE;
  --card: #FBF9F3; --card-inner: #F7F4EC;
  --surface-1: #FFFDF8; --surface-2: #EDE9DE; --surface-3: #E1DCCE;
  --text: #3A4136; --text-strong: #1C2118; --text-muted: #646B5B; --text-dim: #7F8575;
  --line: rgba(35, 40, 31, 0.16); --line-strong: rgba(35, 40, 31, 0.32);
  --primary: #0A4D30; --primary-strong: #083D26;
  --primary-soft: rgba(10, 77, 48, 0.09); --on-primary: #F7F4EA;
  --accent: #8A6D35; --accent-soft: rgba(138, 109, 53, 0.12);
  --danger: #A9352B; --success: #0A4D30; --warning: #8A6D35;
  --btn-primary: #0A4D30; --btn-primary-hover: #0C5C3A; --btn-primary-text: #F7F4EA;
  --paper-top: #FBF9F3; --paper-bottom: #FBF9F3;
  --body-light: #F4F1EA;
  --shadow: 0 1px 2px rgba(30, 30, 20, 0.04), 0 8px 24px rgba(30, 30, 20, 0.05);
  --glow: none;
  --bg-glow-a: transparent; --bg-glow-b: transparent;
}

/* Edges: square boxes, rounded controls (deliberate mix). --radius drives the
   controls; boxes that borrowed it are squared off below. */
:root, :root[data-theme] {
  --radius: 8px;
  --radius-lg: 2px;
  --radius-pill: 999px;
  --letter-caps: 0.16em;
  --font-weight-strong: 600;
}

body { background: radial-gradient(1150px 540px at 28% -12%, var(--body-light) 0%, var(--bg) 58%) fixed; }

.bridge-card, .modal-panel {
  background: linear-gradient(180deg, var(--paper-top), var(--paper-bottom));
}

.topbar {
  background: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
}

.mod-tile, .org-task, .vault-uprow { border-radius: var(--radius-lg); }

.section-title, .org-card-title { font-weight: 600; font-size: 0.66rem; }

/* Primary buttons: one forest colour, no neon glow */
button.primary, .mint-btn.big, .mint-btn:hover, .kw-new {
  background: var(--btn-primary);
  border-color: var(--btn-primary);
  color: var(--btn-primary-text);
  box-shadow: none;
}
button.primary:hover, .mint-btn.big:hover, .kw-new:hover {
  background: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
  box-shadow: none;
  filter: none;
}
.mint-btn.big .hotkey, .send-btn .hotkey { color: var(--btn-primary-text); }

/* Active module: a brass rule rather than a tinted glow */
.mod-pill.is-active {
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* Theme picker shows the new papers */
.theme-preview-cyberdeck { background: linear-gradient(90deg, #0D1117 55%, #105034 55% 78%, #C9A96A 78% 100%); border-color: rgba(214, 222, 230, 0.24); }
.theme-preview-warm { background: linear-gradient(90deg, #1F262D 55%, #14593A 55% 78%, #D4B67A 78% 100%); border-color: rgba(222, 228, 234, 0.26); }
.theme-preview-silver { background: linear-gradient(90deg, #F4F1EA 55%, #0A4D30 55% 78%, #8A6D35 78% 100%); border-color: rgba(35, 40, 31, 0.32); }

/* Warning and overdue states follow the theme. Calendar category colours
   (task / note / reminder) stay distinct on purpose: they carry meaning. */
.kw-meter-fill.warn { background: var(--warning); }
.kw-radar-card.warn .kw-radar-value, .wt-score.warn .wt-score-num, .wt-card.warn .wt-card-val { color: var(--warning); }
.org-task-prio.is-p-med { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 45%, var(--line)); }
.org-day-prio.is-p-med { color: var(--warning); background: color-mix(in srgb, var(--warning) 15%, transparent); }
.org-day-prio.is-p-high { color: var(--danger); background: color-mix(in srgb, var(--danger) 15%, transparent); }
.org-rem-row .org-rem-at.is-due { color: var(--danger); }
.org-rem-row.is-due { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.vault-dupopt-tag { color: var(--on-primary); }
