/*
 * Beam CSS variables — colour.
 *
 * VARIABLES ONLY. No selector in this file renders or overrides anything; it
 * declares custom properties and nothing else. That is the contract the name
 * carries, and css_foundation_test.clj enforces it.
 *
 * This is one of three, split by domain on 23 September 2026 because the single
 * file it came from was called tokens.css and "token" means four different
 * things in this repo — the anti-forgery token on every form POST, the preview
 * and API auth tokens, this, and @beam/input-ui/tokens.css which the islands
 * import and which is a different file entirely. Same values, same names,
 * findable by what they are:
 *
 *   vars-colour.css   surfaces, text, borders, --status-*, charts, scrim
 *   vars-layout.css   spacing, drawer and globals widths, z-index
 *   vars-control.css  radii, control heights and padding, component sizing
 *
 * THE TYPE SCALE IS NOT HERE and never was. resources/styleguide.css owns
 * --headings-large-* and --body-*, and specs/presentation.allium
 * (TypographyPresentation) is its behavioural contract. Brand ramps
 * (--primary-*, --secondary-*, --dark-*, --light-*, --alert-*) are owned by
 * resources/tailwind.css. Where sources disagree, styleguide.css is canonical.
 *
 * Names are UNCHANGED by the split: every var() that resolved before resolves
 * now. Only the file a name lives in, and the <link> that pulls it in, moved.
 *
 * Placeholders with no platform precedent, still awaiting ratification:
 * --status-stale-*, --status-changed-*, --status-error-*, --heatmap-*,
 * --tooltip-*, --map-polygon-*, --file-upload-*, --table-status-*, --ag-beam-*.
 *
 * --status-changed-* aliases the warning triple outright, so warning's text
 * #6f5200 is what two of the five states resolve to. CRM 60055 moves the
 * global nav to dark green and the vendor registration sidebar's save
 * indicator draws these states there: `dirty` is unreadable on that ground.
 * Fix the values before that sidebar lands.
 */

