/*
 * RELAY admin — one design system for every page.
 * Replaces app.css (15k lines, 13 token sets, 802 !important). Pages keep their markup:
 * the parallel component families (stitch-*, cdc-*, setup-*, core-v4-*, gos-*, inbox-v14-*)
 * are mapped onto the same primitives below.
 *
 * Principles: color means status (jade = live/primary, amber = attention, red = failure);
 * panels are bordered, shadows only on floating layers; one radius scale by hierarchy;
 * every control is 40px+ with a visible focus ring; RTL first, logical properties only.
 */

/* ---------------------------------------------------------------- type */
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("../fonts/plex-arabic/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url("../fonts/plex-arabic/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url("../fonts/plex-arabic/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url("../fonts/plex-arabic/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("../fonts/plex-arabic/ibm-plex-sans-arabic-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url("../fonts/plex-arabic/ibm-plex-sans-arabic-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url("../fonts/plex-arabic/ibm-plex-sans-arabic-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url("../fonts/plex-arabic/ibm-plex-sans-arabic-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+FEFF, U+FFFD; }

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: light;
  --font: "Plex Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --paper: #f2f4f3;      /* app background */
  --surface: #ffffff;    /* panels */
  --sunken: #f7f9f8;     /* inner areas, table heads */
  --line: #dde3e0;
  --line-strong: #c7d0cc;
  --ink: #18222b;        /* text */
  --ink-2: #3c4954;
  --muted: #5b6873;
  --faint: #8a969e;

  --rail: #121b21;       /* the switchboard rail */
  --rail-2: #1a252c;
  --rail-ink: #dfe7e3;
  --rail-muted: #8fa09a;

  --jade: #0b7a63;       /* live, primary action, success */
  --jade-strong: #08604e;
  --jade-soft: #e3f2ee;
  --amber: #a86412;      /* attention */
  --amber-soft: #fbf0e1;
  --red: #b42318;        /* failure */
  --red-soft: #fdecea;
  --blue: #2f5d8a;       /* information only */
  --blue-soft: #e8eff6;

  --r-panel: 12px;
  --r-control: 8px;
  --r-pill: 999px;
  --focus: 0 0 0 3px color-mix(in srgb, var(--jade) 35%, transparent);
  --float: 0 12px 32px rgba(18, 27, 33, .16), 0 2px 6px rgba(18, 27, 33, .08);
  --rail-w: 264px;
  --rail-w-collapsed: 76px;
  --topbar-h: 60px;
  --gap: 16px;

  --t-xs: 12.5px; --t-sm: 13.5px; --t-base: 15px; --t-md: 17px; --t-lg: 20px; --t-xl: 24px;
}

:root[data-theme="dark"], body.theme-dark {
  color-scheme: dark;
  --paper: #0e1418;
  --surface: #151e23;
  --sunken: #11191d;
  --line: #26343b;
  --line-strong: #33454d;
  --ink: #e2e9e6;
  --ink-2: #c3cec9;
  --muted: #9aa8af;
  --faint: #6f7f86;
  --rail: #0a1013;
  --rail-2: #121b20;
  --jade: #37c2a1;
  --jade-strong: #5ad3b5;
  --jade-soft: #123129;
  --amber: #e3a04a;
  --amber-soft: #33240f;
  --red: #f2867c;
  --red-soft: #3a1714;
  --blue: #8db5dc;
  --blue-soft: #16273a;
  --float: 0 14px 36px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .35);
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 var(--t-base)/1.65 var(--font);
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
/* links, order numbers and IDs break inside their container instead of running over neighbours */
:where(.stitch-main) :where(h1, h2, h3, h4, p, li, dd, dt, a, strong, b, small, time, label, td, blockquote) { overflow-wrap: anywhere; }
h1, h2, h3, h4 { margin: 0 0 .4em; color: var(--ink); line-height: 1.35; font-weight: 600; }
h1 { font-size: var(--t-xl); font-weight: 700; }
h2 { font-size: var(--t-lg); }
h3 { font-size: var(--t-md); }
h4 { font-size: var(--t-base); }
p { margin: 0 0 .75em; }
a { color: var(--jade); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
small, .small { font-size: var(--t-sm); }
strong, b { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
code, kbd, pre, .mono, .ai-diag-code, .cdc-code-sample, .air-ops-code {
  font-family: var(--mono); font-size: .88em; direction: ltr; unicode-bidi: isolate;
}
code { background: var(--sunken); border: 1px solid var(--line); border-radius: 6px; padding: .05em .35em;  overflow-wrap: anywhere; }
/* grid and flex children may shrink below their content width; prevents page-level sideways scroll */
:where(.stitch-main) :where(div, section, article, aside, header, footer, form, nav, fieldset, li, main) { min-width: 0; }
pre { background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-control); padding: 12px 14px; overflow: auto; text-align: left; }
img, svg, video { max-width: 100%; }
::selection { background: color-mix(in srgb, var(--jade) 25%, transparent); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
.muted, .setup-hint, .hint, .core-v4-toolbar-note, .message-meta, .inbox-v14-msg-meta, .inbox-v14-composer-hint { color: var(--muted); }
.full { grid-column: 1 / -1; width: 100%; }
.inline { display: inline-flex; align-items: center; gap: 8px; }
.block { display: block; }
.mt { margin-top: var(--gap); }
.container { max-width: 1320px; margin-inline: auto; }
.clip-cell { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* icons: app.js swaps every .material-symbols-outlined for a local SVG */
.material-symbols-outlined {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 1.25em; height: 1.25em; font-size: 18px; line-height: 1; overflow: hidden; color: inherit;
  font-style: normal; white-space: nowrap;
}
.material-symbols-outlined:not([data-local-icon]) { color: transparent; }  /* never show raw icon names */
.material-symbols-outlined svg {   /* the local icons are line drawings */
  width: 100%; height: 100%; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}


/* ---------------------------------------------------------------- naming conventions (zero specificity)
 * Page-specific containers get their layout from their names: *-grid, *-metrics, *-card, *-panel,
 * *-hero, *-head, *-actions, *-list, *-note. :where() keeps these as defaults that any explicit
 * rule overrides, so one block covers current and future pages without per-page CSS. */
:where([class$="-grid"], [class*="-grid "], [class*="__grid"], [class*="-grid--"]):where(:not(.form-grid, .stitch-form-grid)) {
  display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start;
}
:where([class$="-metrics"], [class*="-metrics "], [class*="__metrics"], [class*="kpi-grid"], [class$="-kpis"], [class*="-kpis "], [class$="-stats"], [class*="-stats "]) {
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: stretch;
}
:where([class$="-card"], [class*="-card "], [class$="-panel"], [class*="-panel "], [class*="__readiness "], [class$="__readiness"]):where(:not(.notifications-panel)) {
  position: relative; min-width: 0; padding: 20px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-panel);
}
:where([class$="-hero"], [class*="-hero "], [class$="__hero"], [class*="__hero "], [class$="-page-head"], [class*="-page-head "]) {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px;
}
:where([class$="-head"], [class*="-head "], [class*="-head--"], [class$="__head"]) {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px;
}
:where([class$="-actions"], [class*="-actions "], [class*="-actions-"], [class*="__actions"], [class$="-tools"], [class*="-tools "]) {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
:where([class$="-list"], [class*="-list "], [class$="__list"]) { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
:where([class$="-note"], [class*="-note "], [class*="__notice"], [class$="-notice"]):where(:not(.core-v4-toolbar-note)) {
  display: block; padding: 12px 16px; border: 1px solid var(--line); border-inline-start: 3px solid var(--blue);
  border-radius: var(--r-control); background: var(--surface); font-size: var(--t-sm);
}
:where([class$="-flags"], [class*="-flags "], [class$="-chips"], [class*="-chips "], [class$="-tags"], [class*="-tags "]) { display: flex; flex-wrap: wrap; gap: 6px; }
:where([class$="-flags"], [class*="-flags "], [class$="-chips"], [class*="-chips "]) > :where(span, a, li) {
  display: inline-flex; align-items: center; min-height: 24px; padding: 2px 10px; border-radius: var(--r-pill);
  background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line); font-size: var(--t-xs); font-weight: 600; overflow-wrap: anywhere;
}
:where([class*="eyebrow"]) { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--t-xs); font-weight: 500; text-transform: none; letter-spacing: 0; }
:where([class$="-meta"], [class*="-meta "], [class*="__meta"]) { color: var(--muted); font-size: var(--t-sm); }
:where([class$="-copy"], [class*="-copy "], [class*="__copy"]) { min-width: 0; }

/* ---------------------------------------------------------------- shell */
.stitch-shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }
body.sidebar-collapsed .stitch-shell { grid-template-columns: var(--rail-w-collapsed) minmax(0, 1fr); }
.stitch-workspace { min-width: 0; display: flex; flex-direction: column; }
.stitch-main { width: 100%; max-width: 1320px; margin-inline: auto; padding: 24px 28px 48px; flex: 1; }
.stitch-main > * + * { margin-top: var(--gap); }

/* the rail */
.stitch-sidebar {
  position: sticky; top: 0; height: 100vh; overflow: hidden auto;
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--rail); color: var(--rail-ink);
  scrollbar-width: thin; scrollbar-color: var(--rail-2) transparent;
}
.stitch-sidebar-main { padding: 16px 12px; }
.stitch-brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 18px; }
.stitch-brand-home { display: flex; align-items: center; gap: 10px; color: inherit; min-width: 0; }
.stitch-brand-home:hover { text-decoration: none; }
.stitch-brand-icon {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center;
  border-radius: 10px; background: var(--jade); color: #fff;
}
.stitch-brand-icon .material-symbols-outlined { font-size: 20px; }
.stitch-brand-copy { min-width: 0; }
.stitch-brand-copy h1 { margin: 0; font-size: 16px; font-weight: 700; color: #fff; letter-spacing: .2px; }
.stitch-brand-copy p { margin: 0; font-size: 12px; color: var(--rail-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stitch-sidebar-collapse {
  width: 32px; height: 32px; display: grid; place-items: center; flex: none;
  border: 0; border-radius: var(--r-control); background: transparent; color: var(--rail-muted); cursor: pointer;
}
.stitch-sidebar-collapse:hover { background: var(--rail-2); color: var(--rail-ink); }
body.sidebar-collapsed .stitch-sidebar-collapse .material-symbols-outlined { transform: scaleX(-1); }
.stitch-nav-heading { padding: 0 10px 8px; font-size: 12px; color: var(--rail-muted); }
.stitch-nav { display: flex; flex-direction: column; gap: 2px; }
.stitch-nav-row { display: flex; align-items: center; gap: 2px; }
.stitch-nav-link {
  position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 8px 10px; border-radius: var(--r-control);
  color: var(--rail-ink); font-size: var(--t-sm); font-weight: 500;
}
.stitch-nav-link:hover { background: var(--rail-2); text-decoration: none; }
.stitch-nav-link.is-active { background: var(--rail-2); color: #fff; }
.stitch-nav-link.is-active::before {   /* the signal line: the one bold element */
  content: ""; position: absolute; inset-inline-start: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--jade);
}
:root[data-theme="dark"] .stitch-nav-link.is-active::before { background: var(--jade); }
.stitch-nav-leading { display: grid; place-items: center; width: 24px; color: var(--rail-muted); }
.stitch-nav-link.is-active .stitch-nav-leading { color: var(--jade); }
:root:not([data-theme="dark"]) .stitch-nav-link.is-active .stitch-nav-leading { color: #4fd1b0; }
.stitch-nav-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stitch-nav-toggle {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center;
  border: 0; border-radius: var(--r-control); background: transparent; color: var(--rail-muted); cursor: pointer;
}
.stitch-nav-toggle:hover { background: var(--rail-2); color: var(--rail-ink); }
.stitch-nav-toggle .material-symbols-outlined { transition: transform .18s ease; }
.stitch-nav-group.is-expanded .stitch-nav-toggle .material-symbols-outlined { transform: rotate(180deg); }
.stitch-nav-sublist { display: none; padding: 2px 0 8px; margin-inline-start: 22px; border-inline-start: 1px solid var(--rail-2); }
.stitch-nav-group.is-expanded .stitch-nav-sublist { display: block; }
.stitch-sub-label { min-width: 0; line-height: 1.45; }
.stitch-nav-sublink {
  display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 12px;
  border-radius: var(--r-control); color: var(--rail-muted); font-size: var(--t-sm);
}
.stitch-nav-sublink:hover { color: var(--rail-ink); background: var(--rail-2); text-decoration: none; }
.stitch-nav-sublink.is-sub-active { color: #fff; font-weight: 600; }
.stitch-sub-leading { font-size: 15px; opacity: .8; }
.stitch-sub-icon { font-size: 13px; margin-inline-start: auto; opacity: .6; }
.stitch-user { display: flex; align-items: center; gap: 10px; margin: 12px; padding: 12px; border-radius: 10px; background: var(--rail-2); }
.stitch-user-avatar { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #2b3a42; color: #fff; font-weight: 600; }
.stitch-user-meta { min-width: 0; display: grid; }
.stitch-user-meta strong { color: #fff; font-size: var(--t-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stitch-user-meta small { color: var(--rail-muted); font-size: 12px; }
.stitch-user-actions { display: flex; gap: 12px; margin-top: 2px; font-size: 12px; }
.stitch-user-actions a { color: var(--rail-ink); }
.stitch-user-actions a.is-danger { color: #f2a59d; }

/* collapsed rail (desktop) */
body.sidebar-collapsed .stitch-brand-copy,
body.sidebar-collapsed .stitch-nav-heading,
body.sidebar-collapsed .stitch-nav-title,
body.sidebar-collapsed .stitch-nav-toggle,
body.sidebar-collapsed .stitch-nav-sublist,
body.sidebar-collapsed .stitch-user-meta { display: none; }
body.sidebar-collapsed .stitch-brand { flex-direction: column; }
body.sidebar-collapsed .stitch-nav-link { justify-content: center; padding-inline: 0; }
body.sidebar-collapsed .stitch-user { justify-content: center; margin-inline: 10px; }

.stitch-sidebar-overlay { display: none; }

/* topbar */
.stitch-topbar {
  position: sticky; top: 0; z-index: 30; min-height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px 28px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(6px); border-bottom: 1px solid var(--line);
}
.stitch-topbar-context { display: flex; align-items: center; gap: 14px; min-width: 0; }
.stitch-mobile-menu { display: none; }
.stitch-page-context { display: grid; min-width: 0; }
.stitch-page-context-kicker { display: none; }
.stitch-page-context strong { font-size: var(--t-md); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stitch-company-context {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px;
  border: 1px solid var(--line); border-radius: var(--r-control); background: var(--surface); color: var(--ink);
}
.stitch-company-context:hover { border-color: var(--line-strong); text-decoration: none; }
.stitch-company-context-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--jade); box-shadow: 0 0 0 3px var(--jade-soft); flex: none; }
.stitch-company-context-copy { display: grid; line-height: 1.3; }
.stitch-company-context-copy small { color: var(--muted); font-size: 11.5px; }
.stitch-company-context-copy b, .stitch-company-context select { font-size: var(--t-sm); font-weight: 600; }
.stitch-company-context select { border: 0; background: transparent; padding: 0; min-height: 0; height: auto; color: var(--ink); box-shadow: none; }
.stitch-company-context select:focus { box-shadow: none; }
.stitch-company-context > .material-symbols-outlined { color: var(--muted); }
.stitch-topbar-tools { position: relative; display: flex; align-items: center; gap: 8px; }
.stitch-search { position: relative; display: flex; align-items: center; width: min(320px, 32vw); }
.stitch-search > .material-symbols-outlined { position: absolute; inset-inline-start: 10px; color: var(--muted); pointer-events: none; }
.stitch-search input { padding-inline-start: 36px; padding-inline-end: 44px; background: var(--sunken); }
.stitch-search kbd {
  position: absolute; inset-inline-end: 8px; font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; background: var(--surface);
}
.stitch-search-results {
  position: absolute; top: calc(100% + 6px); inset-inline: 0; z-index: 40; max-height: 60vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--float); padding: 6px;
}
.stitch-search-results a { display: block; padding: 8px 10px; border-radius: var(--r-control); color: var(--ink); }
.stitch-search-results a:hover, .stitch-search-results .is-active { background: var(--sunken); text-decoration: none; }
.stitch-icon-btn, .notifications-panel__more {
  position: relative; width: 40px; height: 40px; display: grid; place-items: center; flex: none;
  border: 1px solid var(--line); border-radius: var(--r-control); background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.stitch-icon-btn:hover, .notifications-panel__more:hover { border-color: var(--line-strong); color: var(--ink); }
.browser-notify-count {
  position: absolute; top: -6px; inset-inline-end: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center; border-radius: var(--r-pill); background: var(--red); color: #fff; font-size: 11px; font-weight: 600;
}
.browser-notify-count:empty, .browser-notify-count[data-count="0"] { display: none; }
.notifications-panel {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 45; width: min(380px, 92vw);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--float); overflow: hidden;
}
.notifications-panel__header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notifications-panel__header h2 { font-size: var(--t-base); margin: 0; }
.notifications-panel__header p { margin: 0; color: var(--muted); font-size: var(--t-xs); }
.notifications-panel__settings-wrap { position: relative; }
.notifications-settings-menu {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 46; min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--float);
}
.notifications-settings-menu button {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: var(--r-control);
  background: transparent; color: var(--ink); font: inherit; font-size: var(--t-sm); cursor: pointer; text-align: start;
}
.notifications-settings-menu button:hover { background: var(--sunken); }

/* in-page search (top of every page): one compact field with the icon inside */
.gos-page-search { position: relative; display: flex; align-items: center; max-width: 520px; }
.gos-page-search > .material-symbols-outlined { position: absolute; inset-inline-start: 12px; color: var(--muted); pointer-events: none; }
.gos-page-search input { flex: 1; padding-inline-start: 38px; padding-inline-end: 36px; background: var(--surface); }
.gos-page-search [data-page-search-clear] {
  position: absolute; inset-inline-end: 6px; width: 28px; height: 28px; min-height: 0; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer;
}
.gos-page-search [data-page-search-clear]:hover { background: var(--sunken); color: var(--ink); }
.gos-page-search small:not(:empty) { margin-inline-start: 10px; color: var(--muted); font-size: var(--t-xs); white-space: nowrap; }

/* ---------------------------------------------------------------- page heads */
.stitch-page-head, .section-head, .section-heading, .gos-hub-hero, .core-v4-hero, .brain-hero, .setup-heading, .page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px;
  padding: 0; margin: 0 0 4px; background: none; border: 0; box-shadow: none; min-height: 0;
}
.stitch-page-head h1, .section-head h1, .gos-hub-hero h1, .core-v4-hero h1, .brain-hero h1, .setup-heading h1 { font-size: var(--t-xl); margin: 0 0 4px; }
.stitch-page-head h2, .section-head h2, .section-heading h2 { font-size: var(--t-lg); margin: 0 0 2px; }
.stitch-page-head p, .section-head p, .section-heading p, .gos-hub-hero p, .core-v4-hero p, .brain-hero p, .setup-heading p {
  margin: 0; color: var(--muted); max-width: 72ch; font-size: var(--t-sm);
}
.core-v4-hero-copy { min-width: 0; }
.stitch-eyebrow, .core-v4-eyebrow, .brain-eyebrow, .setup-kicker, .gos-ops-v3__section-label {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px; padding: 0; background: none;
  color: var(--muted); font-size: var(--t-xs); font-weight: 500; letter-spacing: 0; text-transform: none;
}
.core-v4-company-line, .brain-status-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--t-sm); margin-top: 6px; }
.core-v4-live-dot, .brain-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--jade); box-shadow: 0 0 0 3px var(--jade-soft); flex: none; }

/* ---------------------------------------------------------------- panels */
.panel, .card-panel, .stitch-card, .cdc-panel, .setup-card, .admin-ui-card, .support-guide-card, .settings-section,
.health-card, .report-card, .export-card, .template-card, .gap-card, .note-card, .ai-diag-card, .brain-section,
.gos-ops-v3__panel, .settings-summary-card, .persona-preview, .core-v4-toolbar, .login-card, .demo-panel, .card {
  position: relative; min-width: 0; padding: 20px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: none;
}
.panel > :last-child, .card-panel > :last-child, .stitch-card > :last-child, .cdc-panel > :last-child, .setup-card > :last-child { margin-bottom: 0; }
.stitch-card__header, .admin-ui-card-head, .cdc-panel-head, .gos-ops-v3__panel-head, .slim-head, .compact-head, .settings-section > header, .inbox-v14-context-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 14px;
}
.stitch-card__header h2, .stitch-card__header h3, .admin-ui-card-head h2, .admin-ui-card-head h3, .cdc-panel-head h2, .cdc-panel-head h3,
.gos-ops-v3__panel-head h2, .gos-ops-v3__panel-head h3, .panel > h2, .panel > h3, .card-panel > h2, .card-panel > h3 { font-size: var(--t-md); margin: 0; }
.stitch-card__header p, .admin-ui-card-head p, .cdc-panel-head p, .gos-ops-v3__panel-head p { margin: 2px 0 0; color: var(--muted); font-size: var(--t-sm); }
.settings-section-body > * + * { margin-top: 12px; }
.panel .panel, .stitch-card .stitch-card, .cdc-panel .cdc-panel, .panel .card-panel { background: var(--sunken); }

