/* ==========================================================================
   RPS themes (round 2026-11-10: "multiple themes for app, websites").

   The same six choices as the app (mobile/lib/palette.dart), same names,
   same values:

     system    Follow the device        -> light or dark below
     light     Light     warm platinum paper            (style.css :root)
     dark      Dark      night navy, the brand look     (style.css [data-theme="dark"])
     graphite  Graphite  neutral dark, no blue          (here, on the dark base)
     sand      Sand      warm light, espresso chrome    (here, on the light base)
     contrast  High contrast  black on white, 7:1 text  (here, on the light base)

   How it is wired: <html data-theme="light|dark"> stays the BASE mode, so
   every existing [data-theme="dark"] rule keeps working; a named theme adds
   data-skin="graphite|sand|contrast" and overrides tokens only. The boot
   snippet in each page's <head> sets both attributes before the first paint
   (js/app.js RPS_THEMES is the list; tests/theme-contrast.test.js recomputes
   every text / surface pair of every theme: WCAG AA 4.5:1, High contrast 7:1).

   A theme is a token set. Do not style components per theme here - give the
   component a token in style.css and set the token below.
   ========================================================================== */

/* ---- Graphite: neutral dark ------------------------------------------------
   Page < sidebar-dark < surface < raised, all without a hue; the crimson and
   the status colours are the only colour on screen. */
