/* ══ NeoAI Customer Portal — V2 design system (CUSTOMER-PORTAL-IA-01 Release 1) ═══════════════════════════
   The V2 design language (docs/standards/NeoAI_Interactive_Portals_Prototype_v2.html): dark grouped sidebar with
   icons (264px, 76px rail when collapsed or on tablet, a drawer on phones), a light header carrying the plane,
   the customer and its lifecycle, the working context, search, notifications, Ask NEO, Help and the profile, and
   cards on the NeoAI brand canvas (NEOAI-UNIFIED-BRAND-UI: the public website's palette, type and component
   language, tokens below). Copied, never imported: the planes share no runtime code. Light theme only. The legacy
   page rules further down keep the operational pages (Health, Asset Detail, Telemetry, AI, Access, Environment)
   working on the same tokens. */
:root {
  color-scheme: light;
  /* NeoAI brand palette. Canonical source: apps/neoai-website/site/assets/css/tokens.css (copied, never imported).
     Contrast (WCAG 2.2 AA, measured): --text 9.09:1 and --text-muted 5.13:1 on --bg; --accent 6.07:1 on white;
     --brand-amber is for dark surfaces only (7.09:1 on --dark, 2.41:1 on white), never text on a light surface. */
  --brand-ink: #0b1f1d;
  --brand-teal: #0f6e6a;
  --brand-teal-deep: #0a4a47;
  --brand-teal-pale: #e4f0ef;
  --brand-amber: #e0982f;
  --brand-paper: #f6f5ef;
  --brand-card: #ffffff;
  --brand-slate: #3a4544;
  --brand-mist: #dbe3e1;

  /* Semantic tokens: every rule below uses these, never a raw colour */
  --bg: var(--brand-paper);
  --surface: var(--brand-card);
  --surface-sunk: #f2f5f3;
  --surface-hover: #f4f8f7;
  --ink: var(--brand-ink);
  --text: var(--brand-slate);
  --text-muted: #5f6a68;
  --text-faint: #6b7674;
  --border: var(--brand-mist);
  --line: var(--brand-mist);
  --border-strong: #c3cfcc;
  --control-border: #8a9794;
  --accent: var(--brand-teal);
  --accent-strong: var(--brand-teal-deep);
  --accent-soft: var(--brand-teal-pale);
  --accent-border: #b9d6d3;
  --accent-warm: var(--brand-amber);
  --dark: var(--brand-ink);
  --dark-2: #12302d;
  --on-dark: #d8ede9;
  --on-dark-soft: #9fc4bf;
  --on-dark-line: rgba(216, 237, 233, .12);
  --on-dark-hover: rgba(216, 237, 233, .08);
  --on-dark-scroll: #35504c;
  --on-dark-amber: #f0b25a;    /* amber for small text on dark: 9.14:1 on --dark, 5.73:1 on a hovered nav row */
  --nav-active: linear-gradient(90deg, rgba(15, 110, 106, .62), rgba(15, 110, 106, .2));
  --ok: #1f6b3a;
  --ok-soft: #dcefdf;
  --ok-wash: #f1f8f2;
  --ok-border: #b9dcc0;
  --warn: #96590a;
  --warn-soft: #fbe8cf;
  --warn-wash: #fdf6ec;
  --warn-border: #efcf9f;
  --bad: #a4262c;
  --bad-soft: #fbeaea;
  --bad-wash: #fdf4f4;
  --bad-border: #eab9bb;
  --info: #2c5d86;
  --info-soft: #e5eef6;
  --info-wash: #eef4f9;
  --info-border: #c5d7e8;
  --soon: #4a4a63;
  --soon-soft: #e6e6ee;
  --soon-wash: #f6f6f9;
  --soon-border: #c9c9d9;
  --violet: #5a4a9c;
  --violet-soft: #efecf8;
  --forbidden: #78354e;
  --forbidden-wash: #fdf5f8;
  --forbidden-border: #edcfdb;
  --skeleton: #e6ecea;
  /* Customer Plane marker: brand teal (the Platform Portal's is violet, so a person always knows the plane) */
  --plane: var(--brand-teal-deep);
  --plane-soft: var(--brand-teal-pale);
  --plane-border: #c4dedb;
  --focus: var(--brand-teal-deep);
  --focus-on-dark: var(--brand-amber);
  --backdrop: rgba(11, 31, 29, .5);
  --radius: 10px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(11, 31, 29, .06), 0 8px 24px rgba(11, 31, 29, .06);
  --shadow-pop: 0 18px 48px rgba(11, 31, 29, .18);
  --nav-width: 264px;
  --nav-mini: 76px;
  --header-height: 73px;
  /* the website's system stack: no web-font request, so the CSP needs no font-src */
  --font: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-height) + 8px); }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { color: var(--ink); }
::selection { background: var(--accent-soft); color: var(--ink); }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; }
.skip-link { position: absolute; left: .5rem; top: -4rem; z-index: 90; background: var(--surface); color: var(--ink);
  padding: .55rem .9rem; border: 2px solid var(--focus); border-radius: var(--radius-sm); font-weight: 700; }
.skip-link:focus { top: .5rem; }

/* ── icons ──────────────────────────────────────────────────────────────────────────────────────── */
.icon { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round;
  stroke-linejoin: round; flex-shrink: 0; display: block; }
.icon--sm { width: 16px; height: 16px; }
.icon--xs { width: 14px; height: 14px; }
.icon--lg { width: 22px; height: 22px; }

/* ── layout ─────────────────────────────────────────────────────────────────────────────────────── */
.app-layout { --rail: var(--nav-width); display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh;
  transition: grid-template-columns .22s ease;
  /* the sidebar column stays dark the full height of a long page, behind the sticky sidebar */
  background: linear-gradient(to right, var(--dark) var(--rail), transparent var(--rail)); }
.app-layout--collapsed { --rail: var(--nav-mini); }
.app-work { min-width: 0; display: flex; flex-direction: column; }
.app-main { min-width: 0; padding: 27px 32px 60px; flex: 1; }
.app-main:focus { outline: none; }
.app-main--solo { max-width: 900px; margin: 0 auto; width: 100%; }
.solo-shell { min-height: 100vh; }
.page { max-width: 1320px; margin: 0 auto; }
.nav-backdrop { display: none; }

/* ── sidebar ────────────────────────────────────────────────────────────────────────────────────── */
.app-nav { position: sticky; top: 0; height: 100vh; background: var(--dark); color: var(--on-dark); display: flex;
  flex-direction: column; overflow: hidden; z-index: 42; }
.brand { height: var(--header-height); display: flex; align-items: center; gap: 11px; padding: 0 18px;
  border-bottom: 1px solid var(--on-dark-line); flex-shrink: 0; text-decoration: none; color: #fff; }
.brandmark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--radius-md); flex-shrink: 0;
  background: var(--brand-teal); color: #fff; font-size: 20px; font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.brandmark--lg { width: 52px; height: 52px; font-size: 26px; border-radius: var(--radius); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: 18px; font-weight: 800; color: #fff; letter-spacing: .2em; text-transform: uppercase; line-height: 1.15; }
.brand-caption { font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--on-dark-soft); font-weight: 800; }
.nav-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 17px 11px 15px; scrollbar-width: thin;
  scrollbar-color: var(--on-dark-scroll) transparent; }
.nav-group { padding-bottom: 8px; margin-bottom: 7px; }
.nav-group-heading { font-size: 10px; letter-spacing: 1.2px; font-weight: 800; color: var(--on-dark-soft); text-transform: uppercase;
  padding: 11px 12px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* My Workspace selector (ADR-050 A7): presentation only. */
.workspace-switch { display: flex; flex-direction: column; gap: 4px; margin: 0 4px 14px; }
.workspace-switch-label { font-size: 10px; letter-spacing: 1.2px; font-weight: 800; color: var(--on-dark-soft); text-transform: uppercase; }
.workspace-select { width: 100%; min-height: 36px; border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.06); color: inherit; padding: 6px 8px; font: inherit; }
/* The open list is drawn by the browser on a light popup: the select's light sidebar text would be near-invisible there. */
.workspace-select option { color: var(--ink); background: var(--surface); }
.app-layout--collapsed .workspace-switch { display: none; }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-link { display: flex; align-items: center; gap: 11px; position: relative; min-height: 39px; padding: 9px 10px;
  margin: 2px 0; border-radius: var(--radius-sm); color: var(--on-dark); text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s; }
.nav-link .icon { opacity: .83; }
.nav-link:hover { background: var(--on-dark-hover); color: #fff; }
.nav-link--active { background: var(--nav-active); color: #fff; font-weight: 700; }
.nav-link--active::before { content: ""; position: absolute; left: -11px; width: 3px; top: 6px; bottom: 6px;
  border-radius: 0 4px 4px 0; background: var(--focus-on-dark); }
.nav-link:focus-visible { outline-color: var(--focus-on-dark); }
.nav-link-label { flex: 1; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.nav-link--soon { color: var(--on-dark-soft); }
.nav-pill { font-size: 10px; border-radius: 4px; padding: 2px 6px; color: var(--on-dark-amber); background: rgba(224, 152, 47, .16); font-weight: 700;
  letter-spacing: .1px; text-transform: none; border: 0; }
.nav-foot { border-top: 1px solid var(--on-dark-line); padding: 10px 11px 14px; flex-shrink: 0; }
.nav-foot-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 10px; border: 0;
  border-radius: var(--radius-sm); background: transparent; color: var(--on-dark); font-size: 12.5px; text-align: left; cursor: pointer; }
.nav-foot-btn:hover { background: var(--on-dark-hover); color: #fff; border: 0; }
.nav-foot-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* collapsed rail (desktop, by choice) — and the same rail on tablets */
.app-layout--collapsed .brand-text, .app-layout--collapsed .nav-link-label, .app-layout--collapsed .nav-pill,
.app-layout--collapsed .nav-foot-label { display: none; }
.app-layout--collapsed .brand { justify-content: center; padding: 0; }
.app-layout--collapsed .nav-scroll { padding: 12px 9px; }
.app-layout--collapsed .nav-group-heading { font-size: 0; padding: 0; height: 1px; margin: 6px 5px 6px;
  border-top: 1px solid var(--on-dark-line); }
.app-layout--collapsed .nav-group:first-child .nav-group-heading { border-top: 0; }
.app-layout--collapsed .nav-link, .app-layout--collapsed .nav-foot-btn { justify-content: center; padding: 12px 7px; }
.app-layout--collapsed .collapse-btn .icon { transform: rotate(180deg); }

/* ── header ─────────────────────────────────────────────────────────────────────────────────────── */
.app-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  min-height: var(--header-height); padding: 0 25px; background: var(--surface); border-bottom: 1px solid var(--line);
  box-shadow: inset 0 3px 0 var(--plane); }
.solo-shell .app-header { position: relative; }
.app-header .app-menu-btn { display: none; }
.plane-pill { font-size: 10px; text-transform: uppercase; letter-spacing: 1.1px; color: var(--plane); background: var(--plane-soft);
  border: 1px solid var(--plane-border); padding: 6px 9px; border-radius: 7px; white-space: nowrap; font-weight: 800; }
.customer-context { display: flex; align-items: center; gap: 7px; min-width: 0; }
.context-btn { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid transparent;
  border-radius: var(--radius-sm); max-width: 320px; min-width: 0; background: transparent; color: var(--ink); font-size: 12.5px;
  font-weight: 700; white-space: nowrap; cursor: pointer; }
.context-btn:hover { background: var(--surface-hover); border-color: var(--line); }
.context-label { overflow: hidden; text-overflow: ellipsis; }
.active-pill { border-radius: 6px; font-size: 10px; font-weight: 800; padding: 5px 8px; white-space: nowrap;
  text-transform: uppercase; letter-spacing: .4px; background: var(--warn-soft); color: var(--warn); }
.active-pill--ok { background: var(--ok-soft); color: var(--ok); }
.active-pill--bad { background: var(--bad-soft); color: var(--bad); }
.app-tenant-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28ch; }
.app-spacer { flex: 1; min-width: 4px; }
.search-launch { display: flex; align-items: center; gap: 9px; flex: 0 1 250px; min-width: 200px; padding: 10px 11px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-sunk); color: var(--text-muted); text-align: left;
  cursor: pointer; font-size: 12.5px; }