:root {
  /* FIN-F14 consumes this shared modelled opacity. */
  --modelled-mix: 50%;
  /* Shared map paint, preserving the solar layout and PV connector colours. */
  --map-solar-panel-fill: rgb(17, 24, 39);
  --map-solar-panel-edge: rgb(3, 7, 18);
  --energy-solar-connector: #FE9900;

  /* Type fills stay light; these inks keep text and thin lines readable. */
  --btm-battery-ink: #20788A;
  --fom-battery-ink: #2563A8;
  --pfc-ink: #706E69;

  --shadow-dialog: rgba(0, 0, 0, 0.28); /* Existing system-choice dialog elevation. */
  --rec-dialog-scrim: rgba(0, 20, 22, 0.45); /* Existing system-choice backdrop. */
  /* UX-55b: semantic ranking ramp, preserving the approved Beam teal/red. */
  --score-best: var(--beam-teal);
  --score-worst: #AF3739;
  --score-text-light: var(--text-inverse);
  --score-text-dark: var(--coredark-900);
  --surface-control-overlay: rgba(255, 255, 255, 0.85); /* Weighting segment remove button. */
  /* Surfaces and text. Values observed in styleguide.css and site-setup.css. */
  --surface-white: #ffffff; /* opaque white surface (white notices) */
  --surface-page: var(--corelight-100); /* styleguide.css --corelight-100 */
  --surface-canvas: #f7f8fb; /* site-setup.css .load-workspace background */
  --surface-panel: var(--corelight-100); /* styleguide.css --corelight-100 */
  --surface-muted: var(--corelight-300); /* styleguide.css --corelight-300 */
  --surface-divider: var(--corelight-500); /* styleguide.css --corelight-500 */
  --text-primary: var(--coredark-700); /* styleguide.css --coredark-700 */
  --text-secondary: #677489; /* site-setup.css modal descriptions */
  --text-inverse: var(--corelight-100); /* styleguide.css --corelight-100 */
  --text-link: #2a578d; /* site-setup.css modal active tab */
  --text-inverse-muted: rgba(255, 255, 255, 0.5); /* the dashboard top bar's inactive tabs (PR #365) */
  --shadow-menu: rgba(0, 0, 0, 0.15); /* drop-down menus under the dashboard top bar (PR #365) */
  /* Standard View (PR #365): Beam-green-based tints and shadows. */
  --tint-teal: #E6F9F5; /* a chosen menu item; a step's "done" chip */
  --tint-green: #F2F7F7; /* the active next step */
  --shadow-green-soft: rgba(0, 58, 64, 0.1); /* a card on hover */
  --shadow-green: rgba(0, 58, 64, 0.16); /* menus */
  --shadow-green-strong: rgba(0, 58, 64, 0.18); /* the filmstrip's arrows */
  /* Shadows tinted with --dark-300 (#052A2E), Listy 4 Nov (PR #877). */
  --shadow-ink-soft: rgba(5, 42, 46, 0.10); /* the Stage popover (.bm-stage-chevron) */
  --shadow-ink: rgba(5, 42, 46, 0.18); /* the project bar card (.bm-project-bar--card) */
  --shadow-ink-strong: rgba(5, 42, 46, 0.25); /* the round modals (Request Offers, New round) */
  --surface-summary: #F4F4F4; /* the offer round Total block */
  --surface-selected-tint: #F2FAF8; /* a chosen radio option in the round modals */
  --border-subtle: var(--corelight-500); /* styleguide.css --corelight-500 */
  --border-default: var(--corelight-900); /* styleguide.css --corelight-900 */
  --border-strong: #d8dee8; /* site-setup.css modal/sidebar dividers */

  /* Manage performance bands (actual vs expected generation): the Sites
     page's Performance mix bar. ag-grid.js and elements/common.clj still
     carry these as literals. */
  --perf-band-under: #6B3945; /* 0-80% */
  --perf-band-low: #FFDC00; /* 80-90% */
  --perf-band-on: var(--primary-100); /* 90-100% */
  --perf-band-over: var(--primary-900); /* 100%+ */
  --perf-band-none: #8C99B1; /* no status */

  /* Semantic states. Existing warning chip extracted; other states are placeholders. */
  /* Temporary read-only system view: half-opacity brand teal in either theme. */
  --status-viewed: color-mix(in srgb, var(--beam-teal) 50%, transparent);
  --status-warning-bg: #fff7d6; /* site-setup.css .modal-dirty-chip background */
  --status-warning-border: #d8a200; /* site-setup.css .modal-dirty-chip border */
  --status-warning-text: #6f5200; /* site-setup.css .modal-dirty-chip color */
  --status-error-bg: #fff1f1; /* new — no platform precedent */
  --status-error-border: var(--alert-700); /* = #c03838 */
  --status-error-text: var(--alert-900); /* = #912b2b */
  --status-success-bg: #eefaf6; /* new — no platform precedent */
  --status-success-border: #1d9477; /* #1d9477 as a literal, not var(--battery-charged), so success borders never follow a battery-colour change; 3.54:1 on the bg, passes the 3:1 a border needs */
  --status-success-text: var(--primary-500); /* 6.22:1 on the bg. NOT the border green, which is 3.54:1 and fails text's 4.5:1 */
  --status-info-bg: #eef4ff; /* new (CPM T61355): Listy, 16 Oct -- Enrolled and Initial Offers read blue */
  --status-info-border: #6585d0; /* new; 3.27:1 on the bg, past the 3:1 a border needs */
  --status-info-text: #1e40af; /* new; 7.9:1 on the bg */
  --status-stale-bg: #f7f8fb; /* site-setup.css .load-workspace background */
  --status-stale-border: var(--corelight-900); /* styleguide.css */
  --status-stale-text: var(--coredark-100); /* styleguide.css */
  --status-changed-bg: var(--status-warning-bg); /* current dirty-chip idiom */
  --status-changed-border: var(--status-warning-border); /* current dirty-chip idiom */
  --status-changed-text: var(--status-warning-text); /* current dirty-chip idiom */

  /* The timelines' blue band (the project list's "under three months",
     Project History's "last week"; CPM T61355 / Listy 22 Oct), CPM's
     Activity-stream blue. A decorative 10px dot beside
     text that says the time, so no text-contrast need. */
  --timeline-blue: #2f9fe0;

  /* The system-choice measures (PR #426; Listy, 19 Oct 2026): the "How Beam
     chooses initial systems" dialog's weighting chart and legend
     (components/system-choice-info.css). Payback, NPV, Net Benefit on
     Financed and Back-up Duration take brand tokens or black; these four
     have no brand or energy token, so they are named here. */
  --measure-size: #FF0040;
  --measure-grid: #C000F0;
  --measure-emissions: #5000F0;
  --measure-export: #FFD700;

  /* Chart aliases. Existing colors alias styleguide energy vars first. */
  --c-load: var(--load); /* styleguide.css */
  --c-grid: var(--grid-supply-primary); /* styleguide.css */
  --c-grid-secondary: var(--grid-supply-secondary); /* styleguide.css */
  --c-gas: var(--gas-supply); /* styleguide.css */
  --c-solar: var(--solar-consumed); /* styleguide.css */
  --c-solar-export: var(--solar-exported); /* styleguide.css */
  --c-battery-charge: var(--battery-charged); /* styleguide.css */
  --c-battery-discharge: var(--battery-discharged); /* styleguide.css */
  /* The load charts' 3rd and 4th component colours (load-canvas.js,
     beam-bar-chart.js). They used to borrow the battery charge/discharge
     tokens; a load component is not a battery, so they have their own
     (the same greens), and follow no battery-colour change (22 Oct 2026). */
  --c-series-green: #3db598;
  --c-series-green-dark: #1d9477;
  --c-ev: var(--ev); /* styleguide.css */
  --c-generator: var(--generator); /* styleguide.css */
  --c-electrification: var(--electrification); /* styleguide.css */
  --chart-grid-line: var(--corelight-500); /* dashboard.html chart grid #E8EAED */
  --chart-axis: var(--coredark-100); /* styleguide.css muted dark */
  --chart-tooltip-bg: var(--coredark-500); /* styleguide.css */
  --chart-tooltip-text: var(--corelight-100); /* styleguide.css */

  /* Component placeholders with no platform precedent yet. */
  --tooltip-bg: var(--coredark-500); /* new — no platform precedent */
  --tooltip-text: var(--corelight-100); /* new — no platform precedent */
  --heatmap-low: var(--corelight-300); /* new — no platform precedent */
  --heatmap-mid: var(--solar-consumed); /* new — no platform precedent */
  --heatmap-high: var(--solar-exported); /* new — no platform precedent */
  --map-polygon-selected: rgba(42, 87, 141, 0.28); /* new — no platform precedent */
  --map-polygon-hover: rgba(42, 87, 141, 0.16); /* new — no platform precedent */
  --file-upload-progress: var(--energygrid-100); /* new — no platform precedent */
  --file-upload-error-bg: var(--status-error-bg); /* new — no platform precedent */
  --file-upload-error-border: var(--status-error-border); /* new — no platform precedent */
  --table-status-bg: var(--surface-muted); /* new — no platform precedent */
  --table-status-text: var(--text-primary); /* new — no platform precedent */
  --table-progress-fill: var(--energygrid-100); /* new — no platform precedent */
  --table-header-bg: var(--corelight-100); /* shared server/ag-grid header treatment */
  --table-header-fg: var(--coredark-300); /* shared server/ag-grid header treatment */
  --ag-beam-background: var(--surface-panel); /* new — no platform precedent */
  --ag-beam-foreground: var(--text-primary); /* new — no platform precedent */
  --ag-beam-border: var(--border-strong); /* new — no platform precedent */
  --ag-beam-header-bg: #fff; /* both, spelled #fff / #FFFFFF */
  --ag-beam-header-fg: var(--coredark-300); /* both hardcoded #35475C */
  --ag-beam-header-hover-bg: transparent; /* both */
  /* Modal scrim (WP-04, I-08). Value taken from the shipped precedent: the dashboard's
     pv-table and site-total modals use Tailwind `bg-black/40` (dashboard.html:424).
     Added as a token because a scrim is a recurring need and the house rule prefers a token
     over scattering the literal. Before this, `.beam-modal` used `--map-polygon-hover`
     (rgba(42,87,141,.16)) as its backdrop — a 16% hover tint, which is why modals read as
     floating over a fully lit, still-interactive page (S-18). */
  --scrim: rgba(0, 0, 0, 0.4);
  /* Dashboard lines, tints and shadows (PR #379), named rather than scattered as
     literals. The axis line is the Systems and Cashflow charts' half-black rule;
     the dividers are the dashboard's faint and section borders. */
  --chart-axis-line: rgba(0, 0, 0, 0.5);
  --chart-axis-label: #374151; /* Tailwind gray-700, Energy Flows' axis labels */
  --divider-faint: rgba(0, 0, 0, 0.1);
  --divider-section: rgba(0, 0, 0, 0.2);
  --hover-tint: rgba(0, 0, 0, 0.06);
  --shadow-soft: rgba(0, 0, 0, 0.08);
  --shadow-raised: rgba(0, 0, 0, 0.12);
  --shadow-pressed: rgba(0, 0, 0, 0.2);
  --surface-see-through: rgba(255, 255, 255, 0.7);
  /* The Site List's electricity cost scale, cheap to dear (Listy, 22 Oct;
     sites-grid.js costBand). Bright enough that a predicted bar at 50% reads
     clearly apart from an actual one. Steps 2 and 3 have no brand ramp. */
  --cost-scale-1: var(--beam-teal);
  --cost-scale-2: #1BB3D1; /* green/blue — no brand cyan */
  --cost-scale-3: #3A86E8; /* blue — --energy-grid is too dark for a 50% bar */
  --cost-scale-4: var(--tertiary-b-300);
  --cost-scale-5: var(--warning-500);
  --cost-scale-6: var(--alert-500);
}

