/* The design system's named values: the only place a colour, a size, a line weight or a time of motion is written.
   Two sets with the same names: light and dark. The page's mode is the attribute data-mode on <html>, set by ds.js
   (his choice, remembered; the first time, the machine's setting). Every value here is set by us (docs/DESIGN.md)
   and is the owner's to change. The product's name and marks are his: --brand-* here, product_name in labels.json. */

@font-face { font-family: "DT Inter"; src: url(/door/inter-var.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "DT JetBrains Mono"; src: url(/door/jetbrainsmono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DT JetBrains Mono"; src: url(/door/jetbrainsmono-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "DT Plex Sans Arabic"; src: url(/door/plexsansarabic-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DT Plex Sans Arabic"; src: url(/door/plexsansarabic-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --browser-level: 0; /* Project Browser rows set their indentation depth. */
  --browser-system-max: 50%; /* A shown system leaves at least half the right side for the browser. */
  /* brand (the owner's: one place) */
  --brand-accent-light: #0f766e;
  --brand-accent-dark: #2dd4bf;

  /* faces: the demo's three families, on disk with their record (engines/SOURCES.md, "Fonts (2026-11-10)"), owner's yes
     2026-11-10; the machine's own faces after each. Text and numbers: Inter; labels and figures in tables: JetBrains Mono;
     what a person wrote in Arabic: IBM Plex Sans Arabic (parts.css: bdi read right to left). */
  --font-sans: "DT Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-mono: "DT JetBrains Mono", Consolas, "Segoe UI", "Cascadia Mono", monospace;  /* Segoe UI lends Arabic letters */
  --font-arabic: "DT Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;

  /* type sizes */
  --fs-label: 11px;      /* small labels, upper case, fixed-width face */
  --fs-plan-min: 10px;   /* the smallest text a plan shows: under it a name drops and its value stays; a value under it, the plans stack */
  --fs-small: 12px;
  --fs-body: 13px;
  --fs-head: 15px;
  --fs-title: 17px;
  --fs-num: 26px;        /* the large number of a tile */
  --fs-num-s: 18px;
  --lh: 1.45;
  --ls-label: 0.06em;    /* letter spacing of labels */
  --fw-normal: 400;
  --fw-strong: 600;

  /* spacing */
  --sp-1: 2px;
  --sp-2: 4px;
  --sp-3: 8px;
  --sp-4: 12px;
  --sp-5: 16px;
  --sp-6: 24px;
  --sp-7: 32px;

  /* corners */
  --r-1: 3px;
  --r-2: 6px;
  --r-3: 10px;
  --r-round: 999px;

  /* line weights */
  --lw-hair: 1px;
  --lw-mark: 2px;
  --lw-strong: 3px;
  --lw-ring: 2.5px;      /* an alert's ring in the 3D: the same on screen at any distance */
  --lw-3d-edge: 1;       /* pixels, for the 3D's lines */

  /* times of motion */
  --t-fast: 120ms;
  --t-mid: 240ms;
  --t-flight: 1100ms;    /* a camera flight */
  --t-tip: 80ms;

  /* layout */
  --header-h: 44px;
  --ribbon-tabs-h: 28px;  /* The approved tabs join the ribbon's control area at this height. */
  --ribbon-tab-padding: 0 var(--sp-5);  /* The approved tab words have sixteen pixels on each side. */
  --ribbon-tabs-gap: 0;  /* Tab borders meet; their padding supplies the word spacing. */
  --ribbon-tab-font-size: var(--fs-small);  /* The approved tab words use the small type size. */
  --ribbon-controls-h: 72px;  /* The approved control area, excluding the panel-name band. */
  --icon-small: 20px;  /* Small command masks use the twenty-pixel file at its own size. */
  --ribbon-button-w: 52px;  /* Minimum width of an approved large ribbon command. */
  --ribbon-small-h: 22px;  /* Three small commands fit vertically in the control area. */
  --ribbon-name-w: 120px;  /* The approved saved-view name field's width. */
  --ribbon-hour-w: 64px;  /* The approved read-only result hour. */
  --ribbon-step-w: 40px;  /* The approved hours-per-step field. */
  --size-full: 100%;  /* Full extent for the product frame's parts. */
  --window-w: 100vw;  /* Ribbon menus stay inside the available window width. */
  --window-h: 100vh;  /* Ribbon menus stay inside the available window height. */
  --disabled-opacity: 0.4;  /* Unavailable ribbon controls retain forty percent opacity. */
  --opacity-full: 1;  /* Dimmed panels apply their opacity once, rather than per disabled child. */
  --icon-mask: none;  /* A command supplies its manifest icon URL on its mask element. */
  --ribbon-h: calc(var(--ribbon-tabs-h) + var(--ribbon-controls-h) + var(--icon-small));  /* Tabs, controls and the approved name band. */
  --cube: 224px;  /* Approved occupied corner, including the compass and menu. */
  --cube-side: 60px;
  --cube-half: calc(var(--cube-side) / 2);
  --cube-top: 20px;
  --cube-quarter-turn: 90deg;
  --cube-half-turn: 180deg;
  --cube-corner-hit: 16px;  /* A corner can be picked around its unchanged centre. */
  --cube-corner-mark: 8px;  /* Hover/focus paints only the original small mark. */
  --part-half: 50%;
  --compass-size: 200px;
  --compass-band: 8px;  /* Approved screen-space band inside the projected circle. */
  --viewbar-h: 28px;
  --view-command-w: 24px;
  --status-h: 24px;
  --strip-h: 34px;
  --panel-w: 318px;
  --side-w: 264px;  /* The approved default width of both shell sides. */
  --side-w-min: 220px;  /* Owner's ruling, shell brief §8: each side resizes from 220 px. */
  --side-w-max: 480px;  /* Owner's ruling, shell brief §8: each side resizes to 480 px. */
  --fold-at: 1000px;
  --side-title-h: 28px;
  --side-panel-min-h: calc(var(--side-title-h) * 4);
  --prop-selector-h: 52px;
  --prop-icon: 32px;  /* The look's --ic-lg: draw the forty-pixel file at this size. */
  --prop-group-h: 24px;
  --prop-row-h: 22px;
  --prop-name-w: 42%;
  --prop-value-w: 58%;
  --prop-triangle: 4px;
  --prop-quarter-turn: 90deg;
  --prop-source-lines: 2;
  --panel-w-narrow: 280px;
  --panel-w-card: 224px;   /* the card inside a page's 3D (embed): the page around it says the rest */
  --tile-w: 132px;
  --chart-h: 180px;
  --narrow-view-h: 70vh;   /* the 3D in a narrow window, the panels under it */
  --chip: 10px;          /* a colour chip in a legend or a list */
  --bar-h: 6px;          /* the bar inside a table row */
  --tag-max: 180px;
  --phone-w: 420px;
  --dialog-w: 420px;
  --dialog-w-wide: 640px;
  --dialog-w-table: 1200px;  /* A table window gives keys and their basis room to be read. */
  --z-panel: 10;
  --z-tip: 30;
  --z-dialog: 40;
  --z-toast: 50;

  /* the 3D's textures, drawn by the page (no image file): the same in both modes, as the building's appearance is */
  --pattern-ground: #f6f6f6;
  --pattern-line: #9c9c9c;
  --pattern-line-2: #c4c4c4;
  --glass-ground: #ffffff;
  --glass-line: #d8d8d8;
  --appearance-default: #b4bac0;   /* a class the building's viewer.json gives no appearance */

  /* the 3D's fixed numbers (no colour) */
  --wire-alpha: 0.35;
  --see-through: 0.25;
  --wire-sel-alpha: 0.45;          /* a selected element's faces in wireframe */
  --transparent-edge-alpha: 0.3;   /* the edges of an element made see-through */
  --t-step: 1500ms;                /* one step of a run over time at speed 1 */
}

/* ---------- light ---------- */
:root, :root[data-mode="light"] {
  color-scheme: light;
  --control-clear: transparent;  /* Resting frame commands have no visible fill or border. */
  --cube-top-tone: #f7f9fa;
  --cube-front-tone: #e1e6ea;
  --cube-side-tone: #c1cbd3;
  --cube-ring-tone: #cbd4db;
  --ground: #f3f5f7;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --panel-raised: #f7f9fa;
  --hairline: rgba(16, 24, 32, 0.14);
  --hairline-strong: rgba(16, 24, 32, 0.28);
  --text-1: #12181e;
  --text-2: #3b4650;
  --text-3: #56636e;
  --accent: var(--brand-accent-light);
  --accent-ink: #ffffff;           /* text on the accent */
  --accent-soft: rgba(15, 118, 110, 0.12);
  --focus-ring: #0f766e;
  --shadow: 0 1px 2px rgba(16, 24, 32, 0.08), 0 4px 16px rgba(16, 24, 32, 0.08);
  --scrim: rgba(16, 24, 32, 0.32);

  /* states, each with a word or a shape beside it */
  --state-ok: #116329;
  --state-due: #7d4e00;
  --state-alarm: #cf222e;
  --state-cold: #0969da;
  --state-off: #57606a;
  --state-ok-soft: rgba(17, 99, 41, 0.12);
  --state-due-soft: rgba(125, 78, 0, 0.12);
  --state-alarm-soft: rgba(207, 34, 46, 0.10);
  --state-cold-soft: rgba(9, 105, 218, 0.10);
  --state-off-soft: rgba(87, 96, 106, 0.12);

  /* marks: simulated, added or set by us */
  --mark-sim: #6e40c9;
  --mark-sim-soft: rgba(110, 64, 201, 0.10);
  --mark-added: #a2306f;
  --mark-added-soft: rgba(162, 48, 111, 0.10);
  --reveal: #65a30d;

  /* one colour per system, by its IFC type (IfcDistributionSystemEnum); the same in 3D, tags, charts, legends */
  --sys-airconditioning: #1f6feb;
  --sys-exhaust: #2f8f3f;
  --sys-ventilation: #2f8f3f;
  --sys-control: #8a6a00;
  --sys-fireprotection: #d1242f;
  --sys-electrical: #b35900;
  --sys-lighting: #7a8500;
  --sys-domesticcoldwater: #0b7f8a;
  --sys-domestichotwater: #d6336c;
  --sys-drainage: #7d4e24;
  --sys-chilledwater: #173a7a;
  --sys-other-1: #6639ba;
  --sys-other-2: #5c6f82;
  --sys-other-3: #a0336f;

  /* chart series, in order */
  --series-1: #1f5fbf;
  --series-2: #6e7781;
  --series-3: #c2410c;
  --series-4: #7a6a00;
  --series-5: #0e7490;
  --grid: rgba(16, 24, 32, 0.10);

  /* ramps: one direction (low to high) and cold to hot; the same stops in both modes */
  --ramp-seq-0: #d7f0ec;
  --ramp-seq-1: #9fd8cf;
  --ramp-seq-2: #5cb8ab;
  --ramp-seq-3: #2a8f83;
  --ramp-seq-4: #0d5c55;
  --ramp-heat-0: #2c5fa8;
  --ramp-heat-1: #5b9bd5;
  --ramp-heat-2: #a9d1ea;
  --ramp-heat-3: #eeeadb;
  --ramp-heat-4: #f6c28b;
  --ramp-heat-5: #e7793f;
  --ramp-heat-6: #b32424;
  --no-data: #c9cfd5;

  /* the 3D */
  --view-bg: #e7ebef;
  --view-bg-2: #f6f8fa;            /* the far end of the ground's fade */
  --edge: #2c3136;
  --edge-wire: #3d454d;
  --edge-hidden: #111111;
  --hidden-face: #ffffff;
  --cut: #4a4f55;
  --select: #c800c8;
  --handle: #1f6feb;
  --ghost: #8b96a1;
  --ghost-alpha: 0.06;
  --ghost-edge-alpha: 0.26;
  --tag-bg: rgba(255, 255, 255, 0.94);
  --light-sky: #ffffff;
  --light-ground: #9aa0a6;
  --label-halo: rgba(255, 255, 255, 0.85);

  /* the plan and the kinds of things on it (units read from the drawings, sensors added); the same in the 3D */
  --plan-line: #2c3136;
  --plan-under: #b4bac0;
  --kind-indoor-unit: #1f6feb;
  --kind-outdoor-unit: #57606a;
  --kind-exhaust-fan: #2f8f3f;
  --kind-exhaust-grille: #7d4e24;
  --kind-kitchen-exhaust-hood: #9a6700;
  --kind-temperature: #cf222e;
  --kind-humidity: #0b7f8a;
  --kind-co2: #8250df;
  --kind-occupancy: #c2185b;
}

/* ---------- dark ---------- */
:root[data-mode="dark"] {
  --cube-top-tone: #35434f;
  --cube-front-tone: #293640;
  --cube-side-tone: #1d2933;
  --cube-ring-tone: #34434e;
  color-scheme: dark;
  --control-clear: transparent;  /* Resting frame commands remain clear in dark mode. */
  --ground: #0b0e11;
  --panel: rgba(20, 25, 30, 0.86);
  --panel-solid: #14191e;
  --panel-raised: #1b2128;
  --hairline: rgba(255, 255, 255, 0.10);
  --hairline-strong: rgba(255, 255, 255, 0.22);
  --text-1: #e6ecf1;
  --text-2: #aab5bf;
  --text-3: #8592a0;
  --accent: var(--brand-accent-dark);
  --accent-ink: #04201d;
  --accent-soft: rgba(45, 212, 191, 0.14);
  --focus-ring: #2dd4bf;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
  --scrim: rgba(0, 0, 0, 0.55);

  --state-ok: #3fb950;
  --state-due: #d29922;
  --state-alarm: #f85149;
  --state-cold: #58a6ff;
  --state-off: #8b949e;
  --state-ok-soft: rgba(63, 185, 80, 0.14);
  --state-due-soft: rgba(210, 153, 34, 0.14);
  --state-alarm-soft: rgba(248, 81, 73, 0.14);
  --state-cold-soft: rgba(88, 166, 255, 0.14);
  --state-off-soft: rgba(139, 148, 158, 0.14);

  --mark-sim: #a98bff;
  --mark-sim-soft: rgba(169, 139, 255, 0.14);
  --mark-added: #f778ba;
  --mark-added-soft: rgba(247, 120, 186, 0.14);
  --reveal: #a3e635;

  --sys-airconditioning: #4ea1ff;
  --sys-exhaust: #5fd068;
  --sys-ventilation: #5fd068;
  --sys-control: #d4a72c;
  --sys-fireprotection: #ff6a5c;
  --sys-electrical: #ff9d42;
  --sys-lighting: #f2ea6a;
  --sys-domesticcoldwater: #3fd0d9;
  --sys-domestichotwater: #ff5f8f;
  --sys-drainage: #c49a6c;
  --sys-chilledwater: #c4d3ff;
  --sys-other-1: #b392f0;
  --sys-other-2: #8796a8;
  --sys-other-3: #f283b4;

  --series-1: #7ab8ff;
  --series-2: #9aa3ad;
  --series-3: #ff8a4c;
  --series-4: #e8d06a;
  --series-5: #22b8cf;
  --grid: rgba(255, 255, 255, 0.08);

  --ramp-seq-0: #d7f0ec;
  --ramp-seq-1: #9fd8cf;
  --ramp-seq-2: #5cb8ab;
  --ramp-seq-3: #2a8f83;
  --ramp-seq-4: #0d5c55;
  --ramp-heat-0: #2c5fa8;
  --ramp-heat-1: #5b9bd5;
  --ramp-heat-2: #a9d1ea;
  --ramp-heat-3: #eeeadb;
  --ramp-heat-4: #f6c28b;
  --ramp-heat-5: #e7793f;
  --ramp-heat-6: #b32424;
  --no-data: #4a535c;

  --view-bg: #0d1116;
  --view-bg-2: #1a2129;
  --edge: #0b0e11;
  --edge-wire: #b8c4ce;
  --edge-hidden: #d6dee5;
  --hidden-face: #161b21;
  --cut: #2b3138;
  --select: #ff5cff;
  --handle: #58a6ff;
  --ghost: #6f7d8a;
  --ghost-alpha: 0.05;
  --ghost-edge-alpha: 0.20;
  --tag-bg: rgba(20, 25, 30, 0.92);
  --light-sky: #e8eef5;
  --light-ground: #3a4450;
  --label-halo: rgba(11, 14, 17, 0.85);

  --plan-line: #c9d1d9;
  --plan-under: #3a4450;
  --kind-indoor-unit: #4ea1ff;
  --kind-outdoor-unit: #8b949e;
  --kind-exhaust-fan: #5fd068;
  --kind-exhaust-grille: #c49a6c;
  --kind-kitchen-exhaust-hood: #e3b341;
  --kind-temperature: #f85149;
  --kind-humidity: #3fd0d9;
  --kind-co2: #b392f0;
  --kind-occupancy: #ff9d42;
}