/* ---------------------------------------------------------------- grids */
.stats-grid, .metric-grid, .panel-grid, .cdc-grid, .stitch-grid, .dashboard-grid, .library-grid, .export-grid, .persona-grid,
.brain-metrics, .core-v4-metrics, .stats-grid-wide, .cdc-link-grid, .cdc-code-grid, .setup-grid, .grid {
  display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: start;
}
.panel-grid, .dashboard-grid, .library-grid, .persona-grid, .setup-grid, .cdc-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.two, .cdc-two, .stitch-two-col, .grid-2, .stitch-grid--2, .split-layout, .air-ops-row { display: grid; gap: var(--gap); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.three, .air-ops-row--3 { display: grid; gap: var(--gap); grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.four, .stitch-grid--4 { display: grid; gap: var(--gap); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.five { display: grid; gap: var(--gap); grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.side-stack, .cdc-form-stack, .stacked-form { display: flex; flex-direction: column; gap: 12px; }

/* ---------------------------------------------------------------- metrics */
.stat, .stat-card, .metric-card, .stitch-stat-card, .core-v4-metric, .report-kpi-card, .cdc-kpi, .gos-ops-v3__metric {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: none;
}
.stat strong, .stat-card strong, .metric-card strong, .stitch-stat-card strong, .core-v4-metric strong, .report-kpi-card strong, .cdc-kpi strong,
.gos-ops-v3__metric-value, .metric-value, .stat-value, .kpi-value {
  font-size: var(--t-xl); font-weight: 700; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums;
}
.stat span, .stat-card span:not(.material-symbols-outlined), .metric-card span:not(.material-symbols-outlined), .stitch-stat-card span:not(.material-symbols-outlined),
.core-v4-metric span:not(.material-symbols-outlined), .report-kpi-card span:not(.material-symbols-outlined), .cdc-kpi span:not(.material-symbols-outlined),
.stat small, .metric-card small, .stat-card small, .core-v4-metric small, .report-kpi-card small, .cdc-kpi small, .gos-ops-v3__metric small {
  color: var(--muted); font-size: var(--t-sm);
}
.core-v4-metric-icon, .report-kpi-icon, .gos-ops-v3__metric-icon, .metric-icon {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-control);
  background: var(--sunken); color: var(--ink-2); flex: none;
}
.report-kpi-top, .gos-ops-v3__metric-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.report-trend, .gos-ops-v3__metric-trend { font-size: var(--t-xs); color: var(--muted); }
.core-v4-metric.is-blue .core-v4-metric-icon { color: var(--blue); background: var(--blue-soft); }
.core-v4-metric.is-amber .core-v4-metric-icon { color: var(--amber); background: var(--amber-soft); }
.core-v4-metric.is-purple .core-v4-metric-icon { color: var(--jade); background: var(--jade-soft); }

/* ---------------------------------------------------------------- tables */
.table-wrap, .cdc-table-wrap, .table-responsive, .support-guide-table-wrap {
  width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface);
}
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--t-sm); }
th, td { padding: 11px 14px; text-align: start; vertical-align: middle; border-bottom: 1px solid var(--line); }
th { position: sticky; top: 0; z-index: 1; background: var(--sunken); color: var(--muted); font-weight: 600; font-size: var(--t-xs); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--sunken) 70%, transparent); }
.panel > table, .card-panel > table, .stitch-card > table { border: 1px solid var(--line); border-radius: var(--r-control); overflow: hidden; }
.compact-table th, .compact-table td { padding: 8px 10px; }
.row-actions, .cdc-actions-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
td .btn, td .setup-btn { min-height: 32px; padding: 4px 10px; font-size: var(--t-xs); }

