/* PaperLens theme tokens — the SINGLE source of palette truth.
 *
 * RULE: no raw hex anywhere else in static/*.css. Every other stylesheet
 * references these vars only. Enforced by the review grep gate:
 *   grep -rE '#[0-9a-fA-F]{3,6}' static/*.css | grep -v theme.css   # -> empty
 * This is what keeps the palette swappable for org branding (the `theme`
 * table's `tokens jsonb` can later be injected as an inline <style>).
 *
 * Default = the proven paper.metalens.tech teal-navy + mint system.
 */
:root {
  /* brand / accent (teal-navy) */
  --accent:        #1b485e;
  --accent-dark:   #122740;
  --accent-2:      #367380;   /* teal */
  --accent-3:      #9cbcc4;   /* light teal */
  --accent-wash:   #e9f4e7;   /* mint hover/selection wash */

  /* surfaces */
  --bg:            #f5f5f5;
  --surface:       #ffffff;
  --border:        #d6dde2;
  --border-focus:  #9cbcc4;

  /* text */
  --text:          #122740;
  --text-muted:    #5a6b78;
  --on-accent:     #ffffff;

  /* the signature evidence highlight + focus states */
  --highlight:        rgba(250, 204, 21, 0.25);
  --highlight-focus:  rgba(54, 115, 128, 0.32);
  --highlight-stroke: rgba(27, 72, 94, 0.95);
  --green-focus:      rgba(34, 197, 94, 0.20);
  --green-stroke:     rgba(22, 163, 74, 0.95);

  /* semantic */
  --success:       #247a24;
  --success-bg:    #e3f5e3;
  --error:         #c93434;
  --error-bg:      #fdeaea;
  --override-bg:   #fefce8;   /* edited-value wash */
  --override-line: #eab308;
  --rose-wash:     #fbf2f4;   /* subtle rose for nested sub-field cards */

  /* confidence badges */
  --conf-high:     #1c6a37; --conf-high-bg:  #e7f7ec; --conf-high-bd:  #2f9e54;
  --conf-med:      #7d5a02; --conf-med-bg:   #fdf5d3; --conf-med-bd:   #c79412;
  --conf-low:      #8a1f1f; --conf-low-bg:   #fde7e7; --conf-low-bd:   #c93434;

  /* categorical series palette + axes (D3 dashboard charts). Checked with the dataviz palette
     validator on the page surface: the first FOUR are told apart in any pairing, also with a
     colour-vision deficiency (so the colour slot of a chart takes at most 4 categories);
     5-8 only hold next to their neighbours. Order is fixed; never cycle or reorder. */
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #4a3aa7;
  --series-5: #eda100; --series-6: #e87ba4; --series-7: #008300; --series-8: #e34948;
  --ax-line:  #d6dde2;   /* axis / gridlines (= border) */
  --ax-text:  #5a6b78;   /* axis labels (= text-muted) */
  --mark:     #1b485e;   /* default single-series mark (= accent) */
  --mark-2:   #367380;   /* secondary mark / reference */

  /* type, radius, shadow */
  --font:      "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(18, 39, 64, .06);
  --shadow-md: 0 4px 12px rgba(18, 39, 64, .08);
}

/* Example org re-skin via data attribute (kept here so the swap mechanism is
   visible; an org theme would inject its own block from the `theme` table). */
body[data-theme="maseminer"] {
  --accent: #1d4a8c; --accent-dark: #122a4d; --accent-2: #2d8aa3;
  --accent-3: #9ec9d5; --accent-wash: #eef6f9; --bg: #ffffff;
}


/* ── dashboard looks (the Style panel of /dashboard; ids = dashboard_spec.VIBES / FONTS) ──
   A vibe re-skins the page of ONE dashboard via <body data-vibe="…">: surfaces, ink and the
   series colours. Every series list passed the dataviz palette validator on the vibe's own
   surface: all eight hold next to their neighbours, the first four in any pairing (night: the
   first three; its fourth leans on the legend). "clean" is the default above. A user's own
   colours arrive as inline custom properties and win over these. */
body[data-vibe="journal"], .vibe-swatch[data-vibe="journal"] {   /* print-like: white page, flat cards, ink colours (serif type by default) */
  --bg: #ffffff; --surface: #ffffff; --border: #d9d6cf; --text: #1c1b19; --text-muted: #5f5c55;
  --ax-line: #d9d6cf; --ax-text: #5f5c55; --shadow-sm: none; --radius: 2px; --radius-sm: 2px;
  --accent: #1a4f7a; --mark: #1a6ba8; --mark-2: #b8501f;
  --series-1: #1a6ba8; --series-2: #b8501f; --series-3: #2f8f5b; --series-4: #a23b8c;
  --series-5: #c48a00; --series-6: #4f9bd9; --series-7: #8a5a12; --series-8: #d0504f;
}
body[data-vibe="warm"], .vibe-swatch[data-vibe="warm"] {      /* paper background, earthy colours */
  --bg: #f4ecdd; --surface: #fbf6ec; --border: #e2d6bf; --text: #3a2a1d; --text-muted: #7a6a58;
  --ax-line: #e2d6bf; --ax-text: #7a6a58; --accent: #9a3f2b; --accent-wash: #f3e6d0;
  --mark: #c8553d; --mark-2: #0e8fb0;
  --series-1: #c8553d; --series-2: #0e8fb0; --series-3: #d19a1b; --series-4: #6a4c93;
  --series-5: #5a8f3c; --series-6: #e0809a; --series-7: #008566; --series-8: #a33f2f;
}
body[data-vibe="night"], .vibe-swatch[data-vibe="night"] {     /* dark surface, luminous colours */
  color-scheme: dark;
  --bg: #0d1318; --surface: #151c22; --border: #2a343d; --border-focus: #4a6a7a; --text: #eef2f5; --text-muted: #9aa8b3;
  --ax-line: #2a343d; --ax-text: #9aa8b3; --accent: #7fb6d6; --accent-dark: #a9d0e6; --accent-3: #4a6a7a; --accent-wash: #1d2a33;
  --on-accent: #0d1318; --override-bg: #2e2a12; --override-line: #c9a200; --success: #4cc26a; --success-bg: #14301c;
  --error: #ef7676; --error-bg: #3a1a1a; --shadow-sm: none; --shadow-md: 0 4px 14px rgba(0, 0, 0, .5);
  --conf-med: #e3c25a; --conf-med-bg: #2e2a12; --conf-med-bd: #c9a200;
  --mark: #3987e5; --mark-2: #d95926;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
}
/* fonts: what the dashboard (not the site chrome) is set in */
body[data-dash-font="serif"]  { --dash-font: var(--font-serif); }
body[data-dash-font="system"] { --dash-font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body[data-dash-font="mono"]   { --dash-font: var(--font-mono); }
body[data-vibe="journal"]:not([data-dash-font]) { --dash-font: var(--font-serif); }
/* the Style panel previews each look in a swatch, whatever look the page has right now */
.vibe-swatch[data-vibe="clean"] {
  --surface: #ffffff; --border: #d6dde2;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #4a3aa7;
}
