/* ⚠️ SEMANTIC COLOUR — THE PART YOU MUST NOT REPAINT ⚠️

   A large share of Droneportal's colour is DATA, NOT DECORATION. A blue number means cut. An orange
   number means fill. A green point is at a particular height. A purple polygon is a vertical shaft
   rather than a cross-section. Repainting these changes what the interface SAYS, and a surveyor
   reading a tonnage figure off the wrong hue is a real consequence, not an aesthetic one.

   Everything in this file is load-bearing. Everything in the other token files is yours. */
:root{
  /* ── Earthworks. The colour IS the sign of the readout. ──────────────────────────────
     These colour the glyph AND the m³/tonnage number beside it. The NET figure takes
     --cut-color when net >= 0 and --fill-color when net < 0. Deliberately non-standard. */
  --cut-color:#0e8de8;    /* volume ABOVE the reference plane — material to REMOVE */
  --fill-color:#d9601d;   /* space BELOW the reference plane — volume to ADD */

  /* ⚠️ --cut-color is byte-identical to --brand-500. The brand blue doubles as an earthworks data
     colour, plus the 3D POI pin, the GPS marker and image cluster markers. A brand refresh
     silently repaints four data meanings. Re-hue the brand and you must decide about cut. */

  /* ⚠️ LIVE CONTRADICTION, raised not resolved: the 3D Potree slab overlay uses blue (0x2255ff)
     for FILL, sitting beside a panel using blue for CUT, and the cut-magnitude ramp's low end is
     blue as well. This is a real inconsistency. Do not harmonise it silently — it is a product
     decision about what the overlay should say. */
  --overlay-fill-3d:#2255ff;

  /* ── Measurement swatches — PERSISTED DATA, not styling ──────────────────────────────
     The chosen hex is written to the Measurement document and painted via
     ["coalesce",["get","color"],fallback]. Removing or changing a swatch does NOT repaint
     existing saved measurements. Recolouring measurements is a DATA MIGRATION. */
  --measure-orange:#f97316;
  --measure-red:#ef4444;
  --measure-yellow:#eab308;
  --measure-green:#22c55e;
  --measure-cyan:#06b6d4;
  --measure-brand:#0e8de8;
  --measure-purple:#a855f7;
  --measure-pink:#ec4899;

  /* Per-type identity — how you tell shapes apart on a busy map */
  --measure-default-distance:#f97316;
  --measure-default-area:#f97316;
  --measure-default-cross-section:#ef4444;
  --measure-default-chainage:#ef4444;
  --measure-default-volume:#0e8de8;
  --measure-default-vertical-shaft:#a855f7;

  /* ⚠️ Known inconsistency in the product: the live-draw fallback is #f97316 (MapToolbar) but the
     saved-overlay fallback is #06b6d4 (MapViewer, LayerPanel). Same missing-colour case, two
     different results. Pick one when you touch it. */
  --measure-fallback-live:#f97316;
  --measure-fallback-saved:#06b6d4;

  /* The volume POLYGON is deliberately NOT a cut/fill colour — it marks extent, not a quantity. */
  --volume-polygon:#3b82f6;

  /* ── Point-cloud ramps ───────────────────────────────────────────────────────────────
     Potree.Gradients.ELEVATION at stops 0 / .25 / .5 / .75 / 1. Pure data encoding across the
     scene's elevationRange. ⚠️ These five hexes are the LEGEND approximation; the shader uses
     Potree's own gradients. The legend and the render must stay consistent or the legend lies. */
  --elev-0:#0000ff;--elev-25:#00ffff;--elev-50:#00ff00;--elev-75:#ffff00;--elev-100:#ff0000;
  --elev-ramp:linear-gradient(90deg,var(--elev-0) 0%,var(--elev-25) 25%,var(--elev-50) 50%,var(--elev-75) 75%,var(--elev-100) 100%);/* @kind color */

  /* Solid / no-colour fallback for a cloud — chosen to stay visible on either basemap */
  --cloud-solid:#b8b8b8;

  /* Classification colours are read AT RUNTIME from Potree's own scheme. The app deliberately no
     longer keeps its own table, and the CLASSIFICATION_COLORS constant is a pre-load placeholder
     documented as having drifted. Do not treat any local table as the palette. */

  /* ── Map layers ──────────────────────────────────────────────────────────────────────
     Satellite imagery is DELIBERATELY NOT THEMED in dark mode — tinting photography
     misrepresents the ground. Only the streets basemap switches (streets-v12 ↔ dark-v11). */
  --fastighet-color:#f59e0b;      /* property boundaries; user-settable, persisted in localStorage */
  --fastighet-dash:4 2;/* @kind other */
  --fastighet-width:1.4px;

  /* ⚠️ Two conflicting layer-type colour maps exist in the product (LayerPanel vs the projects
     page). This system standardises on LayerPanel's; the projects page should be migrated.
     Flagged for a decision, not silently harmonised. */
  --layer-dem:var(--blue-500);
  --layer-pointcloud:var(--measure-orange);
  --layer-vector:var(--measure-purple);

  /* Dataset status — one formula: bg-{hue}-100 text-{hue}-700 / dark:bg-{hue}-950 text-{hue}-400 */
  --status-ready:var(--emerald-700);
  --status-processing:var(--amber-700);
  --status-error:var(--red-700);
  --status-uploading:var(--blue-700);
}
.dark{
  --status-ready:var(--emerald-400);
  --status-processing:var(--amber-400);
  --status-error:var(--red-400);
  --status-uploading:var(--blue-400);
}