/* ---------------------------------------------------------------- buttons */
.btn, .setup-btn, .stitch-btn, .core-v4-btn, .inbox-v14-btn, .gos-ops-v3__btn, .admin-ui-small-btn,
button:not([class]), input[type="submit"], input[type="button"], input[type="reset"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-control);
  background: var(--surface); color: var(--ink); font: 600 var(--t-sm)/1.2 var(--font); white-space: nowrap;
  cursor: pointer; text-decoration: none; transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover, .setup-btn:hover, .stitch-btn:hover, .core-v4-btn:hover, .inbox-v14-btn:hover, .gos-ops-v3__btn:hover, .admin-ui-small-btn:hover,
button:not([class]):hover, input[type="submit"]:hover { border-color: var(--ink-2); text-decoration: none; }
.btn .material-symbols-outlined, .setup-btn .material-symbols-outlined, .core-v4-btn .material-symbols-outlined, .inbox-v14-btn .material-symbols-outlined { font-size: 17px; }
.btn-primary, .btn.primary, .setup-btn.primary, .stitch-btn.primary, .core-v4-btn-primary, .inbox-v14-btn.primary, .gos-ops-v3__btn.primary,
input[type="submit"], .setup-btn-primary, .btn-success {
  background: var(--jade); border-color: var(--jade); color: #fff;
}
:root[data-theme="dark"] .btn-primary, :root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] .core-v4-btn-primary,
:root[data-theme="dark"] input[type="submit"], :root[data-theme="dark"] .setup-btn.primary { color: #062a22; }
.btn-primary:hover, .btn.primary:hover, .setup-btn.primary:hover, .core-v4-btn-primary:hover, input[type="submit"]:hover, .btn-success:hover {
  background: var(--jade-strong); border-color: var(--jade-strong); color: #fff;
}
.btn-secondary, .btn.secondary, .setup-btn.secondary, .core-v4-btn-secondary, .btn.ghost, .ghost { background: transparent; }
.btn-danger, .btn.danger, .setup-btn.danger, .core-v4-btn.danger, .inbox-v14-btn.danger { background: var(--surface); border-color: color-mix(in srgb, var(--red) 45%, var(--line)); color: var(--red); }
.btn-danger:hover, .btn.danger:hover, .setup-btn.danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn-sm, .btn-small, .btn.small, .btn.compact, .admin-ui-small-btn { min-height: 32px; padding: 4px 10px; font-size: var(--t-xs); }
.btn[disabled], .btn.is-disabled, button[disabled], .btn.is-submitting { opacity: .55; cursor: not-allowed; }
.actions, .form-actions, .setup-actions, .stitch-page-actions, .stitch-actions-row, .core-v4-hero-actions, .gos-hub-hero__actions,
.brain-hero-actions, .action-run-actions, .air-ops-actions, .inbox-v14-actions, .inbox-v14-context-actions, .toolbar-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.inbox-v14-actions-compact .inbox-v14-btn { min-height: 34px; padding: 4px 10px; }

/* ---------------------------------------------------------------- forms */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="color"]),
select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-control);
  background: var(--surface); color: var(--ink); font: 400 var(--t-base)/1.5 var(--font);
  transition: border-color .12s ease, box-shadow .12s ease;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
select { padding-inline-end: 32px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: left 16px center, left 11px center; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--jade); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; margin: 0; accent-color: var(--jade); flex: none; }
input[type="file"] { width: 100%; padding: 6px; border: 1px dashed var(--line-strong); border-radius: var(--r-control); background: var(--sunken); color: var(--muted); font: inherit; font-size: var(--t-sm); }
input[type="file"]::file-selector-button {
  margin-inline-end: 12px; padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--surface); color: var(--ink); font: 600 var(--t-xs) var(--font); cursor: pointer;
}
input[type="color"] { width: 48px; height: 40px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--surface); }
label { display: block; color: var(--ink-2); font-size: var(--t-sm); font-weight: 500; }
label > input:not([type="checkbox"]):not([type="radio"]), label > select, label > textarea { margin-top: 6px; }
form.form, .form, .settings-form, .grid-form, .compact-form, .air-ops-form { display: grid; gap: 14px; }
.form-grid, .stitch-form-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
.form-grid > .full, .stitch-form-grid > .full, .form-grid > .span-2 { grid-column: 1 / -1; }
.inline-form, .stacked-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.inline-form > label, .stacked-inline > label { flex: 1 1 180px; }
.narrow { max-width: 560px; }
.check-row, .check-label, .setup-checkbox, .cdc-check, .check { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 400; }
.setup-field { display: grid; gap: 6px; }
.setup-password-row { display: flex; gap: 8px; align-items: center; }
.setup-full { grid-column: 1 / -1; }

/* ---------------------------------------------------------------- toolbars and search */
.toolbar, .core-v4-toolbar, .filters, .core-v4-filter-group, .page-search-bar, .inbox-v14-tabs, .cdc-tabs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.core-v4-toolbar { justify-content: space-between; padding: 12px 14px; }
.toolbar > input, .toolbar > select, .filters > input, .filters > select, .core-v4-search, .core-v4-select { width: auto; flex: 1 1 200px; }
.page-search-bar { padding: 0; background: none; border: 0; box-shadow: none; }
.page-search-bar input { max-width: 420px; background: var(--surface); }
.core-v4-filter, .inbox-v14-tabs a, .inbox-v14-tabs button, .cdc-tabs a, .cdc-tabs button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 12px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink-2);
  font: 500 var(--t-xs)/1.2 var(--font); cursor: pointer; text-decoration: none;
}
.core-v4-filter.is-active, .core-v4-filter.active, .inbox-v14-tabs .is-active, .inbox-v14-tabs .active, .cdc-tabs .active, .cdc-tabs .is-active, .cdc-tabs [aria-current="page"] {
  background: var(--ink); border-color: var(--ink); color: var(--surface);
}