[data-theme][data-skin="graphite"] {
  color-scheme: dark;
  --bg:            #111214;
  --bg-gradient:   radial-gradient(1000px 560px at 100% -120px, rgba(224,20,34,.08) 0%, transparent 62%),
                   linear-gradient(180deg, #111214 0%, #0e0f11 100%);
  --surface:       #1b1c1f;
  --surface-2:     #202125;
  --surface-muted: #26272c;
  --sidebar:       #0c0d0f;
  --sidebar-hover: #1a1b1f;
  --sidebar-text:  #d3d4d9;
  --sidebar-text-muted: #9395a0;

  --text:          #f1f1f3;
  --text-muted:    #a9abb3;
  --text-faint:    #9b9da6;

  --border:        #2e3035;
  --border-strong: #3d3f46;

  --brand:         #f52a37;
  --brand-700:     #d81626;
  --brand-50:      #421f23;
  --neutral-50:    #26272c;

  /* Status pills: the hue at 18 % over the graphite card. */
  --tone-neutral-bg:    #34363a;  --tone-neutral-fg:  #cbd5e1;  --tone-neutral-solid:  #8b8e99;
  --tone-info-bg:       #273546;  --tone-info-fg:     #60a5fa;  --tone-info-solid:     #60a5fa;
  --tone-success-bg:    #233f30;  --tone-success-fg:  #4ade80;  --tone-success-solid:  #4ade80;
  --tone-warning-bg:    #433920;  --tone-warning-fg:  #fbbf24;  --tone-warning-solid:  #fbbf24;
  --tone-danger-bg:     #432b2e;  --tone-danger-fg:   #f87171;  --tone-danger-solid:   #f87171;
  --tone-handover-bg:   #343046;  --tone-handover-fg: #a78bfa;  --tone-handover-solid: #a78bfa;
  --tone-progress-bg:   #1e3d3c;  --tone-progress-fg: #2dd4bf;  --tone-progress-solid: #2dd4bf;
  --tone-assigned-bg:   #2f3246;  --tone-assigned-fg: #8b95f9;  --tone-assigned-solid: #8b95f9;
  --tone-void-bg:       #3d3539;  --tone-void-fg:     #d7a9ae;  --tone-void-solid:     #b07d87;
  --tone-leer-bg:       #433124;  --tone-leer-fg:     #fb923c;  --tone-leer-solid:     #fb923c;

  --chart-1:       #e6e6ea;
  --chart-2:       #5a5c66;

  --elev-1: inset 0 1px 0 rgba(255,255,255,.05), 0 1px 2px rgba(0,0,0,.45), 0 10px 24px -16px rgba(0,0,0,.8);
  --elev-2: inset 0 1px 0 rgba(255,255,255,.065), 0 2px 4px rgba(0,0,0,.4), 0 18px 40px -16px rgba(0,0,0,.85);
  --elev-3: inset 0 1px 0 rgba(255,255,255,.075), 0 32px 72px -20px rgba(0,0,0,.9), 0 2px 8px rgba(0,0,0,.45);
  --field-bg:      #141518;
  --field-border:  #777a83;
  --skeleton-base: #26272c;
  --skeleton-peak: #32343a;

  --sidebar-bg: linear-gradient(180deg, #101113 0%, #0c0d0f 55%, #0a0b0c 100%);
  --chrome-tint: 255 255 255;
  --backdrop: rgba(0, 0, 0, .62);
  --hero-bg: radial-gradient(120% 70% at 85% -10%, rgba(84, 22, 30, .8) 0%, transparent 58%),
             linear-gradient(168deg, #0c0d0f 0%, #17181b 58%, #20171a 120%);
  --map-filter: grayscale(1) invert(1) brightness(.9) contrast(.9);
  --raised-1: #26272c; --raised-2: #2b2c32; --raised-3: #32343a; --raised-line: #3c3e45;
}

/* ---- Sand: warm light ------------------------------------------------------
   Sand paper, warm white cards, espresso chrome. The status colours are the
   deeper steps so they still read as text on the sand page. */
[data-theme][data-skin="sand"] {
  color-scheme: light;
  --bg:            #f3ece0;
  --bg-gradient:   radial-gradient(1100px 520px at 100% -140px, rgba(203,19,35,.06) 0%, transparent 62%),
                   radial-gradient(900px 480px at 18% -180px, rgba(255,253,248,.9) 0%, transparent 70%),
                   linear-gradient(180deg, #f5efe4 0%, #efe7d9 100%);
  --surface:       #fffdf8;
  --surface-2:     #faf5ea;
  --surface-muted: #efe6d6;
  --sidebar:       #231c16;
  --sidebar-hover: #32281f;
  --sidebar-text:  #e3d8c8;
  --sidebar-text-muted: #a89b88;

  --text:          #2a221b;
  --text-muted:    #5f5245;
  --text-faint:    #6f6152;

  --border:        #e6dccb;
  --border-strong: #d3c6b0;

  --brand:         #cb1323;
  --brand-700:     #9c0f1a;
  --brand-50:      #fbe9e4;

  --success:       #166534;
  --success-50:    #e9f7ea;
  --warning:       #92400e;
  --warning-50:    #fdf3d7;
  --info:          #1d4ed8;
  --info-50:       #e8effc;
  --danger:        #b91c1c;
  --danger-50:     #fbe9e6;
  --neutral-50:    #efe6d6;

  --tone-neutral-bg:    #efe6d6;  --tone-neutral-fg:  #4f4438;  --tone-neutral-solid:  #8f8272;

  --chart-1:       #3a3028;
  --chart-2:       #c2b5a0;

  --elev-1: 0 1px 0 rgba(60,42,20,.03), 0 1px 3px rgba(60,42,20,.06), 0 8px 20px -14px rgba(60,42,20,.18);
  --elev-2: 0 1px 2px rgba(60,42,20,.06), 0 14px 32px -14px rgba(60,42,20,.26);
  --elev-3: 0 28px 64px -20px rgba(60,42,20,.36), 0 2px 8px rgba(60,42,20,.07);
  --sheen: linear-gradient(180deg, rgba(255,253,248,.6), rgba(255,253,248,0) 96px);
  --field-bg:      #fffdf8;
  --field-focus-bg: #fffdf8;
  --skeleton-base: #ebe2d2;
  --skeleton-peak: #f7f1e6;
  /* Warmth (style.css @@R17-WARM@@) on sand; text / muted / faint:
     band 12.06 / 5.83 / 4.62, head 14.76 / 7.13 / 5.65, button 13.46 / 6.50 / 5.15,
     button hover 12.53 / 6.05 / 4.80, zebra 15.01 / 7.25 / 5.75, hover row 13.70 / 6.62 / 5.25. */
  --band-top:      #ebe1cf;
  --head-tint:     #fcf8f0;
  --btn-2-bg:      #f5ede0;
  --btn-2-hover:   #efe5d4;
  --btn-2-line:    #d3c6b0;
  --row-alt:       #fdfaf4;
  --row-hover:     #f7efe2;
}

/* ---- High contrast: black on white ------------------------------------------
   For tired eyes and bright sun: pure white paper, black ink, outlines you
   can find. Every text step clears 7:1 (WCAG AAA) on every surface, every
   pill and button label 7:1 on its own fill; borders clear 3:1. No washes,
   no sheen. */
[data-theme][data-skin="contrast"] {
  color-scheme: light;
  --bg:            #ffffff;
  --bg-gradient:   none;
  --surface:       #ffffff;
  --surface-2:     #f2f2f2;
  --surface-muted: #e8e8e8;
  --sidebar:       #000000;
  --sidebar-hover: #262626;
  --sidebar-text:  #ffffff;
  --sidebar-text-muted: #d4d4d4;

  --text:          #000000;
  --text-muted:    #2b2b2b;
  --text-faint:    #404040;

  --border:        #767676;
  --border-strong: #1a1a1a;
  --field-border:  #1a1a1a;

  --brand:         #b00014;
  --brand-700:     #7f000e;
  --brand-50:      #ffe3e6;

  --success:       #14532d;
  --success-50:    #d3f8df;
  --warning:       #713f12;
  --warning-50:    #fdf0b8;
  --info:          #1e3a8a;
  --info-50:       #dbe7ff;
  --danger:        #991b1b;
  --danger-50:     #ffe0e0;
  --neutral-50:    #e8e8e8;
  --handover:      #4c1d95;
  --handover-50:   #ebe2ff;

  --tone-neutral-bg:    #e8e8e8;  --tone-neutral-fg:  #1f1f1f;  --tone-neutral-solid:  #595959;
  --tone-info-bg:       #dbe7ff;  --tone-info-fg:     #1e3a8a;  --tone-info-solid:     #1d4ed8;
  --tone-success-bg:    #d3f8df;  --tone-success-fg:  #14532d;  --tone-success-solid:  #15803d;
  --tone-warning-bg:    #fdf0b8;  --tone-warning-fg:  #713f12;  --tone-warning-solid:  #a16207;
  --tone-danger-bg:     #ffe0e0;  --tone-danger-fg:   #7f1d1d;  --tone-danger-solid:   #b91c1c;
  --tone-handover-bg:   #ebe2ff;  --tone-handover-fg: #4c1d95;  --tone-handover-solid: #6d28d9;
  --tone-progress-bg:   #cdf5ee;  --tone-progress-fg: #134e4a;  --tone-progress-solid: #0f766e;
  --tone-assigned-bg:   #e0e3ff;  --tone-assigned-fg: #312e81;  --tone-assigned-solid: #4338ca;
  --tone-void-bg:       #f3e1e4;  --tone-void-fg:     #6b2932;  --tone-void-solid:     #8f3f48;
  --tone-leer-bg:       #ffe6cc;  --tone-leer-fg:     #7c2d12;  --tone-leer-solid:     #c2410c;

  --act-go-solid: #166534;       --act-go-soft: #d3f8df;       --act-go-fg: #14532d;
  --act-finish-solid: #1e40af;   --act-finish-soft: #dbe7ff;   --act-finish-fg: #1e3a8a;
  --act-route-solid: #115e59;    --act-route-soft: #cdf5ee;    --act-route-fg: #134e4a;
  --act-talk-solid: #5b21b6;     --act-talk-soft: #ebe2ff;     --act-talk-fg: #4c1d95;
  --act-dispatch-soft: #ffe3e6;  --act-dispatch-fg: #7f000e;
  --act-money-solid: #eab308;    --act-money-on: #000000;      --act-money-soft: #fdf0b8;  --act-money-fg: #5f370d;
  --act-caution-solid: #9a3412;  --act-caution-soft: #ffe6cc;  --act-caution-fg: #6f2710;
  --act-stop-solid: #991b1b;     --act-stop-soft: #ffe0e0;     --act-stop-fg: #7f1d1d;
  --act-line-mix: 70%;
  --act-hover-mix: 4%;
  --act-press-mix: 6%;

  --src-sixt-solid:   #c2410c;  --src-sixt-fg:   #7c2d12;  --src-sixt-soft:   #ffe6cc;
  --src-cloud-solid:  #a16207;  --src-cloud-fg:  #713f12;  --src-cloud-soft:  #fdf0b8;
  --src-hk-solid:     #15803d;  --src-hk-fg:     #14532d;  --src-hk-soft:     #d3f8df;
  --src-ps-solid:     #1d4ed8;  --src-ps-fg:     #1e3a8a;  --src-ps-soft:     #dbe7ff;
  --src-custom-solid: #7e22ce;  --src-custom-fg: #581c87;  --src-custom-soft: #f1e3ff;
  --money-share: #14532d;

  --chart-1:       #000000;
  --chart-2:       #767676;

  --elev-1: 0 0 0 1px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.12);
  --elev-2: 0 0 0 1px rgba(0,0,0,.2), 0 12px 28px -12px rgba(0,0,0,.35);
  --elev-3: 0 0 0 1px rgba(0,0,0,.4), 0 28px 64px -20px rgba(0,0,0,.45);
  --sheen: none;
  --focus-glow: 0 0 0 2px #ffffff, 0 0 0 5px #000000;
  --field-bg:      #ffffff;
  --skeleton-base: #dcdcdc;
  --skeleton-peak: #f2f2f2;
  /* Warmth (style.css @@R17-WARM@@): no washes here - white paper, the
     inset grey for a button and the row under the pointer, black outlines. */
  --band-top:      #ffffff;
  --head-tint:     #ffffff;
  --btn-2-bg:      #f2f2f2;
  --btn-2-hover:   #e8e8e8;
  --btn-2-line:    #1a1a1a;
  --row-alt:       #ffffff;
  --row-hover:     #f2f2f2;
}
/* The pill keeps its outline in its own colour, so a status never rests on a
   faint tint alone. */
[data-skin="contrast"] :is(.pill, .status-pill, .mc-status, .of-status, .dsp-pill, .live-chip, .nu-status, .ac-flag) {
  box-shadow: inset 0 0 0 1px currentColor;
}
/* Links read as links without relying on colour. */
[data-skin="contrast"] :is(.main, .modal, .sheet) a:not(.btn, .nav a, .acct-row, .seg-btn, .tabs a, [class*="tile"], [class*="card"]) {
  text-decoration: underline; text-underline-offset: 2px;
}
