/**
 * Industry — the additions layer.
 *
 * `vendor/styles.css` is the supplied system and the source of truth. This file
 * carries only what that file does not, and mirrors its day tokens so both can
 * be loaded in either order without one silently winning. `tests/11-tokens.test.ts`
 * asserts the mirrored values match the vendor file exactly, so they cannot drift.
 *
 * Six things are genuinely absent from the supplied system and are declared here
 * because the standard requires them:
 *
 *   the night theme; --color-text-muted (mapped onto the supplied neutral ramp,
 *   not invented); --rail-fg; the two status colours; the .corner registration
 *   marks; and .sp-lbl. Fonts are self-hosted rather than pulled from the CDN
 *   the supplied file @imports — these apps run inside the plant network.
 *
 * No component below rounds a corner, fills a card, or adds a gradient, whatever
 * --radius-* offers.
 */

/* ── Tokens: day — MIRRORED from vendor/styles.css, do not edit by hand ────── */
:root {
  --color-bg: #f2f2f3;
  --color-surface: #e9e9ea;
  --color-text: #1d1f20;
  --color-divider: color-mix(in srgb, #1d1f20 16%, transparent);

  --color-accent: #5980a6;
  --color-accent-100: #eef6ff;
  --color-accent-200: #d6ebff;
  --color-accent-300: #b5d9fd;
  --color-accent-400: #94bce3;
  --color-accent-500: #749dc4;
  --color-accent-600: #597ea3;
  --color-accent-700: #416180;
  --color-accent-800: #2c455d;
  --color-accent-900: #1d2d3d;

  --color-neutral-100: #f5f5f8;
  --color-neutral-200: #e7e7ea;
  --color-neutral-300: #d4d4d7;
  --color-neutral-400: #b7b7ba;
  --color-neutral-500: #98989b;
  --color-neutral-600: #7a7a7d;
  --color-neutral-700: #5d5d60;
  --color-neutral-800: #424244;
  --color-neutral-900: #2b2b2d;

  --font-heading: "Barlow Condensed", system-ui, sans-serif;
  --font-heading-weight: 600;
  --font-body: "Barlow", system-ui, sans-serif;

/* ── Additions the supplied system does not carry ─────────────────────────── */

  /**
   * Meta text. From the supplied neutral ramp, not invented.
   *
   * Step 700, not 600. Measured on a real screen rather than chosen by eye:
   * 600 on this ground gives about 4:1, and every meta label in an app — the
   * counts, the column headings, the "no results" line — is small text, where
   * that is below the readable threshold. 700 gives about 6:1 and still reads
   * as secondary.
   */
  --color-text-muted: var(--color-neutral-700);

  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /**
   * Rail foreground.
   *
   * The standard says the rail reverses type to --color-bg, which is right in
   * day (a light ground on a dark rail) and fails in night: --color-bg is
   * #141c24 against a #0d141b rail, 1.08:1 — the mark, the icons and the user
   * chip are invisible. A rail is dark in BOTH themes, so its foreground is a
   * token of its own rather than one borrowed from the page.
   */
  --rail-fg: #f2f2f3;

  /* The only non-steel colour in the system. Never extended. */
  --st-crit: oklch(0.55 0.13 32);
  --st-caution: oklch(0.64 0.11 78);
  --st-crit-text: #f7f2f0;
  --st-caution-text: #231a08;
}

/* ── Tokens: night ───────────────────────────────────────────────────────── */
/* Same skeleton, token overrides on the app root — exactly as the standard
   states. The supplied system has no dark theme at all. */
:root[data-theme="night"] {
  --color-bg: #141c24;
  --color-surface: #1b2530;
  --color-text: #dfe5ea;
  --color-divider: rgba(223, 229, 234, 0.16);

  /**
   * On a dark ground the ramp reads in reverse: the accent lightens, and the
   * steps used for fills and for text on them swap ends. Step N in night is
   * step (1000 − N) in day.
   *
   * All nine steps are declared. Five of them used to be — 100, 300, 700, 800,
   * 900 — and 200, 400, 500 and 600 were left holding their day values. A step
   * that does not change between themes is a colour that is legible on one
   * ground and not the other, and there is no way for an app to use it
   * correctly: --color-accent-400 was #94bce3 in both, so anything pointed at
   * it read on the night page and vanished on the day one. Every app that
   * consumed this ramp had to inspect its own markup and hand-pick a substitute
   * step, which is precisely the work this file exists to make unnecessary.
   * A partial ramp is worse than no ramp, because it looks like it works.
   */
  --color-accent: #94bce3;
  --color-accent-100: #23313f;
  --color-accent-200: #2c455d;
  --color-accent-300: #4c7ba8;
  --color-accent-400: #597ea3;
  --color-accent-500: #749dc4;
  --color-accent-600: #94bce3;
  --color-accent-700: #b5d9fd;
  --color-accent-800: #d6ebff;

  /**
   * 900 is a role, not a ramp step: it is the rail, and the rail is dark in
   * both themes. It therefore does NOT invert, and nothing may treat it as the
   * dark end of the ramp — accent-800 is that end. The Tailwind bridge maps the
   * 900/950 palette steps to accent-800 for exactly this reason.
   */
  --color-accent-900: #0d141b;

  /**
   * The neutral ramp inverts.
   *
   * The supplied ramp runs 100 (lightest) to 900 (darkest), and its roles go
   * with the numbers: the light steps are subtle fills, the dark steps are text
   * on them. On a dark ground those roles need the opposite lightness, and
   * without this the ramp simply stays light — so every card, chip and panel an
   * app fills with neutral-100 or 200 is a pale block on a dark page. That is
   * what made night mode look nothing like the design: the ground went dark and
   * the furniture did not follow.
   */
  --color-neutral-100: #1b2530;
  --color-neutral-200: #23313f;
  --color-neutral-300: #2e3d4d;
  --color-neutral-400: #46586b;
  --color-neutral-500: #6a7d92;
  --color-neutral-600: #93a3b1;
  --color-neutral-700: #b7c3cd;
  --color-neutral-800: #d3dbe2;
  --color-neutral-900: #eef2f5;

  /* Step 600 of the inverted ramp, which is the same role step 700 plays in
     day: clearly secondary, comfortably readable. */
  --color-text-muted: var(--color-neutral-600);

  --st-crit: oklch(0.62 0.13 32);
  --st-caution: oklch(0.72 0.11 78);

  /*
   * Both status hues are lightened for the night ground so they still read as
   * marks. That makes them too light to sit behind near-white text: a filled
   * crit tag measured 3.48:1, under AA for the 11px type these tags carry.
   * Caution already used a dark ink for exactly this reason; crit now does the
   * same, and both clear 4.5:1. The hue is unchanged — this is which ink sits
   * on the fill, not a sixth status colour.
   */
  --st-crit-text: #2a1410;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}

/* Never removed — the spec makes this explicit. */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ── Spec label ──────────────────────────────────────────────────────────── */
.sp-lbl {
  font: 400 10px/1 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.5;
}

/* ── Blueprint frame ─────────────────────────────────────────────────────── */
/* Every framed object is a wireframe line drawing: square corners, hairline
   border, four registration marks. */
.blueprint {
  position: relative;
  border: 1px solid var(--color-divider);
  background: transparent;
}

.corner {
  position: absolute;
  width: 5px;
  height: 5px;
  border: 1px solid var(--color-accent);
  opacity: 0.55;
}
/* The marks are logical, so they mirror with the page: in right-to-left text
   "tl" is the top corner on the reading side. The four together look the same
   either way, and the frame stays one piece with the content it holds. */
.corner.tl { top: -1px; inset-inline-start: -1px; border-inline-end: 0; border-bottom: 0; }
.corner.tr { top: -1px; inset-inline-end: -1px; border-inline-start: 0; border-bottom: 0; }
.corner.bl { bottom: -1px; inset-inline-start: -1px; border-inline-end: 0; border-top: 0; }
.corner.br { bottom: -1px; inset-inline-end: -1px; border-inline-start: 0; border-top: 0; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;               /* gloves and glare are assumed possible */
  padding: 0 14px;
  border: 1px solid var(--color-divider);
  border-radius: 0;               /* never rounded */
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn:hover:not(:disabled) { border-color: var(--color-accent); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/**
 * The primary button's fill is accent-700, not the raw accent.
 *
 * White on `--color-accent` measures 4.14:1 in day — under AA for the 13.5px
 * label it carries, on the one control the standard says every screen has
 * exactly one of. The standard already draws this distinction itself: "accent
 * is chrome and large text only; for paragraph text in accent use
 * accent-700". A button label is small text on an accent ground, so it takes
 * the same step. In night the ramp inverts and this becomes the light steel,
 * which is why the rule below hands it dark text.
 */
.btn-primary {
  background: var(--color-accent-700);
  border-color: var(--color-accent-700);
  color: var(--rail-fg);
}
:root[data-theme="night"] .btn-primary { color: #0d141b; }
.btn-primary:hover:not(:disabled) { background: var(--color-accent-800); }

.btn-secondary { background: var(--color-surface); }
.btn-ghost { border-color: transparent; font-weight: 500; }
.btn-ghost:hover:not(:disabled) { border-color: var(--color-divider); }

.btn-icon {
  min-width: 44px;
  padding: 0;
  justify-content: center;
  border-color: transparent;
}

/* The shortcut lives inside the button as a muted mono chip. */
.kbd {
  font: 400 11px/1 var(--font-mono);
  padding: 3px 5px;
  border: 1px solid currentColor;
  opacity: 0.55;
  letter-spacing: 0.04em;
}

/* ── Tags ────────────────────────────────────────────────────────────────── */
/* The tag always carries a word — colour is never the only signal. */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border: 1px solid transparent;
  font: 600 10.5px/1.6 var(--font-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-neutral { background: transparent; color: var(--color-text-muted); border-color: var(--color-divider); }
/* accent-700, not accent: the raw accent is 3.4:1 on the day ground and this
   tag is 11px. The border stays the raw accent, where 3:1 is the requirement. */
.tag-outline { background: transparent; color: var(--color-accent-700); border-color: var(--color-accent); }
.tag-crit { background: var(--st-crit); color: var(--st-crit-text); }
.tag-caution { background: var(--st-caution); color: var(--st-caution-text); }

/* ── Inputs ──────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label {
  font-family: var(--font-heading);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--color-divider);
  border-radius: 0;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 13.5px;
}
.input::placeholder { color: var(--color-text-muted); opacity: 0.8; }
.input:focus { border-color: var(--color-accent); }

textarea.input { min-height: 88px; resize: vertical; line-height: 1.55; }

/* ── Segmented control ───────────────────────────────────────────────────── */
.seg {
  display: inline-flex;
  border: 1px solid var(--color-divider);
  background: var(--color-surface);
}
.seg-opt {
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-inline-end: 1px solid var(--color-divider);
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.seg-opt:last-child { border-inline-end: 0; }
.seg-opt[aria-pressed="true"] { background: var(--color-accent-100); color: var(--color-accent-800); }

/* ── Table ───────────────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: start;
  padding: 7px 10px;
  border-bottom: 1px solid var(--color-divider);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--color-divider);
  /* Mono numerals — a column of figures has to line up to be read at a glance. */
  font-variant-numeric: tabular-nums;
}
.table td.num { font-family: var(--font-mono); text-align: end; }

/* ── Card ────────────────────────────────────────────────────────────────── */
/* Square, unfilled, hairline — a card is a frame, not a surface. */
.card {
  border: 1px solid var(--color-divider);
  background: var(--color-surface);
  padding: 14px;
}

/* ── Dialog ──────────────────────────────────────────────────────────────── */
/**
 * The standard lists `.dialog` among the classes an app uses as-is, and the
 * package never shipped one — so the first app to need a modal was going to
 * invent its own, and the second a different one. That is how an estate ends up
 * with two of everything.
 *
 * The scrim is the page's own ground at high opacity rather than black, so it
 * darkens in day and lightens in night with everything else.
 */
.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--color-accent-900) 72%, transparent);
}

.dialog {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  /* Square corners, like everything else. */
  border-radius: 0;
}

/* ── Phone ───────────────────────────────────────────────────────────────── */
/**
 * 16px on anything you can type into, and the reason is not legibility.
 *
 * iOS Safari zooms the page when a field with a font smaller than 16px takes
 * focus, and it does not zoom back out when the field is left. The estate's
 * `.input` is 13.5px, so assigning hours on the dispatcher zoomed the screen and
 * left it enlarged after the dialog closed — read as a layout bug, and it is a
 * platform behaviour with one documented cure.
 *
 * Deliberately at the end of this file: the rules it overrides are declared above
 * it, and a media query placed before them is silently inert.
 */
@media (max-width: 767px) {
  .input,
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

/* ── appended: kit.css ── */
/**
 * MaxAccelerate AI UI Kit layer — the estate's look from 2.0.0 (approved 2026-09-30):
 * IBM Plex, navy rail and header, IBM blue accent, one blue→teal primary.
 *
 * Source: "MaxAccelerate AI UI Kit.zip" (MAXAI_UI_STYLE.md v1.0, maxai-theme.css).
 * copy-static.mjs appends this file to the END of every dist stylesheet, so it
 * re-points the same tokens and restyles the same classes every app already
 * uses, and wins whatever order an app imports the stylesheets in.
 *
 * Where it departs from the kit, deliberately:
 *   - the rail stays (navy), rather than the kit's desktop top nav;
 *   - the blueprint corner marks stay;
 *   - the primary gradient is darkened so white text clears 4.5:1;
 *   - Emergency stays a FILLED tag; teal "success" is the one added state (done).
 */

/* ── Tokens: day ─────────────────────────────────────────────────────────── */
:root {
  --dm-navy-deep: #07162b;
  --dm-navy: #0a1e3c;
  --dm-navy-2: #0c2447;
  --dm-navy-line: #0e2e58;
  --dm-teal: #17b3a3;
  --dm-teal-dark: #0b7d72;
  --dm-teal-light: #6fd3c8;
  --dm-teal-10: #d9f3f0;
  --dm-teal-line: #a8ded8;
  --dm-blue-10: #edf5ff;
  --dm-blue-line: #bcd4fd;
  --dm-amber: #8e6a00;
  --dm-amber-10: #fcf4d6;
  --dm-amber-line: #f1d58a;
  --dm-red: #a2191f;
  --dm-red-10: #fff1f1;
  --dm-red-line: #f5c2c4;
  --dm-header-bg: #07162b;
  --dm-header-icon: #8fb4dc;
  /* The kit's blue→teal, with the middle and end stops darkened so white text
     clears 4.5:1 at every point (kit original #2394d8 / #17b3a3 measured 3.3:1
     and 2.6:1). #1b66c9 5.5:1 · #1a73b8 5.0:1 · #0b7d72 5.0:1. */
  --dm-grad-primary: linear-gradient(92deg, #1b66c9 0%, #1a73b8 55%, #0b7d72 115%);
  --dm-grad-panel: linear-gradient(140deg, #0c2447 0%, #07162b 62%, #050f1f 100%);
  --dm-surface-2: #f4f4f4;
  --dm-border-strong: #8d8d8d;

  --color-bg: #f4f4f4;
  --color-surface: #ffffff;
  /* The light plate a client's dark logo sits on over the navy band (Logo.tsx). White in both themes: the band is navy in both. */
  --brand-plate: #ffffff;
  --color-text: #161616;
  --color-divider: #e0e0e0;
  --color-text-muted: #525252;

  /* IBM blue ramp. 900 is the rail's role, not a ramp step. */
  --color-accent: #0f62fe;
  --color-accent-100: #edf5ff;
  --color-accent-200: #d0e2ff;
  --color-accent-300: #a6c8ff;
  --color-accent-400: #78a9ff;
  --color-accent-500: #4589ff;
  --color-accent-600: #0f62fe;
  --color-accent-700: #0043ce;
  --color-accent-800: #002d9c;
  --color-accent-900: #07162b;

  --color-neutral-100: #f4f4f4;
  --color-neutral-200: #e0e0e0;
  --color-neutral-300: #c6c6c6;
  --color-neutral-400: #a8a8a8;
  --color-neutral-500: #8d8d8d;
  --color-neutral-600: #6f6f6f;
  --color-neutral-700: #525252;
  --color-neutral-800: #393939;
  --color-neutral-900: #262626;

  --font-heading: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --rail-fg: #ffffff;

  /* Status marks (borders, dots, meters). Tags carry their own tints below. */
  --st-crit: #a2191f;
  --st-caution: #d2a106;
  --st-ok: #17b3a3;
  --st-crit-text: #a2191f;
  --st-caution-text: #8e6a00;
}

/* ── Tokens: night ───────────────────────────────────────────────────────── */
:root[data-theme="night"] {
  --dm-teal-10: #0d3531;
  --dm-teal-line: #1f5f58;
  --dm-blue-10: #12264a;
  --dm-blue-line: #28487e;
  --dm-amber-10: #3a2e05;
  --dm-amber-line: #6b5410;
  --dm-red-10: #3d1214;
  --dm-red-line: #6d2226;
  --dm-header-bg: #050f1f;
  --dm-surface-2: #16233a;
  --dm-border-strong: #4b5d7d;

  --color-bg: #0b1320;
  --color-surface: #111c2e;
  --color-text: #f2f7fd;
  --color-divider: #223250;
  --color-text-muted: #a9c3e2;

  --color-accent: #78a9ff;
  --color-accent-100: #12264a;
  --color-accent-200: #002d9c;
  --color-accent-300: #0043ce;
  --color-accent-400: #0f62fe;
  --color-accent-500: #4589ff;
  --color-accent-600: #78a9ff;
  --color-accent-700: #a6c8ff;
  --color-accent-800: #d0e2ff;
  --color-accent-900: #050f1f;

  --color-neutral-100: #111c2e;
  --color-neutral-200: #16233a;
  --color-neutral-300: #223250;
  --color-neutral-400: #4b5d7d;
  --color-neutral-500: #6a7fa0;
  --color-neutral-600: #8fa6c4;
  --color-neutral-700: #a9c3e2;
  --color-neutral-800: #dce9f8;
  --color-neutral-900: #f2f7fd;

  --st-crit: #ff8389;
  --st-caution: #f1c21b;
  --st-ok: #6fd3c8;
  --st-crit-text: #ff8389;
  --st-caution-text: #f8d66d;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }

/* Small label: IBM uppercase kicker, not mono. */
.sp-lbl {
  font: 600 10.5px/1.2 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  opacity: 1;
}

/* Frames: white card, 1px line, corner marks kept. */
.blueprint { background: var(--color-surface); border-color: var(--color-divider); }
.corner { border-color: var(--color-accent); opacity: 0.7; }
.card { background: var(--color-surface); border-color: var(--color-divider); padding: 16px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--color-neutral-300);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  transition: filter .15s ease, background .15s ease;
}
.btn:hover:not(:disabled) { background: var(--dm-surface-2); border-color: var(--color-neutral-300); }
.btn:disabled {
  opacity: 1;
  background: var(--dm-surface-2);
  color: var(--color-neutral-500);
  border-color: var(--color-divider);
  box-shadow: none;
  filter: none;
}
.btn-secondary { background: var(--color-surface); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--color-accent-700); padding: 0 8px; }
.btn-ghost:hover:not(:disabled) { background: var(--dm-surface-2); border-color: transparent; }
.btn-icon { background: transparent; border-color: transparent; padding: 0; color: inherit; }
.btn-icon:hover:not(:disabled) { background: var(--dm-surface-2); border-color: transparent; }

/* The one primary per screen: the blue→teal gradient. */
.btn.btn-primary,
:root[data-theme="night"] .btn.btn-primary {
  /* A solid colour under the gradient: the fallback if the gradient cannot
     paint, and what a contrast checker reads (a gradient has no
     background-color, so white text on it measured as white on the page). */
  background: #1a73b8 var(--dm-grad-primary);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(27, 102, 201, 0.28);
}
.btn.btn-primary:hover:not(:disabled) { background: #1a73b8 var(--dm-grad-primary); filter: brightness(1.08); }
.btn.btn-primary:disabled {
  background: var(--dm-surface-2);
  color: var(--color-neutral-500);
  border-color: var(--color-divider);
  box-shadow: none;
}

.kbd { font: 400 11px/1 var(--font-mono); opacity: 0.7; }

/* ── Tags ────────────────────────────────────────────────────────────────── */
.tag {
  padding: 2px 8px;
  font: 700 10.5px/1.6 var(--font-body);
  letter-spacing: 0.08em;
}
/* Scheduled */
.tag-accent { background: var(--dm-blue-10); color: var(--color-accent-700); border-color: var(--dm-blue-line); }
/* In progress */
.tag-outline { background: transparent; color: var(--color-accent-700); border-color: var(--color-accent); }
/* Waiting / closed */
.tag-neutral { background: var(--dm-surface-2); color: var(--color-text-muted); border-color: var(--color-divider); }
/* Emergency */
/* Emergency stays FILLED, unlike the kit's tinted danger tag: it is the one
   state that has to be seen across a room. White on #a2191f is 7.4:1. */
.tag-crit { background: var(--st-crit); color: #ffffff; border-color: var(--st-crit); }
:root[data-theme="night"] .tag-crit { color: #2a1410; }
/* Overdue / out of range */
.tag-caution { background: var(--dm-amber-10); color: var(--st-caution-text); border-color: var(--dm-amber-line); }
/* Done — the kit's teal, the one addition */
.tag-success { background: var(--dm-teal-10); color: var(--dm-teal-dark); border-color: var(--dm-teal-line); }
:root[data-theme="night"] .tag-success { color: var(--dm-teal-light); }

/* ── Inputs ──────────────────────────────────────────────────────────────── */
.field > label {
  font: 600 11px/1.3 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.input {
  min-height: 44px;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid var(--dm-border-strong);
  background: var(--dm-surface-2);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
}
.input::placeholder { color: var(--color-neutral-500); opacity: 1; }
.input:focus { outline: 2px solid var(--color-accent); outline-offset: -2px; border-bottom-color: transparent; }

.seg { border: 1px solid var(--color-divider); background: var(--color-surface); }
.seg-opt {
  min-height: 44px;                /* the 44px floor (it was 34px) */
  border-inline-end: 1px solid var(--color-divider);
  color: var(--color-text-muted);
  font: 700 11px/1 var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.seg-opt[aria-pressed="true"] {
  background: var(--dm-blue-10);
  color: var(--color-accent-700);
  box-shadow: inset 0 -2px 0 var(--color-accent);
}

/* ── Table ───────────────────────────────────────────────────────────────── */
.table { font-size: 13.5px; background: var(--color-surface); }
.table th {
  padding: 10px 14px;
  background: var(--dm-surface-2);
  font: 700 11px/1.3 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--color-divider); }
.table tbody tr:hover { background: var(--dm-surface-2); }

/* ── Rail (kept, navy) ───────────────────────────────────────────────────── */
.rail {
  background: var(--dm-header-bg);
  color: var(--dm-header-icon);
  border-inline-end: 1px solid var(--dm-navy-line);
}
.rail-btn:hover { background: rgba(255, 255, 255, 0.08); color: #ffffff; }
.rail-btn.on { background: rgba(255, 255, 255, 0.10); border-inline-start-color: var(--dm-teal); color: #ffffff; }
.rail-user { border-color: rgba(143, 180, 220, 0.45); color: #ffffff; font: 600 12px/1 var(--font-body); }

/* ── Header: navy, white logo, tokens scoped so app content follows ──────── */
.hdr {
  --color-text: #ffffff;
  --color-text-muted: #a9c3e2;
  --color-divider: rgba(255, 255, 255, 0.16);
  --color-surface: var(--dm-navy-2);
  --dm-surface-2: var(--dm-navy-line);
  --color-neutral-300: rgba(255, 255, 255, 0.22);
  --color-accent-100: var(--dm-navy-line);
  --color-accent-700: #a6c8ff;
  --color-accent-800: #d0e2ff;
  background: var(--dm-header-bg);
  color: #ffffff;
  border-bottom: 1px solid var(--dm-navy-line);
}
.hdr .sp-lbl { color: var(--dm-teal-light); }
.hdr-app h1 { font-size: 16px; font-weight: 600; text-transform: none; letter-spacing: -0.005em; color: #ffffff; }
.hdr .btn-icon { color: var(--dm-header-icon); }
.hdr .btn-icon:hover:not(:disabled) { color: #ffffff; }
/* The command bar reads as a search field on navy; its sparkles icon is teal (AI). */
.cmd {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom-color: var(--dm-header-icon);
  color: #a9c3e2;
  font-family: var(--font-body);
  font-size: 13.5px;
}
.cmd:hover:not(:disabled) { background: rgba(255, 255, 255, 0.10); border-color: rgba(255, 255, 255, 0.28); }
.cmd > svg:first-child { color: var(--dm-teal-light); }

/* ── Columns, list, action bar, tabs ─────────────────────────────────────── */
.col-list { background: var(--color-surface); }
.action-bar { background: var(--color-surface); border-top-color: var(--color-divider); }

.list-head h2 { font-size: 18px; font-weight: 600; text-transform: none; letter-spacing: -0.01em; }
.count {
  display: inline-block;
  padding: 1px 7px;
  font: 600 11px/1.5 var(--font-body);
  color: var(--color-accent-700);
  background: var(--dm-blue-10);
}
.list-row:hover { background: var(--dm-surface-2); }
.list-row.on { background: var(--dm-blue-10); border-inline-start-color: var(--color-accent); }
.list-row-id {
  font: 600 12px/1 var(--font-body);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  color: var(--color-accent-700);
}
.list-row-title { font-family: var(--font-body); font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.list-row-meta { font-size: 12px; }

.tabbar { background: var(--color-surface); border-top-color: var(--color-divider); }
.tabbar-label { font: 600 10px/1 var(--font-body); letter-spacing: 0.06em; }
.tabbar-item.on { color: var(--color-accent-700); border-top-color: var(--color-accent); }
.tabbar-item.ask { color: var(--color-accent); }
.tabbar-item.ask .tabbar-label { color: var(--color-accent-700); }

/* ── Record ──────────────────────────────────────────────────────────────── */
.rec-head h2 { font-size: 24px; font-weight: 600; text-transform: none; letter-spacing: -0.01em; line-height: 1.2; }
.block-head h3 {
  font: 700 11px/1.3 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.closeout-cell { background: var(--color-surface); }
.closeout-cell.done { background: var(--dm-teal-10); }
.closeout-cell.done .closeout-top { color: var(--dm-teal-dark); }
:root[data-theme="night"] .closeout-cell.done .closeout-top { color: var(--dm-teal-light); }
.closeout-name { font: 700 11px/1.2 var(--font-body); letter-spacing: 0.1em; }
.closeout-meta { font-size: 12px; }
.evidence > summary { font: 700 11px/1.3 var(--font-body); letter-spacing: 0.12em; }
.asked p { font-family: var(--font-body); font-size: 17px; }
.fact-top b, .ctx b { font-family: var(--font-body); font-weight: 600; }
.step-name { font-family: var(--font-body); font-size: 12.5px; }
.banner.caution { background: var(--dm-amber-10); }
.banner.crit { background: var(--dm-red-10); }

/* ── Sign-in: navy band with the white logo, white sheet below ───────────── */
.login-card { border: 1px solid var(--color-divider); background: var(--color-surface); }
.login-card .login-brand {
  margin: -26px -24px 0;
  padding: 26px 24px;
  background: var(--dm-grad-panel);
}
.login-title h1 { font-size: 24px; font-weight: 600; text-transform: none; letter-spacing: -0.01em; }

@media (max-width: 767px) {
  .input, input, select, textarea { font-size: 16px; }
  .rec-head h2 { font-size: 23px; }
  .login-card .login-brand { margin: -22px -18px 0; padding: 22px 18px; }
}

/* Header chips (site, sync state) on navy. The icon is held to its slot —
   Lucide's default 24px otherwise spills over the label. */
.hdr .chip {
  border-color: rgba(143, 180, 220, 0.45);
  color: #dce9f8;
  font: 600 10.5px/1.3 var(--font-body) !important;
  letter-spacing: 0.08em;
}
.hdr .chip svg { width: 14px; height: 14px; stroke-width: 1.75; }
.hdr .chip.caution { color: #f8d66d; border-color: rgba(241, 194, 27, 0.55); background: rgba(241, 194, 27, 0.12) !important; }

/* AI actions (anything carrying the sparkles icon) are navy with a teal icon.
   The command bar keeps its own search-field look. */
.btn:not(.cmd):not(.btn-primary):has(> svg.lucide-sparkles) {
  background: var(--dm-navy);
  border-color: var(--dm-navy);
  color: #ffffff;
}
.btn:not(.cmd):not(.btn-primary):has(> svg.lucide-sparkles) > svg { color: var(--dm-teal-light); }
.btn:not(.cmd):not(.btn-primary):has(> svg.lucide-sparkles):hover:not(:disabled) { background: var(--dm-navy-2); }
:root[data-theme="night"] .btn:not(.cmd):not(.btn-primary):has(> svg.lucide-sparkles) { border-color: var(--dm-navy-line); }

/* Outline icons at the kit's lighter stroke. */
.btn svg.lucide, .tabbar-item svg.lucide, .rail svg.lucide, .hdr svg.lucide, .list-row svg.lucide { stroke-width: 1.75; }

/* One orb on the navy band. Rail and header are both navy now, so the rail's
   32px mark and the header lockup's 28px mark read as the same logo twice,
   70px apart. Wherever the rail shows, the header carries the wordmark alone;
   on a phone the rail is hidden and the header keeps the full lockup. Under a client's brand the rail
   is still ours and the header is the client's, so neither repeats the other. */
@media (min-width: 768px) {
  /* !important: the lockup's images carry display:block inline (the React
     BrandImage and the studio's hand-written page both), which beats any
     selector without it. */
  .shell .hdr .brand > img:first-child { display: none !important; }
  /* A client's logo stays in the header, square or wide: the rail keeps our orb whatever the brand
     (BrandMark), so the header is the only place the client's brand is drawn. */
}

/* The shortcut chip inside the primary: full strength, or white at 70% on the
   gradient drops to ~3:1. */
.btn.btn-primary .kbd { opacity: 1; }

/* Recharts paints legend text in the series colour; a status amber or a light
   accent step is unreadable as text on the page ground. The swatch carries the
   colour, the word is ordinary text. (Third-party chrome does not follow the
   theme on its own.) */
.recharts-legend-item-text { color: var(--color-text) !important; }

/* A labelled field in the header's context slot (a site picker). The header is
   58px; the kit's label (12.6px line) over a 44px field is exactly 58, so the
   label sat on the top edge. Inside the desktop header the field is 44px (the floor) and
   the label one line tall: 55px, inside the 58px header. On a phone the
   context wraps onto its own row and keeps the full 44px field. */
@media (min-width: 768px) {
  .hdr .ctx .sp-lbl { line-height: 1; }
  .hdr .ctx .input { min-height: 44px; padding-top: 8px; padding-bottom: 8px; } /* label 10.5px + 44px = 55px: inside 58 */
}

/* ── Right to left (Arabic, Urdu) ─────────────────────────────────────────── */
/* Layout already follows the page: every inline edge above is logical, and
   grid columns mirror on their own under dir="rtl". Two things do not. */

/* An icon that points a way has to point the other way when the page reads the
   other way, or "back" points forward. Applied only to icons that mean a
   direction — never to the brand mark, the logo, a check or a close. */
[dir="rtl"] .rtl-flip { transform: scaleX(-1); }

/* Record IDs, meter readings, keyboard hints and codes are left-to-right
   strings wherever they sit. Isolated, "WO-1830" keeps its order inside an
   Arabic sentence instead of being turned round by the text around it. */
.list-row-id,
.table td.num,
.kbd,
.mono,
code,
kbd,
samp {
  unicode-bidi: isolate;
  direction: ltr;
}
/* A figure column is set left to right, so "end" now means its own right edge.
   Under an Arabic page it should still sit on the page's end, which for a
   left-to-right cell is its start. */
[dir="rtl"] .table td.num { text-align: start; }

/* Text that may hold words of the other direction — the command bar, the app's
   name, list and record titles. English left untranslated inside an Arabic page
   (or a record title written in English) has its punctuation turned round by
   the text around it: "…Ask Orbit AI or search work, assets, parts", the
   ellipsis at the front. Each is isolated and set in the direction of its own
   first letter; the package's own components set dir explicitly (textDir), so
   only markup an app wrote itself — no dir attribute — is taken by this rule.
   It keeps the page's alignment either way (match-parent). */
.cmd > span:not([dir]):not(.kbd),
.hdr-app h1:not([dir]),
.list-head h2:not([dir]),
.list-row-title:not([dir]),
.rec-head h2:not([dir]) {
  unicode-bidi: plaintext;
  text-align: match-parent;
}
.cmd-text,
.hdr-app > [dir],
.list-row-title[dir],
.rec-head h2[dir] {
  unicode-bidi: isolate;
  text-align: match-parent;
}
.cmd-text { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Joined scripts are never letter-spaced. The small uppercase labels are tracked .1–.14em, which in
   Arabic and Urdu pulls the letters of a word apart (they must join), and breaks the headline of
   Devanagari. Uppercase means nothing in these scripts either, so the tracking goes entirely. */
:root:is([lang="ar"], [lang="ur"], [lang="hi"]) *,
:root:is([lang="ar"], [lang="ur"], [lang="hi"]) *::before,
:root:is([lang="ar"], [lang="ur"], [lang="hi"]) *::after { letter-spacing: 0 !important; }

/* The phone floor is 48px (the app standard, §2b). Fields and segment options
   were 44-46px on a phone, which the acceptance run measured as under it. */
/* The tap floor as a value apps and the suite can use inline: 44px, 48px on a phone. */
:root { --tap-min: 44px; }
@media (max-width: 767px) {
  :root { --tap-min: 48px; }
  .input:not(textarea) { min-height: 48px; }
  .seg-opt { min-height: 48px; }
}

/* ── Phone tap floor, 48px high AND wide (§2b, §7) ───────────────────────────
   Every interactive element the package styles. `:root` in front lifts each
   rule to (0,2,0)+ so it wins whatever order an app imports the stylesheets in
   (industry.css 44px button rule and the shell.css command bar otherwise
   beat a bare class that came earlier), without !important. Desktop is
   untouched: the whole block sits inside the phone query.
   Tags are NOT touched unless they are used as controls (button, link,
   role=button, tabindex) — a status tag is a label, not a target. */
@media (max-width: 767px) {
  :root .btn,
  :root .cmd,
  :root .btn-ghost,
  :root .btn-icon,
  :root .seg-opt,
  :root .rail-btn,
  :root .tabbar-item,
  :root .hdr .chip,
  :root button.chip,
  :root a.chip,
  :root .chip[role="button"],
  :root .chip[tabindex],
  :root button.tag,
  :root a.tag,
  :root .tag[role="button"],
  :root .tag[tabindex],
  :root [role="switch"],
  :root [role="tab"],
  :root .switch,
  :root .toggle,
  :root .lang-select,
  :root select,
  :root input[type="checkbox"]:not(.sr-only),
  :root input[type="radio"]:not(.sr-only) {
    min-height: 48px;
  }
  :root .btn,
  :root .btn-ghost,
  :root .btn-icon,
  :root .seg-opt,
  :root .rail-btn,
  :root .tabbar-item,
  :root .hdr .chip,
  :root button.chip,
  :root a.chip,
  :root .chip[role="button"],
  :root .chip[tabindex],
  :root button.tag,
  :root a.tag,
  :root .tag[role="button"],
  :root .tag[tabindex],
  :root [role="switch"],
  :root [role="tab"],
  :root .switch,
  :root .toggle,
  :root .lang-select,
  :root input[type="checkbox"]:not(.sr-only),
  :root input[type="radio"]:not(.sr-only) {
    min-width: 48px;
  }
  /* Tags/chips are inline-flex already; centre the word in the taller box. */
  :root .hdr .chip,
  :root button.chip, :root a.chip, :root .chip[role="button"], :root .chip[tabindex],
  :root button.tag, :root a.tag, :root .tag[role="button"], :root .tag[tabindex] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-block: 0;
    padding-inline: 12px;
  }
  /* Switch/toggle track: keep its drawn size, grow the hit area invisibly. */
  :root [role="switch"], :root .switch, :root .toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }
  /* Segmented control: the options share the row, so the width floor is on the option. */
  :root .seg { min-height: 48px; }
  /* Ghost buttons keep their 8px side padding on desktop; on a phone they need a wider target. */
  :root .btn-ghost { padding-inline: 12px; }
  /* The command bar: 48px whatever file declared its 44px. */
  :root .cmd { min-height: 48px; }
  /* Body text the package styles is 13.5px or more. */
  :root .list-row-meta,
  :root .table td,
  :root .table th { font-size: 13.5px; }
  :root .list-row-id { font-size: 13.5px; }
}

/* The list's filter field is a full-height target on a desktop too (record.css draws it 34px high). */
:root .list-filter .input { min-height: 44px; }
@media (max-width: 767px) { :root .list-filter .input { min-height: 48px; } }

/* Every pressable control is at least as WIDE as it is tall (the 44px floor, 48px on a phone): a short word in Hindi or Urdu made buttons
   37–43px wide, a fault on every screen of Setup, HSQE and Nebula (test engine, 3 Nov 2026, all 17 languages). One rule here, for every app. */
:root .btn, :root .seg-opt, :root [role="tab"], :root .tabbar-item { min-width: 44px; }
@media (max-width: 767px) { :root .btn, :root .seg-opt, :root [role="tab"], :root .tabbar-item { min-width: 48px; } }