/* ---------------------------------------------------------------- pills, badges, statuses */
.badge, .pill, .stitch-pill, .status-pill, .stitch-badge, .status-badge, .stitch-chip, .inbox-v14-chip, .muted-pill, .setup-chip, .chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 2px 10px;
  border: 0; border-radius: var(--r-pill); background: var(--sunken); color: var(--ink-2);
  font-size: var(--t-xs); font-weight: 600; line-height: 1.4; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line);
}
.badge .material-symbols-outlined, .pill .material-symbols-outlined, .stitch-pill .material-symbols-outlined, .status-pill .material-symbols-outlined { font-size: 14px; }
.stitch-chip-row, .inbox-v14-head-chips, .inbox-v14-card-tags, .quality-flag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
:is(.badge, .pill, .stitch-pill, .status-pill, .stitch-badge, .status-badge, .stitch-chip, .inbox-v14-chip, .setup-chip):is(.good, .ok, .success, .is-success, .badge-ok, .green, .active-pill) ,
.badge-ok { background: var(--jade-soft); color: var(--jade); box-shadow: none; }
:is(.badge, .pill, .stitch-pill, .status-pill, .stitch-badge, .status-badge, .stitch-chip, .inbox-v14-chip, .setup-chip):is(.warn, .warning, .amber, .gold, .warning-soft, .pending),
.badge-warn { background: var(--amber-soft); color: var(--amber); box-shadow: none; }
:is(.badge, .pill, .stitch-pill, .status-pill, .stitch-badge, .status-badge, .stitch-chip, .inbox-v14-chip, .setup-chip):is(.danger, .error, .is-error, .bad, .failed, .red),
.badge-danger { background: var(--red-soft); color: var(--red); box-shadow: none; }
:is(.badge, .pill, .stitch-pill, .status-pill, .stitch-badge, .status-badge, .stitch-chip, .inbox-v14-chip, .setup-chip):is(.info, .blue, .neutral) { background: var(--blue-soft); color: var(--blue); box-shadow: none; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.status-row:last-child { border-bottom: 0; }

/* ---------------------------------------------------------------- flash, alerts, notices */
.flash, .stitch-flash, .setup-notice, .notice, .stitch-alert, .alert, .core-v4-alert, .inbox-v14-flash, .cdc-inline-notice, .setup-export-guide {
  display: block; padding: 12px 16px; border: 1px solid var(--line); border-inline-start: 3px solid var(--blue);
  border-radius: var(--r-control); background: var(--surface); color: var(--ink); font-size: var(--t-sm);
}
.flash > :last-child, .stitch-flash > :last-child, .notice > :last-child, .stitch-alert > :last-child { margin-bottom: 0; }
.flash-success, .stitch-flash--success, .notice.success, .notice.good, .stitch-alert--success, .alert-success { border-inline-start-color: var(--jade); background: var(--jade-soft); }
.flash-error, .stitch-flash--danger, .stitch-flash--error, .core-v4-alert-danger, .notice.error, .notice.danger, .alert-danger, .inbox-v14-flash.error, .stitch-alert--danger { border-inline-start-color: var(--red); background: var(--red-soft); }
.flash-warning, .stitch-flash--warning, .notice.warning, .notice.warn, .stitch-alert--warning, .alert-warning, .setup-notice.warning { border-inline-start-color: var(--amber); background: var(--amber-soft); }
.stitch-alert--info, .flash-info, .notice.info { border-inline-start-color: var(--blue); background: var(--blue-soft); }
.core-v4-alert { display: flex; align-items: center; gap: 10px; }

/* ---------------------------------------------------------------- empty states */
.empty, .inbox-v14-empty, .inbox-v14-list-empty, .inbox-v14-context-empty, .inbox-v14-thread-empty, .core-v4-empty-mini, .core-v4-filter-empty {
  display: grid; justify-items: center; gap: 6px; padding: 28px 20px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line-strong); border-radius: var(--r-panel); background: transparent;
}
.empty h2, .empty h3, .inbox-v14-empty h2, .inbox-v14-empty h3 { color: var(--ink); font-size: var(--t-md); margin: 4px 0 0; }
.empty .material-symbols-outlined, .inbox-v14-empty .material-symbols-outlined { font-size: 30px; color: var(--faint); }
.empty p, .inbox-v14-empty p { margin: 0; max-width: 46ch; }

/* ---------------------------------------------------------------- lists and timelines */
.timeline-list, .clean-list, .cdc-list, .note-list, .gap-list, .action-run-list, .setup-analysis-list, .demo-check-list, .cdc-check-list, .mini-facts, .inbox-v14-context-list {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 0;
}
.timeline-list > li, .clean-list > li, .cdc-list > li, .note-list > li, .action-run-list > li, .setup-analysis-list > li, .demo-check-list > li, .cdc-check-list > li, .mini-facts > li,
.inbox-v14-context-list > li, .timeline-item {
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.timeline-list > li:last-child, .clean-list > li:last-child, .cdc-list > li:last-child, .note-list > li:last-child, .mini-facts > li:last-child, .inbox-v14-context-list > li:last-child { border-bottom: 0; }
.mini-facts > li, .inbox-v14-source-row { display: flex; justify-content: space-between; gap: 12px; }
.inbox-v14-source-row { padding: 6px 0; font-size: var(--t-sm); }
.message-bubble, .webchat-admin-preview__msg, .setup-bubble {
  max-width: 72ch; padding: 10px 14px; border-radius: 14px; background: var(--sunken); border: 1px solid var(--line);
}
.message-box { display: grid; gap: 8px; }
.setup-live-preview { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--sunken); }
.setup-chat-label { font-size: var(--t-xs); color: var(--muted); }
.gap-card .gap-body { margin-top: 8px; }


/* ---------------------------------------------------------------- dashboard (ops): ring and activity chart */
.gos-ops-v3 > * + * { margin-top: var(--gap); }
.gos-ops-v3__hero { align-items: stretch; }
.gos-ops-v3__hero-copy { flex: 1 1 420px; display: grid; align-content: center; gap: 6px; }
.gos-ops-v3__hero-copy h1 { font-size: var(--t-xl); margin: 0; }
.gos-ops-v3__readiness { flex: 0 1 340px; display: grid; gap: 12px; }
.gos-ops-v3__readiness-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gos-ops-v3__readiness-body { display: flex; align-items: center; gap: 16px; }
.gos-ops-v3__readiness-meta { display: grid; gap: 4px; font-size: var(--t-sm); flex: 1; }
.gos-ops-v3__progress-ring {
  --p: calc(var(--progress, 0) * 1%); position: relative; width: 92px; height: 92px; flex: none;
  display: grid; place-items: center; border-radius: 50%;
  background: conic-gradient(var(--jade) var(--p), var(--line) 0);
}
.gos-ops-v3__progress-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.gos-ops-v3__progress-ring > * { position: relative; text-align: center; line-height: 1.2; }
.gos-ops-v3__progress-ring strong { font-size: var(--t-lg); font-variant-numeric: tabular-nums; }
.gos-ops-v3__main-grid { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.gos-ops-v3__legend, .report-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: var(--t-xs); }
.gos-ops-v3__chart { display: flex; align-items: flex-end; gap: 10px; height: 210px; padding-top: 8px; }
.gos-ops-v3__chart-col { position: relative; flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; font-size: var(--t-xs); color: var(--muted); }
.gos-ops-v3__chart-track { width: 100%; max-width: 44px; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; background: var(--sunken); border-radius: 6px; overflow: hidden; }
.gos-ops-v3__chart-stack { width: 100%; min-height: 2px; background: var(--jade); }
.gos-ops-v3__chart-tooltip { display: none; position: absolute; bottom: calc(100% + 4px); z-index: 5; padding: 4px 8px; border-radius: 6px; background: var(--ink); color: var(--surface); white-space: nowrap; }
.gos-ops-v3__chart-col:hover .gos-ops-v3__chart-tooltip, .gos-ops-v3__chart-col:focus-within .gos-ops-v3__chart-tooltip { display: block; }
.gos-ops-v3__side-stack { display: grid; gap: var(--gap); }
.gos-ops-v3__quick-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.gos-ops-v3__priority-list > *, .gos-ops-v3__pulse-list > * { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.gos-ops-v3__priority-list > :last-child, .gos-ops-v3__pulse-list > :last-child { border-bottom: 0; }

/* reports: status split bar and team bars */
.status-bars { display: flex; height: 10px; border-radius: var(--r-pill); overflow: hidden; background: var(--sunken); margin: 10px 0; }
.status-bars > * { height: 100%; background: var(--jade); }
.status-bars .processing { background: var(--blue); }
.status-bars .late { background: var(--amber); }
.team-bars { display: flex; align-items: flex-end; gap: 10px; height: 190px; }
.team-bar-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; font-size: var(--t-xs); color: var(--muted); }
.team-bar { width: 100%; max-width: 40px; min-height: 2px; background: var(--line-strong); border-radius: 6px 6px 0 0; }
.team-bar.active { background: var(--jade); }
.report-segmented { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--sunken); }
.report-segmented > * { min-height: 30px; padding: 2px 12px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-2); font: 500 var(--t-xs) var(--font); cursor: pointer; }
.report-segmented > .active, .report-segmented > .is-active, .report-segmented > [aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.reports-page > * + *, .settings-page > * + * { margin-top: var(--gap); }

/* ---------------------------------------------------------------- inbox: list | conversation | details */
.inbox-v14 { display: grid; gap: 12px; }
.inbox-v14-shell {
  display: grid; gap: 12px; align-items: stretch;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(240px, 300px);
  grid-template-areas: "list chat context";
  height: calc(100vh - var(--topbar-h) - 72px); min-height: 520px;
}
.inbox-v14-sidebar { grid-area: list; }
.inbox-v14-chat { grid-area: chat; }
.inbox-v14-context { grid-area: context; }
.inbox-v14-sidebar, .inbox-v14-chat, .inbox-v14-context {
  min-width: 0; min-height: 0; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden;
}
.inbox-v14-side-head, .inbox-v14-chat-head, .inbox-v14-context-head { padding: 12px 14px; border-bottom: 1px solid var(--line); margin: 0; }
.inbox-v14-tabs { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.inbox-v14-list { flex: 1; overflow: auto; padding: 6px; }
.inbox-v14-list > a, .inbox-v14-list > div:not(.inbox-v14-list-empty), .inbox-v14-card {
  display: flex; gap: 10px; padding: 10px; border-radius: var(--r-control); color: var(--ink); text-decoration: none;
}
.inbox-v14-list > a:hover, .inbox-v14-card:hover { background: var(--sunken); text-decoration: none; }
.inbox-v14-list .is-selected, .inbox-v14-list .is-current, .inbox-v14-list .active { background: var(--jade-soft); }
.inbox-v14-list .is-unread .inbox-v14-card-title, .inbox-v14-list .has-unread .inbox-v14-card-title { font-weight: 700; }
.inbox-v14-avatar, .inbox-v14-card-avatar {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--sunken); border: 1px solid var(--line); color: var(--ink-2); font-weight: 600;
}
.inbox-v14-card-body { min-width: 0; flex: 1; display: grid; gap: 2px; }
.inbox-v14-card-top { display: flex; justify-content: space-between; gap: 8px; font-size: var(--t-xs); color: var(--muted); }
.inbox-v14-card-title { font-size: var(--t-sm); font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-v14-chat-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.inbox-v14-head-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.inbox-v14-title { min-width: 0; }
.inbox-v14-title h2, .inbox-v14-title strong { font-size: var(--t-base); margin: 0; }
.inbox-v14-meta { padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: var(--t-xs); color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.inbox-v14-thread { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--sunken); }
.inbox-v14-bubble { max-width: min(72ch, 80%); padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; }
.inbox-v14-bubble.is-staff, .inbox-v14-bubble.staff, .inbox-v14-bubble.is-bot, .inbox-v14-bubble.bot { align-self: flex-end; background: var(--jade-soft); border-color: transparent; }
.inbox-v14-composer { border-top: 1px solid var(--line); padding: 12px; background: var(--surface); }
.inbox-v14-reply-form { display: grid; gap: 8px; }
.inbox-v14-composer-field textarea { min-height: 72px; }
.inbox-v14-disabled { color: var(--muted); font-size: var(--t-sm); padding: 4px 2px 8px; }
.inbox-v14-context { overflow: auto; padding: 0; }
.inbox-v14-context-card { margin: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--surface); }
.inbox-v14-context-card h3 { font-size: var(--t-sm); margin: 0 0 8px; }
.inbox-v14-live-toasts { position: fixed; bottom: 16px; inset-inline-start: 16px; z-index: 60; display: grid; gap: 8px; }

/* ---------------------------------------------------------------- ticket board: kanban */
.gos-core-v4 > * + * { margin-top: var(--gap); }
.core-v4-kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.core-v4-kanban-column { min-width: 0; display: flex; flex-direction: column; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-panel); }
.core-v4-column-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; }
.core-v4-column-body { display: grid; gap: 8px; padding: 10px; min-height: 120px; }
.core-v4-column-body > article, .core-v4-column-body > a, .ticket-card {
  display: grid; gap: 6px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-control); color: var(--ink);
}
.core-v4-ticket-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--t-xs); color: var(--muted); }
.core-v4-ticket-warning { color: var(--amber); font-size: var(--t-xs); }
.core-v4-person { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); color: var(--muted); }