.search-launch:hover { border-color: var(--accent); background: #fff; }
.search-launch-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kbd { font: inherit; font-size: 10px; font-weight: 650; background: var(--surface-sunk); color: var(--text-muted); padding: 2px 5px;
  border: 1px solid var(--line); border-radius: 5px; white-space: nowrap; }
.header-icon { width: 38px; height: 38px; display: grid; place-items: center; flex-shrink: 0; padding: 0;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--text-muted); cursor: pointer; }
.header-icon:hover, .header-icon[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.profile { display: flex; flex-shrink: 0; align-items: center; gap: 9px; padding: 0 0 0 10px; border: 0; border-left: 1px solid var(--line);
  border-radius: 0; background: transparent; min-width: 0; text-align: left; cursor: pointer; color: var(--ink); }
.profile:hover { border-color: var(--line); }
.avatar { width: 34px; height: 34px; border-radius: var(--radius-sm); flex-shrink: 0; display: grid; place-items: center;
  background: var(--brand-teal-deep); color: #fff; font-size: 11px; font-weight: 800; }
.profile-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.app-user-name { font-size: 12.5px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22ch; }
.app-user-role { color: var(--text-faint); font-size: 10.5px; font-weight: 600; margin-top: 2px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 30ch; }
.lifecycle-banner { background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--warn-border); padding: .6rem 25px;
  font-size: 12.5px; }

/* ── popovers ───────────────────────────────────────────────────────────────────────────────────── */
.popover { position: absolute; top: calc(100% + 6px); right: 16px; z-index: 65; width: min(320px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.popover[hidden] { display: none; }
.popover:focus { outline: none; }
.popover--context { left: 16px; right: auto; width: min(360px, calc(100vw - 24px)); }
.popover-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.popover-body { padding: 12px 16px 16px; display: grid; gap: 10px; font-size: 12.5px; }
.popover-body p { margin: 0; }
.popover-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
/* the header bell: changes to the member's own access (core/access-notifications.js) */
.bell-list { gap: 6px; max-height: min(60vh, 420px); overflow-y: auto; overscroll-behavior: contain; }
.bell-item { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.bell-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.header-icon--bell { position: relative; }
.bell-count { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; display: grid; place-items: center; background: var(--bad); color: #fff; font-size: 10px; font-weight: 800; line-height: 1; border: 2px solid var(--surface); }
.bell-count[hidden] { display: none; }
/* a notification is a card: its text opens it (never styled as an underlined link); a small control flips read/unread */
.bell-item-main { display: grid; gap: 2px; width: 100%; padding: 0; border: 0; background: transparent; color: inherit;
  font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.bell-item-main:hover strong, .bell-item-main:focus-visible strong { color: var(--accent); }
.bell-item-toggle { justify-self: start; margin-top: 4px; padding: 0; border: 0; background: transparent; color: var(--accent);
  font: inherit; font-size: 11.5px; font-weight: 650; cursor: pointer; }
.bell-item-toggle:hover { text-decoration: underline; }
/* Notification settings: one row per notification type */
.notification-settings-list { gap: 10px; }
.notification-setting { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.notification-setting-label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.notification-setting-label input[disabled] + strong { color: var(--ink); }
.bell-item--unread { border-left: 3px solid var(--accent); background: var(--accent-soft); }
/* the header user menu (NEOAI-CUSTOMER-UX-01): 44px targets for touch, a visible focus ring for keyboards */
.popover--profile { width: min(330px, calc(100vw - 24px)); }
.popover--profile .popover-body { padding: 10px 8px 10px; gap: 6px; }
.user-menu-who { display: flex; align-items: center; gap: 11px; padding: 4px 8px 10px; border-bottom: 1px solid var(--line); }
.user-menu-who-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.user-menu-who-text .note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.user-menu-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 44px; padding: 7px 10px; border: 0;
  border-radius: var(--radius-sm); background: transparent; color: var(--ink); font: inherit; text-align: left;
  text-decoration: none; cursor: pointer; }
.user-menu-item:hover { background: var(--accent-soft); color: var(--accent); }
.user-menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--accent-soft); }
.user-menu-item--signout { border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-sm) var(--radius-sm); margin-top: 4px; }
.user-menu-text { display: flex; flex-direction: column; min-width: 0; }
.user-menu-label { font-weight: 650; }
.user-menu-hint { color: var(--text-faint); font-size: 11px; }
/* denied actions (NEOAI-CUSTOMER-UX-01): one presentation for every refusal or failure */
.denied-action p { margin: 0 0 6px; }
.denied-action .denied-why { color: var(--ink); }
.denied-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; }
.denied-help { font-weight: 650; min-height: 44px; display: inline-flex; align-items: center; }
/* My Access & Permissions, and permissions on People & Access */
.my-access { display: grid; gap: 18px; }
.area-list { display: grid; gap: 10px; }
.area-group { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.area-group > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px;
  padding: 8px 14px; cursor: pointer; font-weight: 700; }
.area-items { list-style: none; margin: 0; padding: 4px 14px 12px; display: grid; gap: 8px; }
.area-item { display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.area-item:first-child { border-top: 0; padding-top: 0; }
.area-item-head { display: flex; gap: 9px; align-items: baseline; }
.area-item-head .badge { flex-shrink: 0; min-width: 58px; justify-content: center; text-align: center; }
.area-where { margin: 0 0 0 67px; }
.area-where--unknown { color: var(--warn); }
.role-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.role-card { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.role-card > summary { display: grid; gap: 3px; padding: 10px 14px; min-height: 44px; cursor: pointer; }
.role-card-name { font-weight: 750; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.role-compare { margin-top: 10px; }
.role-compare-pickers { display: flex; flex-wrap: wrap; gap: 12px; }
.role-compare-pickers .field { min-width: min(260px, 100%); flex: 1; }
.role-compare-result { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 10px; }
.role-compare-col h3 { font-size: 13px; margin: 0 0 6px; }
@media (max-width: 740px) {
  .role-compare-result { grid-template-columns: minmax(0, 1fr); }
  .area-where { margin-left: 0; }
}
/* Organisation & Sites (NEOAI-CUSTOMER-JOURNEY-01 REV4 Part 1) */
.org-kpis { margin-bottom: 14px; }
.org-kpi-scope { margin: 0 0 8px; }
.kpi-grid.org-kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 0; }
.org-next { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; margin-bottom: 16px; }
.org-next .next-steps { margin: 4px 0; padding-left: 18px; }
.org-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 18px; align-items: start; }
.org-tree { padding: 12px 14px; }
.org-tree-summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.org-tree-summary::-webkit-details-marker { display: none; }
.org-tree-filters { display: grid; gap: 8px; margin: 6px 0 10px; }
.org-tree-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.org-tree-list { list-style: none; margin: 0; padding: 0 0 0 14px; display: grid; gap: 2px; }
.org-tree-host > .org-tree-list { padding-left: 0; }
.org-node-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 6px 8px; border: 0;
  border-radius: var(--radius-sm); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.org-node-btn:hover { background: var(--accent-soft); }
.org-node-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.org-node-btn[aria-current="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent); }
.org-node-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.org-node-label { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-node-sub { color: var(--text-faint); font-size: 11px; }
.org-detail { display: grid; gap: 16px; min-width: 0; }
.org-detail .panel { margin: 0; padding: 16px 18px; }
.org-site-head, .org-deployment-head, .org-commissioning-head { display: flex; gap: 12px; align-items: flex-start;
  justify-content: space-between; flex-wrap: wrap; }
.org-site-head { justify-content: flex-start; }
.org-site-head h2:focus { outline: none; }
.org-deployment-head h3, .org-commissioning-head h3, .org-setup h3 { margin: 0; }
.org-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0 8px; }
.org-count { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-sunk); }
.org-count strong { font-size: 20px; }
.org-percent { font-weight: 750; color: var(--accent); }
.org-progress { width: 100%; height: 10px; margin: 10px 0 14px; accent-color: var(--accent); }
.org-journey { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px; }
.org-stage { display: grid; gap: 6px; align-content: start; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.org-stage--current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.org-stage-mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 750;
  background: var(--surface-sunk); color: var(--text-muted); }
.org-stage--ok .org-stage-mark { background: var(--ok-soft); color: var(--ok); }
.org-stage--info .org-stage-mark { background: var(--accent-soft); color: var(--accent); }
.org-stage--warn .org-stage-mark { background: var(--warn-soft); color: var(--warn); }
.org-stage-body p { margin: 4px 0; }
.org-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.org-action { display: grid; gap: 6px; align-content: start; margin: 0; }
.org-action p { margin: 0; }
.org-action--off { background: var(--surface-sunk); }
.org-action-go { font-weight: 700; color: var(--accent); }
.org-runs { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 12px; }
.org-run-steps { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.org-run-step { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--surface-sunk);
  color: var(--text-muted); }
.org-run-step--done { background: var(--ok-soft); color: var(--ok); }
.org-run-step--current, .org-run-step--active { background: var(--accent-soft); color: var(--accent); }
.org-run-step--failed { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 1320px) { .org-journey { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1120px) {
  .kpi-grid.org-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .org-layout { grid-template-columns: minmax(0, 1fr); }
  .org-tree { margin: 0; }
}
@media (max-width: 740px) {
  .kpi-grid.org-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .org-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .org-journey { grid-template-columns: minmax(0, 1fr); }
  .org-stage { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .org-actions { grid-template-columns: minmax(0, 1fr); }
  .org-tree-selects { grid-template-columns: minmax(0, 1fr); }
}
/* bundled illustrations: generic pictures, always captioned -- never a photo of the customer's equipment */
.illustration { margin: 0; display: inline-grid; justify-items: center; gap: 2px; flex-shrink: 0; }
.illustration svg { display: block; max-width: 100%; height: auto; color: var(--accent); }
.illustration--sm .illustration-art { width: 104px; }
.illustration--md .illustration-art { width: 170px; }
.illustration-caption { font-size: 10px; font-weight: 650; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.org-deployment-head { justify-content: flex-start; }
.org-deployment-title { flex: 1; min-width: 0; }
/* Device & Gateway Onboarding (NEOAI-CUSTOMER-JOURNEY-01 REV4 Part 2) */
.onb { display: grid; gap: 16px; }
.onb-context { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.onb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.onb-row { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); }
.onb-row p { margin: 0; }
.onb-row-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.onb-row .btn { justify-self: start; min-height: 44px; }
.onb-progress-line { display: grid; gap: 4px; }
.onb-progress { width: 100%; height: 10px; accent-color: var(--accent); }
.onb-wizard { display: grid; gap: 14px; }
.onb-head { display: grid; gap: 8px; padding: 16px 18px; margin: 0; }
.onb-selected { display: flex; gap: 12px; align-items: center; overflow-wrap: anywhere; }
.onb-selected > div, .onb-row-head > strong, .onb-check { min-width: 0; overflow-wrap: anywhere; }
.onb-selected p { margin: 0; }
.onb-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.onb-step { display: grid; gap: 2px; justify-items: start; width: 100%; min-height: 44px; padding: 8px 10px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.onb-step:disabled { cursor: not-allowed; opacity: .6; }
.onb-step[aria-current="step"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.onb-step:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.onb-step-n { font-weight: 800; }
.onb-step-label { font-weight: 650; font-size: 12.5px; }
.onb-step-state { font-size: 11px; color: var(--text-faint); }
.onb-step--ok .onb-step-state { color: var(--ok); }
.onb-step--warn .onb-step-state { color: var(--warn); }
.onb-panel { display: grid; gap: 12px; padding: 16px 18px; margin: 0; }
.onb-panel h3 { margin: 0; }
.onb-panel h3:focus { outline: none; }
.onb-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.onb-mode { display: grid; gap: 6px; justify-items: start; min-height: 44px; padding: 14px; text-align: left; font: inherit;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; }
.onb-mode--on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: var(--accent-soft); }
.onb-mode:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.onb-devices { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; display: grid; gap: 4px; }
.onb-check { display: flex; gap: 8px; align-items: center; min-height: 44px; }
.onb-check input { width: 20px; height: 20px; }
.onb-device-group { display: grid; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.onb-device-group:last-child { border-bottom: 0; }
.onb-map { display: grid; gap: 8px; }
.onb-map-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.4fr) auto; gap: 8px; align-items: center; }
.onb-map-row .input, .onb-map-row select { min-height: 44px; }
.onb-map-head { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.onb-params { display: grid; gap: 8px; margin-bottom: 16px; }
.onb-params-title { margin: 0; font-size: 15px; }
.onb-param-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.onb-param-row > .badge { justify-self: start; }
.onb-param-sensor { display: grid; gap: 2px; min-width: 0; }
.onb-param-pick { display: grid; gap: 4px; min-width: 0; }
.onb-param-pick select { min-height: 44px; }
.onb-param-desc { margin: 0; }
.onb-sample-box { margin-top: 12px; }
.onb-sample { margin: 8px 0 0; padding: 12px; overflow-x: auto; background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; line-height: 1.45; }
.onb-actions, .onb-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.onb-actions .btn, .onb-foot .btn { min-height: 44px; }
.onb-foot { justify-content: space-between; }
.env-rename-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-top: 8px; }
.env-rename { display: grid; gap: 6px; }
.env-rename-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.env-rename-actions .btn, .env-rename .btn { min-height: 44px; }
.env-choices { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.env-choice { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.env-choice p { margin: 4px 0 0; }
.env-source-list li { display: grid; gap: 4px; padding: 8px 0; border-top: 1px solid var(--border); }
.env-source-list .btn { justify-self: start; min-height: 44px; }
.env-policy-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.env-policy-table { width: 100%; }
.env-cs { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--border); }
.org-percent-line { margin: 4px 0 0; }
.org-setup-now { margin: 0; }
@media (max-width: 1120px) { .env-choices { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 740px) {
  .env-policy-table thead { display: none; }
  .env-policy-table tr { display: grid; gap: 2px; padding: 8px 0; border-top: 1px solid var(--border); }
  .env-policy-table td { border: 0; padding: 0; }
}
.onb-cov { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.onb-cov-row { display: grid; grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1.6fr); gap: 8px 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--border); }
.onb-cov-row > .badge { justify-self: start; }
.onb-cov-row > .note { grid-column: 1 / -1; margin: 0; }
.onb-cov-freq { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; margin: 0; font-size: 13px; }
.onb-cov-freq dt { color: var(--text-muted); }
.onb-cov-freq dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 1120px) { .onb-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 740px) {
  .onb-steps { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .onb-step { grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; padding: 8px 10px; }
  .onb-step-label { font-size: 12.5px; }
  .onb-step-state { font-size: 11px; }
  .onb-cov-row { grid-template-columns: minmax(0, 1fr); }
  .page-head .btn--small { min-height: 44px; }
  .onb-modes { grid-template-columns: minmax(0, 1fr); }
  .onb-map-row { grid-template-columns: minmax(0, 1fr); }
  .onb-map-row > span[aria-hidden="true"] { display: none; }
  .onb-map-head { display: none; }
  .onb-param-row { grid-template-columns: minmax(0, 1fr); }
}
/* My Profile */
.profile-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.role-scope-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.role-scope { display: grid; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.role-scope:last-child { border-bottom: 0; padding-bottom: 0; }
.disclosure summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 650; color: var(--accent); }
@media (max-width: 1120px) { .profile-layout { grid-template-columns: minmax(0, 1fr); } }
.kv--compact { grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 12.5px; }

/* ── search ─────────────────────────────────────────────────────────────────────────────────────── */
.search-modal { width: min(670px, calc(100vw - 28px)); max-height: min(650px, 80vh); padding: 0; margin: min(13vh, 105px) auto auto;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 25px 95px rgba(11, 31, 29, .32); overflow: hidden; color: var(--ink); }
.search-modal[open] { display: flex; flex-direction: column; }
.search-modal::backdrop { background: var(--backdrop); }
.search-field { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 14px 16px; color: var(--text-muted); }
.search-input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 16px; color: var(--ink); background: transparent; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-results { flex: 1; overflow-y: auto; padding: 8px 10px 10px; min-height: 120px; }
.search-group-head { font-size: 10px; text-transform: uppercase; letter-spacing: 1.1px; color: var(--text-muted); font-weight: 850;
  padding: 13px 11px 6px; }
.search-result { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.search-result[aria-selected="true"], .search-result:hover { background: var(--accent-soft); }
.search-result-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: var(--radius-sm); background: var(--surface-sunk);
  color: var(--text-muted); flex-shrink: 0; }
.search-result strong { display: block; font-size: 12.5px; }
.search-result small { display: block; font-size: 10.5px; color: var(--text-muted); margin-top: 3px; }
.search-note, .search-empty { margin: 6px 12px 10px; color: var(--text-muted); font-size: 12px; }
.search-footer { border-top: 1px solid var(--line); padding: 10px 16px; font-size: 10.5px; color: var(--text-muted); display: flex; gap: 14px;
  flex-wrap: wrap; }

/* ── page structure ─────────────────────────────────────────────────────────────────────────────── */
.page-head { margin-bottom: 21px; }
.page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-head-text { min-width: 0; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .16em; color: var(--accent); font-weight: 800; margin: 0 0 6px; }
.page-title { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.page-title:focus { outline: none; }
.page-subtitle { margin: 8px 0 0; color: var(--text-muted); font-size: 12.5px; max-width: 720px; }
.page-actions, .panel-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.breadcrumb-nav { margin-bottom: 15px; }
.breadcrumb { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 0; padding: 0;
  font-size: 11px; font-weight: 600; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb li + li::before { content: "›"; margin-right: 7px; color: var(--text-faint); }
.breadcrumb [aria-current="page"] { color: var(--accent-strong); font-weight: 750; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 16px; min-width: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 19px 19px 4px; }
.panel-title { margin: 0; font-size: 17px; letter-spacing: -.3px; }
.panel-description { margin: 4px 0 0; color: var(--text-muted); font-size: 11.5px; }
.panel-body { padding: 10px 19px 19px; }
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.5fr) minmax(290px, 1fr); align-items: start; }
.split > .panel { margin-bottom: 16px; }

.grid { display: grid; gap: 15px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid--wide { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.kpi-grid { display: grid; gap: 15px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.card { display: block; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 19px; color: inherit; text-decoration: none; min-width: 0; }
.panel .card { box-shadow: none; }
.kpi-grid .card { min-height: 138px; border-top: 3px solid var(--accent); }
.card--link:hover { border-color: var(--accent); }
.card--muted { background: var(--surface-sunk); }
.card--warn { border-color: var(--warn-border); }
.card-icon { width: 34px; height: 34px; border-radius: var(--radius-sm); display: grid; place-items: center; color: var(--accent);
  background: var(--accent-soft); margin-bottom: 14px; }
.card-icon .icon { width: 18px; height: 18px; }
.card-icon--blue { background: var(--info-soft); color: var(--info); }
.card-icon--violet { background: var(--violet-soft); color: var(--violet); }
.card-icon--amber { background: var(--warn-soft); color: var(--warn); }
.card-title { color: var(--text-muted); font-size: 11.5px; font-weight: 700; }
.card-value { font-size: 27px; font-weight: 820; letter-spacing: -1px; margin-top: 4px; color: var(--ink);
  font-variant-numeric: tabular-nums; line-height: 1.15; overflow-wrap: anywhere; }
.grid .card-value { font-size: 21px; letter-spacing: -.5px; }
.card-sub, .card-line { color: var(--text-muted); font-size: 11px; margin: 6px 0 0; }
.card .badge { margin: 8px 6px 0 0; }
.kv { display: grid; grid-template-columns: minmax(9rem, max-content) 1fr; gap: 0; margin: 0; }
.kv dt, .kv dd { padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--text-muted); padding-right: 16px; }
.kv dd { margin: 0; text-align: right; font-weight: 700; overflow-wrap: anywhere; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.kv--compact dt, .kv--compact dd { padding: 0; border: 0; }
.kv--compact dd { text-align: left; font-weight: 600; }
.param-grid { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 10px; }
.param { background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px; min-width: 0; }
.param-label { display: block; color: var(--text-muted); font-size: 11px; }
.param-value { display: block; font-size: 17px; margin-top: 3px; overflow-wrap: anywhere; }
.link-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.context-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 15px; }
.context-bar:empty { display: none; }
.context-bar-label { font-size: 13px; color: var(--ink); }
.legend { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 0; align-items: baseline; }
.legend dd { margin: 0; color: var(--text-muted); }
.help-list { gap: 10px; }
/* NEOAI-HELP-CENTRE-UX-01: contents, workflow diagrams (an ordered list drawn as steps), worked examples */
.help-toc { margin-bottom: 16px; }
.help-toc ol { margin: 8px 0 0; padding-left: 20px; columns: 2 220px; column-gap: 24px; }
.help-toc li { margin: 4px 0; break-inside: avoid; }
.link-button { background: none; border: 0; padding: 2px 0; color: var(--accent); font: inherit; font-weight: 650; cursor: pointer; text-align: left; }
.link-button:hover { text-decoration: underline; }
.help-figure { margin: 14px 0; }
.help-flow { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 26px; counter-reset: step; }
.help-flow li { position: relative; flex: 1 1 140px; min-width: 130px; background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: var(--radius-sm); padding: 10px 12px; counter-increment: step; }
.help-flow li::before { content: counter(step); display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 800; }
.help-flow li:not(:last-child)::after { content: "\2192"; position: absolute; right: -21px; top: 50%; transform: translateY(-50%); color: var(--accent-strong); font-weight: 800; }
.help-flow strong { font-size: 13px; }
.help-flow span { display: block; margin-top: 4px; color: var(--text-muted); font-size: 12.5px; }
.help-caption, .help-muted { color: var(--text-muted); font-size: 12.5px; }
.help-caption { margin-top: 6px; }
.help-example, .help-note { margin: 12px 0; padding: 12px 14px; border-radius: var(--radius-sm); line-height: 1.55; }
.help-example { background: var(--accent-soft); border-left: 4px solid var(--accent); }
.help-note { background: var(--surface-sunk); border-left: 4px solid var(--line); }
.help-table { margin: 10px 0; }
.help-table td { vertical-align: top; }
.help-table .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11.5px; }
.help-code { margin: 0; padding: 12px; overflow-x: auto; white-space: pre; background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; line-height: 1.45; user-select: text; }
@media (max-width: 740px) {
  .help-flow { flex-direction: column; gap: 22px; }
  .help-flow li:not(:last-child)::after { content: "\2193"; right: auto; left: 22px; top: auto; bottom: -21px; transform: none; }
}
.note { color: var(--text-muted); font-size: 12.5px; }

/* ── badges / buttons ───────────────────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 800; line-height: 1.4;
  padding: 4px 9px; border-radius: 20px; border: 0; background: var(--surface-sunk); color: var(--text-muted); white-space: nowrap; }
.badge--ok { color: var(--ok); background: var(--ok-soft); }
.badge--warn { color: var(--warn); background: var(--warn-soft); }
.badge--bad { color: var(--bad); background: var(--bad-soft); }
.badge--info { color: var(--info); background: var(--info-soft); }
.badge--soon { color: var(--soon); background: var(--soon-soft); }

.btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px;
  padding: 9px 13px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  font-size: 12.5px; font-weight: 750; cursor: pointer; text-decoration: none; line-height: 1.3; white-space: nowrap; }
.btn:hover { border-color: var(--accent); background: var(--surface-hover); }
.btn:disabled, .btn[aria-busy="true"] { opacity: .5; cursor: not-allowed; }
.btn .icon { width: 15px; height: 15px; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn--danger { background: var(--surface); color: var(--bad); border-color: var(--bad-border); }
.btn--danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.dialog .btn--danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent-soft); border-color: transparent; }
.btn--outline { color: var(--accent); border-color: var(--accent-border); font-weight: 650; }
.btn--outline:hover { background: var(--accent-soft); }
.btn--block { width: 100%; }
.btn--small { min-height: 30px; padding: 6px 10px; font-size: 11.5px; }

/* ── tables ─────────────────────────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.table-wrap table { border-radius: 0; }
.table-wrap th { background: var(--surface-sunk); font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); }
.table-wrap tr:last-child td { border-bottom: 0; }
.col-actions { text-align: right; white-space: nowrap; }

/* ── states ─────────────────────────────────────────────────────────────────────────────────────── */
.state { border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 18px; background: var(--surface); margin: 8px 0; }
.state p { margin: 4px 0; }
.state-title { font-weight: 750; }
.state--empty { border-style: dashed; color: var(--text-muted); }
.state--soon { border-color: var(--soon-border); background: var(--soon-wash); }
.state--soon .state-title { color: var(--soon); }
.state--unavailable { background: var(--surface-sunk); }
.state--forbidden { background: var(--forbidden-wash); border-color: var(--forbidden-border); color: var(--forbidden); }
.state--forbidden .state-title { color: var(--forbidden); }
.state--lifecycle, .state--warn { border-color: var(--warn-border); background: var(--warn-wash); }
.state--lifecycle .state-title, .state--warn .state-title { color: var(--warn); }
.state--error { border-color: var(--bad-border); background: var(--bad-wash); }
.state--error .state-title { color: var(--bad); }
.state--network { background: var(--surface-sunk); }
.state--ok { border-color: var(--ok-border); background: var(--ok-wash); }
.state--ok .state-title { color: var(--ok); }
.state--info { border-color: var(--info-border); background: var(--info-wash); color: var(--info); }
.skeleton-block { display: grid; gap: .5rem; padding: .5rem 0; }
.skeleton { height: .9rem; border-radius: 4px; background: linear-gradient(90deg, var(--skeleton), var(--surface-sunk), var(--skeleton));
  background-size: 200% 100%; animation: cp-pulse 1.3s ease-in-out infinite; }
.skeleton--short { width: 55%; }
@keyframes cp-pulse { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.action-status { min-height: 1.2em; margin: .5rem 0 0; font-size: 12.5px; }
.action-status--ok { color: var(--ok); }
.action-status--bad { color: var(--bad); }
.action-status--warn { color: var(--warn); }

/* ── forms ──────────────────────────────────────────────────────────────────────────────────────── */
.form-stack { display: grid; gap: .85rem; }
.form-row { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.field { display: grid; gap: .3rem; }
.field-label { font-weight: 700; font-size: 12px; }
.field-required { color: var(--bad); }
.field-hint { margin: 0; color: var(--text-muted); font-size: 11.5px; }
.field-error { margin: 0; color: var(--bad); font-size: 11.5px; }
.field-error:empty { display: none; }
.input { font: inherit; font-size: 13px; padding: 9px 11px; border: 1px solid var(--control-border); border-radius: var(--radius-sm); min-height: 36px;
  background: var(--surface); color: var(--ink); width: 100%; }
.input--compact { width: auto; min-width: 150px; font-size: 12px; font-weight: 700; color: var(--text); }
.input[aria-invalid="true"] { border-color: var(--bad); }
fieldset.field-group { border: 1px solid var(--line); border-radius: var(--radius-md); padding: .6rem .9rem .9rem; margin: 0; }
fieldset.field-group legend { font-weight: 700; font-size: 12.5px; padding: 0 .3rem; }
.checkbox-row { display: flex; gap: .5rem; align-items: center; }

/* ── tabs ───────────────────────────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 5px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { all: unset; box-sizing: border-box; padding: 11px 15px; cursor: pointer; color: var(--text-muted); border-bottom: 3px solid transparent;
  white-space: nowrap; font-weight: 700; font-size: 12.5px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }

/* ── dialogs ────────────────────────────────────────────────────────────────────────────────────── */
.dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.4rem; width: min(560px, calc(100vw - 2rem));
  box-shadow: 0 25px 95px rgba(11, 31, 29, .25); color: var(--ink); }
.dialog--lg { width: min(760px, calc(100vw - 2rem)); }
.dialog::backdrop { background: var(--backdrop); }
.dialog-title { margin: 0 0 .75rem; font-size: 17px; }
.dialog-subtitle { margin: 1.1rem 0 .5rem; font-size: 14px; }   /* Activity details: Changes, Recorded detail */
.activity-filters { margin-bottom: 1rem; }
.dialog-intro { margin: 0 0 .5rem; color: var(--text-muted); }
.dialog-body { max-height: 60vh; overflow-y: auto; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.dialog-outcome:empty { display: none; }
.dialog-outcome { margin-top: .6rem; }

/* ── sign-in ────────────────────────────────────────────────────────────────────────────────────── */
/* Light page + accent-keyline card: the same look as the hosted Keycloak pages (infra/keycloak/themes/neoai). */
.login-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem;
  background: var(--bg); color: var(--ink); }
.login-card { display: flex; flex-direction: column; align-items: flex-start; gap: .8rem; width: min(380px, 100%);
  background: var(--surface); padding: 2rem; border: 1px solid var(--line); border-top: 3px solid var(--accent);
  border-radius: var(--radius); box-shadow: 0 1px 3px rgba(11, 31, 29, .08), 0 12px 40px rgba(11, 31, 29, .08); }
.login-card h1 { margin: 0; color: var(--ink); font-size: 26px; letter-spacing: -.8px; }
.login-card p { margin: 0; }
.login-card .notice, .login-status { width: 100%; }
.login-status { display: flex; flex-direction: column; gap: .6rem; }
.login-status:empty { display: none; }
.login-subtitle { margin: 0; color: var(--text-muted); }

/* ── responsive ─────────────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1320px) {
  .app-header { gap: 10px; padding: 0 17px; }
  .profile-text { display: none; }
  .context-btn { max-width: 220px; }
  .app-main { padding: 25px 22px 55px; }
}
/* tablet: the icon rail, whatever the collapse choice */
@media (max-width: 1120px) {
  .app-layout, .app-layout--collapsed { --rail: var(--nav-mini); }
  .app-layout .brand-text, .app-layout .nav-link-label, .app-layout .nav-pill, .app-layout .nav-foot-label { display: none; }
  .app-layout .brand { justify-content: center; padding: 0; }
  .app-layout .nav-scroll { padding: 12px 9px; }
  .app-layout .nav-group-heading { font-size: 0; padding: 0; height: 1px; margin: 6px 5px; border-top: 1px solid var(--on-dark-line); }
  .app-layout .nav-group:first-child .nav-group-heading { border-top: 0; }
  .app-layout .nav-link, .app-layout .nav-foot-btn { justify-content: center; padding: 12px 7px; }
  .app-layout .collapse-btn { display: none; }
  .search-launch { min-width: 38px; flex: 0 0 38px; padding: 10px; justify-content: center; }
  .search-launch-text, .search-launch .kbd { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
/* phone: the sidebar becomes a drawer over a backdrop */
@media (max-width: 740px) {
  .app-layout, .app-layout--collapsed { --rail: 0px; grid-template-columns: minmax(0, 1fr); background: none; }
  .app-nav { position: fixed; top: 0; bottom: 0; left: 0; width: min(280px, 86vw); height: 100vh; height: 100dvh;
    transform: translateX(-102%); transition: transform .2s ease; z-index: 70; box-shadow: 0 12px 40px rgba(11, 31, 29, .28); }
  .app-layout--nav-open .app-nav { transform: translateX(0); }
  .app-layout .brand-text, .app-layout .nav-link-label, .app-layout .nav-pill, .app-layout .nav-foot-label { display: initial; }
  .app-layout .brand-text { display: flex; }
  .app-layout .brand { justify-content: flex-start; padding: 0 18px; }
  .app-layout .nav-scroll { padding: 17px 11px; }
  .app-layout .nav-group-heading { font-size: 10px; height: auto; padding: 11px 12px 8px; margin: 0; border: 0; }
  .app-layout .nav-link, .app-layout .nav-foot-btn { justify-content: flex-start; padding: 9px 10px; }
  .app-layout--nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: var(--backdrop); z-index: 60; }
  .app-header .app-menu-btn { display: grid; }
  .app-header { min-height: 62px; padding: 0 12px; gap: 5px; }
  .plane-pill { font-size: 8px; padding: 5px 7px; max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
  .customer-context, .header-icon--help { display: none; }
  .header-icon { width: 34px; height: 34px; }
  .search-launch { flex: 0 0 34px; min-width: 34px; width: 34px; padding: 7px; background: transparent; border: 0; }
  .profile { padding-left: 0; border: 0; }
  .avatar { width: 31px; height: 31px; }
  .app-main { padding: 19px 13px 40px; }
  .page-head-row { flex-direction: column; gap: 15px; }
  .page-title { font-size: 23px; }
  .page-actions { width: 100%; }
  .kpi-grid { gap: 9px; }
  .kpi-grid .card { min-height: 126px; padding: 14px; }
  .card-value { font-size: 24px; }
  .panel-head { padding: 15px 15px 4px; }
  .panel-body { padding: 8px 15px 15px; }
  .param-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { border-bottom: 0; padding-bottom: 0; }
  .kv dd { text-align: left; padding-top: 3px; }
  .legend { grid-template-columns: 1fr; gap: 4px; }
  .legend dd { margin-bottom: 8px; }
  .popover { position: fixed; top: 70px; left: 12px; right: 12px; width: auto; }
  .search-modal { margin-top: 50px; }
  .lifecycle-banner { padding: .6rem 13px; }
}
@media (max-width: 380px) { .header-icon--ai { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
  .app-nav, .app-layout { transition: none; }
}

/* ══ Legacy operational page rules (Health, Asset Detail, Telemetry, AI Insights, Access, Environment) ══ */
  /* Outbound link that leaves this app (Help, Asset Detail). Styled as a real link, not a button,
     so it reads as such. The Platform Studio link it was introduced for is gone -- Phase 4.0: a
     platform-plane tool shown by matching role names had no place in a tenant-plane product. */
  .header-link { color: var(--accent); font-size: .85em; text-decoration: none; border-bottom: 1px dotted var(--accent); }
  .header-link:hover { text-decoration: none; opacity: .8; }
  button {
    font: inherit; padding: .45rem .9rem; border: 1px solid var(--border);
    background: var(--surface); border-radius: 6px; cursor: pointer; color: var(--text);
  }
  button:hover { border-color: var(--accent); }
  h2 { margin-top: 0; }
  .note { color: var(--text-muted); font-size: .9em; }
  .empty-state { color: var(--text-muted); padding: 1rem 0; }
  .portal-error { color: var(--bad); border: 1px solid var(--bad-border); background: var(--bad-wash); border-radius: 6px; padding: .6rem .9rem; margin: .5rem 0; }

  /* Denied state (Phase 4.3, FORBIDDEN half). A refusal is not an outage: it reads as a calm,
     explanatory amber note, visually distinct from the red failure box above, so "you may not do
     this" is never mistaken for "the platform is broken". */
  .portal-error--forbidden { color: var(--warn); border-color: var(--warn-border); background: var(--warn-wash); }
  .portal-error-title { display: block; margin-bottom: .15rem; }
  .portal-error--network { color: var(--text-muted); border-color: var(--border); background: var(--surface-sunk); }

  /* ── Access Management (Phase 4.1) ───────────────────────────────────────────────────── */
  .access-block { margin-bottom: 2rem; }
  .access-hint { color: var(--text-muted); font-size: .9em; margin: .2rem 0 .8rem; }
  .access-user { margin-bottom: .4rem; }
  .access-row-meta { display: inline-flex; gap: .4rem; align-items: center; }
  .access-panel { margin-top: .9rem; }
  .access-list { display: flex; flex-direction: column; gap: .35rem; margin: .4rem 0; }
  .access-list-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    border: 1px solid var(--border); border-radius: 6px; padding: .4rem .65rem; background: var(--surface); }
  .access-form-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; }
  .access-input, .access-select { font: inherit; padding: .4rem .55rem; border: 1px solid var(--control-border);
    border-radius: 6px; background: var(--surface); color: inherit; }
  .access-btn { font: inherit; padding: .4rem .75rem; border: 1px solid var(--border); border-radius: 6px;
    background: var(--surface); cursor: pointer; }
  .access-btn:disabled { opacity: .55; cursor: default; }
  .access-btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
  .access-btn--danger { color: var(--bad); border-color: var(--bad-border); }
  .access-outcome:empty { display: none; }
  .access-ok { color: var(--ok); border: 1px solid var(--ok-border); background: var(--ok-wash); border-radius: 6px;
    padding: .5rem .8rem; margin: .5rem 0; }
  .access-chip { font-size: .8em; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--border); }
  .access-chip--ok { color: var(--ok); border-color: var(--ok-border); background: var(--ok-wash); }
  .access-chip--open { color: var(--warn); border-color: var(--warn-border); background: var(--warn-wash); }

  /* ── AI Configuration (Phase 4.2) — reuses the Access controls above; only the option
        grid is new, since nothing else in this app is a multi-select of labelled choices. ── */
  .aiconfig-options { display: grid; gap: .4rem; margin: .4rem 0 1.2rem; }
  .aiconfig-row { display: grid; grid-template-columns: auto 1fr; gap: .1rem .6rem; align-items: baseline;
    border: 1px solid var(--border); border-radius: 6px; padding: .55rem .7rem; background: var(--surface);
    cursor: pointer; }
  .aiconfig-check { margin: 0; grid-row: span 2; align-self: center; }
  .aiconfig-label { font-weight: 500; }
  .aiconfig-hint { grid-column: 2; color: var(--text-muted); font-size: .88em; }
  .aiconfig-row:has(.aiconfig-check:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
  @media (min-width: 720px) { .aiconfig-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .access-chip--closed { color: var(--text-muted); }
  .access-invite-row { border: 1px solid var(--border); border-radius: 8px; padding: .7rem .9rem;
    background: var(--surface); margin-bottom: .5rem; }
  .access-invite-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .3rem; }
  .access-invite-email { font-weight: 600; }


  .tile-row { display: flex; gap: 1rem; margin: 1rem 0; }
  .tile { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.4rem; min-width: 140px; }
  .tile-label { color: var(--text-muted); font-size: .85em; }
  .tile-value { font-size: 1.6rem; font-weight: 700; color: var(--accent); }

  .toolbar { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
  select { font: inherit; padding: .45rem .6rem; border: 1px solid var(--control-border); border-radius: 6px; background: var(--surface); color: var(--ink); }

  table { border-collapse: collapse; width: 100%; background: var(--surface); border-radius: 8px; overflow: hidden; }
  th, td { text-align: left; padding: .55rem .8rem; border-bottom: 1px solid var(--border); font-size: .92em; }
  th { color: var(--text-muted); font-weight: 600; }

  .lineage-tree, .lineage-tree ul { list-style: none; margin: .2rem 0; padding-left: 1.2rem; }
  .lineage-tree { padding-left: 0; }
  .twin-node { cursor: pointer; padding: .15rem 0; display: inline-block; }
  .twin-node:hover { color: var(--accent); }
  .twin-node--leaf { cursor: default; }
  .twin-node--leaf:hover { color: inherit; }
  .status-badge { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .75em; border: 1px solid var(--border); color: var(--text-muted); margin-left: .3rem; }

  .insight-list { display: flex; flex-direction: column; gap: .8rem; }
  .insight-card { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: 8px; padding: 1rem 1.2rem; }
  .insight-card--critical { border-left-color: var(--bad); }
  .insight-card--warning { border-left-color: var(--warn); }
  .insight-card--normal { border-left-color: var(--ok); }
  .insight-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
  .insight-status { font-weight: 700; letter-spacing: .03em; }
  .insight-status--critical { color: var(--bad); }
  .insight-status--warning { color: var(--warn); }
  .insight-status--normal { color: var(--ok); }
  .insight-model-badge { font-size: .75em; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: .1rem .6rem; }
  .insight-explanation { margin: .4rem 0; }
  .insight-meta { color: var(--text-muted); font-size: .8em; }

  h3 { margin: 1.8rem 0 .7rem; font-size: 1.05rem; }

  /* Asset Health cards -- reuses the same three severity colors as .insight-status--*, so a
     "Warning" reads the same way everywhere in the app, not just on the AI Insights page. */
  .health-row { display: flex; flex-wrap: wrap; gap: 1rem; }
  .health-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.2rem; min-width: 220px; flex: 1 1 220px; }
  .health-card-header { display: flex; align-items: center; gap: .5rem; }
  /* Slice 3A: link affordance -- plain color:inherit read as static text with no hint it was
     clickable. Reuses .header-link's own established "subtle link" language verbatim (accent
     color + dotted underline, opacity dip on hover) instead of inventing a new one, so a card
     title and the header's Platform Studio/View Detail links read as the same kind of thing. */
  .health-name { font-weight: 700; color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }
  .health-name:hover { text-decoration: none; opacity: .8; }
  .health-dot { width: .6rem; height: .6rem; border-radius: 50%; flex: none; background: var(--text-muted); }
  .health-dot--normal { background: var(--ok); }
  .health-dot--warning { background: var(--warn); }
  .health-dot--critical { background: var(--bad); }

  /* SVG status badge (core/asset-visuals.js::getStatusVisual) -- same canonical health colors as
     .health-dot--*, expressed as `color` since the glyph itself uses currentColor. */
  .status-visual { color: var(--text-muted); flex: none; }
  .status-visual--normal { color: var(--ok); }
  .status-visual--warning { color: var(--warn); }
  .status-visual--critical { color: var(--bad); }
  .health-type { margin: .3rem 0 .5rem; }
  .health-label { font-weight: 600; font-size: .9em; margin-bottom: .4rem; }
  .status-line .health-label { margin-bottom: 0; }
  .health-label--normal { color: var(--ok); }
  .health-label--warning { color: var(--warn); }
  .health-label--critical { color: var(--bad); }
  .health-label--unknown, .health-label--not_monitored,
  .health-label--not_evaluated, .health-label--no_data { color: var(--text-muted); }

  /* Monitoring (is telemetry arriving) and Health (did a policy resolve) are two separate
     axes -- ADR-039 Decision 8. Shown as two labelled lines on every Asset Health card so
     "no health policy configured" can never again be misread as "sensor not reporting". */
  .asset-status-lines { margin: .3rem 0 .5rem; display: flex; flex-direction: column; gap: .2rem; }
  .status-line { display: flex; align-items: baseline; gap: .4rem; font-size: .9em; }
  .status-line-label { color: var(--text-muted); font-size: .82em; min-width: 5.2rem; text-transform: uppercase; letter-spacing: .02em; }
  .monitoring-value { font-weight: 600; display: inline-flex; align-items: center; gap: .35rem; }
  .monitoring-value--active { color: var(--ok); }
  .monitoring-value--stale { color: var(--warn); }
  .monitoring-value--offline { color: var(--text-muted); }
  .monitoring-dot { width: .55rem; height: .55rem; border-radius: 50%; flex: none; background: var(--text-muted); }
  .monitoring-dot--active { background: var(--ok); }
  .monitoring-dot--stale { background: var(--warn); }
  .monitoring-dot--offline { background: var(--text-muted); }
  .health-dot--not_evaluated, .health-dot--no_data { background: var(--text-muted); }
  .status-visual--not-evaluated, .status-visual--no-data { color: var(--text-muted); }
  .health-reading { font-size: .92em; }
  .health-timestamp { color: var(--text-muted); font-size: .78em; margin-top: .15rem; }
  .health-ai { font-size: .8em; margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--border); }
  /* An AI assessment that disagrees with the current deterministic health -- called out, never
     silently hidden (see app/health.py's module docstring for why the two can legitimately differ). */
  .health-ai-caveat { color: var(--warn); font-size: .95em; margin-top: .3rem; }
  /* An AI assessment whose generatedAt predates telemetry that has since arrived -- distinct from
     the divergence caveat above (a stale assessment can still happen to agree with current health;
     that's not the same claim as "this describes the current reading"). */
  .health-ai-stale { color: var(--text-muted); font-size: .85em; margin-top: .3rem; font-style: italic; }
  .insight-model-badge--stale { border-color: var(--warn); color: var(--warn); }

  /* Org-level health badge, next to the Dashboard heading. */
  .org-health-badge {
    display: inline-flex; align-items: center; gap: .4rem; margin-left: .8rem;
    font-size: .55em; font-weight: 600; vertical-align: middle;
    border: 1px solid var(--border); border-radius: 999px; padding: .2rem .7rem;
  }

  /* AI Insights page's canonical-health banner, above the AI-generated card feed. */
  .asset-health-banner { display: flex; align-items: center; gap: .4rem; margin-bottom: 1rem; }

  /* Trend chart -- hand-built inline SVG (no charting library exists anywhere in this repo).
     width:100% + the SVG's own viewBox is what makes it responsive down to tablet width. */
  .trend-chart-box { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.2rem; }
  .trend-chart-wrap { width: 100%; }
  .trend-chart-svg { width: 100%; height: auto; display: block; }
  .chart-gridline { stroke: var(--border); stroke-width: 1; }
  .chart-line { fill: none; stroke: var(--accent); stroke-width: 2; }
  .chart-bar { fill: var(--accent); opacity: .78; }
  .chart-area { fill: var(--accent); opacity: .16; stroke: none; }
  .chart-point { fill: var(--accent); }
  .chart-band { fill: var(--accent-soft); stroke: none; }
  .chart-band-range { fill: none; stroke: var(--accent); stroke-width: 2; }
  .chart-dot { fill: var(--accent); }
  /* overlays: comparison series, zero line, sign words, ACTIVE-policy limit lines, legend */
  .chart-line--s1 { stroke: var(--info); stroke-dasharray: 6 3; }
  .chart-line--s2 { stroke: var(--violet); stroke-dasharray: 2 3; }
  .chart-line--s3 { stroke: var(--warn); stroke-dasharray: 8 2 2 2; }
  .chart-dot--s1 { fill: var(--info); }
  .chart-dot--s2 { fill: var(--violet); }
  .chart-dot--s3 { fill: var(--warn); }
  .chart-zero { stroke: var(--text-faint); stroke-width: 1; }
  .chart-sign-label { fill: var(--text-muted); font-size: 10px; }
  .chart-threshold { stroke: var(--text-muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
  .chart-threshold--warning { stroke: var(--warn); }
  .chart-threshold--critical { stroke: var(--bad); }
  .chart-threshold-label { fill: var(--text-muted); font-size: 10px; }
  .chart-threshold-label--warning { fill: var(--warn); }
  .chart-threshold-label--critical { fill: var(--bad); }
  .chart-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; list-style: none; margin: .5rem 0 0; padding: 0;
    font-size: .8em; color: var(--text-muted); }
  .chart-legend li { display: inline-flex; align-items: center; gap: .35rem; }
  .chart-swatch { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--accent); }
  .chart-swatch--s1 { border-top: 2px dashed var(--info); }
  .chart-swatch--s2 { border-top: 2px dotted var(--violet); }
  .chart-swatch--s3 { border-top: 2px dashed var(--warn); }
  .chart-swatch--limit { border-top: 2px dashed var(--text-muted); }
  .chart-swatch--limit.chart-swatch--warning { border-top-color: var(--warn); }
  .chart-swatch--limit.chart-swatch--critical { border-top-color: var(--bad); }
  .readings-table { max-height: 22rem; overflow: auto; }
  .hero-group-title { margin: .9rem 0 .35rem; font-size: .8em; font-weight: 600; letter-spacing: .4px;
    text-transform: uppercase; color: var(--text-muted); }
  .trend-limits-note { margin: .4rem 0 0; }
  /* hover / keyboard inspection: crosshair, dot and tooltip drawn inside the SVG */
  .trend-chart-svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .chart-hit { fill: transparent; pointer-events: all; cursor: crosshair; touch-action: pan-y; }
  .chart-crosshair { stroke: var(--text-faint); stroke-width: 1; pointer-events: none; }
  .chart-hover-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; pointer-events: none; }
  .chart-tip-box { fill: var(--surface); stroke: var(--border-strong); pointer-events: none; }
  .chart-tip-text { fill: var(--ink); font-size: 11px; pointer-events: none; }
  .chart-axis-label { fill: var(--text-muted); font-size: 11px; }
  .trend-chart-caption { color: var(--text-muted); font-size: .8em; margin-top: .5rem; }

  /* Time-range picker (Dashboard's Telemetry Trend chart + BESS stats block each get their own
     instance -- see buildRangePicker in shell.js). Custom inputs stay hidden until "Custom range"
     is selected. */
  .range-picker { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
  .range-custom-wrap { display: inline-flex; align-items: center; gap: .3rem; }
  .range-custom-input { font: inherit; padding: .35rem .5rem; border: 1px solid var(--control-border); border-radius: 6px; }
  .range-summary { margin: -.4rem 0 .8rem; }
  /* Real backend truncation (telemetry-platform's MAX_MEASUREMENT_LIMIT), disclosed rather than
     silently implying full requested-range coverage -- see rangeSummaryLine's own docstring. */
  .range-summary--truncated { color: var(--warn); font-size: .85em; margin: -.4rem 0 .8rem; }

  /* AI / Alerts summary */
  .ai-alerts-box { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.2rem; }
  .alert-counts { display: flex; gap: 1.4rem; margin-bottom: .8rem; font-weight: 600; }
  .alert-count--normal { color: var(--ok); }
  .alert-count--warning { color: var(--warn); }
  .alert-count--critical { color: var(--bad); }
  .alert-latest { border-top: 1px solid var(--border); padding-top: .7rem; }
  .alert-latest-header { display: flex; align-items: center; gap: .6rem; }

  /* Slice 2 -- visual boundary between Home's always-visible portfolio zone (story strip / tile
     row / portfolio grid) and the tabbed operational-detail zone below it. Same card language
     already used by .tile/.kpi-card/etc (surface + border + radius), applied once around the
     whole detail zone rather than adding a new pattern. */
  .dashboard-detail-zone {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 1.25rem 1.5rem 1.5rem; margin-top: 1.6rem;
  }
  .dashboard-detail-zone .dashboard-tabs { margin-top: 0; }

  /* Three-tier Dashboard (Executive/Operations/Technical, N-3) -- one tab bar switching which
     already-fetched data renders, not three separate pages/fetches. */
  .dashboard-tabs { display: flex; gap: .4rem; margin: 1.2rem 0 .3rem; border-bottom: 1px solid var(--border); }
  .dashboard-tab-btn {
    border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none;
    padding: .6rem .9rem; color: var(--text-muted); font-weight: 600;
  }
  .dashboard-tab-btn:hover { border-color: var(--border); color: var(--text); }
  .dashboard-tab-btn--active { color: var(--accent); border-bottom-color: var(--accent); }
  .dashboard-tab-content { margin-top: .8rem; }

  /* Executive View's bigger stat tiles -- same intent as .tile, sized to be scanned at a glance. */
  .kpi-row { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0; }
  .kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1.1rem 1.4rem; min-width: 170px; flex: 1 1 170px; }
  .kpi-label { color: var(--text-muted); font-size: .82em; }
  .kpi-value { font-size: 1.7rem; font-weight: 700; color: var(--accent); margin-top: .15rem; }
  .kpi-sub { color: var(--text-muted); font-size: .8em; margin-top: .2rem; }
  /* Slice 2 -- reads as a caption of the KPI row above it (site metadata), not a competing
     paragraph; content/behavior unchanged, spacing tightened only. */
  .kpi-note { margin: -.3rem 0 0; }

  /* Loading placeholders (Slice 2) -- built inside the SAME container class as the real content
     each replaces (.tile/.trend-chart-wrap via chartSkeleton/tileSkeleton in shell.js), so the
     placeholder occupies the same footprint as what lands in its place. */
  @keyframes skeleton-pulse { 0%, 100% { opacity: .45; } 50% { opacity: .85; } }
  .skeleton-line {
    display: block; height: .8em; border-radius: 4px; background: var(--border);
    animation: skeleton-pulse 1.4s ease-in-out infinite;
  }
  .skeleton-chart {
    width: 100%; aspect-ratio: 760 / 220; border-radius: 6px; background: var(--border);
    animation: skeleton-pulse 1.4s ease-in-out infinite;
  }
  .skeleton-chart-caption { width: 40%; margin-top: .5rem; }
  @media (prefers-reduced-motion: reduce) {
    .skeleton-line, .skeleton-chart { animation: none; opacity: .6; }
  }
  /* Dashboard progressive-load: localized skeleton widths for sections whose per-asset health /
     AI / org-health data is still in flight (healthCardSkeleton / kpiCardSkeleton in shell.js). */
  .health-card > .skeleton-line { width: 80%; margin-top: .5rem; }
  .health-card > .skeleton-line:last-child { width: 55%; }
  .kpi-value > .skeleton-line { width: 70%; height: 1.35em; }
  .ai-alerts-box > .skeleton-line { width: 60%; margin: .4rem 0; }
  .ai-alerts-box > .skeleton-line:first-child { width: 40%; }

  /* Story strip -- "Energy Assets -> Telemetry -> Monitoring -> Health & Alarms -> AI Insights ->
     Operations" on Home. Matches the single-line-diagram pattern from
     docs/specs/telemetry-platform/flyers/flyer-5-operations.svg's own in-app mockup (battery -> PCS
     -> transformer -> bus): light teal-bordered nodes joined by teal arrows, not the same flyer's
     separate dark hero-band styling -- that band is marketing chrome around the mockup, not a
     pattern the mockup itself uses for an in-app flow. Sized smaller than the box widths that were
     already proven to fit on one line at the 1280px content width, so this restyle keeps strictly
     more wrapping margin than before, never less. */
  .story-strip {
    display: flex; flex-wrap: wrap; align-items: stretch; gap: .5rem;
    margin: 1rem 0 1.4rem;
  }
  .story-step {
    background: var(--surface); border: 1px solid var(--accent); border-radius: 6px;
    padding: .5rem .75rem; flex: 1 1 128px; min-width: 108px;
  }
  .story-step-k {
    display: block; font-size: .65rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--text-muted); margin-bottom: .15rem;
  }
  .story-step-v { font-size: .82rem; font-weight: 700; color: var(--text); line-height: 1.2; }
  .story-arrow {
    display: flex; align-items: center; color: var(--accent); font-size: 1rem; padding: 0 .1rem;
  }

  /* Section kicker -- tiny bold uppercase label + muted subhead, the flyer's own section-header
     convention, reused here instead of a plain <h3> for the Portfolio section. */
  .section-kicker { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 1.6rem 0 .15rem; }
  .section-kicker-sub { font-size: .82rem; color: var(--text-muted); margin: 0 0 .8rem; }

  /* Visual Asset Portfolio -- one card per asset TYPE actually present for this tenant (never an
     invented zero-count category), icon + count + label, reusing core/asset-visuals.js. */
  .portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem; margin-bottom: 1.2rem; }
  .portfolio-card {
    background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--accent);
    border-radius: 6px; padding: 1rem .9rem .9rem; display: flex; flex-direction: column; align-items: flex-start; gap: .5rem;
  }
  .portfolio-icon { color: var(--accent); }
  .portfolio-count { font-size: 1.6rem; font-weight: 700; color: var(--text); line-height: 1; }
  .portfolio-count-unit { font-size: .7rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-left: .3rem; }
  .portfolio-label { font-size: .85rem; font-weight: 700; color: var(--text); }

  /* Intermediate desktop/tablet widths (721-1279px, deliberately stopping above the existing
     720px mobile breakpoint below so the two never overlap or interact) -- without this, both the
     story strip and the portfolio grid wrap 5-then-1 somewhere around 1000px (measured: portfolio
     first, ~1000px; story strip next, ~976px), leaving a lone item stretched or stranded on its own
     row. "Health & Alarms"/"Backup Generation" are the longest labels (measured natural width
     102px / ~204px) -- tightened spacing alone can't fit six of those above ~1000px, so this trims
     padding/gaps and lets the longest 1-2 labels wrap to a second text line within their own
     (unfixed-height) box instead -- a taller box, not clipped or hidden content -- which keeps
     every item on one row down to 721px, verified across the full 721-1280px range. Font size,
     colour, icons, labels and DOM are untouched -- spacing/sizing only. */
  @media (max-width: 1279px) and (min-width: 721px) {
    .story-strip { gap: 2px; }
    .story-step { flex: 1 1 88px; min-width: 80px; padding: .5rem .5rem; }
    .story-arrow { padding: 0; }
    .portfolio-grid { gap: 4px; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
  }

  /* Asset Detail (Slice 3) -- layout only; every visual language piece it uses (.status-badge,
     .health-label--*, .metric-strip, .kv-list, .header-link, .insight-list) is already defined
     elsewhere and reused as-is, not reinvented for this page. */
  .asset-detail-back { display: inline-block; margin-bottom: 1rem; }
  .asset-detail-header { margin-bottom: .4rem; }
  .asset-detail-title-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .3rem; }
  .asset-detail-title-row .asset-illustration { color: var(--accent); flex: none; }
  .asset-detail-name { margin: 0; font-size: 1.35rem; }
  /* Digital Twin's per-asset-node link into Asset Detail -- inline next to the node label rather
     than a new row, so the tree's own indentation/nesting is untouched. */
  .twin-detail-link { margin-left: .6rem; font-size: .8em; }

  /* ── UI/UX redesign slice — shared building blocks ──────────────────────────────────────
     Collapsible disclosure section (native <details>/<summary>: no JS, keyboard-accessible).
     Used to keep engineering metadata out of the default view so the page stays short and
     scannable — Technical View, Asset Detail, and per-equipment/device metadata. Same
     surface + border + radius card language as the rest of the app. */
  .portal-section { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin: .7rem 0; }
  .portal-section > summary {
    list-style: none; cursor: pointer; padding: .8rem 1rem; display: flex; align-items: center;
    gap: .55rem; font-weight: 700; font-size: .95rem; -webkit-user-select: none; user-select: none;
  }
  .portal-section > summary::-webkit-details-marker { display: none; }
  .portal-section > summary::before {
    content: "\25B8"; color: var(--text-muted); font-size: .85em; flex: none;
    transition: transform .15s ease;
  }
  @media (prefers-reduced-motion: reduce) { .portal-section > summary::before { transition: none; } }
  .portal-section[open] > summary::before { transform: rotate(90deg); }
  .portal-section > summary:hover { color: var(--accent); }
  .portal-section-body { padding: 0 1rem 1rem; }
  .portal-section-meta { margin-left: auto; font-weight: 600; font-size: .82rem; display: inline-flex; align-items: center; gap: .5rem; }
  .portal-subsection {
    font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
    color: var(--text-muted); margin: 1rem 0 .3rem;
  }
  .portal-subsection:first-child { margin-top: .2rem; }
  /* Nested (equipment/device metadata inside a section) — lighter, no card chrome. */
  .portal-section--nested { border: none; border-top: 1px dashed var(--border); border-radius: 0; margin: .5rem 0 0; background: none; }
  .portal-section--nested > summary { padding: .5rem 0; font-weight: 600; font-size: .85rem; color: var(--text-muted); }
  .portal-section--nested > .portal-section-body { padding: 0 0 .4rem; }

  /* Key/value list — replaces the repeated wide metadata tables. Two-column grid on desktop,
     stacks on narrow screens. "not recorded" stays visually distinct from a real value. */
  .kv-list { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: .3rem 1.4rem; margin: .4rem 0; font-size: .9em; }
  .kv-list dt { color: var(--text-muted); }
  .kv-list dd { margin: 0; }
  .kv-list dd.not-recorded { color: var(--text-muted); font-style: italic; }
  @media (max-width: 560px) {
    .kv-list { grid-template-columns: 1fr; gap: 0; }
    .kv-list dt { margin-top: .5rem; }
    .kv-list dd { margin-bottom: .1rem; }
  }

  /* Sensor cards — replace the wide, hard-to-read 7-column sensor table. Responsive grid;
     each card answers value / health / trend / quality / freshness at a glance. */
  .sensor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .7rem; margin: .5rem 0 .2rem; }
  .sensor-card { border: 1px solid var(--border); border-radius: 8px; padding: .7rem .85rem; background: var(--bg); }
  .sensor-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
  .sensor-card-name { font-weight: 600; font-size: .87rem; line-height: 1.25; }
  .sensor-card-value { font-size: 1.4rem; font-weight: 700; color: var(--text); margin: .3rem 0 .1rem; }
  .sensor-card-value .sensor-card-unit { font-size: .78rem; font-weight: 600; color: var(--text-muted); margin-left: .2rem; }
  .sensor-card-meta { display: flex; flex-wrap: wrap; gap: .2rem .8rem; font-size: .76rem; color: var(--text-muted); margin-top: .35rem; }
  .sensor-card-time { font-size: .74rem; color: var(--text-muted); margin-top: .3rem; }

  /* Health verdict as a compact pill — same canonical triad colours as .health-label--*. */
  .health-pill {
    display: inline-flex; align-items: center; gap: .32rem; padding: .1rem .55rem; border-radius: 999px;
    font-size: .72rem; font-weight: 700; border: 1px solid var(--border); white-space: nowrap;
  }
  .health-pill::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; flex: none; }
  .health-pill--normal { color: var(--ok); }
  .health-pill--warning { color: var(--warn); }
  .health-pill--critical { color: var(--bad); }
  .health-pill--unknown, .health-pill--not_evaluated, .health-pill--no_data, .health-pill--not_monitored { color: var(--text-muted); }

  /* Trend direction chip. */
  .trend-chip { font-weight: 600; letter-spacing: .01em; }
  .trend-chip--rising { color: var(--warn); }
  .trend-chip--falling { color: var(--info); }
  .trend-chip--stable { color: var(--text-muted); }

  /* Compact live-metric strip — Executive "Current Operations", Asset Detail "Key Telemetry".
     Smaller than .kpi-card: meant to be a dense row of current readings, scanned in seconds. */
  .metric-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: .7rem; margin: .6rem 0 1.2rem; }
  .metric-cell { border: 1px solid var(--border); border-radius: 8px; padding: .65rem .85rem; background: var(--surface); }
  .metric-cell-label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
  .metric-cell-value { font-size: 1.45rem; font-weight: 700; color: var(--accent); margin-top: .15rem; line-height: 1.15; }
  .metric-cell-value .metric-cell-unit { font-size: .74rem; color: var(--text-muted); font-weight: 600; margin-left: .15rem; }
  .metric-cell-sub { font-size: .74rem; color: var(--text-muted); margin-top: .15rem; }
  .metric-cell .skeleton-line { width: 60%; height: 1.2em; }

  /* Equipment / device blocks inside a Sensors section (Technical View, Asset Detail). */
  .equip-block { margin: .8rem 0; padding-top: .6rem; border-top: 1px solid var(--border); }
  .equip-block:first-child { border-top: none; padding-top: 0; }
  .equip-head { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .95rem; }
  .equip-head .asset-illustration { color: var(--accent); flex: none; }
  .device-block { margin: .6rem 0 .6rem .3rem; padding-left: .8rem; border-left: 2px solid var(--border); }
  .device-head { display: flex; align-items: center; gap: .4rem; }
  .device-name { font-weight: 600; font-size: .88rem; }

  /* Operational Summary — Location -> Asset -> Equipment -> Device hierarchy. Compact rows;
     each asset expands to reveal its equipment/device breakdown (lineage fetched lazily). */
  .site-group { margin: .3rem 0 1.1rem; }
  .site-group-head {
    font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
    color: var(--text-muted); margin: 1rem 0 .5rem; display: flex; align-items: baseline; gap: .5rem;
  }
  .hierarchy-asset { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); margin: .5rem 0; overflow: hidden; }
  .hierarchy-asset-head { display: flex; align-items: center; }
  .hierarchy-asset-row {
    display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; flex: 1; min-width: 0;
    text-align: left; background: none; border: none; border-radius: 0; cursor: pointer; font: inherit;
  }
  .hierarchy-asset-row:hover { background: var(--bg); border-color: var(--border); }
  .hierarchy-asset-link { flex: none; padding: .7rem .9rem; white-space: nowrap; }
  .hierarchy-asset-caret { color: var(--text-muted); font-size: .8em; flex: none; width: .8rem; }
  .hierarchy-asset-name { font-weight: 700; }
  .hierarchy-asset-status { margin-left: auto; display: inline-flex; align-items: center; gap: .6rem; white-space: nowrap; }
  .hierarchy-asset-metric { font-size: .84rem; color: var(--text-muted); }
  .hierarchy-asset-body { padding: .2rem .9rem .8rem 2.3rem; }
  .hierarchy-equip { margin: .5rem 0; }
  .hierarchy-equip-name { font-weight: 600; font-size: .86rem; }
  .hierarchy-device { font-size: .83rem; color: var(--text-muted); margin: .15rem 0 .15rem 1rem; }
  .hierarchy-device-sensors { color: var(--text-muted); }

  /* Asset Detail — status summary strip under the identity header. */
  .asset-status-strip {
    display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; align-items: center;
    padding: .7rem 0; margin: .2rem 0 .4rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
    font-size: .88rem;
  }
  .asset-status-strip .status-line-label { min-width: 0; }

  /* Tablet-and-narrower: stack what was side-by-side, keep the chart full-width and legible. */
  @media (max-width: 720px) {
    .dashboard-detail-zone { padding: 1rem; margin-top: 1.2rem; }
    .tile-row { flex-wrap: wrap; }
    .tile { min-width: 0; flex: 1 1 45%; }
    .health-card { flex-basis: 100%; }
    .toolbar { flex-wrap: wrap; }
    .alert-counts { flex-wrap: wrap; gap: .8rem 1.4rem; }
    .kpi-row { flex-wrap: wrap; }
    .kpi-card { min-width: 0; flex: 1 1 45%; }
    .dashboard-tabs { flex-wrap: wrap; }
    .story-step { flex-basis: 45%; }
    .portfolio-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
    .sensor-grid { grid-template-columns: 1fr; }
    .metric-strip { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .hierarchy-asset-row { flex-wrap: wrap; }
    .hierarchy-asset-status { margin-left: 0; width: 100%; }
    .hierarchy-asset-body { padding-left: 1.2rem; }
    .portal-section-meta { margin-left: 0; }
  }
  /* Activation, onboarding and the Environment module (ADR-059 A1, PROPOSED) */
  .page-subtitle, .muted { color: var(--text-muted); }
  .notice { border: 1px solid var(--border); border-radius: 6px; padding: .6rem .8rem; margin: .6rem 0; background: var(--surface); }
  .notice--error { border-color: var(--bad); }
  /* .notice.warn: the AI-feed PARTIAL state (pages/operations.js, UI-KPI-02) uses the modifier as a bare class */
  .notice--warn, .notice.warn { border-color: var(--accent-warm); }
  .notice--ok { border-color: var(--accent); }
  .env-section { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.2rem; margin: 1rem 0; }
  .env-section h2 { margin-top: 0; font-size: 1.1rem; }
  .env-field { display: flex; flex-direction: column; gap: .25rem; margin: .5rem 0; max-width: 28rem; }
  .env-site { border-top: 1px solid var(--border); padding-top: .6rem; margin-top: .6rem; }
  .env-deployment { margin-left: 1rem; }
  .env-run { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .3rem 0 .3rem 1rem; }
  .env-add { margin: .5rem 0; }
  .env-run > .env-preview-slot { flex-basis: 100%; }
  .env-preview-slot[hidden] { display: none; }
  .env-preview { border: 1px solid var(--border); border-radius: 6px; padding: .6rem .8rem; background: var(--surface); overflow-x: auto; }
  .env-preview-header { margin: .3rem 0; padding-left: 1.2rem; }
  .env-preview-table { border-collapse: collapse; width: 100%; font-size: .9rem; }
  .env-preview-table th, .env-preview-table td { border-bottom: 1px solid var(--border); padding: .3rem .5rem; text-align: left; overflow-wrap: anywhere; }
  .env-preview-draft { border-left: 3px solid var(--accent-warm); padding-left: .6rem; margin-top: .8rem; }
  .next-steps li { margin: .3rem 0; }
  .activation-page { max-width: 40rem; }
  .link-btn { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0 .4rem; }

/* ── Simulation: Scenario Explorer and Scenario Runs (NEOAI-SIMULATION-01) ─────────────────────────────────
   Two series only -- scenario vs baseline. Colours validated with the dataviz palette checks on the light surface
   (chroma, CVD separation, contrast >= 3:1); the baseline is also dashed, so identity never rests on colour alone. */
:root { --series-scenario: #008c82; --series-baseline: #b26d12; }
.sim .panel + .panel, .sim > * + * { margin-top: 1rem; }
.sim-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.sim-toolbar .input { max-width: 16rem; }
.sim-inline-label { display: inline-flex; gap: .35rem; align-items: center; color: var(--text-muted); font-size: .9em; }
.sim-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .75rem; }
.sim-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .9rem 1rem;
  display: flex; flex-direction: column; gap: .4rem; }
.sim-card--unavailable { background: var(--surface-sunk); }
.sim-card-head { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.sim-card-title { margin: 0; font-size: 1rem; color: var(--ink); }
.sim-card-category { margin: 0; color: var(--text-muted); font-size: .85em; }
.sim-card-actions { margin-top: auto; }
.sim-unavailable-reason { color: var(--text-muted); font-size: .9em; margin: 0; }
.sim-form { display: flex; flex-direction: column; gap: .75rem; }
.sim-field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .25rem 1rem; }
.sim-fieldset { border: 1px solid var(--border); border-radius: 8px; padding: .5rem 1rem 0; margin: 0; }
.sim-fieldset legend { color: var(--ink); font-weight: 600; padding: 0 .25rem; }
.sim-form-actions, .sim-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.sim-pager { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; color: var(--text-muted); }
.sim-status-row { display: flex; gap: .75rem; align-items: center; margin-bottom: .75rem; }
.sim-progress { width: min(20rem, 50%); height: .6rem; accent-color: var(--series-scenario); }
.sim-note { color: var(--text-muted); font-size: .85em; }
.sim-chart { margin: 0 0 1.25rem; }
.sim-chart-title { font-weight: 600; color: var(--ink); margin-bottom: .25rem; }
.sim-chart-svg { width: 100%; height: auto; display: block; }
.sim-legend { display: flex; gap: 1rem; color: var(--text); font-size: .85em; margin-bottom: .25rem; }
.sim-legend-item { display: inline-flex; gap: .35rem; align-items: center; }
.sim-swatch { display: inline-block; width: 1.25rem; height: 0; border-top: 2px solid var(--series-scenario); }
.sim-swatch--baseline { border-top: 2px dashed var(--series-baseline); }
.sim-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sim-line--scenario { stroke: var(--series-scenario); }
.sim-line--baseline { stroke: var(--series-baseline); stroke-dasharray: 6 4; }
.sim-zero { stroke: var(--border-strong); stroke-width: 1; }
.sim-end-label { fill: var(--text); font-size: 11px; }
.sim-crosshair { stroke: var(--text-faint); stroke-width: 1; }
.sim-dot { stroke: var(--surface); stroke-width: 2; }
.sim-dot--scenario { fill: var(--series-scenario); }
.sim-dot--baseline { fill: var(--series-baseline); }
.sim-tip-box { fill: var(--surface); stroke: var(--border-strong); }
.sim-tip-text { fill: var(--ink); font-size: 11px; }
.sim-hit { fill: transparent; cursor: crosshair; }
.sim-data-table summary, .sim-snapshot summary { cursor: pointer; color: var(--accent-strong); margin: .25rem 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Security & MFA (NEOAI-CUSTOMER-ACCOUNT-SECURITY-01): one responsive list; the action wraps under the text on phones. */
.account-security-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.account-security-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.account-security-text { flex: 1 1 260px; min-width: 0; }
.account-security-text .note { margin: 4px 0 0; }
.account-security-subhead { font-size: 15px; margin: 14px 0 6px; }
.account-recovery-steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.status-note { border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 0 12px; border: 1px solid var(--border); }
.status-note--ok { border-color: var(--accent); }
.status-note--warn { border-color: var(--warn); }

/* My dashboards (NEOAI-CUSTOMER-RBAC-WORKSPACE-01 slice 3): one responsive grid, no separate mobile layout. */
.dash-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.dash-field { display: flex; flex-direction: column; gap: 4px; min-width: 160px; flex: 1 1 180px; }
.dash-field-label { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.dash-check { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.dash-actions, .dash-add { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.dash-table { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.dash-table thead th { position: sticky; top: 0; background: var(--surface); }
/* Flexible Dashboard Builder: a 12-column grid, each widget placed by classes only (the CSP forbids inline style).
   gc-s/gc-w = column start/width, gr-s/gr-h = row start/height, from core/dashboard-layout.js layoutClasses(). Rows
   grow with their content. Tablet: two columns in reading order (half-width widgets side by side); phone: one. */
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: minmax(96px, auto);
  gap: 16px; }
.gc-s1 { grid-column-start: 1; } .gc-s2 { grid-column-start: 2; } .gc-s3 { grid-column-start: 3; } .gc-s4 { grid-column-start: 4; } .gc-s5 { grid-column-start: 5; } .gc-s6 { grid-column-start: 6; } .gc-s7 { grid-column-start: 7; } .gc-s8 { grid-column-start: 8; } .gc-s9 { grid-column-start: 9; } .gc-s10 { grid-column-start: 10; } .gc-s11 { grid-column-start: 11; } .gc-s12 { grid-column-start: 12; }
.gc-w1 { grid-column-end: span 1; } .gc-w2 { grid-column-end: span 2; } .gc-w3 { grid-column-end: span 3; } .gc-w4 { grid-column-end: span 4; } .gc-w5 { grid-column-end: span 5; } .gc-w6 { grid-column-end: span 6; } .gc-w7 { grid-column-end: span 7; } .gc-w8 { grid-column-end: span 8; } .gc-w9 { grid-column-end: span 9; } .gc-w10 { grid-column-end: span 10; } .gc-w11 { grid-column-end: span 11; } .gc-w12 { grid-column-end: span 12; }
.gr-s1 { grid-row-start: 1; } .gr-s2 { grid-row-start: 2; } .gr-s3 { grid-row-start: 3; } .gr-s4 { grid-row-start: 4; } .gr-s5 { grid-row-start: 5; } .gr-s6 { grid-row-start: 6; } .gr-s7 { grid-row-start: 7; } .gr-s8 { grid-row-start: 8; } .gr-s9 { grid-row-start: 9; } .gr-s10 { grid-row-start: 10; } .gr-s11 { grid-row-start: 11; } .gr-s12 { grid-row-start: 12; }
.gr-s13 { grid-row-start: 13; } .gr-s14 { grid-row-start: 14; } .gr-s15 { grid-row-start: 15; } .gr-s16 { grid-row-start: 16; } .gr-s17 { grid-row-start: 17; } .gr-s18 { grid-row-start: 18; } .gr-s19 { grid-row-start: 19; } .gr-s20 { grid-row-start: 20; } .gr-s21 { grid-row-start: 21; } .gr-s22 { grid-row-start: 22; } .gr-s23 { grid-row-start: 23; } .gr-s24 { grid-row-start: 24; }
.gr-s25 { grid-row-start: 25; } .gr-s26 { grid-row-start: 26; } .gr-s27 { grid-row-start: 27; } .gr-s28 { grid-row-start: 28; } .gr-s29 { grid-row-start: 29; } .gr-s30 { grid-row-start: 30; } .gr-s31 { grid-row-start: 31; } .gr-s32 { grid-row-start: 32; } .gr-s33 { grid-row-start: 33; } .gr-s34 { grid-row-start: 34; } .gr-s35 { grid-row-start: 35; } .gr-s36 { grid-row-start: 36; }
.gr-s37 { grid-row-start: 37; } .gr-s38 { grid-row-start: 38; } .gr-s39 { grid-row-start: 39; } .gr-s40 { grid-row-start: 40; } .gr-s41 { grid-row-start: 41; } .gr-s42 { grid-row-start: 42; } .gr-s43 { grid-row-start: 43; } .gr-s44 { grid-row-start: 44; } .gr-s45 { grid-row-start: 45; } .gr-s46 { grid-row-start: 46; } .gr-s47 { grid-row-start: 47; } .gr-s48 { grid-row-start: 48; }
.gr-s49 { grid-row-start: 49; } .gr-s50 { grid-row-start: 50; } .gr-s51 { grid-row-start: 51; } .gr-s52 { grid-row-start: 52; } .gr-s53 { grid-row-start: 53; } .gr-s54 { grid-row-start: 54; } .gr-s55 { grid-row-start: 55; } .gr-s56 { grid-row-start: 56; } .gr-s57 { grid-row-start: 57; } .gr-s58 { grid-row-start: 58; } .gr-s59 { grid-row-start: 59; } .gr-s60 { grid-row-start: 60; }
.gr-h1 { grid-row-end: span 1; } .gr-h2 { grid-row-end: span 2; } .gr-h3 { grid-row-end: span 3; } .gr-h4 { grid-row-end: span 4; } .gr-h5 { grid-row-end: span 5; } .gr-h6 { grid-row-end: span 6; } .gr-h7 { grid-row-end: span 7; } .gr-h8 { grid-row-end: span 8; }
.dash-edit-bar { display: none; flex-wrap: wrap; gap: 6px; }
.dash-grid--edit .dash-edit-bar { display: flex; }
.dash-grid--edit .dash-widget { outline: 2px dashed var(--accent-border); outline-offset: 2px; }
.dash-grid--dragging { user-select: none; }
.dash-handle, .dash-resize { touch-action: none; cursor: grab; }
.dash-resize { cursor: nwse-resize; }
.dash-step { min-width: 44px; min-height: 44px; padding: 4px 8px; }
.dash-narrow-note { display: none; }
.dash-provenance { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.dash-notes { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-muted); }
.dash-compare { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; margin: 0;
  display: grid; gap: 6px; }
.dash-widget-body { min-width: 0; overflow-x: auto; display: flex; flex-direction: column; gap: 8px; }
.dash-gauge-svg { width: 100%; max-width: 260px; height: auto; display: block; margin: 0 auto; }
.chart-axis-label { fill: var(--text-muted); font-size: 11px; }
.chart-gauge-track { fill: none; stroke: var(--border); stroke-width: 16; stroke-linecap: round; }
.chart-gauge-fill { fill: none; stroke: var(--accent); stroke-width: 16; stroke-linecap: round; }
.chart-gauge-fill--out { stroke: var(--warn); }
.chart-gauge-value { fill: var(--text); font-size: 26px; font-weight: 700; }
.chart-gauge-out { fill: var(--warn); font-size: 11px; }
.chart-box { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.chart-box--s1 { fill: var(--info-soft); stroke: var(--info); }
.chart-box--s2 { fill: var(--violet-soft); stroke: var(--violet); }
.chart-box--s3 { fill: var(--surface); stroke: var(--warn); }
.chart-whisker { stroke: var(--text-muted); stroke-width: 1.5; }
.chart-median { stroke: var(--text); stroke-width: 2.5; }
.chart-heat { stroke: none; }
.chart-heat-0 { fill: #e6f2f1; } .chart-heat-1 { fill: #c4e0dd; } .chart-heat-2 { fill: #93c6c1; }
.chart-heat-3 { fill: #5fa7a1; } .chart-heat-4 { fill: #2f857f; } .chart-heat-5 { fill: #135e59; }
.chart-stack--s0, .chart-key { fill: var(--accent); background: var(--accent); }
.chart-stack--s1, .chart-key--s1 { fill: var(--info); background: var(--info); }
.chart-stack--s2, .chart-key--s2 { fill: var(--violet); background: var(--violet); }
.chart-stack--s3, .chart-key--s3 { fill: var(--warn); background: var(--warn); }
.chart-state-0, .chart-key-state { fill: var(--accent); background: var(--accent); }
.chart-state-1, .chart-key-state--s1 { fill: var(--info); background: var(--info); }
.chart-state-2, .chart-key-state--s2 { fill: var(--violet); background: var(--violet); }
.chart-state-3, .chart-key-state--s3 { fill: var(--warn); background: var(--warn); }
.chart-state-4, .chart-key-state--s4 { fill: var(--bad); background: var(--bad); }
.chart-state-5, .chart-key-state--s5 { fill: var(--ok); background: var(--ok); }
.chart-state-6, .chart-key-state--s6 { fill: var(--text-faint); background: var(--text-faint); }
.chart-state-7, .chart-key-state--s7 { fill: #c4e0dd; background: #c4e0dd; }
.chart-key, .chart-key-state { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
@media (max-width: 1120px) {
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid > .dash-widget { grid-column-start: auto; grid-row-start: auto; }
  .dash-grid > .gc-w1, .dash-grid > .gc-w2, .dash-grid > .gc-w3, .dash-grid > .gc-w4, .dash-grid > .gc-w5, .dash-grid > .gc-w6 { grid-column-end: span 1; }
  .dash-grid > .gc-w7, .dash-grid > .gc-w8, .dash-grid > .gc-w9, .dash-grid > .gc-w10, .dash-grid > .gc-w11, .dash-grid > .gc-w12 { grid-column-end: span 2; }
  .dash-handle, .dash-resize { display: none; }
  .dash-narrow-note { display: block; }
}
@media (max-width: 740px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-grid > .dash-widget { grid-column: 1 / -1; grid-row-end: auto; }
}
.dash-widget { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: 14px;
  display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dash-widget-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dash-widget-title { margin: 0; font-size: 15px; }
.dash-widget-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-widget-controls .dash-field { min-width: 140px; flex: 1 1 140px; }
.dash-list { margin: 0; padding-left: 18px; }
.dash-caption { margin: 0; }
/* Grouped bars (dashboards and Simulation Run analytics) and the simulation analysis panel. */
.chart-gbar { stroke: none; }
.chart-gbar--s0 { fill: var(--accent); } .chart-gbar--s1 { fill: var(--info); }
.chart-gbar--baseline { fill: var(--series-baseline); } .chart-gbar--scenario { fill: var(--series-scenario); }
.chart-gbar--up { fill: var(--series-scenario); } .chart-gbar--same { fill: var(--text-faint); } .chart-gbar--down { fill: var(--series-baseline); }
.chart-key--baseline { fill: var(--series-baseline); background: var(--series-baseline); }
.chart-key--scenario { fill: var(--series-scenario); background: var(--series-scenario); }
.chart-key--up { fill: var(--series-scenario); background: var(--series-scenario); }
.chart-key--down { fill: var(--series-baseline); background: var(--series-baseline); }
.chart-line--baseline { stroke: var(--series-baseline); stroke-dasharray: 6 4; }
.chart-dot--baseline { fill: var(--series-baseline); }
.chart-swatch--baseline { border-top: 2px dashed var(--series-baseline); }
.chart-box--baseline { fill: var(--surface); stroke: var(--series-baseline); }
.chart-box--scenario { fill: var(--accent-soft); stroke: var(--series-scenario); }
.sim-analysis-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 8px; }
.sim-analysis-controls .dash-field { flex: 1 1 200px; }
.sim-analysis { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sim-gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.sim-gauge { margin: 0; text-align: center; }

/* Organisation / Sites and the existing setup wizard: bounded layouts at phone through desktop sizes. */
.organisation-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 20px; }
.organisation-summary h2 { flex: 1 1 100%; margin-bottom: 0; }
.organisation-summary[hidden] { display: none; }
.organisation-summary .btn { min-height: 44px; }
.organisation-identity { display: flex; align-items: center; gap: 12px; flex: 1 1 100%; min-width: 0; }
.organisation-identity h2 { overflow-wrap: anywhere; }
.organisation-logo { display: inline-grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--brand-teal-deep); font-weight: 700; }
.organisation-logo img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.workspace-organisation-logo .organisation-logo { width: 26px; height: 26px; font-size: 10px; }
.organisation-logo-editor { flex: 1 1 100%; min-width: 0; }
.organisation-logo-editor > summary { cursor: pointer; min-height: 44px; padding-block: 12px; }
.organisation-logo-editor input[type="file"] { width: 100%; min-width: 0; min-height: 44px; }
.logo-current, .logo-preview { margin-block: 12px; }
@media (max-width: 740px) {
  .app-header { flex-wrap: wrap; }
  .app-header .customer-context { display: flex; order: 20; flex: 1 1 100%; min-width: 0; padding-bottom: 5px; }
  .app-header .customer-context .context-btn { max-width: calc(100% - 70px); }
}
.structure-steps { display: flex; flex-wrap: wrap; gap: 12px 28px; padding: 18px 24px; margin-block: 16px; border-radius: var(--radius); background: var(--surface); }
.structure-steps li { margin-left: 16px; overflow-wrap: anywhere; }
.structure-form { display: grid; gap: 16px; }
.structure-form input, .structure-form select, .structure-form button { min-height: 44px; }
.structure-form > button { justify-self: start; }
.org-site { padding: 20px; }
.org-site .env-rename-row { display: block; }
.org-site .env-add { width: 100%; }
.structure-breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.sites-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; margin-block: 16px; }
.site-card, .site-card h2, .site-card li { min-width: 0; overflow-wrap: anywhere; }
.setup-editor, .setup-fields, .setup-tree, .setup-assets, .setup-children, .setup-node { min-width: 0; max-width: 100%; }
.setup-editor { display: flex; flex-direction: column; gap: 16px; }
.setup-parameter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; }
.setup-parameter-grid .env-field, .setup-editor input, .setup-editor select { min-width: 0; max-width: 100%; width: 100%; }
.setup-editor input[type="checkbox"] { width: auto; }
.ask-layout { display: grid; grid-template-columns: minmax(230px, 300px) minmax(0, 1fr); gap: 20px; align-items: start; }
.ask-main, .ask-conversation, .ask-answer { min-width: 0; }
.ask-guide, .ask-question, .ask-answer, .ask-composer { padding: 20px; }
.ask-scope { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.ask-scope input[type="checkbox"] { width: auto; }
.ask-guide > .btn { display: block; width: 100%; text-align: left; margin-block: 10px; white-space: normal; }
.ask-conversation { display: grid; gap: 16px; }
.ask-answer td { white-space: normal; overflow-wrap: anywhere; min-width: 110px; max-width: 360px; }
.ask-composer { margin-top: 16px; }
.ask-actions, .ask-choices, .ask-points { display: flex; flex-wrap: wrap; gap: 12px; }
.ask-points[hidden] { display: none; }
.ask-points > .field { flex: 1 1 180px; min-width: 0; }
.ask-question p, .ask-answer p { overflow-wrap: anywhere; }
@media (max-width: 900px) { .ask-layout { grid-template-columns: minmax(0, 1fr); } }
.setup-node { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-block: 12px; }
.setup-node > summary { overflow-wrap: anywhere; cursor: pointer; min-height: 44px; padding-block: 10px; }
.setup-node > .btn { margin: 8px 8px 0 0; }
.setup-children { padding-left: 8px; }
.setup-tree > output { display: block; font-weight: 600; overflow-wrap: anywhere; }
.setup-editor input, .setup-editor select, .setup-editor button { min-height: 44px; }
@media (max-width: 767px) {
  .setup-parameter-grid { grid-template-columns: minmax(0, 1fr); }
  .setup-node { padding: 8px; }
  .setup-children { padding-left: 0; }
}