/* a card that is a link must be a block, or its parts spill into neighbouring cards */
:where(a):where([class$="-card"], [class*="-card "], [class$="-tile"], [class*="-tile "]) { display: block; color: inherit; text-decoration: none; }
:where(a):where([class$="-card"], [class*="-card "]):hover { border-color: var(--line-strong); text-decoration: none; }

/* ticket cards on the board */
.core-v4-ticket-card { display: grid; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-control); color: var(--ink); text-decoration: none; }
.core-v4-ticket-card:hover { border-color: var(--line-strong); text-decoration: none; }
.core-v4-ticket-card[data-overdue="1"], .core-v4-ticket-card.is-overdue { border-inline-start: 3px solid var(--amber); }
.core-v4-ticket-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.core-v4-ticket-top code { font-size: 11.5px; padding: 0 .4em; }
.core-v4-priority { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.core-v4-priority i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.core-v4-priority.is-urgent i { background: var(--red); }
.core-v4-priority.is-high i { background: var(--amber); }
.core-v4-priority.is-normal i { background: var(--blue); }
.core-v4-ticket-card h3 { margin: 0; font-size: var(--t-sm); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.core-v4-ticket-summary { margin: 0; color: var(--muted); font-size: var(--t-xs); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.core-v4-ticket-warning { display: inline-flex; align-items: center; gap: 4px; }
.core-v4-ticket-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: var(--t-xs); color: var(--muted); }
.core-v4-person { min-width: 0; }
.core-v4-person > span { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--sunken); border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; }
.core-v4-person > div { display: grid; min-width: 0; line-height: 1.35; }
.core-v4-person b { color: var(--ink); font-weight: 600; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.core-v4-ticket-foot time { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.core-v4-ticket-foot .material-symbols-outlined, .core-v4-ticket-warning .material-symbols-outlined { font-size: 14px; }

/* inbox conversation cards */
.inbox-v14-context-backdrop { display: none; }
.inbox-v14-card { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border-radius: var(--r-control); color: var(--ink); text-decoration: none; }
.inbox-v14-card-top > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-v14-card-top > time { flex: none; white-space: nowrap; }
.inbox-v14-card-title { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.inbox-v14-card-title strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-v14-card-title b { flex: none; font-size: var(--t-xs); color: var(--jade); }
.inbox-v14-card-body p { margin: 0; color: var(--muted); font-size: var(--t-xs); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* inbox thread: who said what is visible at a glance */
.inbox-v14-msg { display: flex; width: 100%; }
.inbox-v14-msg.customer { justify-content: flex-start; }
.inbox-v14-msg.ai, .inbox-v14-msg.bot, .inbox-v14-msg.staff, .inbox-v14-msg.admin { justify-content: flex-end; }
.inbox-v14-msg .inbox-v14-bubble { align-self: auto; max-width: min(72ch, 78%); }
.inbox-v14-msg.customer .inbox-v14-bubble { background: var(--surface); border-color: var(--line); border-start-start-radius: 4px; }
.inbox-v14-msg.ai .inbox-v14-bubble, .inbox-v14-msg.bot .inbox-v14-bubble { background: var(--blue-soft); border-color: transparent; border-start-end-radius: 4px; }
.inbox-v14-msg.staff .inbox-v14-bubble, .inbox-v14-msg.admin .inbox-v14-bubble { background: var(--jade-soft); border-color: transparent; border-start-end-radius: 4px; }
.inbox-v14-msg.system, .inbox-v14-msg.note { justify-content: center; }
.inbox-v14-msg.system .inbox-v14-bubble, .inbox-v14-msg.note .inbox-v14-bubble { background: transparent; border: 1px dashed var(--line-strong); color: var(--muted); font-size: var(--t-xs); }
.inbox-v14-msg-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: var(--t-xs); }
.inbox-v14-msg-meta b { color: var(--ink-2); font-weight: 600; }
.inbox-v14-msg-meta time { color: var(--faint); font-variant-numeric: tabular-nums; }
.inbox-v14-bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; }

/* conversation header details: label then value, never glued together */
.inbox-v14-meta > div { display: inline-flex; align-items: center; gap: 5px; }
.inbox-v14-meta > div > span { color: var(--muted); }
.inbox-v14-meta > div > span::after { content: ":"; }
.inbox-v14-meta > div > b { color: var(--ink); font-weight: 600; }
.inbox-v14-meta .material-symbols-outlined { font-size: 15px; color: var(--faint); }

/* context panel: definition rows */
.inbox-v14-context-head { display: flex; align-items: flex-start; justify-content: flex-start; gap: 10px; }
.inbox-v14-context-head > div { flex: 1; min-width: 0; }
.inbox-v14-context-head h2 { font-size: var(--t-base); margin: 0; }
.inbox-v14-context-head p { margin: 2px 0 0; font-size: var(--t-xs); color: var(--muted); }
.inbox-v14-context-head > .material-symbols-outlined { color: var(--jade); margin-top: 3px; }
.inbox-v14-context-close { display: none; }
.inbox-v14-context-card dl { margin: 0; display: grid; }
.inbox-v14-context-card dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.inbox-v14-context-card dl > div:last-child { border-bottom: 0; }
.inbox-v14-context-card dt { color: var(--muted); font-size: var(--t-xs); flex: none; }
.inbox-v14-context-card dd { margin: 0; min-width: 0; font-size: var(--t-sm); font-weight: 600; text-align: end; }

/* composer */
.inbox-v14-send {
  justify-self: end; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; min-width: 120px; padding: 8px 18px;
  border: 1px solid var(--jade); border-radius: var(--r-control); background: var(--jade); color: #fff; font: 600 var(--t-sm)/1.2 var(--font); cursor: pointer;
}
.inbox-v14-send:hover { background: var(--jade-strong); border-color: var(--jade-strong); }
:root[data-theme="dark"] .inbox-v14-send { color: #062a22; }
.inbox-v14-send .material-symbols-outlined { font-size: 17px; transform: scaleX(-1); }

/* filter forms: one row that wraps */
:where(form[class*="filter"], .core-v4-filter-form) { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; }
:where(form[class*="filter"], .core-v4-filter-form) > :where(label, div) { flex: 1 1 170px; margin: 0; }
:where(form[class*="filter"], .core-v4-filter-form) > :where(button, .btn, input[type="submit"]) { flex: none; }
.core-v4-search { position: relative; flex: 2 1 280px; display: block; }
.core-v4-search > .material-symbols-outlined { position: absolute; inset-inline-start: 12px; bottom: 11px; color: var(--muted); pointer-events: none; }
.core-v4-search input { margin-top: 0; padding-inline-start: 38px; }
.core-v4-select > span { display: block; margin-bottom: 4px; font-size: var(--t-xs); color: var(--muted); }

/* ---------------------------------------------------------------- reports, persona, brain, data center */
.report-card h3, .health-card h3, .export-card h3 { font-size: var(--t-base); }
.cdc-source-map, .cdc-link-matrix { display: grid; gap: 10px; }
.cdc-token-once { padding: 12px; border: 1px dashed var(--amber); border-radius: var(--r-control); background: var(--amber-soft); font-family: var(--mono); direction: ltr; word-break: break-all; }
.cdc-company-switch { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bot-identity-fallback { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; background: var(--jade); color: #fff; font-size: 26px; font-weight: 700; }
.support-guide-ordered { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 6px; }

/* ---------------------------------------------------------------- login */
body[data-admin-page="login.php"] .stitch-sidebar, body[data-admin-page="login.php"] .stitch-topbar,
body[data-admin-page="register.php"] .stitch-sidebar, body[data-admin-page="register.php"] .stitch-topbar { display: none; }
body[data-admin-page="login.php"] .stitch-shell, body[data-admin-page="register.php"] .stitch-shell { grid-template-columns: 1fr; }
body[data-admin-page="login.php"] .stitch-main, body[data-admin-page="register.php"] .stitch-main { max-width: 980px; display: grid; place-items: center; min-height: 100vh; }
.login-card { width: min(920px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 0; overflow: hidden; }
.login-card > .flash { grid-column: 1 / -1; margin: 16px 16px 0; }
.login-hero { padding: 40px 36px; background: var(--rail); color: var(--rail-ink); display: grid; align-content: center; gap: 10px; }
.login-hero h2 { color: #fff; font-size: var(--t-xl); margin: 0; }
.login-hero p { color: var(--rail-muted); margin: 0; }
.login-hero a { color: #4fd1b0; }
.login-hero .badge { justify-self: start; background: var(--jade); color: #fff; box-shadow: none; }
.login-card > .form { padding: 36px; align-content: center; }
.login-card > .hint { grid-column: 2; padding: 0 36px 28px; color: var(--muted); font-size: var(--t-xs); }

/* ================================================================= v4 refinement layer
 * Depth, hierarchy and calibrated color on top of the same primitives. Every page inherits it. */
:root {
  --paper: #edf2f0;
  --sunken: #f4f7f6;
  --line: #e1e8e5;
  --line-strong: #cdd7d3;
  --r-panel: 16px;
  --r-control: 10px;
  --t-xl: 28px; --t-lg: 21px;
  --shadow-1: 0 1px 2px rgba(16, 26, 32, .04), 0 2px 8px rgba(16, 26, 32, .05);
  --shadow-2: 0 2px 6px rgba(16, 26, 32, .05), 0 16px 36px rgba(16, 26, 32, .09);
  --violet: #6a4fbf; --violet-soft: #efebfa;
  --glow: color-mix(in srgb, var(--jade) 16%, transparent);
}
:root[data-theme="dark"], body.theme-dark {
  --paper: #0c1215;
  --line: #233038;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 10px rgba(0, 0, 0, .25);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, .4), 0 18px 40px rgba(0, 0, 0, .45);
  --violet: #b4a1f0; --violet-soft: #241d3a;
}
body {
  background:
    radial-gradient(1100px 420px at 100% -12%, color-mix(in srgb, var(--jade) 10%, transparent), transparent 62%),
    radial-gradient(900px 380px at 0% -18%, color-mix(in srgb, var(--blue) 7%, transparent), transparent 60%),
    var(--paper);
  background-attachment: fixed;
}
h1 { letter-spacing: -.2px; }

/* the rail: graded surface, glowing active route */
.stitch-sidebar { background: linear-gradient(180deg, #13211f 0%, #0f181c 46%, #0d1418 100%); border-inline-end: 1px solid rgba(255, 255, 255, .04); }
:root[data-theme="dark"] .stitch-sidebar { background: linear-gradient(180deg, #0d1816 0%, #0a1114 100%); }
.stitch-brand-icon { background: linear-gradient(135deg, #18a283 0%, #0b7a63 100%); box-shadow: 0 6px 16px rgba(11, 122, 99, .35); }
.stitch-nav-link { transition: background-color .15s ease, color .15s ease; }
.stitch-nav-link.is-active { background: linear-gradient(270deg, rgba(55, 194, 161, .22) 0%, rgba(55, 194, 161, .07) 100%); box-shadow: inset 0 0 0 1px rgba(55, 194, 161, .18); }
.stitch-nav-link.is-active::before { background: #37c2a1; box-shadow: 0 0 12px rgba(55, 194, 161, .7); }
.stitch-nav-sublist { border-inline-start: 1px dashed rgba(255, 255, 255, .12); }
.stitch-nav-sublink.is-sub-active { background: rgba(255, 255, 255, .06); }
.stitch-nav-sublink.is-sub-active::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #37c2a1; margin-inline-end: 2px; flex: none; }
.stitch-user { background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.stitch-user-avatar { background: linear-gradient(135deg, #2c4a44, #1d2c31); box-shadow: 0 0 0 2px rgba(55, 194, 161, .45); }

/* topbar */
.stitch-topbar { min-height: 64px; background: color-mix(in srgb, var(--surface) 82%, transparent); border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
.stitch-search input { border-radius: var(--r-pill); background: var(--sunken); border-color: transparent; }
.stitch-search input:focus { background: var(--surface); border-color: var(--jade); }
.stitch-icon-btn { border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-1); border-color: transparent; }
.stitch-company-context { border-radius: 12px; box-shadow: var(--shadow-1); border-color: transparent; }

/* page heads: real hierarchy */
.stitch-page-head h1, .section-head h1, .gos-hub-hero h1, .core-v4-hero h1, .brain-hero h1, .setup-heading h1, .gos-ops-v3__hero-copy h1,
:where([class$="-hero"], [class*="-hero "], [class$="__hero"], [class*="__hero "], [class$="-page-head"]) h1 {
  font-size: var(--t-xl); font-weight: 700; line-height: 1.3; margin: 0 0 6px;
}
.stitch-page-head, .section-head, .gos-hub-hero, .core-v4-hero, .brain-hero { padding-block: 6px 4px; }
.stitch-page-head p, .section-head p, .gos-hub-hero p, .core-v4-hero p, .brain-hero p { font-size: var(--t-base); }

/* panels: raised surfaces */
.panel, .card-panel, .stitch-card, .cdc-panel, .setup-card, .admin-ui-card, .support-guide-card, .settings-section,
.health-card, .report-card, .export-card, .template-card, .gap-card, .note-card, .ai-diag-card, .brain-section,
.gos-ops-v3__panel, .settings-summary-card, .persona-preview, .core-v4-toolbar, .demo-panel, .card,
:where([class$="-card"], [class*="-card "], [class$="-panel"], [class*="-panel "], [class*="__readiness"]):where(:not(.notifications-panel)) {
  border-color: transparent; box-shadow: var(--shadow-1); border-radius: var(--r-panel); padding: 22px;
}
:root[data-theme="dark"] :is(.panel, .card-panel, .stitch-card, .cdc-panel, .setup-card, .settings-section, .gos-ops-v3__panel, .core-v4-toolbar) { border-color: var(--line); }
.stitch-card__header, .admin-ui-card-head, .cdc-panel-head, .gos-ops-v3__panel-head, .settings-section > header {
  padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--line);
}
.stitch-card__header h2, .stitch-card__header h3, .admin-ui-card-head h2, .admin-ui-card-head h3, .cdc-panel-head h2, .cdc-panel-head h3,
.gos-ops-v3__panel-head h2, .gos-ops-v3__panel-head h3, .panel > h2, .panel > h3, .card-panel > h2 { font-size: var(--t-md); font-weight: 700; }
:where(a):where([class$="-card"], [class*="-card "]) { transition: transform .15s ease, box-shadow .15s ease; }
:where(a):where([class$="-card"], [class*="-card "]):hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }

/* metrics: big numbers, tinted icon chips that vary by position */
.stat, .stat-card, .metric-card, .stitch-stat-card, .core-v4-metric, .report-kpi-card, .cdc-kpi, .gos-ops-v3__metric {
  padding: 20px; border-color: transparent; box-shadow: var(--shadow-1); border-radius: var(--r-panel); gap: 6px;
}
.stat strong, .stat-card strong, .metric-card strong, .stitch-stat-card strong, .core-v4-metric strong, .report-kpi-card strong, .cdc-kpi strong,
.gos-ops-v3__metric-value, .metric-value, .stat-value, .kpi-value { font-size: 30px; letter-spacing: -.5px; }
.core-v4-metric-icon, .report-kpi-icon, .gos-ops-v3__metric-icon, .metric-icon, .stat-card .material-symbols-outlined:first-child {
  width: 40px; height: 40px; border-radius: 12px; background: var(--jade-soft); color: var(--jade);
}
:is(.core-v4-metrics, .reports-kpi-grid, .gos-ops-v3__metrics, .stats-grid, .metric-grid, .cdc-grid, .brain-metrics) > :nth-child(4n+2) :is(.core-v4-metric-icon, .report-kpi-icon, .gos-ops-v3__metric-icon, .metric-icon) { background: var(--blue-soft); color: var(--blue); }
:is(.core-v4-metrics, .reports-kpi-grid, .gos-ops-v3__metrics, .stats-grid, .metric-grid, .cdc-grid, .brain-metrics) > :nth-child(4n+3) :is(.core-v4-metric-icon, .report-kpi-icon, .gos-ops-v3__metric-icon, .metric-icon) { background: var(--amber-soft); color: var(--amber); }
:is(.core-v4-metrics, .reports-kpi-grid, .gos-ops-v3__metrics, .stats-grid, .metric-grid, .cdc-grid, .brain-metrics) > :nth-child(4n+4) :is(.core-v4-metric-icon, .report-kpi-icon, .gos-ops-v3__metric-icon, .metric-icon) { background: var(--violet-soft); color: var(--violet); }
.core-v4-metric-icon .material-symbols-outlined, .report-kpi-icon .material-symbols-outlined, .gos-ops-v3__metric-icon .material-symbols-outlined { font-size: 20px; }

/* tables: comfortable rows */
.table-wrap, .cdc-table-wrap, .table-responsive, .support-guide-table-wrap { border-color: transparent; box-shadow: var(--shadow-1); border-radius: var(--r-panel); }
th { padding-block: 12px; background: var(--sunken); }
td { padding-block: 13px; }
tbody tr { transition: background-color .12s ease; }
tbody tr:hover td { background: color-mix(in srgb, var(--jade-soft) 45%, transparent); }
td:first-child { font-weight: 600; color: var(--ink); }

/* buttons with depth */
.btn, .setup-btn, .stitch-btn, .core-v4-btn, .inbox-v14-btn, .gos-ops-v3__btn, .admin-ui-small-btn, button:not([class]) {
  min-height: 42px; border-radius: var(--r-control); border-color: var(--line-strong); box-shadow: 0 1px 2px rgba(16, 26, 32, .05);
}
.btn-primary, .btn.primary, .setup-btn.primary, .stitch-btn.primary, .core-v4-btn-primary, .inbox-v14-btn.primary, .gos-ops-v3__btn.primary, input[type="submit"], .btn-success, .inbox-v14-send {
  background: linear-gradient(180deg, #129a7c 0%, var(--jade) 100%); border-color: var(--jade);
  box-shadow: 0 1px 2px rgba(11, 122, 99, .25), 0 6px 16px rgba(11, 122, 99, .22), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover, .btn.primary:hover, .core-v4-btn-primary:hover, input[type="submit"]:hover, .inbox-v14-send:hover { background: linear-gradient(180deg, var(--jade) 0%, var(--jade-strong) 100%); }
:root[data-theme="dark"] :is(.btn-primary, .btn.primary, .core-v4-btn-primary, input[type="submit"], .inbox-v14-send) { background: linear-gradient(180deg, #4fd1b0 0%, var(--jade) 100%); }

/* fields */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="color"]),
select, textarea { min-height: 44px; border-radius: var(--r-control); border-color: var(--line-strong); background-color: var(--surface); box-shadow: inset 0 1px 1px rgba(16, 26, 32, .03); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 4px var(--glow); }

/* pills with a status dot */
:is(.status-pill, .stitch-pill, .badge):is(.good, .ok, .success, .is-success, .warn, .warning, .danger, .error, .is-error)::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none;
}

/* empty states */
.empty, .inbox-v14-empty, .inbox-v14-list-empty, .inbox-v14-context-empty, .inbox-v14-thread-empty, .core-v4-empty-mini, .core-v4-filter-empty {
  border: 1px dashed var(--line-strong); background: color-mix(in srgb, var(--surface) 60%, transparent); padding: 32px 20px;
}
.empty .material-symbols-outlined, .inbox-v14-empty .material-symbols-outlined, .core-v4-empty-mini .material-symbols-outlined {
  width: 56px; height: 56px; padding: 14px; border-radius: 50%; background: var(--jade-soft); color: var(--jade); font-size: 28px;
}

/* daily work: inbox panes and the board */
.inbox-v14-sidebar, .inbox-v14-chat, .inbox-v14-context { border-color: transparent; box-shadow: var(--shadow-1); border-radius: var(--r-panel); }
.inbox-v14-card.is-selected, .inbox-v14-card.is-current, .inbox-v14-card.active, .inbox-v14-list .is-selected { background: var(--jade-soft); box-shadow: inset -3px 0 0 var(--jade); }
.inbox-v14-thread { background:
  radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 6%, transparent) 1px, transparent 0) 0 0 / 18px 18px, var(--sunken); }
.inbox-v14-bubble { box-shadow: 0 1px 2px rgba(16, 26, 32, .06); }
.core-v4-kanban-column { background: color-mix(in srgb, var(--surface) 55%, transparent); border-color: transparent; box-shadow: inset 0 0 0 1px var(--line); border-top: 3px solid var(--blue); }
.core-v4-kanban > :nth-child(2) { border-top-color: var(--amber); }
.core-v4-kanban > :nth-child(3) { border-top-color: var(--violet); }
.core-v4-kanban > :nth-child(4) { border-top-color: var(--jade); }
.core-v4-ticket-card { border-color: transparent; box-shadow: var(--shadow-1); border-radius: 12px; transition: transform .15s ease, box-shadow .15s ease; }
.core-v4-ticket-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }

/* dashboard ring */
.gos-ops-v3__progress-ring { background: conic-gradient(from 200deg, #37c2a1 0, var(--jade) var(--p), var(--line) 0); filter: drop-shadow(0 4px 10px rgba(11, 122, 99, .18)); }
.gos-ops-v3__chart-stack { background: linear-gradient(180deg, #37c2a1, var(--jade)); border-radius: 6px 6px 0 0; }

/* login */
.login-card { box-shadow: var(--shadow-2); border-color: transparent; }
.login-hero { background: radial-gradient(500px 300px at 100% 0%, rgba(55, 194, 161, .28), transparent 60%), linear-gradient(180deg, #13211f, #0d1418); }

/* the readiness card is one surface: its inner parts are layout only */
.gos-ops-v3__readiness-top, .gos-ops-v3__readiness-body, .gos-ops-v3__readiness-meta {
  padding: 0; background: none; border: 0; box-shadow: none; border-radius: 0;
}
.gos-ops-v3__readiness-top { padding-bottom: 12px; border-bottom: 1px solid var(--line); }

/* ================================================================= v5 navigation and menus */
:root { --rail-w: 288px; --rail-w-collapsed: 84px; }

/* rail surface */
.stitch-sidebar {
  background:
    radial-gradient(520px 280px at 100% 0%, rgba(55, 194, 161, .17), transparent 62%),
    radial-gradient(420px 320px at 0% 100%, rgba(47, 93, 138, .16), transparent 60%),
    linear-gradient(180deg, #10221f 0%, #0e1a1d 42%, #0b1316 100%);
}
.stitch-sidebar-main { padding: 18px 14px 10px; }
.stitch-brand { padding: 4px 6px 18px; margin-bottom: 14px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.stitch-brand-icon { width: 42px; height: 42px; border-radius: 13px; }
.stitch-brand-copy h1 { font-size: 17px; }

/* section label with a fading rule */
.stitch-nav-heading { display: flex; align-items: center; gap: 10px; padding: 4px 10px 10px; font-size: 11.5px; font-weight: 600; color: rgba(223, 231, 227, .5); }
.stitch-nav-heading::after { content: ""; flex: 1; height: 1px; background: linear-gradient(270deg, rgba(255, 255, 255, .12), transparent); }

/* items: icon tiles, glowing active tile */
.stitch-nav { gap: 4px; }
.stitch-nav-group { border-radius: 14px; transition: background-color .2s ease, box-shadow .2s ease; }
.stitch-nav-group.is-expanded { background: rgba(255, 255, 255, .035); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .045); padding-bottom: 6px; }
.stitch-nav-link { min-height: 48px; gap: 12px; padding: 7px 8px; border-radius: 12px; font-size: 14.5px; color: #d4dfda; }
.stitch-nav-link:hover { background: rgba(255, 255, 255, .05); }
.stitch-nav-leading {
  width: 34px; height: 34px; flex: none; border-radius: 10px; background: rgba(255, 255, 255, .06); color: #b4c6bf;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.stitch-nav-leading .material-symbols-outlined { font-size: 19px; }
.stitch-nav-link:hover .stitch-nav-leading { background: rgba(255, 255, 255, .11); color: #fff; }
.stitch-nav-link.is-active { background: none; box-shadow: none; color: #fff; font-weight: 600; }
.stitch-nav-link.is-active .stitch-nav-leading {
  background: linear-gradient(135deg, #2fd4ab 0%, #0b7a63 100%); color: #fff;
  box-shadow: 0 6px 18px rgba(19, 170, 133, .45), inset 0 1px 0 rgba(255, 255, 255, .25);
}
:root:not([data-theme="dark"]) .stitch-nav-link.is-active .stitch-nav-leading { color: #fff; }
.stitch-nav-link.is-active::before { top: 10px; bottom: 10px; inset-inline-start: -14px; width: 4px; }
.stitch-nav-toggle { width: 30px; height: 30px; border-radius: 9px; }

/* sub-menus: a tree with branches */
.stitch-nav-sublist { margin-inline-start: 25px; padding: 4px 0; border-inline-start: 1px solid rgba(255, 255, 255, .1); }
.stitch-nav-sublink {
  position: relative; margin-inline-start: 12px; min-height: 36px; padding: 7px 12px; border-radius: 10px;
  font-size: 13.5px; color: rgba(223, 231, 227, .72); transition: background-color .15s ease, color .15s ease;
}
.stitch-nav-sublink::after { content: ""; position: absolute; inset-inline-start: -13px; top: 50%; width: 11px; height: 1px; background: rgba(255, 255, 255, .14); }
.stitch-nav-sublink:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.stitch-nav-sublink.is-sub-active { background: linear-gradient(270deg, rgba(55, 194, 161, .2), rgba(55, 194, 161, .06)); color: #fff; font-weight: 600; }
.stitch-nav-sublink.is-sub-active::after { background: #37c2a1; height: 2px; }
.stitch-sub-leading { width: 18px; font-size: 16px; opacity: .85; }
.stitch-sub-icon { display: none; }

/* user card with presence */
.stitch-user { margin: 12px 14px 16px; padding: 12px; border-radius: 16px; }
.stitch-user-avatar { position: relative; width: 40px; height: 40px; }
.stitch-user-avatar::after { content: ""; position: absolute; bottom: 0; inset-inline-end: 0; width: 10px; height: 10px; border-radius: 50%; background: #37c2a1; box-shadow: 0 0 0 2px #0e171a; }
.stitch-user-actions { gap: 6px; margin-top: 6px; }
.stitch-user-actions a { padding: 2px 10px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .07); font-size: 11.5px; }
.stitch-user-actions a:hover { background: rgba(255, 255, 255, .13); text-decoration: none; }
.stitch-user-actions a.is-danger { background: rgba(242, 134, 124, .13); color: #f6b3ab; }

/* collapsed rail: tooltips and flyout sub-menus */
@media (min-width: 1025px) {
  body.sidebar-collapsed .stitch-sidebar { overflow: visible; }
  body.sidebar-collapsed .stitch-sidebar-main { padding-inline: 10px; }
  body.sidebar-collapsed .stitch-nav-group, body.sidebar-collapsed .stitch-nav-group.is-expanded { position: relative; background: none; box-shadow: none; padding: 0; }
  body.sidebar-collapsed .stitch-nav-link { justify-content: center; padding: 7px 0; }
  body.sidebar-collapsed .stitch-nav-group:not(:has(.stitch-nav-sublist)) .stitch-nav-link:hover::after,
  body.sidebar-collapsed .stitch-nav-link:focus-visible::after {
    content: attr(data-nav-label); position: absolute; inset-inline-start: calc(100% + 12px); top: 50%; transform: translateY(-50%); z-index: 90;
    padding: 6px 12px; border-radius: 9px; background: #0b1316; color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; box-shadow: var(--float);
  }
  body.sidebar-collapsed .stitch-nav-group:hover .stitch-nav-sublist,
  body.sidebar-collapsed .stitch-nav-group:focus-within .stitch-nav-sublist {
    display: block; position: absolute; inset-inline-start: calc(100% - 4px); top: 0; z-index: 90; min-width: 240px;
    margin: 0; padding: 8px; border: 0; border-radius: 14px; background: linear-gradient(180deg, #13221f, #0d1518);
    box-shadow: var(--float), inset 0 0 0 1px rgba(255, 255, 255, .06);
  }
  body.sidebar-collapsed .stitch-nav-sublist::before { content: attr(aria-label); display: block; padding: 4px 10px 8px; margin-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, .08); color: rgba(223, 231, 227, .55); font-size: 11.5px; font-weight: 600; }
  body.sidebar-collapsed .stitch-nav-sublink { margin-inline-start: 0; }
  body.sidebar-collapsed .stitch-nav-sublink::after { display: none; }
}

/* company switcher: live workspace pill */
.stitch-company-context { padding: 5px 12px 5px 8px; gap: 10px; transition: box-shadow .15s ease; }
.stitch-company-context:hover { box-shadow: var(--shadow-2); }
.stitch-company-context-dot { width: 10px; height: 10px; animation: relay-live 2.4s ease-out infinite; }
@keyframes relay-live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--jade) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

/* global search: a command palette */
.stitch-search-results { width: min(520px, 92vw); inset-inline: auto 0; padding: 8px; border-radius: 16px; border: 0; box-shadow: var(--shadow-2), 0 0 0 1px var(--line); }
.stitch-search-results::after { content: "استخدم الأسهم للتنقل وEnter للفتح"; display: block; padding: 8px 10px 2px; margin-top: 6px; border-top: 1px solid var(--line); color: var(--faint); font-size: 11.5px; }
.stitch-search-result { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; color: var(--ink); }
.stitch-search-result:hover, .stitch-search-result.is-selected { background: var(--jade-soft); text-decoration: none; box-shadow: inset -3px 0 0 var(--jade); }
.stitch-search-result-icon { width: 36px; height: 36px; padding: 8px; border-radius: 11px; background: var(--sunken); color: var(--ink-2); font-size: 20px; }
.stitch-search-result.is-selected .stitch-search-result-icon { background: var(--jade); color: #fff; }
.stitch-search-result-copy { display: grid; line-height: 1.35; min-width: 0; }
.stitch-search-result-copy b { font-size: var(--t-sm); font-weight: 600; }
.stitch-search-result-copy small { color: var(--muted); font-size: 11.5px; }

/* notifications */
.notifications-panel { width: min(400px, 94vw); border: 0; border-radius: 18px; box-shadow: var(--shadow-2), 0 0 0 1px var(--line); }
.notifications-panel__header { padding: 16px 18px; background: linear-gradient(180deg, var(--jade-soft), transparent); }
.notifications-panel__header h2 { font-size: var(--t-md); font-weight: 700; }
.notifications-panel > :not(header) { max-height: 60vh; overflow: auto; }
.notifications-panel :is(ul, ol) { list-style: none; margin: 0; padding: 6px; }
.notifications-panel :is(li, a):not(.notifications-panel__more) { border-radius: 12px; }
.notifications-panel li > a, .notifications-panel > div > a { display: flex; gap: 10px; padding: 10px 12px; color: var(--ink); }
.notifications-panel li > a:hover, .notifications-panel > div > a:hover { background: var(--sunken); text-decoration: none; }
.notifications-settings-menu { border: 0; border-radius: 14px; box-shadow: var(--shadow-2), 0 0 0 1px var(--line); }
.notifications-settings-menu button { border-radius: 10px; }
.notifications-settings-menu button:hover { background: var(--jade-soft); }

.notifications-panel { overflow: hidden; }
.notifications-panel__list { max-height: 60vh; overflow: auto; padding: 6px; display: grid; gap: 2px; }
.notifications-panel__list > a, .notifications-panel__item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--ink); }
.notifications-panel__list > a:hover, .notifications-panel__item:hover { background: var(--sunken); text-decoration: none; }
.notifications-panel__empty { display: grid; justify-items: center; gap: 4px; padding: 26px 18px; text-align: center; }
.notifications-panel__empty::before {
  content: ""; width: 48px; height: 48px; margin-bottom: 6px; border-radius: 50%;
  background: var(--jade-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b7a63' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8a6 6 0 1 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/%3E%3Cpath d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/%3E%3C/svg%3E") center / 24px no-repeat;
}
.notifications-panel__empty strong { display: block; font-size: var(--t-sm); font-weight: 700; color: var(--ink); }
.notifications-panel__empty span { display: block; color: var(--muted); font-size: var(--t-xs); }
.notifications-panel__footer {
  max-height: none; overflow: visible; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--line); background: var(--sunken); font-size: var(--t-xs);
}
.browser-notify-status { min-width: 0; color: var(--muted); }
.notifications-panel__footer a { flex: none; font-weight: 600; }

/* in-page menus: segmented tabs with a raised active item */
.inbox-v14-tabs, .cdc-tabs, .report-segmented { padding: 4px; gap: 4px; background: var(--sunken); border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.inbox-v14-tabs :is(a, button), .cdc-tabs :is(a, button) { border: 0; background: transparent; border-radius: 9px; min-height: 32px; }
.inbox-v14-tabs :is(.is-active, .active), .cdc-tabs :is(.is-active, .active, [aria-current="page"]) { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.core-v4-filter { border-color: transparent; background: var(--surface); box-shadow: var(--shadow-1); }
.core-v4-filter:is(.is-active, .active) { background: var(--ink); color: var(--surface); }

/* mobile drawer */
@media (max-width: 1024px) {
  .stitch-sidebar { width: min(320px, 88vw); border-start-end-radius: 22px; border-end-end-radius: 22px; }
  .stitch-sidebar-overlay { backdrop-filter: blur(3px); background: rgba(8, 14, 17, .5); }
  .stitch-mobile-menu { border-color: transparent; box-shadow: var(--shadow-1); border-radius: 12px; }
}

/* ================================================================= hub pages
 * Quality & Development, Control Center and Administration Center share these components
 * (admin/includes/ui/command_center.php): hero, metrics, and sections of action rows. */
.gos-hub-hero {
  align-items: center; padding: 26px 28px; margin-bottom: 4px; border-radius: 20px;
  background: radial-gradient(560px 260px at 0% 0%, color-mix(in srgb, var(--jade) 13%, transparent), transparent 70%), var(--surface);
  box-shadow: var(--shadow-1);
}
.gos-hub-hero > div:first-child { flex: 1 1 520px; display: grid; gap: 6px; min-width: 0; }
.gos-hub-hero small { color: var(--jade); font-weight: 600; font-size: var(--t-xs); }
.gos-hub-hero h1 { margin: 0; }
.gos-hub-hero p { margin: 0; max-width: 72ch; color: var(--muted); font-size: var(--t-base); }
.gos-hub-hero__actions { flex: none; }

.gos-hub-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--gap); }
.gos-hub-metric {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 14px;
  padding: 18px 20px; background: var(--surface); border-radius: var(--r-panel); box-shadow: var(--shadow-1);
}
.gos-hub-metric > .material-symbols-outlined { width: 46px; height: 46px; padding: 11px; border-radius: 14px; background: var(--jade-soft); color: var(--jade); font-size: 22px; }
.gos-hub-metrics > :nth-child(4n+2) > .material-symbols-outlined { background: var(--blue-soft); color: var(--blue); }
.gos-hub-metrics > :nth-child(4n+3) > .material-symbols-outlined { background: var(--amber-soft); color: var(--amber); }
.gos-hub-metrics > :nth-child(4n+4) > .material-symbols-outlined { background: var(--violet-soft); color: var(--violet); }
.gos-hub-metric > div { display: grid; min-width: 0; }
.gos-hub-metric small { color: var(--muted); font-size: var(--t-xs); }
.gos-hub-metric strong { font-size: 24px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.gos-hub-metric p { grid-column: 1 / -1; margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--t-xs); line-height: 1.6; }

.gos-hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.gos-hub-section { overflow: hidden; background: var(--surface); border-radius: var(--r-panel); box-shadow: var(--shadow-1); }
.gos-hub-section > header {
  display: flex; align-items: flex-start; gap: 14px; margin: 0; padding: 18px 20px;
  border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--sunken), transparent);
}
.gos-hub-section > header > .material-symbols-outlined { flex: none; width: 42px; height: 42px; padding: 10px; border-radius: 13px; background: var(--jade-soft); color: var(--jade); font-size: 22px; }
.gos-hub-grid > :nth-child(4n+2) > header > .material-symbols-outlined { background: var(--blue-soft); color: var(--blue); }
.gos-hub-grid > :nth-child(4n+3) > header > .material-symbols-outlined { background: var(--violet-soft); color: var(--violet); }
.gos-hub-grid > :nth-child(4n+4) > header > .material-symbols-outlined { background: var(--amber-soft); color: var(--amber); }
.gos-hub-section > header > div { min-width: 0; }
.gos-hub-section > header h2 { margin: 0 0 2px; font-size: var(--t-md); font-weight: 700; }
.gos-hub-section > header p { margin: 0; color: var(--muted); font-size: var(--t-sm); }
.gos-hub-actions { display: grid; gap: 0; padding: 6px; }
.gos-hub-actions > a {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px; color: var(--ink); text-decoration: none; transition: background-color .15s ease;
}
.gos-hub-actions > a + a { box-shadow: inset 0 1px 0 var(--line); }
.gos-hub-actions > a:hover, .gos-hub-actions > a:focus-visible { background: var(--jade-soft); box-shadow: none; text-decoration: none; }
.gos-hub-actions > a:hover + a { box-shadow: none; }
.gos-hub-actions > a > .material-symbols-outlined { width: 38px; height: 38px; padding: 9px; border-radius: 11px; background: var(--sunken); color: var(--ink-2); font-size: 20px; transition: background-color .15s ease, color .15s ease; }
.gos-hub-actions > a:hover > .material-symbols-outlined { background: var(--surface); color: var(--jade); }
.gos-hub-actions > a > span:nth-of-type(2) { display: grid; gap: 1px; min-width: 0; }
.gos-hub-actions b { font-size: var(--t-sm); font-weight: 600; }
.gos-hub-actions small { color: var(--muted); font-size: var(--t-xs); line-height: 1.55; }
.gos-hub-actions em {
  display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 2px 10px; border-radius: var(--r-pill);
  background: var(--sunken); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
  font-style: normal; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.gos-hub-actions em::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.gos-hub-actions em.is-ok { background: var(--jade-soft); color: var(--jade); box-shadow: none; }
.gos-hub-actions em.is-warn { background: var(--amber-soft); color: var(--amber); box-shadow: none; }
.gos-hub-actions em:is(.is-bad, .is-danger, .is-error) { background: var(--red-soft); color: var(--red); box-shadow: none; }
@media (max-width: 1100px) { .gos-hub-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .gos-hub-hero { padding: 20px; }
  .gos-hub-hero__actions { width: 100%; }
  .gos-hub-actions > a { grid-template-columns: auto minmax(0, 1fr); }
  .gos-hub-actions em { grid-column: 2; justify-self: start; }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1280px) {
  .stitch-company-context-copy small { display: none; }
  .stitch-search { width: min(260px, 26vw); }
  .five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .four, .stitch-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inbox-v14-shell { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); grid-template-areas: "list chat" "context context"; height: auto; }
  .inbox-v14-sidebar, .inbox-v14-chat { height: calc(100vh - var(--topbar-h) - 72px); min-height: 520px; }
}
@media (max-width: 1024px) {
  .gos-ops-v3__main-grid { grid-template-columns: minmax(0, 1fr); }
  .stitch-shell, body.sidebar-collapsed .stitch-shell { grid-template-columns: minmax(0, 1fr); }
  .stitch-sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 70; width: min(300px, 86vw);
    transform: translateX(100%); transition: transform .22s ease; box-shadow: none;
  }
  body.mobile-sidebar-open .stitch-sidebar { transform: none; box-shadow: var(--float); }
  body.sidebar-collapsed .stitch-brand-copy, body.sidebar-collapsed .stitch-nav-title, body.sidebar-collapsed .stitch-nav-toggle,
  body.sidebar-collapsed .stitch-user-meta, body.sidebar-collapsed .stitch-nav-heading { display: revert; }
  body.sidebar-collapsed .stitch-nav-group.is-expanded .stitch-nav-sublist { display: block; }
  body.sidebar-collapsed .stitch-nav-link { justify-content: flex-start; padding-inline: 10px; }
  body.sidebar-collapsed .stitch-brand { flex-direction: row; }
  .stitch-sidebar-collapse { display: none; }
  .stitch-sidebar-overlay { position: fixed; inset: 0; z-index: 65; border: 0; background: rgba(10, 16, 19, .45); }
  body.mobile-sidebar-open .stitch-sidebar-overlay { display: block; }
  .stitch-mobile-menu {
    display: grid; place-items: center; width: 40px; height: 40px; flex: none;
    border: 1px solid var(--line); border-radius: var(--r-control); background: var(--surface); color: var(--ink); cursor: pointer;
  }
  .stitch-topbar { padding: 8px 16px; }
  .stitch-main { padding: 18px 16px 40px; }
  .three, .air-ops-row--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  :root { --t-xl: 21px; --t-lg: 18px; }
  :where(.stitch-main) :not(.table-wrap, .cdc-table-wrap, .table-responsive, .support-guide-table-wrap) > table { display: block; overflow-x: auto; }
  .stitch-topbar { flex-wrap: wrap; gap: 8px; }
  .stitch-topbar-context { flex: 1 1 100%; }
  .stitch-company-context { margin-inline-start: auto; }
  .stitch-company-context-copy small { display: none; }
  .stitch-topbar-tools { flex: 1 1 100%; }
  .stitch-search { flex: 1; width: auto; }
  .stitch-search kbd { display: none; }
  .two, .cdc-two, .stitch-two-col, .grid-2, .stitch-grid--2, .split-layout, .air-ops-row, .three, .air-ops-row--3,
  .four, .stitch-grid--4, .five { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .stats-grid, .metric-grid, .core-v4-metrics, .brain-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel, .card-panel, .stitch-card, .cdc-panel, .setup-card { padding: 16px; }
  .stitch-page-head, .section-head, .gos-hub-hero, .core-v4-hero, .brain-hero { align-items: stretch; }
  .stitch-page-actions, .core-v4-hero-actions, .gos-hub-hero__actions, .brain-hero-actions { width: 100%; }
  .inbox-v14-shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "list" "chat" "context"; }
  .inbox-v14-shell:has(.inbox-v14-chat-head) { grid-template-areas: "chat" "list" "context"; }
  .inbox-v14-sidebar { height: auto; max-height: 70vh; min-height: 0; }
  .inbox-v14-chat { height: auto; min-height: 60vh; }
  .inbox-v14-bubble { max-width: 92%; }
  .login-card { grid-template-columns: 1fr; }
  .login-card > .hint { grid-column: 1; }
  .login-hero, .login-card > .form { padding: 24px; }
  th, td { padding: 9px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
}
@media print {
  .stitch-sidebar, .stitch-topbar, .stitch-sidebar-overlay { display: none; }
  .stitch-shell { display: block; }
  body { background: #fff; }
}
