/* BTI Portal — adapted from the BraveThinkingAI Admin Portal design system. */
@font-face { font-family: "Roboto Condensed"; src: url("/assets/fonts/roboto-condensed-light.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Roboto Condensed"; src: url("/assets/fonts/roboto-condensed-regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Roboto Condensed"; src: url("/assets/fonts/roboto-condensed-bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Roboto Condensed"; src: url("/assets/fonts/roboto-condensed-bold.ttf") format("truetype"); font-weight: 800 900; font-display: swap; }

:root {
  --navy-900: #000541;
  --navy-800: #01143f;
  --navy-700: #002060;
  --navy-600: #0a2a6e;
  --navy-ink: #01021e;
  --gold-500: #ffb72a;
  --gold-600: #e09e18;
  --gold-400: #ffc958;
  --gold-100: #fff2d4;
  --teal-500: #3e94a9;
  --magenta-500: #f63182;
  --violet-500: #a34ec4;
  --blue-accent: #4876ff;
  --paper: #fbfaf6;
  --stone-50: #f4f2ec;
  --stone-100: #e8e5dc;
  --stone-200: #d3cec0;
  --stone-300: #a8a193;
  --stone-400: #756f62;
  --stone-500: #4a463d;
  --success: #2e7d5b;
  --warning: #c47a00;
  --error: #c00000;
  --font-display: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  --font-body: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg-app: #f6f4ee;
  --bg-surface: #ffffff;
  --bg-subtle: #fbfaf6;
  --bg-sunken: #f0ede4;
  --bg-row-hover: #f7f4eb;
  --bg-sidebar: #0a1438;
  --bg-sidebar-hover: rgba(255, 255, 255, 0.06);
  --bg-sidebar-active: rgba(255, 183, 42, 0.14);
  --fg-1: #0b1740;
  --fg-2: #4a463d;
  --fg-3: #756f62;
  --fg-sidebar: #e6eaf5;
  --fg-sidebar-muted: #8992b3;
  --fg-sidebar-active: #ffb72a;
  --stroke-1: rgba(10, 25, 80, 0.10);
  --stroke-2: rgba(10, 25, 80, 0.18);
  --stroke-sidebar: rgba(255, 255, 255, 0.08);
  --accent: #ffb72a;
  --accent-ink: #0b1740;
  --shadow-xs: 0 1px 2px rgba(0, 12, 46, 0.06);
  --shadow-sm: 0 2px 8px rgba(0, 12, 46, 0.08);
  --shadow-md: 0 10px 28px rgba(0, 12, 46, 0.12);
  --shadow-lg: 0 22px 48px rgba(0, 12, 46, 0.18);
  --chip-bg: #f0ede4;
  --chip-fg: #4a463d;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-app: #060b22;
  --bg-surface: #0e1637;
  --bg-subtle: #0a1231;
  --bg-sunken: #040826;
  --bg-row-hover: #142050;
  --bg-sidebar: #030722;
  --bg-sidebar-hover: rgba(255, 255, 255, 0.05);
  --bg-sidebar-active: rgba(255, 183, 42, 0.14);
  --fg-1: #f1f3fb;
  --fg-2: #b5bcd7;
  --fg-3: #7a83a8;
  --fg-sidebar: #e6eaf5;
  --fg-sidebar-muted: #7a83a8;
  --fg-sidebar-active: #ffb72a;
  --stroke-1: rgba(255, 255, 255, 0.08);
  --stroke-2: rgba(255, 255, 255, 0.16);
  --stroke-sidebar: rgba(255, 255, 255, 0.06);
  --accent: #ffb72a;
  --accent-ink: #0b1740;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.40);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.50);
  --shadow-lg: 0 22px 48px rgba(0, 0, 0, 0.60);
  --chip-bg: rgba(255, 255, 255, 0.06);
  --chip-fg: #b5bcd7;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; margin: 0; overflow-x: clip; }
body {
  min-width: 320px;
  font-family: var(--font-body);
  color: var(--fg-1);
  background: var(--bg-app);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.env-banner {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  padding: 6px 0;
  color: #0b1740;
  background: #f5b400;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5 { margin: 0; color: var(--fg-1); font-family: var(--font-display); }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--stroke-2); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--fg-3); background-clip: padding-box; border: 2px solid transparent; }
:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; border-radius: 6px; }

.shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg-app);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 14px 14px;
  background: var(--bg-sidebar);
  color: var(--fg-sidebar);
  border-right: 1px solid var(--stroke-sidebar);
}
.brand {
  display: grid;
  gap: 3px;
  padding: 0 6px 18px;
  border-bottom: 1px solid var(--stroke-sidebar);
  color: var(--fg-sidebar);
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.005em;
}
.brand::after {
  content: "BRAVE THINKING INSTITUTE";
  color: var(--fg-sidebar-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sidebar nav { display: grid; gap: 15px; }
.nav-section { display: grid; gap: 5px; }
.nav-section h2 {
  margin: 0 0 2px;
  padding: 0 12px;
  color: var(--fg-sidebar-muted);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}
.sidebar nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 10px 12px 10px 14px;
  border-radius: 8px;
  color: var(--fg-sidebar);
  font-size: 14px;
  font-weight: 500;
  transition: background 120ms, color 120ms;
}
.sidebar nav a .nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--fg-sidebar-muted);
}
.sidebar nav a > span { min-width: 0; }
.sidebar nav a:hover { background: var(--bg-sidebar-hover); }
.sidebar nav a.active {
  background: var(--bg-sidebar-active);
  color: var(--fg-sidebar-active);
}
.sidebar nav a.active .nav-icon { color: var(--fg-sidebar-active); }
.sidebar nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 999px;
  background: var(--gold-500);
}
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(360px, 520px) max-content;
  align-items: center;
  gap: 18px;
  min-height: 74px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--stroke-1);
  background: color-mix(in oklab, var(--bg-app) 88%, transparent);
  backdrop-filter: blur(14px);
}
.topbar-title {
  min-width: 0;
}
.topbar h1 {
  margin: 3px 0 0;
  font-size: clamp(25px, 2.5vw, 38px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-customer-search {
  justify-self: center;
  width: min(100%, 520px);
  min-width: 0;
}
.topbar-search-wrap {
  width: 100%;
}
.topbar-search-wrap input {
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--stroke-2);
  border-radius: 999px;
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--bg-surface) 98%, white), color-mix(in oklab, var(--bg-subtle) 92%, var(--bg-sunken)));
  color: var(--fg-1);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  font-weight: 700;
  outline: none;
}
.topbar-search-wrap input::placeholder {
  color: var(--fg-3);
  font-weight: 700;
}
.topbar-search-wrap input:focus {
  border-color: color-mix(in oklab, var(--gold-500) 58%, var(--stroke-2));
  box-shadow:
    0 0 0 3px color-mix(in oklab, var(--gold-500) 16%, transparent),
    var(--shadow-sm);
}
.topbar-search-icon {
  position: absolute;
  z-index: 1;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-3);
  pointer-events: none;
}
.topbar-autocomplete-panel {
  top: calc(100% + 10px);
  max-height: min(520px, calc(100vh - 118px));
}
:root[data-theme="dark"] .topbar-search-wrap input {
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--bg-surface) 92%, white), color-mix(in oklab, var(--bg-subtle) 92%, black));
}
.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}
main { padding: 24px 28px 48px; }
.ui-icon {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: currentColor;
}
.ui-icon.sm { width: 15px; height: 15px; }

.eyebrow {
  margin: 0;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.muted, small { color: var(--fg-3); }
.divider { height: 1px; margin: 0; border: 0; background: var(--stroke-1); }

.button, button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--stroke-2);
  background: var(--bg-surface);
  color: var(--fg-1);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: background 120ms, transform 80ms, border-color 120ms, box-shadow 120ms;
}
.button:hover, button:hover, .btn:hover { background: var(--bg-row-hover); }
.button:active, button:active, .btn:active { transform: translateY(1px); }
.button:disabled, button:disabled, .btn:disabled {
  cursor: not-allowed;
  opacity: .56;
  transform: none;
}
.button:disabled:hover, button:disabled:hover, .btn:disabled:hover {
  background: var(--bg-surface);
  border-color: var(--stroke-2);
}
.button.primary, button.primary, .btn.primary {
  background: var(--gold-500);
  border-color: var(--gold-500);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.button.primary:hover, button.primary:hover, .btn.primary:hover { background: var(--gold-600); border-color: var(--gold-600); }
.button.primary:disabled:hover, button.primary:disabled:hover, .btn.primary:disabled:hover {
  background: var(--gold-500);
  border-color: var(--gold-500);
}
.button.danger, button.danger, .btn.danger {
  border-color: color-mix(in oklab, var(--error) 36%, var(--stroke-2));
  background: color-mix(in oklab, var(--error) 9%, var(--bg-surface));
  color: var(--error);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.button.danger:hover, button.danger:hover, .btn.danger:hover {
  border-color: var(--error);
  background: color-mix(in oklab, var(--error) 14%, var(--bg-surface));
}
.button.ghost, .btn.ghost { background: transparent; border-color: transparent; }
.button.ghost:hover, .btn.ghost:hover { background: var(--bg-row-hover); }
.button.icon-only, .btn.icon-only {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
}
.topbar-button, button.topbar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-width: 86px;
  height: 38px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--stroke-2);
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg-surface) 96%, white), var(--bg-subtle));
  color: var(--fg-1);
  box-shadow: var(--shadow-xs);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}
.topbar-button:hover, button.topbar-button:hover {
  border-color: color-mix(in oklab, var(--gold-500) 42%, var(--stroke-2));
  background: color-mix(in oklab, var(--gold-500) 9%, var(--bg-surface));
  color: var(--fg-1);
}
.topbar-button:active, button.topbar-button:active { transform: translateY(1px); }
.theme-button, button.theme-button {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-color: color-mix(in oklab, var(--stroke-2) 74%, var(--fg-3));
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--bg-surface) 98%, white), color-mix(in oklab, var(--bg-subtle) 92%, var(--bg-sunken)));
  color: var(--fg-1);
  box-shadow: var(--shadow-sm);
}
.theme-button__icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid color-mix(in oklab, var(--gold-500) 32%, var(--stroke-2));
  border-radius: 999px;
  background: color-mix(in oklab, var(--gold-500) 10%, var(--bg-surface));
  color: var(--gold-600);
}
.theme-button .theme-icon {
  grid-area: 1 / 1;
  width: 15px;
  height: 15px;
  stroke-width: 2;
}
.theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: none; }
:root[data-theme="dark"] .theme-icon-light { display: block; }
:root[data-theme="dark"] .theme-button {
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--bg-surface) 92%, white), color-mix(in oklab, var(--bg-subtle) 92%, black));
  color: var(--fg-1);
}
:root[data-theme="dark"] .theme-button__icon {
  color: var(--gold-500);
  background: rgba(255, 183, 42, 0.12);
  border-color: rgba(255, 183, 42, 0.30);
}
.button.is-loading, button.is-loading, .autocomplete-option.is-loading {
  pointer-events: none;
  opacity: .78;
}
.loading-active { cursor: progress; }

.chip, .pill, .source-pills span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px;
  padding: 3px 9px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-fg);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip .dot, .pill .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.chip.success, .pill.success { color: var(--success); background: color-mix(in oklab, var(--success) 10%, var(--bg-surface)); border-color: color-mix(in oklab, var(--success) 22%, transparent); }
.chip.warning, .pill.warning { color: var(--warning); background: color-mix(in oklab, var(--warning) 12%, var(--bg-surface)); border-color: color-mix(in oklab, var(--warning) 25%, transparent); }
.chip.error, .pill.error { color: var(--error); background: color-mix(in oklab, var(--error) 10%, var(--bg-surface)); border-color: color-mix(in oklab, var(--error) 22%, transparent); }
.chip.gold, .pill.gold { color: #7a4e00; background: var(--gold-100); border-color: color-mix(in oklab, var(--gold-500) 35%, transparent); }
:root[data-theme="dark"] .chip.gold,
:root[data-theme="dark"] .pill.gold { color: var(--gold-500); background: rgba(255, 183, 42, 0.12); border-color: rgba(255, 183, 42, 0.28); }

.panel,
.source-card,
.section-card,
.match-card,
.kpi {
  background: var(--bg-surface);
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  box-shadow: var(--shadow-xs);
}
.page-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 18px;
  background: linear-gradient(135deg, color-mix(in oklab, var(--bg-surface) 96%, var(--gold-500) 4%), var(--bg-subtle));
}
.page-intro h2 {
  margin: 0;
  max-width: 980px;
  color: var(--fg-1);
  font-size: clamp(24px, 3.4vw, 38px);
  font-weight: 900;
  line-height: 1.02;
}
.page-intro p:not(.eyebrow) {
  max-width: 860px;
  margin: 8px 0 0;
  color: var(--fg-2);
  line-height: 1.45;
}
.page-intro-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.developer-api-intro {
  background:
    radial-gradient(circle at 85% 18%, color-mix(in oklab, var(--blue-accent) 18%, transparent), transparent 34%),
    linear-gradient(135deg, color-mix(in oklab, var(--bg-surface) 92%, var(--navy-700) 8%), var(--bg-subtle));
}
.developer-body {
  min-width: 0;
  background: var(--bg-canvas);
}
.developer-shell {
  width: min(1600px, 100%);
  min-height: 100vh;
  margin: 0 auto;
}
.developer-header {
  position: sticky;
  z-index: 40;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  min-height: 68px;
  padding: 0 28px;
  border-bottom: 1px solid var(--stroke-1);
  background: color-mix(in oklab, var(--bg-surface) 92%, transparent);
  backdrop-filter: blur(16px);
}
.developer-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--fg-1);
  text-decoration: none;
}
.developer-brand span {
  color: var(--gold-600);
  font-weight: 900;
  letter-spacing: .08em;
}
.developer-brand strong {
  font-size: 18px;
  font-weight: 900;
}
.developer-header nav {
  display: flex;
  align-items: stretch;
  gap: 4px;
  min-height: 68px;
}
.developer-header nav a {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-bottom: 2px solid transparent;
  color: var(--fg-3);
  font-weight: 700;
  text-decoration: none;
}
.developer-header nav a:hover,
.developer-header nav a.active {
  border-bottom-color: var(--blue-accent);
  color: var(--fg-1);
}
.developer-account {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--fg-3);
  font-size: 13px;
}
.developer-account a {
  padding: 8px 11px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  color: var(--fg-2);
  font-weight: 700;
  text-decoration: none;
}
.developer-docs-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 26px 28px 48px;
}
.developer-docs-nav {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}
.developer-docs-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--fg-2);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.developer-docs-nav a:hover,
.developer-docs-nav a.active {
  color: var(--fg-1);
  background: var(--bg-subtle);
}
.developer-docs-nav hr {
  width: 100%;
  margin: 10px 0;
  border: 0;
  border-top: 1px solid var(--stroke-1);
}
.developer-docs-content { min-width: 0; }
.developer-docs-content > :first-child { margin-top: 0; }
.developer-docs-content .section-grid > * { min-width: 0; }
.developer-docs-content .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}
.developer-docs-content .section-data-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
.developer-docs-content .section-data-table th,
.developer-docs-content .section-data-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}
.developer-docs-content code {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.developer-docs-content pre {
  max-width: 100%;
  overflow: auto;
}
.developer-docs-content pre code {
  overflow-wrap: normal;
  word-break: normal;
}
.developer-base-url {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-subtle);
}
.developer-base-url span {
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.developer-endpoint-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
  color: var(--fg-1);
  text-decoration: none;
  background: var(--bg-subtle);
}
.developer-endpoint-card:hover {
  border-color: var(--blue-accent);
  transform: translateY(-1px);
}
.developer-endpoint-card p {
  margin: 5px 0 0;
  color: var(--fg-3);
}
.developer-reference-list {
  display: grid;
  gap: 12px;
}
.developer-reference-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
  color: var(--fg-1);
  text-decoration: none;
  background: var(--bg-subtle);
}
a.developer-reference-card:hover {
  border-color: var(--blue-accent);
  transform: translateY(-1px);
}
.developer-reference-card h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
.developer-reference-card p {
  margin: 7px 0;
  color: var(--fg-2);
}
.developer-reference-card strong {
  color: var(--fg-3);
  font-size: 12px;
}
.developer-reference-action {
  align-self: center;
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.pill.published {
  color: var(--success);
  background: color-mix(in oklab, var(--success) 10%, var(--bg-surface));
}
.pill.prototype_backed {
  color: var(--blue-accent);
  background: color-mix(in oklab, var(--blue-accent) 10%, var(--bg-surface));
}
.pill.discovery {
  color: var(--gold-700);
  background: color-mix(in oklab, var(--gold-500) 12%, var(--bg-surface));
}
.pill.blocked {
  color: var(--error);
  background: color-mix(in oklab, var(--error) 9%, var(--bg-surface));
}
.developer-foundation-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.developer-foundation-table > article {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
  background: var(--bg-subtle);
}
.developer-foundation-table article > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.developer-foundation-table h3 { margin: 12px 0 6px; }
.developer-foundation-table p { margin: 0; color: var(--fg-2); }
.developer-foundation-table dl { margin: 14px 0 0; }
.developer-foundation-table dt {
  margin-top: 10px;
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.developer-foundation-table dd {
  margin: 4px 0 0;
  color: var(--fg-2);
  overflow-wrap: anywhere;
}
.developer-explorer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}
.developer-explorer > * { min-width: 0; }
.developer-explorer-pane { margin-top: 18px; }
.developer-explorer-pane h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  overflow-wrap: anywhere;
}
.developer-explorer-label {
  display: block;
  margin-bottom: 8px;
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.developer-explorer textarea {
  width: 100%;
  min-height: 540px;
  resize: vertical;
  padding: 16px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  color: var(--fg-1);
  background: var(--bg-subtle);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  tab-size: 2;
}
.developer-explorer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.developer-explorer-result details {
  border-bottom: 1px solid var(--stroke-1);
  padding: 12px 0;
}
.developer-explorer-result summary {
  cursor: pointer;
  color: var(--fg-1);
  font-weight: 800;
}
.developer-explorer-result pre {
  max-height: 430px;
  margin: 12px 0 0;
}
.developer-explorer-error {
  padding: 14px;
  border: 1px solid color-mix(in oklab, var(--error) 40%, var(--stroke-1));
  border-radius: 10px;
  color: var(--error);
  background: color-mix(in oklab, var(--error) 7%, var(--bg-surface));
}
.developer-explorer-notice p { margin-bottom: 0; }
@media (max-width: 900px) {
  .developer-header {
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding: 0 18px;
  }
  .developer-header nav {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 44px;
    overflow-x: auto;
  }
  .developer-header nav a { padding: 0 10px; white-space: nowrap; }
  .developer-account span { display: none; }
  .developer-docs-layout {
    grid-template-columns: 1fr;
    padding: 18px;
  }
  .developer-docs-nav {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .developer-docs-nav .eyebrow,
  .developer-docs-nav hr,
  .developer-docs-nav small { grid-column: 1 / -1; }
  .developer-explorer { grid-template-columns: 1fr; }
  .developer-explorer textarea { min-height: 420px; }
  .developer-foundation-table { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .developer-header { padding: 0 14px; }
  .developer-brand strong { font-size: 16px; }
  .developer-account a { font-size: 0; }
  .developer-account a::after { content: "Portal"; font-size: 13px; }
  .developer-docs-layout { padding: 14px; }
  .developer-docs-nav { grid-template-columns: 1fr; }
  .developer-docs-content .section-grid { grid-template-columns: 1fr; }
  .developer-base-url { align-items: flex-start; flex-direction: column; }
  .developer-endpoint-card { grid-template-columns: auto minmax(0, 1fr); }
  .developer-endpoint-card > :last-child { display: none; }
  .developer-reference-card { grid-template-columns: 1fr; }
  .developer-reference-action { justify-self: start; }
}

/* Standalone developer documentation */
.developer-body {
  --developer-header-height: 64px;
  background: var(--bg-surface);
}
.developer-shell {
  width: 100%;
  max-width: none;
}
.developer-header {
  min-height: var(--developer-header-height);
  grid-template-columns: 240px auto minmax(320px, 1fr);
  gap: 24px;
  padding: 0 24px;
  background: color-mix(in oklab, var(--bg-surface) 96%, transparent);
  box-shadow: none;
}
.developer-brand { gap: 7px; }
.developer-brand span {
  padding: 3px 6px;
  border-radius: 5px;
  color: #fff;
  background: var(--navy-800);
  font-size: 12px;
  letter-spacing: .04em;
}
.developer-brand strong {
  font-size: 16px;
  letter-spacing: -.01em;
}
.developer-header nav {
  min-height: var(--developer-header-height);
}
.developer-header nav a {
  padding: 0 12px;
  border: 0;
  color: var(--fg-2);
  font-size: 13px;
}
.developer-header nav a:hover,
.developer-header nav a.active {
  border: 0;
  color: var(--fg-1);
  background: transparent;
}
.developer-header nav a.active { font-weight: 850; }
.developer-header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}
.developer-header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(280px, 30vw);
  padding: 8px 10px;
  border: 1px solid var(--stroke-1);
  border-radius: 7px;
  color: var(--fg-3);
  background: var(--bg-subtle);
  font: inherit;
  text-align: left;
}
.developer-header-search span:nth-child(2) { flex: 1; }
.developer-header-search kbd,
.developer-search-dialog kbd {
  min-width: 22px;
  padding: 2px 5px;
  border: 1px solid var(--stroke-1);
  border-radius: 4px;
  color: var(--fg-3);
  background: var(--bg-surface);
  font: 11px var(--font-mono);
  text-align: center;
}
.developer-version {
  padding: 5px 8px;
  border: 1px solid var(--stroke-1);
  border-radius: 6px;
  color: var(--fg-2);
  font: 700 11px var(--font-mono);
  white-space: nowrap;
}
.developer-account span {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.developer-account a {
  padding: 7px 9px;
  border-radius: 6px;
}
.developer-docs-layout {
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 0;
  padding: 0;
}
.developer-docs-nav {
  top: var(--developer-header-height);
  align-content: start;
  gap: 2px;
  height: calc(100vh - var(--developer-header-height));
  padding: 20px 16px 36px;
  overflow-y: auto;
  border: 0;
  border-right: 1px solid var(--stroke-1);
  border-radius: 0;
  background: var(--bg-subtle);
  box-shadow: none;
}
.developer-nav-search {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  padding: 7px 9px;
  border: 1px solid var(--stroke-1);
  border-radius: 6px;
  color: var(--fg-3);
  background: var(--bg-surface);
}
.developer-nav-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--fg-1);
  background: transparent;
  font: inherit;
  font-size: 13px;
}
.developer-nav-heading {
  margin: 18px 10px 6px;
  color: var(--fg-3);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.developer-docs-nav a {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 5px;
  color: var(--fg-2);
  font-size: 13px;
}
.developer-docs-nav a:hover {
  color: var(--fg-1);
  background: color-mix(in oklab, var(--blue-accent) 6%, var(--bg-surface));
}
.developer-docs-nav a.active {
  color: var(--blue-accent);
  background: color-mix(in oklab, var(--blue-accent) 9%, var(--bg-surface));
  font-weight: 800;
}
.developer-docs-nav small {
  margin: 7px 10px 2px;
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 750;
}
.developer-docs-nav .method-badge {
  min-width: 35px;
  padding: 2px 4px;
  font-size: 8px;
}
.developer-docs-content {
  width: 100%;
  max-width: 1500px;
  min-height: calc(100vh - var(--developer-header-height));
  padding: 54px clamp(30px, 5vw, 76px) 80px;
}
.developer-page-header {
  max-width: 820px;
  margin: 0 0 48px;
  padding: 0;
  background: transparent;
}
.developer-page-header h1 {
  max-width: 820px;
  margin: 8px 0 0;
  color: var(--fg-1);
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 850;
  letter-spacing: -.04em;
  line-height: 1.02;
}
.developer-lede {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--fg-2);
  font-size: 17px;
  line-height: 1.65;
}
.developer-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 24px;
}
.developer-action-row .button {
  min-height: 36px;
  border-radius: 6px;
}
.developer-reading-layout {
  display: grid;
  grid-template-columns: minmax(0, 820px) 170px;
  gap: clamp(42px, 7vw, 92px);
  align-items: start;
  max-width: 1120px;
}
.developer-reading-column { min-width: 0; }
.developer-on-this-page {
  position: sticky;
  top: calc(var(--developer-header-height) + 30px);
  display: grid;
  gap: 9px;
  padding-left: 15px;
  border-left: 1px solid var(--stroke-1);
  font-size: 12px;
}
.developer-on-this-page strong {
  margin-bottom: 3px;
  color: var(--fg-1);
}
.developer-on-this-page a {
  color: var(--fg-3);
  text-decoration: none;
}
.developer-on-this-page a:hover { color: var(--blue-accent); }
.developer-callout {
  margin: 0 0 34px;
  padding: 15px 18px;
  border: 1px solid color-mix(in oklab, var(--blue-accent) 25%, var(--stroke-1));
  border-left: 3px solid var(--blue-accent);
  border-radius: 6px;
  background: color-mix(in oklab, var(--blue-accent) 4%, var(--bg-surface));
}
.developer-callout > div {
  display: flex;
  align-items: center;
  gap: 9px;
}
.developer-callout p {
  margin: 6px 0 0;
  color: var(--fg-2);
}
.developer-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--warning);
}
.developer-status-dot.success { background: var(--success); }
.developer-doc-section {
  scroll-margin-top: calc(var(--developer-header-height) + 24px);
  padding: 38px 0;
  border-top: 1px solid var(--stroke-1);
}
.developer-doc-section h2,
.developer-reference-group h2 {
  margin: 6px 0 14px;
  color: var(--fg-1);
  font-size: 25px;
  letter-spacing: -.02em;
}
.developer-doc-section h3 { margin-top: 24px; }
.developer-doc-section p,
.developer-doc-section li {
  color: var(--fg-2);
  line-height: 1.65;
}
.developer-doc-section li + li { margin-top: 7px; }
.developer-doc-section pre {
  border: 0;
  border-radius: 7px;
  background: #121a2b;
}
.developer-definition-list,
.developer-field-list {
  margin: 24px 0 0;
}
.developer-definition-list > div,
.developer-field-list > div {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  gap: 24px;
  padding: 15px 0;
  border-top: 1px solid var(--stroke-1);
}
.developer-definition-list dt,
.developer-field-list dt {
  color: var(--fg-1);
  font-weight: 800;
}
.developer-definition-list dd,
.developer-field-list dd {
  margin: 0;
  color: var(--fg-2);
  line-height: 1.55;
}
.developer-field-list dt {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.developer-field-list dt span {
  color: var(--fg-3);
  font: 10px var(--font-mono);
  text-transform: uppercase;
}
.developer-code-line {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 16px;
  margin-top: 22px;
  border: 1px solid var(--stroke-1);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-subtle);
}
.developer-code-line span,
.developer-code-line code {
  padding: 12px;
}
.developer-code-line span {
  border-right: 1px solid var(--stroke-1);
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.developer-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.developer-section-heading p:not(.eyebrow) {
  max-width: 700px;
  margin: 5px 0 0;
  color: var(--fg-2);
}
.developer-operation-row {
  display: grid;
  grid-template-columns: auto minmax(220px, auto) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
  padding: 15px 0;
  border-top: 1px solid var(--stroke-1);
  border-bottom: 1px solid var(--stroke-1);
  color: var(--fg-1);
  text-decoration: none;
}
.developer-operation-row > span:nth-child(3) {
  color: var(--fg-2);
  font-size: 13px;
}
.developer-operation-row:hover code,
.developer-operation-row:hover > :last-child { color: var(--blue-accent); }
.developer-steps {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
.developer-steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  margin: 0;
  padding: 12px 0;
}
.developer-steps li > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  color: var(--fg-2);
  font-size: 11px;
  font-weight: 800;
}
.developer-steps p { margin: 2px 0 0; }
.developer-reference-header { margin-bottom: 30px; }
.developer-reference-toolbar {
  max-width: 720px;
  margin-bottom: 48px;
}
.developer-reference-toolbar > label {
  display: block;
  margin-bottom: 8px;
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 800;
}
.developer-search-control {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--stroke-1);
  border-radius: 7px;
  background: var(--bg-surface);
}
.developer-search-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}
.developer-search-control:focus-within {
  border-color: var(--blue-accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--blue-accent) 12%, transparent);
}
.developer-search-control input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--fg-1);
  background: transparent;
  font: inherit;
}
.developer-reference-group {
  max-width: 980px;
  margin-top: 48px;
}
.developer-reference-list {
  gap: 0;
  margin-top: 16px;
  border-top: 1px solid var(--stroke-1);
}
.developer-reference-card {
  grid-template-columns: minmax(0, 1fr) minmax(170px, 32%);
  gap: 24px;
  padding: 18px 2px;
  border: 0;
  border-bottom: 1px solid var(--stroke-1);
  border-radius: 0;
  background: transparent;
}
a.developer-reference-card:hover {
  border-color: var(--stroke-1);
  background: color-mix(in oklab, var(--blue-accent) 3%, var(--bg-surface));
  transform: none;
}
.developer-reference-primary {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.developer-reference-primary .method-badge {
  justify-content: center;
  margin-top: 4px;
}
.developer-reference-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--fg-3);
  font-size: 20px;
}
.developer-reference-card h3 {
  display: block;
  margin: 3px 0 0;
  font-size: 16px;
}
.developer-reference-card p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
}
.developer-reference-card small {
  color: var(--fg-3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.developer-reference-meta {
  display: grid;
  justify-items: end;
  gap: 9px;
  align-content: center;
  color: var(--fg-3);
  font-size: 11px;
  text-align: right;
}
.developer-reference-meta > span:last-child {
  max-width: 250px;
}
.developer-filter-empty {
  max-width: 980px;
  padding: 28px;
  border: 1px dashed var(--stroke-1);
  color: var(--fg-3);
  text-align: center;
}
.developer-lifecycle-list {
  margin-top: 22px;
}
.developer-lifecycle-list article {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 15px 0;
  border-top: 1px solid var(--stroke-1);
}
.developer-lifecycle-list article p { margin: 0; }
.developer-foundation-table {
  display: block;
}
.developer-foundation-table > article {
  padding: 22px 0;
  border: 0;
  border-top: 1px solid var(--stroke-1);
  border-radius: 0;
  background: transparent;
}
.developer-foundation-table > article:last-child { border-bottom: 1px solid var(--stroke-1); }
.developer-foundation-table article > div:first-child { justify-content: flex-start; }
.developer-foundation-table article > div:first-child small {
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.developer-foundation-table h3 { font-size: 18px; }
.developer-foundation-table dl {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  margin-top: 16px;
}
.developer-foundation-table dt,
.developer-foundation-table dd {
  margin: 0;
  padding: 9px 0;
  border-top: 1px solid var(--stroke-1);
}
.developer-operation-header {
  max-width: 1050px;
  margin-bottom: 36px;
}
.developer-breadcrumb {
  display: flex;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--fg-3);
  font-size: 12px;
}
.developer-breadcrumb a {
  color: var(--blue-accent);
  text-decoration: none;
}
.developer-operation-title {
  display: flex;
  align-items: center;
  gap: 13px;
}
.developer-operation-title h1 { margin: 0; }
.developer-operation-path {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
}
.developer-operation-path code {
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--stroke-1);
  border-radius: 6px;
  background: var(--bg-subtle);
}
.developer-operation-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(330px, 430px);
  gap: clamp(36px, 5vw, 72px);
  align-items: start;
  max-width: 1280px;
}
.developer-operation-content { min-width: 0; }
.developer-code-rail {
  position: sticky;
  top: calc(var(--developer-header-height) + 24px);
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  color: #e7eaf1;
  background: #121a2b;
  box-shadow: 0 18px 45px rgba(7, 14, 30, .18);
}
.developer-code-rail-head {
  display: flex;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  color: #aeb8ca;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.developer-code-rail pre {
  max-height: 550px;
  margin: 0;
  padding: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.developer-code-rail code { color: #e7eaf1; }
.developer-code-rail details {
  border-top: 1px solid rgba(255,255,255,.1);
}
.developer-code-rail summary {
  padding: 13px 15px;
  color: #c9d1df;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.developer-code-rail details pre { max-height: 430px; }
.developer-code-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.developer-code-actions .button.ghost {
  border-color: rgba(255,255,255,.18);
  color: #e7eaf1;
  background: rgba(255,255,255,.04);
}
.developer-api-table th {
  color: var(--fg-3);
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.developer-http-status {
  display: inline-flex;
  min-width: 56px;
  padding: 3px 7px;
  border-radius: 4px;
  color: var(--fg-2);
  background: var(--bg-subtle);
  font: 800 11px var(--font-mono);
}
.developer-http-status.success { color: var(--success); }
.developer-http-status.warn { color: var(--warning); }
.developer-http-status.error { color: var(--error); }
.developer-explorer {
  gap: 16px;
  max-width: 1280px;
}
.developer-explorer > .panel {
  padding: 18px;
  border-radius: 7px;
  box-shadow: none;
}
.developer-explorer-pane { margin-top: 0; }
.developer-explorer textarea {
  min-height: 520px;
  border-radius: 6px;
  background: color-mix(in oklab, var(--bg-subtle) 92%, var(--navy-800) 8%);
}
.developer-search-dialog[hidden] { display: none; }
.developer-search-dialog {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: start center;
  padding-top: min(18vh, 160px);
  background: rgba(7, 14, 30, .58);
  backdrop-filter: blur(4px);
}
.developer-search-dialog > button {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
}
.developer-search-dialog form {
  position: relative;
  z-index: 1;
  width: min(620px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: 0 24px 80px rgba(7, 14, 30, .28);
}
.developer-search-dialog label {
  display: block;
  margin-bottom: 10px;
  color: var(--fg-1);
  font-size: 13px;
  font-weight: 800;
}
.developer-search-dialog form > div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--blue-accent);
  border-radius: 7px;
}
.developer-search-dialog input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--fg-1);
  background: transparent;
  font: inherit;
}
.developer-search-dialog p {
  margin: 10px 0 0;
  color: var(--fg-3);
  font-size: 11px;
}
.developer-search-open { overflow: hidden; }

@media (max-width: 1220px) {
  .developer-header {
    grid-template-columns: 210px auto minmax(250px, 1fr);
    gap: 14px;
  }
  .developer-account span { display: none; }
  .developer-operation-layout {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 380px);
    gap: 32px;
  }
}
@media (max-width: 980px) {
  .developer-header {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
  }
  .developer-header nav { display: none; }
  .developer-header-tools { min-width: 0; }
  .developer-docs-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .developer-docs-content { padding: 40px 28px 64px; }
  .developer-reading-layout { grid-template-columns: minmax(0, 1fr); }
  .developer-on-this-page { display: none; }
  .developer-operation-layout { grid-template-columns: minmax(0, 1fr); }
  .developer-code-rail { position: static; }
}
@media (max-width: 720px) {
  .developer-body { --developer-header-height: 58px; }
  .developer-header {
    min-height: var(--developer-header-height);
    padding: 0 14px;
  }
  .developer-brand strong { font-size: 14px; }
  .developer-header-search { width: 42px; justify-content: center; }
  .developer-header-search span:nth-child(2),
  .developer-header-search kbd,
  .developer-version,
  .developer-account span { display: none; }
  .developer-account { gap: 0; }
  .developer-account a { font-size: 0; }
  .developer-account a::after { content: "Portal ↗"; font-size: 12px; }
  .developer-docs-layout { grid-template-columns: 1fr; }
  .developer-docs-nav { display: none; }
  .developer-docs-content { padding: 32px 18px 56px; }
  .developer-page-header { margin-bottom: 34px; }
  .developer-page-header h1 { font-size: 36px; }
  .developer-lede { font-size: 15px; }
  .developer-definition-list > div,
  .developer-field-list > div,
  .developer-lifecycle-list article {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .developer-operation-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .developer-operation-row > span:nth-child(3) { display: none; }
  .developer-reference-card { grid-template-columns: 1fr; gap: 12px; }
  .developer-reference-meta { justify-items: start; text-align: left; }
  .developer-operation-title { align-items: flex-start; }
  .developer-operation-title h1 { font-size: 31px; }
  .developer-operation-path { align-items: flex-start; flex-direction: column; }
  .developer-operation-path code { width: 100%; }
  .developer-code-line { grid-template-columns: 1fr; }
  .developer-code-line span { border-right: 0; border-bottom: 1px solid var(--stroke-1); }
}
.home-intro {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  min-height: 0;
  padding: 20px;
  background:
    linear-gradient(135deg, color-mix(in oklab, var(--bg-surface) 96%, var(--gold-500) 4%) 0%, var(--bg-subtle) 54%, color-mix(in oklab, var(--bg-surface) 92%, var(--navy-700) 8%) 100%);
}
.home-intro-copy {
  align-self: center;
  max-width: 780px;
}
.home-intro-copy h2 {
  margin: 6px 0 0;
  color: var(--fg-1);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 900;
  line-height: .98;
}
.home-intro-copy p:not(.eyebrow) {
  max-width: 740px;
  margin: 12px 0 0;
  color: var(--fg-2);
  font-size: 16px;
  line-height: 1.45;
}
.home-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.home-intro-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-self: center;
  gap: 10px;
}
.home-rollup {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.home-rollup-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px 7px 11px;
  border: 1px solid var(--stroke-2);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--fg-1);
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.home-rollup-chip:hover {
  border-color: color-mix(in oklab, var(--gold-500) 42%, var(--stroke-2));
  transform: translateY(-1px);
}
.home-rollup-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--fg-3);
}
.home-rollup-chip.risk .home-rollup-dot { background: var(--error); }
.home-rollup-chip.warn .home-rollup-dot { background: var(--gold-500); }
.home-rollup-chip.calm .home-rollup-dot { background: var(--success); }
.home-rollup-count {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  color: var(--fg-1);
}
.home-rollup-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-2);
}
/* Clear the sticky topbar when a rollup chip jumps to its panel. */
.home-work-panel { scroll-margin-top: 96px; }
.activity-feed {
  display: grid;
  gap: 10px;
}
.kpi-grid, .card-grid, .section-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.section-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi { min-height: 128px; display: flex; flex-direction: column; padding: 18px; }
.kpi p { margin: 0 0 10px; color: var(--fg-3); font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.kpi strong { display: block; color: var(--fg-1); font-family: var(--font-display); font-size: 34px; font-weight: 900; line-height: 1; overflow-wrap: anywhere; }
.kpi small { display: block; margin-top: 9px; line-height: 1.3; }
.home-workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.home-ops-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.home-work-panel {
  min-width: 0;
  padding: 16px;
}
.home-work-panel .panel-head {
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}
.home-work-panel .panel-head h2 {
  font-size: 20px;
}
.home-work-panel .panel-head p {
  max-width: 540px;
}
.home-work-list {
  display: grid;
  gap: 8px;
}
.home-work-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) minmax(92px, auto);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 10px 11px;
  border: 1px solid color-mix(in oklab, var(--stroke-1) 78%, transparent);
  border-radius: 8px;
  background: color-mix(in oklab, var(--bg-surface) 86%, var(--bg-subtle));
  color: inherit;
  text-decoration: none;
}
.home-work-item:hover {
  border-color: color-mix(in oklab, var(--gold-500) 42%, var(--stroke-1));
  background: color-mix(in oklab, var(--gold-500) 7%, var(--bg-surface));
}
.home-work-marker {
  width: 8px;
  height: 34px;
  border-radius: 999px;
  background: var(--fg-3);
}
.home-work-item.success .home-work-marker { background: var(--success); }
.home-work-item.warn .home-work-marker { background: var(--gold-500); }
.home-work-item.risk .home-work-marker { background: var(--error); }
.home-work-item.info .home-work-marker { background: var(--blue-accent); }
.home-work-copy {
  min-width: 0;
}
.home-work-copy strong,
.home-work-copy small,
.home-work-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-work-copy strong {
  display: block;
  color: var(--fg-1);
  font-size: 13.5px;
  font-weight: 850;
}
.home-work-copy small {
  display: block;
  margin-top: 3px;
  color: var(--fg-3);
  font-size: 12px;
  line-height: 1.2;
}
.home-work-meta {
  justify-self: end;
  max-width: 180px;
  padding: 5px 8px;
  border: 1px solid var(--stroke-1);
  border-radius: 7px;
  color: var(--fg-2);
  background: var(--bg-surface);
  font-size: 12px;
  font-weight: 800;
}
.home-quick-links {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.home-workflow-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--stroke-2);
  border-radius: 11px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}
.home-workflow-card-head {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 15px;
  background:
    radial-gradient(circle at 15% 0%, color-mix(in oklab, var(--gold-500) 30%, transparent) 0%, transparent 42%),
    linear-gradient(135deg, color-mix(in oklab, var(--navy-900) 97%, black) 0%, var(--navy-700) 58%, color-mix(in oklab, var(--gold-500) 28%, var(--navy-700)) 100%);
  color: white;
}
.home-workflow-card-body {
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 13px 14px 14px;
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--bg-surface) 98%, var(--gold-100)) 0%, var(--bg-surface) 100%);
}
.workflow-icon,
.surface-card-icon,
.readiness-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid color-mix(in oklab, var(--gold-500) 34%, transparent);
  border-radius: 10px;
  background: color-mix(in oklab, var(--gold-500) 12%, var(--bg-surface));
  color: var(--gold-600);
}
.home-workflow-card .workflow-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-color: color-mix(in oklab, white 44%, transparent);
  background: color-mix(in oklab, white 13%, transparent);
  color: color-mix(in oklab, var(--gold-100) 88%, white);
  box-shadow: 0 8px 20px rgb(0 0 0 / .18);
}
.home-workflow-card h2 {
  margin: 0;
  flex: 1;
  min-width: 0;
  color: white;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.05;
  text-align: right;
}
.home-workflow-card p {
  margin: 0;
  color: var(--fg-2);
  font-size: 13.5px;
  line-height: 1.34;
}
.home-workflow-card .button {
  width: 100%;
  justify-content: center;
  border-color: color-mix(in oklab, var(--gold-500) 16%, var(--stroke-1));
  background: color-mix(in oklab, var(--gold-500) 6%, var(--bg-subtle));
  color: var(--fg-1);
}
.home-workflow-card .button:hover {
  border-color: color-mix(in oklab, var(--gold-500) 28%, var(--stroke-2));
  background: color-mix(in oklab, var(--gold-500) 9%, var(--bg-subtle));
}
.activity-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-subtle);
}
.activity-card time {
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 700;
}
.activity-card strong {
  display: block;
  color: var(--fg-1);
  font-size: 15px;
  line-height: 1.2;
}
.activity-card p {
  margin: 4px 0 0;
  color: var(--fg-3);
  overflow-wrap: anywhere;
}
.spark { height: 4px; width: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold-500), var(--navy-700)); margin-top: auto; }
.metric-card.success .spark { background: linear-gradient(90deg, var(--success), #9bc6ac); }
.metric-card.warn .spark { background: linear-gradient(90deg, #986c00, var(--gold-500)); }
.metric-card.risk .spark { background: linear-gradient(90deg, var(--error), #d88a84); }
.metric-card.info .spark { background: linear-gradient(90deg, var(--blue-accent), var(--gold-500)); }
.panel, .source-card, .section-card, .match-card { padding: 20px; }
.panel { margin-top: 20px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.panel-head h2, .source-card h2, .section-card h2 { font-size: 23px; font-weight: 900; line-height: 1.05; }
.source-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 16px 0 12px;
}
.source-card-meta div {
  min-width: 0;
  padding-top: 9px;
  border-top: 1px solid var(--stroke-1);
}
.source-card-meta dt {
  margin: 0 0 3px;
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  line-height: 1.2;
  text-transform: uppercase;
}
.source-card-meta dd {
  margin: 0;
  color: var(--fg-1);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.c360-profile-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 22px 24px;
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-subtle) 100%);
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  box-shadow: var(--shadow-xs);
}
.c360-avatar {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-sm);
}
.c360-profile-main { min-width: 0; flex: 1; }
.c360-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.c360-title-row h2 {
  margin: 0;
  color: var(--fg-1);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.015em;
}
.c360-prestige-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.c360-prestige {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 0 11px 0 9px;
  border: 1px solid color-mix(in oklab, var(--gold-500) 45%, transparent);
  border-radius: 999px;
  background: linear-gradient(180deg, #fff7e0 0%, #fceab6 100%);
  color: #7a4e00;
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 1px 2px rgba(20,24,50,.06);
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
:root[data-theme="dark"] .c360-prestige {
  background: rgba(255, 183, 42, .12);
  color: var(--gold-500);
  box-shadow: none;
}
.c360-prestige::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, color-mix(in oklab, var(--gold-500) 25%, white), var(--gold-500) 80%);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--gold-500) 40%, transparent), 0 0 0 3px color-mix(in oklab, var(--gold-500) 8%, transparent);
}
.c360-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  margin-top: 14px;
  color: var(--fg-2);
}
.c360-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.c360-meta span:first-child {
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.c360-meta span:last-child { color: var(--fg-1); font-weight: 500; overflow-wrap: anywhere; }
.c360-divider { width: 1px; height: 28px; background: var(--stroke-1); }
.c360-stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 18px;
}
.c360-stat { min-width: 92px; }
.c360-stat span {
  display: block;
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.c360-stat strong {
  display: block;
  margin-top: 4px;
  color: var(--fg-1);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  overflow-wrap: anywhere;
}
.c360-stat small { display: block; margin-top: 4px; max-width: 170px; line-height: 1.25; }
.c360-care-panel {
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}
.c360-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.c360-section-title h2 { margin-top: 4px; font-size: 18px; font-weight: 900; }
.c360-gold-rule { width: 32px; height: 2px; margin: 10px 0 14px; border: 0; background: var(--gold-500); }
.c360-care-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.c360-care-item {
  display: flex;
  gap: 10px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in oklab, var(--warning) 24%, transparent);
  border-radius: 8px;
  background: color-mix(in oklab, var(--warning) 6%, var(--bg-surface));
}
.c360-care-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--warning);
}
.c360-care-item.success {
  border-color: color-mix(in oklab, var(--success) 24%, transparent);
  background: color-mix(in oklab, var(--success) 6%, var(--bg-surface));
}
.c360-care-item.success .c360-care-dot { background: var(--success); }
.c360-care-item strong { display: block; color: var(--fg-1); font-size: 14px; line-height: 1.25; }
.c360-care-item p { margin: 7px 0 0; color: var(--fg-2); font-size: 13px; line-height: 1.42; }
.c360-care-item small { display: block; margin-top: 8px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }

.platform-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: color-mix(in oklab, var(--bg-surface) 76%, var(--bg-subtle));
  box-shadow: var(--shadow-xs);
}
.platform-strip > span {
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.platform-strip > div,
.platform-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.customer-high-attention-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 14px 0 0;
  padding: 14px 16px;
  border: 2px solid color-mix(in oklab, var(--error) 62%, var(--stroke-1));
  border-radius: 10px;
  background:
    linear-gradient(135deg, color-mix(in oklab, #ff1f1f 16%, var(--bg-surface)), color-mix(in oklab, var(--warning) 10%, var(--bg-surface))),
    var(--bg-surface);
  box-shadow: 0 0 0 3px color-mix(in oklab, #ff1f1f 12%, transparent), 0 16px 32px color-mix(in oklab, #ff1f1f 10%, transparent);
}
.customer-high-attention-alert.risk {
  border-color: color-mix(in oklab, var(--warning) 55%, var(--stroke-1));
  background:
    linear-gradient(135deg, color-mix(in oklab, var(--warning) 18%, var(--bg-surface)), color-mix(in oklab, var(--error) 8%, var(--bg-surface))),
    var(--bg-surface);
}
.customer-high-attention-beacon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ff1f1f;
  box-shadow: 0 0 0 7px color-mix(in oklab, #ff1f1f 18%, transparent), 0 0 24px color-mix(in oklab, #ff1f1f 86%, transparent);
  animation: customer-critical-pulse 1.15s ease-in-out infinite;
}
.customer-high-attention-alert.risk .customer-high-attention-beacon {
  background: var(--warning);
  box-shadow: 0 0 0 7px color-mix(in oklab, var(--warning) 18%, transparent), 0 0 20px color-mix(in oklab, var(--warning) 76%, transparent);
}
.customer-high-attention-alert p {
  margin: 0;
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.customer-high-attention-alert h3 {
  margin: 3px 0 4px;
  color: var(--fg-1);
  font-size: 20px;
  line-height: 1.1;
}
.customer-high-attention-alert div div {
  color: var(--fg-2);
  font-size: 14px;
  line-height: 1.34;
}
.customer-high-attention-alert small {
  display: block;
  margin-top: 5px;
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

@keyframes customer-critical-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.28);
    opacity: .52;
  }
}

@media (prefers-reduced-motion: reduce) {
  .customer-high-attention-beacon {
    animation: none;
  }
}

.payment-demo-page {
  display: grid;
  gap: 24px;
  max-width: 1500px;
  margin: 0 auto;
}

.payment-demo-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  color: #f7fbff;
  border: 1px solid rgba(124, 190, 255, 0.38);
  border-radius: 16px;
  background:
    radial-gradient(circle at 92% 12%, rgba(255, 183, 44, 0.2), transparent 28%),
    linear-gradient(135deg, #0a173f, #123668);
  box-shadow: var(--shadow-sm);
}

.payment-demo-banner .eyebrow,
.payment-demo-banner h2,
.payment-demo-banner p {
  color: inherit;
}

.payment-demo-banner h2 {
  margin: 4px 0 8px;
}

.payment-demo-banner p:last-child {
  max-width: 760px;
  margin: 0;
  color: rgba(247, 251, 255, 0.78);
}

.payment-demo-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 430px;
}

.payment-demo-badges span {
  padding: 7px 11px;
  color: #0a173f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  background: #f6c75b;
}

.payment-demo-context {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.7fr);
  gap: 32px;
  align-items: end;
}

.payment-demo-context h2 {
  margin: 4px 0 8px;
}

.payment-demo-context > div > p:last-child {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--fg-2);
}

.payment-demo-result {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
  background: var(--bg-subtle);
}

.payment-demo-result div {
  min-width: 0;
  padding: 14px 16px;
}

.payment-demo-result div + div {
  border-left: 1px solid var(--stroke-1);
}

.payment-demo-result dt {
  margin-bottom: 4px;
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.payment-demo-result dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-weight: 800;
  text-transform: capitalize;
}

@media (max-width: 980px) {
  .payment-demo-banner,
  .payment-demo-context {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .payment-demo-badges {
    justify-content: flex-start;
    max-width: none;
  }
}

@media (max-width: 620px) {
  .payment-demo-banner {
    padding: 20px;
  }

  .payment-demo-result {
    grid-template-columns: 1fr;
  }

  .payment-demo-result div + div {
    border-top: 1px solid var(--stroke-1);
    border-left: 0;
  }
}
.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 6px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.source-badge:hover { border-color: color-mix(in oklab, var(--blue-accent) 26%, transparent); }
.source-badge img,
.source-monogram { width: 16px; height: 16px; flex: 0 0 auto; object-fit: contain; }
.source-badge img { opacity: .84; }
.source-monogram {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--navy-700);
  color: var(--gold-500);
  font-size: 10px;
}
.platform-badges .source-badge { padding: 3px 7px 3px 5px; font-size: 11px; }
.platform-badges .source-badge img,
.platform-badges .source-monogram { width: 14px; height: 14px; }

.portal-access-table td {
  vertical-align: top;
}
.portal-access-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.access-service-badges {
  max-width: 520px;
}

.access-add-form {
  display: grid;
  gap: 14px;
}
.access-add-form[hidden] {
  display: none !important;
}
.access-add-form label {
  display: grid;
  gap: 6px;
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.access-add-permissions {
  display: grid;
  grid-template-columns: minmax(132px, 170px) minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}
.access-add-role select,
.access-add-user-row input,
.access-add-user-row .button {
  min-height: 42px;
}
.access-add-user-row .button {
  padding-top: 11px;
  padding-bottom: 11px;
}
.access-add-services {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.access-add-services legend {
  margin: 0 0 6px;
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.access-add-services .portal-service-grid {
  gap: 8px;
}
.access-add-services .portal-service-option {
  min-height: 38px;
}
.access-add-user-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 10px;
}
.access-add-search {
  min-width: 0;
}
.access-user-autocomplete-panel {
  width: min(620px, calc(100vw - 56px));
}
.access-user-option,
button.access-user-option {
  display: grid;
  grid-template-columns: 32px minmax(210px, 1fr) minmax(150px, auto);
  gap: 12px;
  align-items: center;
  justify-content: stretch;
}
.access-user-option.already-granted {
  background: color-mix(in oklab, var(--warning) 6%, var(--bg-surface));
}
.access-user-option .avatar {
  justify-self: start;
}
.access-user-option-main {
  display: grid;
  gap: 3px;
  justify-self: stretch;
  text-align: left;
  min-width: 0;
}
.access-user-option-main strong {
  font-size: 15px;
  line-height: 1.12;
}
.access-user-option-main small {
  margin-top: 0;
  font-size: 12px;
  line-height: 1.18;
}
.access-user-option-main strong,
.access-user-option-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.access-user-option-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
  text-align: right;
}
.access-user-option-meta em {
  padding: 3px 7px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-fg);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}
.access-user-option-meta em.action {
  background: var(--gold-500);
  color: var(--accent-ink);
  border-color: var(--gold-500);
}
.compact-note {
  margin: 6px 0 0;
  font-size: 12px;
}

.row-manage {
  position: relative;
  min-width: 210px;
}

.row-manage > summary {
  list-style: none;
}

.row-manage > summary::-webkit-details-marker {
  display: none;
}

.portal-access-manage {
  display: grid;
  gap: 12px;
  min-width: min(560px, 78vw);
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-md);
}

.portal-access-manage form {
  display: grid;
  gap: 10px;
}

.portal-access-manage fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.portal-access-manage legend {
  margin: 0 0 7px;
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.portal-service-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-section-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-service-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 38px;
  padding: 7px 11px 7px 9px;
  border: 1px solid var(--stroke-1);
  border-radius: 7px;
  background: var(--bg-subtle);
  color: var(--fg-2);
  line-height: 1;
  cursor: pointer;
  transition: border-color 120ms, background 120ms, box-shadow 120ms, color 120ms;
}

.portal-service-option .platform-badges {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0;
}

.access-manage-sheet {
  display: grid;
  gap: 12px;
}
.access-manage-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: color-mix(in oklab, var(--bg-subtle) 58%, var(--bg-surface));
}
.access-manage-hero .avatar {
  width: 42px;
  height: 42px;
}
.access-manage-hero h2 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 24px;
  font-weight: 950;
  line-height: 1;
}
.access-manage-hero p:not(.eyebrow) {
  margin: 6px 0 0;
  color: var(--fg-3);
  font-size: 13px;
  line-height: 1.3;
}
.access-manage-status,
.access-manage-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.access-manage-form,
.access-manage-danger {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
}
.access-manage-form label {
  display: grid;
  gap: 6px;
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.access-manage-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.access-manage-form legend {
  margin: 0 0 8px;
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.access-manage-danger {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.access-manage-danger form {
  margin: 0;
}
.portal-modal-body:has(.access-manage-sheet) {
  background: var(--bg-subtle);
}

.portal-service-option.selected {
  border-color: color-mix(in oklab, var(--gold-500) 40%, var(--stroke-1));
  background: color-mix(in oklab, var(--gold-500) 10%, var(--bg-surface));
  color: var(--fg-1);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--gold-500) 16%, transparent);
}

.portal-service-option.locked {
  opacity: .78;
}

.portal-service-option input {
  margin: 0;
  width: 14px;
  height: 14px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  flex: 0 0 14px;
  accent-color: var(--gold-500);
}

.portal-service-option .source-badge {
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: 12px;
  line-height: 1;
}

.portal-service-option .source-badge:hover {
  border-color: transparent;
}

.portal-service-option .source-badge img,
.portal-service-option .source-monogram {
  width: 15px;
  height: 15px;
}

.portal-service-option .source-badge span:last-child {
  display: inline-block;
  transform: translateY(.5px);
}

.portal-section-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid var(--stroke-1);
  border-radius: 7px;
  background: var(--bg-subtle);
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 120ms, background 120ms, box-shadow 120ms, color 120ms;
}

.portal-section-option.selected {
  border-color: color-mix(in oklab, var(--success) 38%, var(--stroke-1));
  background: color-mix(in oklab, var(--success) 9%, var(--bg-surface));
  color: var(--fg-1);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--success) 12%, transparent);
}

.portal-section-option input {
  margin: 0 7px 0 0;
  width: 14px;
  height: 14px;
  min-height: 0;
  accent-color: var(--success);
}

.access-section-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.access-add-form .portal-service-option,
.access-manage-form .portal-service-option,
.access-add-form .portal-section-option,
.access-manage-form .portal-section-option {
  display: inline-flex;
  gap: 8px;
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.access-add-form .portal-service-option.selected,
.access-manage-form .portal-service-option.selected,
.access-add-form .portal-section-option.selected,
.access-manage-form .portal-section-option.selected {
  color: var(--fg-1);
}

.portal-service-option small {
  color: var(--fg-3);
  font-size: 11px;
}

.alert-stack { display: grid; gap: 10px; margin-top: 16px; }
.alert {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in oklab, var(--error) 18%, transparent);
  border-left: 4px solid var(--error);
  border-radius: 8px;
  background: color-mix(in oklab, var(--error) 7%, var(--bg-surface));
  color: var(--fg-1);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.security-ban-summary .panel-head {
  align-items: flex-start;
}
.security-ban-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.security-policy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.security-policy-grid div,
.security-policy-detail div {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--stroke-1);
  border-radius: 9px;
  background: var(--bg-subtle);
}
.security-policy-grid span {
  display: block;
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.security-policy-grid strong {
  display: block;
  margin-top: 5px;
  color: var(--fg-1);
  font-size: 21px;
  font-weight: 900;
  line-height: 1.05;
}
.security-ban-records {
  margin-top: 14px;
}
.security-ban-modal {
  display: grid;
  gap: 16px;
}
.security-modal-intro {
  max-width: 760px;
  margin: 0;
  color: var(--fg-2);
  font-size: 14px;
  line-height: 1.5;
}
.security-ban-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, .75fr) minmax(220px, 1.4fr) auto;
  gap: 12px;
  align-items: end;
}
.security-ban-form label {
  display: grid;
  gap: 6px;
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.security-ban-form input,
.security-ban-form select {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--fg-1);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}
.security-policy-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.security-policy-detail strong {
  display: block;
  color: var(--fg-1);
  font-size: 15px;
  font-weight: 900;
}
.security-policy-detail p {
  margin: 6px 0 0;
  color: var(--fg-2);
  font-size: 13.5px;
  line-height: 1.4;
}
.security-ban-table-wrap {
  margin-top: 12px;
}
.security-ban-table {
  min-width: 1080px;
}
.security-ban-table .truncate-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audit-events-panel {
  height: calc(100vh - 146px);
  min-height: 560px;
  display: flex;
  flex-direction: column;
}
.audit-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(150px, 190px) minmax(130px, 170px) minmax(260px, 1fr) auto;
  align-items: stretch;
  gap: 0;
  margin: 0 0 12px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}
.audit-toolbar:focus-within {
  border-color: color-mix(in oklab, var(--blue-accent) 52%, var(--stroke-1));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--blue-accent) 12%, transparent), var(--shadow-xs);
}
.audit-filter-form,
.audit-filter-control,
.audit-search-shell {
  display: grid;
  gap: 4px;
  align-content: center;
  min-width: 0;
  min-height: 60px;
  padding: 8px 13px;
  border-right: 1px solid var(--stroke-1);
}
.audit-filter-form label,
.audit-filter-control span,
.audit-search-shell span {
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.audit-filter-form select,
.audit-filter-control select,
.audit-search-shell input {
  width: 100%;
  min-height: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fg-1);
  font: inherit;
  font-size: 13px;
  outline: none;
  box-shadow: none;
}
.audit-search-shell input::placeholder {
  color: var(--fg-3);
}
.audit-toolbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 60px;
  padding: 8px 12px;
  background: color-mix(in oklab, var(--bg-subtle) 72%, var(--bg-surface));
  white-space: nowrap;
}
.audit-pagination {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.audit-page-link {
  min-height: 30px;
  padding-inline: 10px;
  font-size: 12px;
}
.audit-page-link.disabled {
  opacity: .45;
  pointer-events: none;
}
.section-table-wrap.audit-events-table-wrap {
  flex: 1 1 0;
  height: auto;
  max-height: none;
  min-height: 0;
}
.audit-events-table {
  min-width: 1240px;
}
.audit-event-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 3px;
}
.audit-event-title strong {
  min-width: 0;
}
.audit-category-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--blue-accent) 10%, var(--bg-subtle));
  color: var(--fg-2);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.audit-time-cell {
  width: 190px;
  white-space: nowrap;
}
.audit-details-cell {
  width: 520px;
}
.audit-details-cell pre {
  max-height: 190px;
  margin: 0;
  font-size: 11px;
}
.audit-chat-context,
.audit-page-context {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}
.audit-chat-line {
  display: grid;
  gap: 4px;
  padding: 8px 9px;
  border: 1px solid var(--stroke-1);
  border-radius: 9px;
  background: color-mix(in oklab, var(--bg-surface) 86%, var(--bg-subtle));
}
.audit-chat-line span,
.audit-page-context span,
.audit-metadata-details summary {
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.audit-chat-line p {
  margin: 0;
  color: var(--fg-1);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.audit-chat-line details {
  margin-top: 2px;
}
.audit-chat-line summary,
.audit-metadata-details summary {
  cursor: pointer;
}
.audit-chat-line pre {
  margin-top: 6px;
  white-space: pre-wrap;
}
.audit-page-context {
  padding: 9px 10px;
  border: 1px solid var(--stroke-1);
  border-radius: 9px;
  background: color-mix(in oklab, var(--green-accent) 8%, var(--bg-surface));
}
.audit-page-context strong {
  color: var(--fg-1);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.audit-metadata-details {
  margin-top: 6px;
}
.audit-metadata-details pre {
  margin-top: 6px;
}
.audit-metadata-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 8px;
}
.audit-metadata-summary div {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--stroke-1);
  border-radius: 9px;
  background: color-mix(in oklab, var(--bg-subtle) 58%, var(--bg-surface));
}
.audit-metadata-summary div.wide {
  grid-column: 1 / -1;
}
.audit-metadata-summary dt {
  margin: 0 0 3px;
  color: var(--fg-3);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.audit-metadata-summary dd {
  margin: 0;
  color: var(--fg-1);
  font-size: 12px;
  line-height: 1.38;
  overflow-wrap: anywhere;
}
.audit-metadata-empty {
  margin: 0 0 8px;
  font-size: 12px;
}
@media (max-width: 760px) {
  .audit-events-panel {
    height: auto;
    min-height: calc(100vh - 112px);
  }
  .section-table-wrap.audit-events-table-wrap {
    min-height: 360px;
  }
  .audit-toolbar {
    grid-template-columns: 1fr;
  }
  .audit-filter-form,
  .audit-filter-control,
  .audit-search-shell {
    border-right: 0;
    border-bottom: 1px solid var(--stroke-1);
  }
  .audit-toolbar-meta {
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .audit-pagination {
    width: 100%;
    justify-content: space-between;
  }
  .audit-metadata-summary {
    grid-template-columns: 1fr;
  }
}

.concierge-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.concierge-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: color-mix(in oklab, var(--bg-surface) 84%, var(--bg-subtle));
  box-shadow: none;
}
.concierge-section[data-section-key="customer360.access_signals"],
.concierge-section[data-section-key="customer360.revenue"],
.concierge-section[data-section-key="customer360.basic"],
.c360-detail-grid .c360-section-wide,
.c360-detail-grid .c360-data-notes {
  grid-column: 1 / -1;
}
.concierge-section .panel-head h2 { font-size: 20px; }
.concierge-section.denied { opacity: .78; }
.section-subhead {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: -8px 0 14px;
  color: var(--fg-3);
  font-size: 13px;
}
.mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.mini-metric {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-subtle);
}
.mini-metric span {
  display: block;
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.mini-metric strong { display: block; margin-top: 4px; color: var(--fg-1); font-size: 23px; line-height: 1.1; overflow-wrap: anywhere; }
.mini-metric small { display: block; margin-top: 4px; line-height: 1.25; }

.insight-grid, .insight-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.insight-list { grid-template-columns: 1fr; margin-top: 14px; }
.insight {
  padding: 14px;
  border: 1px solid var(--stroke-1);
  border-left: 4px solid var(--blue-accent);
  border-radius: 8px;
  background: var(--bg-subtle);
}
.insight.success { border-left-color: var(--success); }
.insight.warn { border-left-color: var(--warning); background: color-mix(in oklab, var(--warning) 6%, var(--bg-surface)); }
.insight.risk { border-left-color: var(--error); background: color-mix(in oklab, var(--error) 6%, var(--bg-surface)); }
.insight.critical { border-left-color: #ff1f1f; background: color-mix(in oklab, #ff1f1f 9%, var(--bg-surface)); }
.insight strong { display: block; color: var(--fg-1); font-size: 17px; line-height: 1.15; }
.insight p { margin: 7px 0 0; color: var(--fg-2); line-height: 1.42; }
.insight small { display: block; margin-top: 9px; }

.signal-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 12px;
}
.signal-group {
  padding: 12px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg-surface) 92%, transparent), color-mix(in oklab, var(--bg-subtle) 88%, transparent));
}
.signal-group.success { border-top: 3px solid var(--success); }
.signal-group.warn { border-top: 3px solid var(--warning); }
.signal-group.info { border-top: 3px solid var(--blue-accent); }
.signal-group.risk { border-top: 3px solid var(--error); }
.signal-group.critical {
  border-top: 4px solid #ff1f1f;
  background: linear-gradient(180deg, color-mix(in oklab, #ff1f1f 12%, var(--bg-surface)), color-mix(in oklab, var(--warning) 7%, var(--bg-subtle)));
}
.signal-group-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.signal-group-head strong { display: block; color: var(--fg-1); font-size: 18px; line-height: 1.05; }
.signal-group-head p { margin: 5px 0 0; color: var(--fg-3); line-height: 1.28; font-size: 13px; }
.signal-group-head > span {
  min-width: 34px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--fg-1);
  font-weight: 700;
}
.signal-chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.signal-chip {
  display: grid;
  gap: 2px;
  max-width: min(100%, 360px);
  padding: 8px 10px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-surface);
}
.signal-chip strong { color: var(--fg-1); font-size: 14px; line-height: 1.12; }
.signal-chip span, .signal-chip small { font-size: 12px; line-height: 1.22; }
.signal-chip.success { border-color: color-mix(in oklab, var(--success) 26%, transparent); background: color-mix(in oklab, var(--success) 5%, var(--bg-surface)); }
.signal-chip.warn { border-color: color-mix(in oklab, var(--warning) 24%, transparent); background: color-mix(in oklab, var(--warning) 6%, var(--bg-surface)); }
.signal-chip.risk { border-color: color-mix(in oklab, var(--error) 24%, transparent); background: color-mix(in oklab, var(--error) 5%, var(--bg-surface)); }
.signal-chip.critical {
  border-color: color-mix(in oklab, #ff1f1f 42%, transparent);
  background: color-mix(in oklab, #ff1f1f 10%, var(--bg-surface));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, #ff1f1f 16%, transparent);
}
.compact-empty { margin: 0; font-size: 13px; }

.section-table-tools {
  display: grid;
  grid-template-columns: auto minmax(220px, 420px) auto;
  align-items: center;
  gap: 10px;
  margin: 14px 0 10px;
}
.section-table-tools label {
  color: var(--fg-2);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.section-table-tools input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--fg-1);
  font: inherit;
  outline: none;
}
.section-table-tools input:focus {
  border-color: color-mix(in oklab, var(--blue-accent) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--blue-accent) 14%, transparent);
}
.section-table-tools span {
  color: var(--fg-3);
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
}
.order-record-search {
  display: grid;
  grid-template-columns: auto minmax(320px, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 4px 0 12px;
  padding: 12px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: color-mix(in oklab, var(--bg-subtle) 62%, var(--bg-surface));
}
.order-record-search label {
  color: var(--fg-2);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.order-record-search input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--fg-1);
  font: inherit;
  outline: none;
}
.order-record-search input:focus {
  border-color: color-mix(in oklab, var(--blue-accent) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--blue-accent) 14%, transparent);
}
.zendesk-record-search {
  grid-template-columns: auto minmax(360px, 1fr) auto;
}
.zendesk-record-search input {
  min-width: 0;
}
.order-autocomplete-panel {
  left: 0;
  right: auto;
  width: min(760px, calc(100vw - 48px));
}
.autocomplete-group-label {
  padding: 9px 14px 7px;
  border-bottom: 1px solid var(--stroke-1);
  background: color-mix(in oklab, var(--bg-subtle) 70%, var(--bg-surface));
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.order-autocomplete-option strong {
  font-size: 15px;
}
.order-autocomplete-option small {
  color: var(--fg-3);
  line-height: 1.35;
}
.tag-filter-autocomplete-option .order-autocomplete-main {
  flex: 1 1 auto;
  min-width: 0;
}
.tag-filter-autocomplete-option .order-autocomplete-meta {
  flex: 0 1 min(330px, 44%);
  max-width: min(330px, 44%);
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}
.tag-filter-autocomplete-option .order-autocomplete-meta em {
  display: inline-block;
  flex: 0 0 auto;
  max-width: 185px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}
.tag-filter-autocomplete-option .order-autocomplete-meta em.is-long {
  flex: 1 1 auto;
  min-width: 88px;
}
.order-autocomplete-meta em.action {
  flex: 0 0 auto;
  background: color-mix(in oklab, var(--blue-accent) 14%, var(--chip-bg));
  color: var(--fg-1);
  font-weight: 750;
}
.section-table-wrap {
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
}
.section-data-table {
  width: 100%;
  min-width: 940px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.section-data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 10px;
  border-bottom: 1px solid var(--stroke-1);
  background: color-mix(in oklab, var(--bg-surface) 88%, var(--bg-subtle));
  color: var(--fg-2);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-align: left;
  text-transform: uppercase;
}
.section-data-table td {
  padding: 9px 10px;
  border-bottom: 1px solid color-mix(in oklab, var(--stroke-1) 72%, transparent);
  color: var(--fg-2);
  vertical-align: top;
}
.section-data-table tr:last-child td { border-bottom: 0; }
.section-data-table tr[hidden] { display: none; }
.section-data-table td strong {
  display: block;
  color: var(--fg-1);
  font-size: 13px;
  line-height: 1.22;
}
.section-data-table .table-link {
  color: var(--fg-1);
  font-weight: 800;
  text-decoration: none;
  text-underline-offset: 3px;
}
.section-data-table .table-link:hover {
  color: var(--blue-accent);
  text-decoration: underline;
}
.section-data-table .strong-link {
  display: inline-block;
  line-height: 1.22;
}
.section-data-table td small {
  display: block;
  margin-top: 4px;
  color: var(--fg-3);
  line-height: 1.24;
}
.section-data-table .row-action-cell {
  width: 1%;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg-surface);
  box-shadow: 1px 0 0 color-mix(in oklab, var(--stroke-1) 82%, transparent);
  text-align: left;
  white-space: nowrap;
}
.section-data-table th.row-action-cell {
  z-index: 4;
  background: color-mix(in oklab, var(--bg-surface) 88%, var(--bg-subtle));
}
.section-data-table .row-action-cell .button {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 12px;
}
.row-action-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.row-action-group .button {
  white-space: nowrap;
}
.row-action-group.asana-row-action {
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  min-width: 150px;
  max-width: 220px;
  white-space: normal;
}
.asana-row-action .row-action-copy strong,
.asana-row-action .row-action-copy small {
  display: block;
  overflow-wrap: anywhere;
}
.asana-row-action .row-action-copy strong {
  color: var(--fg-1);
  font-size: 13px;
}
.asana-row-action .row-action-copy small {
  margin-top: 3px;
  color: var(--fg-3);
  font-size: 12px;
  line-height: 1.25;
}
.section-data-table .wide-cell {
  min-width: 220px;
}
.detail-table-wrap .section-data-table,
.detail-data-table {
  min-width: 860px;
}
.detail-data-table td:nth-child(3) {
  color: var(--fg-1);
  font-weight: 700;
}
.detail-area-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: color-mix(in oklab, var(--bg-subtle) 82%, transparent);
  color: var(--fg-2);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.money-value {
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
}
.order-sheet {
  display: grid;
  gap: 14px;
}
.order-sheet > * {
  min-width: 0;
}
.order-sheet-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: color-mix(in oklab, var(--bg-subtle) 58%, var(--bg-surface));
}
.order-sheet-title h2 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 30px;
  font-weight: 950;
  line-height: 1;
}
.order-sheet-title p:not(.eyebrow) {
  max-width: 760px;
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  color: var(--fg-2);
  font-size: 15px;
  line-height: 1.35;
}
.order-sheet-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.order-sheet-parties {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.order-party-block,
.order-money-tile,
.order-sheet-group,
.order-sheet-source-fields {
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
}
.order-party-block {
  min-width: 0;
  padding: 14px;
}
.order-party-block span,
.order-money-tile span {
  display: block;
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .07em;
  line-height: 1;
  text-transform: uppercase;
}
.order-party-block strong {
  display: block;
  max-width: 100%;
  min-width: 0;
  margin-top: 8px;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  color: var(--fg-1);
  font-size: 16px;
  line-height: 1.2;
}
.order-party-block small {
  display: block;
  margin-top: 7px;
  color: var(--fg-3);
  line-height: 1.35;
}
.order-money-ledger {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.order-money-tile {
  min-width: 0;
  padding: 14px;
  border-top: 3px solid var(--blue-accent);
}
.order-money-tile.success { border-top-color: var(--success); }
.order-money-tile.warn {
  border-top-color: var(--warning);
  background: color-mix(in oklab, var(--warning) 5%, var(--bg-surface));
}
.order-money-tile strong {
  display: block;
  margin-top: 8px;
  color: var(--fg-1);
  font-size: 23px;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  line-height: 1;
}
.order-money-tile small {
  display: block;
  margin-top: 7px;
  color: var(--fg-3);
  line-height: 1.3;
}
.order-sheet-grid {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.order-sheet-group {
  min-width: 0;
  overflow: hidden;
}
.order-sheet-group h3 {
  margin: 0;
  padding: 13px 14px;
  border-bottom: 1px solid var(--stroke-1);
  color: var(--fg-1);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.1;
}
.order-sheet-group dl {
  display: grid;
  margin: 0;
}
.order-sheet-group dl > div {
  display: grid;
  grid-template-columns: minmax(110px, .42fr) minmax(0, .58fr);
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid color-mix(in oklab, var(--stroke-1) 70%, transparent);
}
.order-sheet-group dl > div:last-child {
  border-bottom: 0;
}
.order-sheet-group dt {
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 750;
}
.order-sheet-group dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 13px;
  line-height: 1.3;
}
.order-sheet-source-fields {
  padding: 16px;
}
.portal-modal-body:has(.order-sheet) {
  background: var(--bg-subtle);
}
.strategy-session-sheet {
  display: grid;
  gap: 12px;
}
.strategy-session-sheet > * {
  min-width: 0;
}
.strategy-session-hero,
.strategy-session-lane,
.strategy-session-panel,
.strategy-session-people,
.strategy-session-source-fields {
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
}
.strategy-session-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  background: color-mix(in oklab, var(--bg-subtle) 62%, var(--bg-surface));
}
.strategy-session-title h2 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 28px;
  font-weight: 950;
  line-height: 1;
}
.strategy-session-title p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--fg-2);
  font-size: 14px;
  line-height: 1.35;
}
.strategy-session-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.strategy-session-lane {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}
.strategy-lane-step {
  min-width: 0;
  padding: 13px 14px;
  border-right: 1px solid var(--stroke-1);
}
.strategy-lane-step:last-child {
  border-right: 0;
}
.strategy-lane-step span,
.strategy-role-list span {
  display: block;
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .07em;
  line-height: 1;
  text-transform: uppercase;
}
.strategy-lane-step strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 15px;
  line-height: 1.2;
}
.strategy-lane-step small {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: var(--fg-3);
  line-height: 1.3;
}
.strategy-session-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.strategy-session-panel {
  overflow: hidden;
}
.strategy-session-panel h3 {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--stroke-1);
  color: var(--fg-1);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.1;
}
.strategy-session-panel dl {
  display: grid;
  margin: 0;
}
.strategy-session-panel dl > div {
  display: grid;
  grid-template-columns: minmax(92px, .38fr) minmax(0, .62fr);
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid color-mix(in oklab, var(--stroke-1) 70%, transparent);
}
.strategy-session-panel dl > div:last-child {
  border-bottom: 0;
}
.strategy-session-panel dt {
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 750;
}
.strategy-session-panel dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 13px;
  line-height: 1.3;
}
.strategy-session-people,
.strategy-session-source-fields {
  padding: 15px;
}
.strategy-role-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.strategy-role-list div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: color-mix(in oklab, var(--bg-subtle) 64%, var(--bg-surface));
}
.strategy-role-list strong {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 14px;
  line-height: 1.2;
}
.portal-modal-body:has(.strategy-session-sheet) {
  background: var(--bg-subtle);
}
.tag-detail-sheet {
  display: grid;
  gap: 12px;
}
.tag-detail-sheet > * {
  min-width: 0;
}
.tag-detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: color-mix(in oklab, var(--bg-subtle) 58%, var(--bg-surface));
}
.tag-detail-title h2 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 28px;
  font-weight: 950;
  line-height: 1;
}
.tag-detail-title p:not(.eyebrow) {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  color: var(--fg-3);
  font-size: 13px;
  line-height: 1.35;
}
.tag-detail-signal-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 360px;
}
.tag-detail-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
  overflow: hidden;
}
.tag-detail-facts > div,
.tag-detail-block {
  min-width: 0;
}
.tag-detail-facts > div {
  padding: 14px;
  border-left: 1px solid var(--stroke-1);
}
.tag-detail-facts > div:first-child {
  border-left: 0;
}
.tag-detail-facts span {
  display: block;
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .07em;
  line-height: 1;
  text-transform: uppercase;
}
.tag-detail-facts strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 20px;
  font-weight: 950;
  line-height: 1;
}
.tag-detail-facts small {
  display: block;
  margin-top: 7px;
  color: var(--fg-3);
  line-height: 1.3;
}
.tag-detail-copy-grid {
  display: grid;
  grid-template-columns: minmax(0, .46fr) minmax(0, .54fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
}
.tag-detail-block {
  padding: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.tag-detail-copy-grid .tag-detail-block + .tag-detail-block {
  border-left: 1px solid var(--stroke-1);
}
.tag-detail-assignments {
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
}
.tag-detail-block h3 {
  margin: 0 0 9px;
  color: var(--fg-1);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.1;
}
.tag-detail-block p {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--fg-2);
  font-size: 14px;
  line-height: 1.5;
}
.tag-detail-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.tag-detail-section-head p {
  margin-top: 5px;
  color: var(--fg-3);
  font-size: 13px;
}
.tag-assignment-wrap {
  max-height: 360px;
}
.tag-assignment-table {
  min-width: 860px;
}
.portal-modal-body:has(.tag-detail-sheet) {
  background: var(--bg-subtle);
}
.zendesk-ticket-sheet {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}
.portal-modal-body:has(.zendesk-ticket-sheet) {
  padding: 0;
  background: var(--bg-subtle);
}
.portal-modal-body .zendesk-ticket-sheet {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.zendesk-ticket-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--stroke-1);
  background: var(--bg-surface);
}
.zendesk-ticket-title-block {
  min-width: 0;
}
.zendesk-ticket-title-block h2 {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 28px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.12;
}
.zendesk-ticket-title-block p:not(.eyebrow) {
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  color: var(--fg-3);
  font-size: 13px;
  line-height: 1.35;
}
.zendesk-ticket-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}
.zendesk-ticket-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  min-height: 560px;
}
.zendesk-ticket-main {
  min-width: 0;
  padding: 22px;
}
.zendesk-ticket-side {
  min-width: 0;
  border-left: 1px solid var(--stroke-1);
  background: color-mix(in oklab, var(--bg-subtle) 62%, var(--bg-surface));
}
.zendesk-ticket-section {
  min-width: 0;
  padding: 0 0 22px;
}
.zendesk-ticket-section + .zendesk-ticket-section {
  padding-top: 20px;
  border-top: 1px solid var(--stroke-1);
}
.zendesk-ticket-section h3,
.zendesk-section-head h3 {
  margin: 0;
  color: var(--fg-1);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.1;
}
.zendesk-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.zendesk-section-head span {
  color: var(--fg-3);
  font-size: 12px;
  white-space: nowrap;
}
.zendesk-description {
  max-width: 820px;
  margin: 10px 0 0;
  overflow-wrap: anywhere;
  color: var(--fg-2);
  font-size: 14px;
  line-height: 1.55;
}
.zendesk-conversation-list {
  display: grid;
  gap: 12px;
}
.zendesk-comment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
}
.zendesk-comment .avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}
.zendesk-comment-card {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-surface);
}
.zendesk-comment.internal .zendesk-comment-card {
  border-color: color-mix(in oklab, var(--gold-500) 34%, var(--stroke-1));
  background: color-mix(in oklab, var(--gold-500) 8%, var(--bg-surface));
}
.zendesk-comment-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.zendesk-comment-card strong {
  color: var(--fg-1);
  font-size: 13px;
  font-weight: 850;
}
.zendesk-comment-card small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.3;
}
.zendesk-comment-type {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.zendesk-comment.internal .zendesk-comment-type {
  border-color: color-mix(in oklab, var(--gold-500) 34%, transparent);
  color: color-mix(in oklab, var(--gold-600) 88%, var(--fg-1));
}
.zendesk-comment-card p {
  margin: 9px 0 0;
  overflow-wrap: anywhere;
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.zendesk-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.zendesk-attachment-list span {
  padding: 4px 7px;
  border: 1px solid var(--stroke-1);
  border-radius: 7px;
  color: var(--fg-2);
  font-size: 11px;
}
.zendesk-property-list {
  display: grid;
}
.zendesk-property-row {
  display: grid;
  grid-template-columns: minmax(94px, .38fr) minmax(0, .62fr);
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid color-mix(in oklab, var(--stroke-1) 72%, transparent);
}
.zendesk-property-row dt {
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}
.zendesk-property-row dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 13px;
  line-height: 1.35;
}
.zendesk-property-group {
  min-width: 0;
  padding: 16px;
  border-bottom: 1px solid color-mix(in oklab, var(--stroke-1) 72%, transparent);
}
.zendesk-property-group h3 {
  margin: 0 0 10px;
  color: var(--fg-1);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.15;
}
.zendesk-property-group dl {
  display: grid;
  margin: 0;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-surface);
}
.zendesk-property-group dl > div {
  display: grid;
  grid-template-columns: minmax(100px, .42fr) minmax(0, .58fr);
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border-bottom: 1px solid color-mix(in oklab, var(--stroke-1) 68%, transparent);
}
.zendesk-property-group dl > div:last-child {
  border-bottom: 0;
}
.zendesk-property-group dt {
  color: var(--fg-3);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
}
.zendesk-property-group dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 12.5px;
  line-height: 1.35;
}
.zendesk-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.asana-task-sheet {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}
.portal-modal-body:has(.asana-task-sheet) {
  padding: 0;
  background: var(--bg-subtle);
}
.portal-modal-body .asana-task-sheet {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.asana-task-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--stroke-1);
  background: var(--bg-surface);
}
.asana-task-title-block {
  min-width: 0;
}
.asana-task-title-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  margin-top: 8px;
}
.asana-task-title-row h2 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 28px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.12;
}
.asana-task-title-row p {
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  color: var(--fg-3);
  font-size: 13px;
  line-height: 1.35;
}
.asana-complete-dot {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 4px;
  border: 2px solid color-mix(in oklab, var(--fg-3) 58%, transparent);
  border-radius: 999px;
  color: white;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}
.asana-complete-dot.done {
  border-color: var(--success);
  background: var(--success);
}
.asana-task-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}
.asana-task-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  min-height: 520px;
}
.asana-task-main {
  min-width: 0;
  padding: 22px;
}
.asana-task-side {
  min-width: 0;
  border-left: 1px solid var(--stroke-1);
  background: color-mix(in oklab, var(--bg-subtle) 62%, var(--bg-surface));
}
.asana-task-section {
  min-width: 0;
  padding: 0 0 22px;
}
.asana-task-section + .asana-task-section {
  padding-top: 20px;
  border-top: 1px solid var(--stroke-1);
}
.asana-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}
.asana-section-head h3 {
  margin: 0;
  color: var(--fg-1);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.1;
}
.asana-section-head span {
  color: var(--fg-3);
  font-size: 12px;
  white-space: nowrap;
}
.asana-task-notes {
  max-width: 760px;
  color: var(--fg-2);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.asana-comment-list {
  display: grid;
  gap: 12px;
}
.asana-comment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
}
.asana-comment .avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}
.asana-comment-body {
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: color-mix(in oklab, var(--bg-subtle) 42%, var(--bg-surface));
}
.asana-comment-body header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.asana-comment-body strong {
  color: var(--fg-1);
  font-size: 13px;
  font-weight: 850;
}
.asana-comment-body small {
  font-size: 12px;
}
.asana-comment-body p {
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.5;
}
.asana-field-list {
  display: grid;
  margin: 0;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-surface);
}
.asana-field-list > div {
  display: grid;
  grid-template-columns: minmax(150px, .34fr) minmax(0, .66fr);
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border-bottom: 1px solid color-mix(in oklab, var(--stroke-1) 68%, transparent);
}
.asana-field-list > div:last-child {
  border-bottom: 0;
}
.asana-field-list dt {
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
}
.asana-field-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 13px;
  line-height: 1.35;
}
.asana-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
.asana-field-grid > div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: color-mix(in oklab, var(--bg-subtle) 48%, var(--bg-surface));
}
.asana-field-grid dt {
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.asana-field-grid dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 13px;
  line-height: 1.3;
}
.asana-tag-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.asana-property-list {
  display: grid;
}
.asana-property-group {
  min-width: 0;
  padding: 16px;
  border-bottom: 1px solid color-mix(in oklab, var(--stroke-1) 72%, transparent);
}
.asana-property-group h3 {
  margin: 0 0 10px;
  color: var(--fg-1);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.15;
}
.asana-property-group dl {
  display: grid;
  margin: 0;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-surface);
}
.asana-property-group dl > div {
  display: grid;
  grid-template-columns: minmax(96px, .42fr) minmax(0, .58fr);
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border-bottom: 1px solid color-mix(in oklab, var(--stroke-1) 68%, transparent);
}
.asana-property-group dl > div:last-child {
  border-bottom: 0;
}
.asana-property-group dt {
  color: var(--fg-3);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
}
.asana-property-group dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 12.5px;
  line-height: 1.35;
}
.asana-property-row {
  display: grid;
  grid-template-columns: minmax(84px, .38fr) minmax(0, .62fr);
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid color-mix(in oklab, var(--stroke-1) 72%, transparent);
}
.asana-property-row dt {
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}
.asana-property-row dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 13px;
  line-height: 1.35;
}
.asana-property-row small {
  display: block;
  margin-top: 4px;
  line-height: 1.25;
}
.asana-activity-feed {
  display: grid;
  gap: 0;
}
.asana-activity-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 0;
}
.asana-activity-item + .asana-activity-item {
  border-top: 1px solid color-mix(in oklab, var(--stroke-1) 62%, transparent);
}
.asana-activity-dot {
  width: 9px;
  height: 9px;
  margin: 6px auto 0;
  border-radius: 999px;
  background: color-mix(in oklab, var(--blue-accent) 72%, var(--fg-3));
}
.asana-activity-item header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.asana-activity-item strong {
  color: var(--fg-1);
  font-size: 13px;
  font-weight: 850;
}
.asana-activity-item small {
  font-size: 12px;
}
.asana-activity-item p {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.45;
}
.signal-type.info {
  border-color: color-mix(in oklab, var(--blue-accent) 30%, transparent);
  background: color-mix(in oklab, var(--blue-accent) 8%, var(--bg-surface));
}
.asana-table-wrap .section-data-table,
.asana-task-table {
  min-width: 980px;
}
.source-browse-table-wrap {
  max-height: 640px;
}
.source-browse-table,
.source-browse-table-wrap .section-data-table {
  min-width: 1180px;
}
.orders-browse-table {
  min-width: 1320px;
}
.deals-browse-table {
  min-width: 1200px;
}
.tags-browse-table {
  min-width: 980px;
}
.events-browse-table {
  min-width: 1280px;
}
.events-browse-table .row-action-cell {
  min-width: 132px;
}
.events-browse-table th:nth-child(2),
.events-browse-table td:nth-child(2) {
  min-width: 156px;
  white-space: nowrap;
}
.events-browse-table th:nth-child(3),
.events-browse-table td:nth-child(3) {
  min-width: 150px;
}
.events-browse-table th:nth-child(4),
.events-browse-table td:nth-child(4) {
  min-width: 210px;
}
.events-browse-table th:nth-child(5),
.events-browse-table td:nth-child(5),
.events-browse-table th:nth-child(6),
.events-browse-table td:nth-child(6),
.events-browse-table th:nth-child(7),
.events-browse-table td:nth-child(7) {
  min-width: 92px;
  white-space: nowrap;
}
.events-browse-table th:nth-child(8),
.events-browse-table td:nth-child(8) {
  min-width: 108px;
  white-space: nowrap;
}
.events-browse-table th:nth-child(11),
.events-browse-table td:nth-child(11) {
  min-width: 150px;
}
.support-browse-table {
  min-width: 980px;
}
.compact-button,
a.compact-button,
button.compact-button {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 12px;
}
.signal-type {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--fg-1);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.signal-type.success { border-color: color-mix(in oklab, var(--success) 28%, transparent); background: color-mix(in oklab, var(--success) 8%, var(--bg-surface)); }
.signal-type.warn { border-color: color-mix(in oklab, var(--warning) 28%, transparent); background: color-mix(in oklab, var(--warning) 10%, var(--bg-surface)); }
.signal-type.risk { border-color: color-mix(in oklab, var(--error) 28%, transparent); background: color-mix(in oklab, var(--error) 8%, var(--bg-surface)); }
.signal-type.critical {
  border-color: color-mix(in oklab, #ff1f1f 42%, transparent);
  background: color-mix(in oklab, #ff1f1f 13%, var(--bg-surface));
  color: var(--fg-1);
  box-shadow: 0 0 0 2px color-mix(in oklab, #ff1f1f 10%, transparent);
}

.item-list { display: grid; gap: 10px; margin-top: 14px; }
.paged-item[hidden] { display: none; }
.list-item {
  display: block;
  padding: 12px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-surface);
}
.list-item:hover { border-color: color-mix(in oklab, var(--blue-accent) 28%, transparent); }
.list-item strong { display: block; color: var(--fg-1); font-size: 17px; line-height: 1.18; }
.list-item p { margin: 6px 0 0; color: var(--fg-2); line-height: 1.35; }
.list-item small { display: block; margin-top: 7px; }
.concierge-section .list-item { padding: 10px 11px; }
.concierge-section .list-item strong { font-size: 15px; }
.concierge-section .list-item p { font-size: 14px; }
.concierge-section .list-item small { font-size: 12px; }

.loading-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed color-mix(in oklab, var(--blue-accent) 30%, transparent);
  border-radius: 8px;
  background: var(--bg-subtle);
  color: var(--fg-3);
}
.loading-row p { margin: 0; }
.spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid color-mix(in oklab, var(--blue-accent) 20%, transparent);
  border-top-color: var(--blue-accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--stroke-1);
}
.pager-status { min-width: 90px; color: var(--fg-3); font-size: 13px; text-align: center; }
.pager button:disabled { cursor: not-allowed; opacity: .45; }

.data-notes {
  margin-top: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.data-notes h2 { margin: 0 0 8px; font-size: 18px; }
.data-notes ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.data-notes li {
  padding: 6px 10px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg-surface) 80%, transparent);
  color: var(--fg-3);
  font-size: 13px;
}

.customer-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: linear-gradient(135deg, color-mix(in oklab, var(--bg-surface) 94%, var(--gold-500) 6%), var(--bg-subtle));
  box-shadow: var(--shadow-xs);
}
.customer-detail-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 16px;
}
.customer-detail-identity h2 {
  margin: 0;
  color: var(--fg-1);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: .96;
}
.customer-detail-identity p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--fg-2);
  line-height: 1.35;
}
.customer-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.customer-detail-platforms { margin-bottom: 14px; }
.customer-workspace .customer-detail-header {
  align-items: center;
  padding: 15px 18px;
  background: var(--bg-surface);
}
.customer-workspace .customer-detail-identity {
  gap: 12px;
}
.customer-workspace .customer-detail-identity .c360-avatar {
  width: 50px;
  min-width: 50px;
  height: 50px;
  font-size: 17px;
}
.customer-workspace .customer-detail-identity h2 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
}
.customer-workspace .customer-detail-identity p:not(.eyebrow) {
  margin-top: 5px;
  font-size: 13px;
}
.customer-workspace .c360-prestige-row {
  margin-top: 8px;
}
.customer-workspace .customer-detail-identity .customer-source-scope {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 5px 8px;
  border: 1px solid color-mix(in oklab, var(--success) 35%, var(--stroke-1));
  border-radius: 999px;
  background: color-mix(in oklab, var(--success) 8%, var(--bg-surface));
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 750;
}
.customer-identity-choice-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.customer-identity-choice {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--fg-1);
  text-decoration: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.customer-identity-choice:hover,
.customer-identity-choice:focus-visible {
  border-color: color-mix(in oklab, var(--gold-500) 55%, var(--stroke-1));
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.customer-identity-choice-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: color-mix(in oklab, var(--gold-500) 18%, var(--bg-surface));
  color: var(--fg-1);
  font-size: 13px;
  font-weight: 900;
}
.customer-identity-choice-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.customer-identity-choice-copy strong {
  font-size: 15px;
  line-height: 1.2;
}
.customer-identity-choice-copy span,
.customer-identity-choice-copy small {
  overflow: hidden;
  color: var(--fg-2);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.customer-identity-choice-copy small {
  color: var(--fg-3);
}
.customer-identity-choice-action {
  color: var(--navy-700);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}
.customer-workspace-tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  margin-top: 12px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: color-mix(in oklab, var(--bg-subtle) 80%, var(--bg-surface));
}
.customer-workspace-tabs a {
  position: relative;
  display: inline-flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--fg-2);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}
.customer-workspace-tabs a:hover {
  color: var(--fg-1);
  background: color-mix(in oklab, var(--bg-surface) 72%, transparent);
}
.customer-workspace-tabs a[aria-current="page"] {
  border-color: color-mix(in oklab, var(--gold-500) 34%, var(--stroke-1));
  background: var(--bg-surface);
  color: var(--fg-1);
  box-shadow: var(--shadow-xs);
}
.customer-workspace-tabs a[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 3px;
  left: 14px;
  height: 3px;
  border-radius: 999px;
  background: var(--gold-500);
}
.customer-workspace-tabs a:focus-visible {
  z-index: 1;
  outline: 3px solid color-mix(in oklab, var(--blue-accent) 48%, transparent);
  outline-offset: 1px;
}
.customer-relationship-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}
.customer-relationship-strip > div {
  min-width: 0;
  padding: 14px 16px 15px;
  border-left: 1px solid var(--stroke-1);
}
.customer-relationship-strip > div:first-child {
  border-left: 0;
}
.customer-relationship-strip span {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .09em;
  line-height: 1.2;
  text-transform: uppercase;
}
.customer-relationship-strip strong {
  display: block;
  color: var(--fg-1);
  font-size: 15px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.customer-relationship-strip p {
  margin: 5px 0 0;
  color: var(--fg-2);
  font-size: 12.5px;
  line-height: 1.35;
}
.customer-relationship-strip .customer-relationship-attention {
  box-shadow: inset 0 3px 0 var(--blue-accent);
}
.customer-relationship-strip.warn .customer-relationship-attention,
.customer-relationship-strip.loading .customer-relationship-attention {
  background: color-mix(in oklab, var(--warning) 7%, var(--bg-surface));
  box-shadow: inset 0 3px 0 var(--warning);
}
.customer-relationship-strip.risk .customer-relationship-attention,
.customer-relationship-strip.critical .customer-relationship-attention {
  background: color-mix(in oklab, var(--error) 8%, var(--bg-surface));
  box-shadow: inset 0 4px 0 var(--error);
}
.customer-relationship-strip.clear .customer-relationship-attention {
  background: color-mix(in oklab, var(--success) 6%, var(--bg-surface));
  box-shadow: inset 0 3px 0 var(--success);
}
.customer-workspace-content {
  scroll-margin-top: 24px;
}
.customer-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.customer-detail-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: color-mix(in oklab, var(--bg-surface) 88%, var(--bg-subtle));
  box-shadow: var(--shadow-xs);
}
.customer-detail-summary,
.customer-detail-priority,
.customer-detail-source-map,
.customer-detail-record-card,
.netsuite-validation-card { grid-column: span 2; }
.customer-detail-wide { grid-column: 1 / -1; }
.customer-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.customer-card-head h3 {
  margin: 0;
  color: var(--fg-1);
  font-size: 18px;
  line-height: 1.1;
}
.customer-card-head-sub { margin-bottom: 10px; }
.c360-card-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-width: min(100%, 260px);
}
.c360-card-meta .platform-badges {
  justify-content: flex-end;
}
.c360-generated-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--stroke-1);
  color: var(--fg-3);
  font-size: 11px;
  line-height: 1.3;
}
.c360-section-notes {
  display: grid;
  gap: 7px;
  margin: 0 0 10px;
}
.c360-section-notes > div {
  display: grid;
  grid-template-columns: minmax(150px, .46fr) minmax(0, 1fr);
  gap: 6px 12px;
  padding: 9px 10px;
  border: 1px solid var(--stroke-1);
  border-left: 3px solid var(--blue-accent);
  border-radius: 8px;
  background: color-mix(in oklab, var(--bg-surface) 84%, var(--bg-subtle));
}
.c360-section-notes > div.warn { border-left-color: var(--warning); background: color-mix(in oklab, var(--warning) 5%, var(--bg-surface)); }
.c360-section-notes > div.risk { border-left-color: var(--error); background: color-mix(in oklab, var(--error) 5%, var(--bg-surface)); }
.c360-section-notes > div.critical { border-left-color: #ff1f1f; background: color-mix(in oklab, #ff1f1f 8%, var(--bg-surface)); }
.c360-section-notes > div.success { border-left-color: var(--success); }
.c360-section-notes strong {
  color: var(--fg-1);
  font-size: 13px;
  line-height: 1.2;
}
.c360-section-notes span {
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.32;
}
.c360-section-notes small {
  grid-column: 2;
  color: var(--fg-3);
  font-size: 11px;
}
.c360-data-notes ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.c360-data-notes li {
  padding: 9px 10px;
  border: 1px solid var(--stroke-1);
  border-left: 3px solid var(--blue-accent);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.34;
}
.payment-workspace {
  display: grid;
  grid-column: 1 / -1;
  gap: 14px;
  min-width: 0;
}
.payment-command-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(270px, .7fr);
  gap: 22px;
  align-items: center;
  min-width: 0;
  padding: 18px 20px 18px 24px;
  overflow: hidden;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}
.payment-command-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--blue-accent);
}
.payment-command-panel.payment-tone-positive::before { background: var(--success); }
.payment-command-panel.payment-tone-attention::before { background: var(--warning); }
.payment-command-panel.payment-tone-critical::before { background: var(--error); }
.payment-command-copy {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
}
.payment-status-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in oklab, var(--blue-accent) 34%, var(--stroke-1));
  border-radius: 50%;
  background: color-mix(in oklab, var(--blue-accent) 9%, var(--bg-surface));
  color: var(--blue-accent);
}
.payment-tone-positive .payment-status-mark {
  border-color: color-mix(in oklab, var(--success) 38%, var(--stroke-1));
  background: color-mix(in oklab, var(--success) 9%, var(--bg-surface));
  color: var(--success);
}
.payment-tone-attention .payment-status-mark {
  border-color: color-mix(in oklab, var(--warning) 42%, var(--stroke-1));
  background: color-mix(in oklab, var(--warning) 10%, var(--bg-surface));
  color: color-mix(in oklab, var(--warning) 82%, var(--fg-1));
}
.payment-tone-critical .payment-status-mark {
  border-color: color-mix(in oklab, var(--error) 38%, var(--stroke-1));
  background: color-mix(in oklab, var(--error) 9%, var(--bg-surface));
  color: var(--error);
}
.payment-command-copy h3 {
  margin: 1px 0 0;
  color: var(--fg-1);
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.08;
}
.payment-command-copy p:not(.eyebrow) {
  max-width: 68ch;
  margin: 7px 0 0;
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.42;
}
.payment-freshness {
  min-width: 0;
  padding: 11px 13px;
  border-left: 3px solid var(--blue-accent);
  background: color-mix(in oklab, var(--bg-subtle) 78%, var(--bg-surface));
}
.payment-freshness-fresh { border-left-color: var(--success); }
.payment-freshness-aging,
.payment-freshness-stale,
.payment-freshness-syncing,
.payment-freshness-failed { border-left-color: var(--warning); }
.payment-freshness-unavailable { border-left-color: var(--error); }
.payment-freshness > span {
  display: block;
  color: var(--fg-1);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}
.payment-freshness > p,
.payment-freshness details p {
  margin: 5px 0 0;
  color: var(--fg-2);
  font-size: 11.5px;
  line-height: 1.36;
}
.payment-freshness details {
  margin-top: 7px;
  color: var(--fg-3);
  font-size: 11px;
}
.payment-freshness summary {
  min-height: 24px;
  color: var(--fg-2);
  font-weight: 800;
  cursor: pointer;
}
.payment-freshness summary:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--blue-accent) 48%, transparent);
  outline-offset: 2px;
}
.payment-summary-rail {
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--gold-500) 26%, var(--stroke-1));
  border-radius: 10px;
  background:
    linear-gradient(110deg, color-mix(in oklab, var(--gold-500) 8%, transparent), transparent 36%),
    var(--bg-surface);
  box-shadow: var(--shadow-xs);
}
.payment-summary-rail dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}
.payment-summary-rail dl > div {
  min-width: 0;
  padding: 15px 17px;
  border-left: 1px solid var(--stroke-1);
}
.payment-summary-rail dl > div:first-child { border-left: 0; }
.payment-summary-rail dt {
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1.2;
  text-transform: uppercase;
}
.payment-summary-rail dd {
  min-width: 0;
  margin: 7px 0 0;
  color: var(--fg-1);
  font-size: clamp(15px, 1.65vw, 21px);
  font-weight: 900;
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.payment-summary-rail .payment-summary-note {
  display: block;
  margin-top: 5px;
  color: var(--fg-3);
  font-size: 11px;
  line-height: 1.25;
}
.payment-workspace-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
}
.payment-workspace-section,
.payment-attention-section {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: color-mix(in oklab, var(--bg-surface) 92%, var(--bg-subtle));
  box-shadow: var(--shadow-xs);
}
.payment-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.payment-section-heading h3 {
  margin: 0;
  color: var(--fg-1);
  font-size: 18px;
  line-height: 1.15;
}
.payment-section-heading > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--fg-2);
  font-size: 11px;
  font-weight: 900;
}
.payment-record-list,
.payment-activity-list,
.payment-attention-list,
.payment-inline-facts {
  margin: 0;
  padding: 0;
  list-style: none;
}
.payment-record-list {
  display: grid;
  gap: 10px;
}
.payment-method-tabs {
  min-width: 0;
}
.payment-method-tablist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-subtle);
}
.payment-method-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--fg-2);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}
.payment-method-tab strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--fg-2) 9%, transparent);
  color: inherit;
  font-size: 10px;
}
.payment-method-tab[aria-selected="true"] {
  border-color: var(--stroke-1);
  background: var(--bg-surface);
  color: var(--fg-1);
  box-shadow: 0 1px 2px color-mix(in oklab, var(--fg-1) 8%, transparent);
}
.payment-method-tab:hover:not([aria-selected="true"]) {
  color: var(--fg-1);
  background: color-mix(in oklab, var(--bg-surface) 58%, transparent);
}
.payment-method-tab:focus-visible {
  outline: 3px solid var(--blue-accent);
  outline-offset: 2px;
}
.payment-method-tabpanel:focus-visible {
  outline: 3px solid var(--blue-accent);
  outline-offset: 3px;
}
.payment-method-tabpanel[hidden] {
  display: none;
}
.payment-method-tab-note {
  margin: 0 0 10px;
  color: var(--fg-2);
  font-size: 12px;
  line-height: 1.45;
}
.payment-method-tabpanel-inactive .payment-record {
  background: color-mix(in oklab, var(--bg-subtle) 58%, var(--bg-surface));
}
.payment-method-tab-empty {
  min-height: 116px;
}
.payment-record {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--stroke-1);
  border-radius: 9px;
  background: var(--bg-surface);
}
.payment-method-expired {
  border-color: color-mix(in oklab, var(--warning) 42%, var(--stroke-1));
}
.payment-method-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 34px;
  border: 1px solid color-mix(in oklab, var(--blue-accent) 26%, var(--stroke-1));
  border-radius: 7px;
  background: var(--bg-surface);
  color: var(--fg-1);
}
.payment-brand-icon {
  display: block;
  width: 30px;
  max-height: 22px;
}
.payment-brand-visa { color: #1a1f71; }
.payment-brand-mastercard { color: #eb001b; }
.payment-brand-amex { color: #006fcf; }
.payment-brand-discover { color: #d76500; }
.payment-brand-jcb { color: #007940; }
.payment-brand-diners { color: #0079be; }
.payment-brand-card { color: var(--fg-2); }
.payment-method-expired .payment-method-brand,
.payment-method-removed .payment-method-brand,
.payment-method-verification_required .payment-method-brand {
  filter: saturate(.35);
  opacity: .72;
}
.payment-record-main { min-width: 0; }
.payment-record-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 7px 10px;
}
.payment-record-title > strong {
  min-width: 0;
  color: var(--fg-1);
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.payment-record-main > p {
  margin: 6px 0 0;
  color: var(--fg-2);
  font-size: 12px;
  line-height: 1.35;
}
.payment-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--fg-2);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
}
.payment-pill.payment-tone-positive {
  border-color: color-mix(in oklab, var(--success) 34%, var(--stroke-1));
  background: color-mix(in oklab, var(--success) 7%, var(--bg-surface));
  color: color-mix(in oklab, var(--success) 74%, var(--fg-1));
}
.payment-pill.payment-tone-attention {
  border-color: color-mix(in oklab, var(--warning) 40%, var(--stroke-1));
  background: color-mix(in oklab, var(--warning) 8%, var(--bg-surface));
  color: color-mix(in oklab, var(--warning) 72%, var(--fg-1));
}
.payment-pill.payment-tone-critical {
  border-color: color-mix(in oklab, var(--error) 38%, var(--stroke-1));
  background: color-mix(in oklab, var(--error) 8%, var(--bg-surface));
  color: color-mix(in oklab, var(--error) 78%, var(--fg-1));
}
.payment-inline-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 8px;
}
.payment-inline-facts li {
  position: relative;
  color: var(--fg-3);
  font-size: 10.5px;
  line-height: 1.3;
}
.payment-inline-facts li + li::before {
  content: "·";
  position: absolute;
  left: -8px;
}
.payment-plan {
  grid-template-columns: minmax(0, 1fr);
}
.payment-plan-balance {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 11px;
  overflow: hidden;
  border: 1px solid var(--stroke-1);
  border-radius: 7px;
  background: var(--stroke-1);
}
.payment-plan-balance > div {
  min-width: 0;
  padding: 9px 10px;
  background: color-mix(in oklab, var(--bg-subtle) 72%, var(--bg-surface));
}
.payment-plan-balance span,
.payment-next-payment > span {
  display: block;
  color: var(--fg-3);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .07em;
  line-height: 1.2;
  text-transform: uppercase;
}
.payment-plan-balance strong {
  display: block;
  margin-top: 4px;
  color: var(--fg-1);
  font-size: 15px;
  line-height: 1.15;
}
.payment-plan-progress {
  color: var(--fg-3) !important;
  font-size: 10.5px !important;
}
.payment-next-payment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  border-left: 3px solid var(--gold-500);
  background: color-mix(in oklab, var(--gold-500) 6%, var(--bg-surface));
}
.payment-next-payment > strong {
  grid-row: span 2;
  color: var(--fg-1);
  font-size: 17px;
}
.payment-next-payment time {
  color: var(--fg-2);
  font-size: 11.5px;
}
.payment-next-payment .payment-pill {
  grid-column: 2;
  grid-row: 3;
  justify-self: end;
}
.payment-next-payment-empty {
  display: block;
  color: var(--fg-3) !important;
}
.payment-method-assignment::before {
  content: "Method · ";
  color: var(--fg-3);
  font-weight: 800;
}
.payment-actions {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--stroke-1);
}
.payment-action {
  display: grid;
  grid-template-columns: minmax(132px, auto) minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
}
.payment-action button {
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid var(--stroke-1);
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--fg-2);
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1.15;
  text-align: left;
}
.payment-action button:disabled {
  cursor: not-allowed;
  opacity: .7;
}
.payment-action small {
  color: var(--fg-3);
  font-size: 10px;
  line-height: 1.25;
}
.payment-attention-section {
  border-color: color-mix(in oklab, var(--warning) 48%, var(--stroke-1));
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--warning) 8%, transparent), transparent 36%),
    var(--bg-surface);
}
.payment-attention-list {
  display: grid;
  gap: 8px;
}
.payment-attention-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--warning);
  background: color-mix(in oklab, var(--warning) 6%, var(--bg-surface));
}
.payment-attention-list li > span {
  display: inline-flex;
  justify-content: center;
  padding-top: 2px;
  color: color-mix(in oklab, var(--warning) 80%, var(--fg-1));
}
.payment-attention-list strong {
  color: var(--fg-1);
  font-size: 13px;
}
.payment-attention-list p {
  margin: 4px 0 0;
  color: var(--fg-2);
  font-size: 12px;
  line-height: 1.35;
}
.payment-activity-list {
  border-top: 1px solid var(--stroke-1);
}
.payment-provider-history,
.payment-canonical-history {
  min-width: 0;
}
.payment-provider-history + .payment-canonical-history {
  margin-top: 22px;
}
.payment-history-source-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid color-mix(in oklab, var(--blue-accent) 22%, var(--stroke-1));
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: color-mix(in oklab, var(--blue-accent) 5%, var(--bg-surface));
}
.payment-history-source-heading h4 {
  margin: 0;
  color: var(--fg-1);
  font-size: 14px;
  line-height: 1.2;
}
.payment-history-source-heading p {
  max-width: 74ch;
  margin: 4px 0 0;
  color: var(--fg-2);
  font-size: 11px;
  line-height: 1.4;
}
.payment-history-source-heading > span {
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.payment-history-limit-note {
  margin: 0;
  padding: 9px 14px;
  border-inline: 1px solid var(--stroke-1);
  color: var(--fg-2);
  background: color-mix(in oklab, var(--warning) 7%, var(--bg-surface));
  font-size: 11px;
  line-height: 1.4;
}
.payment-provider-history-list {
  padding-inline: 10px;
  border: 1px solid var(--stroke-1);
  border-radius: 0 0 9px 9px;
}
.payment-provider-history-item::before {
  background: var(--blue-accent);
}
.payment-activity-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(118px, .26fr) minmax(0, 1fr) minmax(90px, auto);
  gap: 14px;
  align-items: start;
  min-width: 0;
  padding: 14px 4px 14px 18px;
  border-bottom: 1px solid var(--stroke-1);
}
.payment-activity-item:last-child { border-bottom: 0; }
.payment-activity-item::before {
  content: "";
  position: absolute;
  top: 19px;
  left: 2px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--bg-surface);
  border-radius: 50%;
  background: var(--blue-accent);
  box-shadow: 0 0 0 1px var(--stroke-2);
}
.payment-activity-settled::before,
.payment-activity-refunded::before,
.payment-activity-voided::before { background: var(--success); }
.payment-activity-declined::before,
.payment-activity-held_for_review::before { background: var(--warning); }
.payment-activity-ambiguous::before { background: var(--error); }
.payment-activity-date time {
  color: var(--fg-3);
  font-size: 11px;
  line-height: 1.3;
}
.payment-activity-copy {
  min-width: 0;
}
.payment-activity-copy > p {
  margin: 5px 0 0;
  color: var(--fg-2);
  font-size: 12px;
  line-height: 1.35;
}
.payment-activity-copy > small {
  display: block;
  margin-top: 4px;
  color: var(--fg-3);
  font-size: 10.5px;
  line-height: 1.3;
}
.payment-activity-copy .payment-actions {
  max-width: 620px;
}
.payment-activity-amount {
  color: var(--fg-1);
  font-size: 15px;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
}
.payment-empty-state {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  min-width: 0;
  padding: 18px;
  border: 1px dashed var(--stroke-2);
  border-radius: 9px;
  background: color-mix(in oklab, var(--bg-subtle) 66%, var(--bg-surface));
}
.payment-state-only { min-height: 150px; align-items: center; }
.payment-empty-state > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--blue-accent) 9%, var(--bg-surface));
  color: var(--blue-accent);
}
.payment-empty-state h3,
.payment-empty-state h4 {
  margin: 0;
  color: var(--fg-1);
  font-size: 15px;
  line-height: 1.2;
}
.payment-empty-state p {
  margin: 6px 0 0;
  color: var(--fg-2);
  font-size: 12px;
  line-height: 1.4;
}
.payment-restricted .payment-empty-state {
  border-style: solid;
}

.customer-detail-divider {
  height: 1px;
  margin: 14px 0;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--stroke-1), transparent);
}

.customer-account-brief {
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--bg-surface) 92%, var(--gold-500) 4%), var(--bg-surface));
}

.customer-brief-count {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg-subtle) 74%, var(--bg-surface));
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.customer-account-brief-body {
  display: grid;
  gap: 12px;
}

.customer-brief-rows {
  overflow: hidden;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
}

.customer-brief-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(118px, .54fr) minmax(118px, .48fr) minmax(180px, 1fr);
  gap: 10px 14px;
  align-items: center;
  min-height: 55px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--stroke-1);
}

.customer-brief-row:last-child { border-bottom: 0; }

.customer-brief-row::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 0;
  width: 3px;
  border-radius: 999px;
  background: var(--blue-accent);
}

.customer-brief-row.success::before { background: var(--success); }
.customer-brief-row.warn::before { background: var(--warning); }
.customer-brief-row.risk::before { background: var(--error); }
.customer-brief-row.critical::before {
  width: 5px;
  background: #ff1f1f;
  box-shadow: 0 0 14px color-mix(in oklab, #ff1f1f 70%, transparent);
}

.customer-brief-label {
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1.15;
  text-transform: uppercase;
}

.customer-brief-value {
  min-width: 0;
  color: var(--fg-1);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.customer-brief-detail {
  min-width: 0;
  color: var(--fg-2);
  font-size: 12.5px;
  line-height: 1.28;
}

.customer-money-strip {
  display: grid;
  grid-template-columns: minmax(120px, .42fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 11px;
  border: 1px solid color-mix(in oklab, var(--gold-500) 26%, var(--stroke-1));
  border-radius: 10px;
  background:
    linear-gradient(135deg, color-mix(in oklab, var(--gold-500) 10%, transparent), transparent 44%),
    color-mix(in oklab, var(--bg-subtle) 84%, var(--bg-surface));
}

.customer-money-strip-head {
  display: flex;
  align-items: center;
  min-width: 0;
}

.customer-money-strip-head h4 {
  margin: 2px 0 0;
  color: var(--fg-1);
  font-size: 15px;
  line-height: 1.1;
}

.customer-money-inline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  min-width: 0;
}

.customer-money-item {
  min-width: 0;
  padding: 2px 12px;
  border-left: 1px solid var(--stroke-1);
}

.customer-money-item:first-child {
  border-left: 0;
  padding-left: 0;
}

.customer-money-item span,
.customer-money-item small {
  display: block;
  color: var(--fg-3);
  font-size: 11px;
  line-height: 1.25;
}

.customer-money-item span {
  font-weight: 800;
  text-transform: uppercase;
}

.customer-money-item strong {
  display: block;
  margin: 3px 0;
  color: var(--fg-1);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.source-validation-band {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background:
    linear-gradient(135deg, color-mix(in oklab, var(--bg-surface) 94%, var(--blue-accent) 6%), var(--bg-subtle));
  box-shadow: var(--shadow-xs);
}

.source-validation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.source-validation-head h2 {
  margin: 0;
  color: var(--fg-1);
  font-size: 20px;
  line-height: 1.1;
}

.source-validation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.source-validation-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--stroke-1);
  border-top: 3px solid var(--blue-accent);
  border-radius: 8px;
  background: var(--bg-surface);
}

.source-validation-item.success { border-top-color: var(--success); }
.source-validation-item.warn,
.source-validation-item.denied { border-top-color: var(--warning); background: color-mix(in oklab, var(--warning) 5%, var(--bg-surface)); }
.source-validation-item.risk,
.source-validation-item.error { border-top-color: var(--error); background: color-mix(in oklab, var(--error) 5%, var(--bg-surface)); }
.source-validation-item.critical { border-top-color: #ff1f1f; background: color-mix(in oklab, #ff1f1f 8%, var(--bg-surface)); }

.source-validation-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.source-validation-title strong {
  color: var(--fg-1);
  font-size: 14px;
  line-height: 1.15;
}

.source-validation-item p {
  margin: 8px 0 0;
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.35;
}

.netsuite-validation-card {
  border-top: 3px solid color-mix(in oklab, var(--blue-accent) 70%, var(--gold-500));
}

.netsuite-validation-card.denied,
.netsuite-validation-card.error,
.netsuite-validation-card.not_available {
  border-top-color: var(--warning);
}

.netsuite-validation-banner {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid color-mix(in oklab, var(--blue-accent) 24%, var(--stroke-1));
  border-radius: 8px;
  background: color-mix(in oklab, var(--blue-accent) 7%, var(--bg-surface));
}

.netsuite-validation-banner strong {
  color: var(--fg-1);
  font-size: 17px;
  line-height: 1.1;
}

.netsuite-validation-banner span {
  color: var(--fg-2);
  font-size: 14px;
  line-height: 1.3;
}
.netsuite-record-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.responsive-table {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
}

.netsuite-record-table th,
.netsuite-record-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--stroke-1);
  color: var(--fg-2);
  text-align: left;
  vertical-align: top;
}

.netsuite-record-table th {
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.customer-record-table {
  margin-top: 2px;
}
.inline-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 34px;
  margin: -2px 0 8px;
}
.inline-table-search-shell {
  width: min(420px, 100%);
  display: block;
  min-width: min(320px, 100%);
}
.inline-table-search-input {
  width: 100%;
  min-height: 40px;
  height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--fg-1);
  font: inherit;
  font-size: 13px;
  line-height: 20px;
  outline: none;
  box-shadow: var(--shadow-xs);
}
.inline-table-search-input:focus {
  border-color: color-mix(in oklab, var(--blue-accent) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--blue-accent) 14%, transparent);
}
.inline-table-filters select {
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--fg-1);
  font: inherit;
  font-size: 13px;
  outline: none;
}
.inline-table-filters select:focus {
  border-color: color-mix(in oklab, var(--blue-accent) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--blue-accent) 14%, transparent);
}
.inline-table-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.inline-table-filters label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 800;
}
.inline-table-filters select {
  max-width: 190px;
  padding: 0 28px 0 10px;
}
.inline-table-count {
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.customer-record-table table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 12.5px;
}
.customer-detail-record-card .customer-record-table table,
.customer-detail-source-map .customer-record-table table,
.netsuite-validation-card .customer-record-table table {
  min-width: 640px;
}
.customer-detail-wide .customer-record-table table {
  min-width: 920px;
}
.customer-detail-status-signals .customer-record-table table,
.customer-detail-known-owners .customer-record-table table {
  min-width: 0;
  table-layout: fixed;
}
.customer-detail-status-signals .customer-record-table td,
.customer-detail-known-owners .customer-record-table td {
  overflow-wrap: anywhere;
}
.customer-derived-table td strong {
  display: block;
  max-width: 34ch;
  overflow: hidden;
  text-overflow: ellipsis;
}
.customer-table-footnote {
  margin: 8px 0 0;
  color: var(--fg-3);
  font-size: 12px;
  line-height: 1.35;
}
.customer-detail-eightss-activity {
  border-top: 3px solid color-mix(in oklab, var(--blue-accent) 58%, var(--gold-500));
}
.eightss-tracker {
  display: grid;
  gap: 12px;
}
.eightss-tracker-summary {
  display: grid;
  grid-template-columns: minmax(190px, .3fr) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}
.eightss-progress-block,
.eightss-touch-strip {
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}
.eightss-progress-block {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 108px;
  padding: 12px;
}
.eightss-progress-block span,
.eightss-touch-strip span {
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1.1;
  text-transform: uppercase;
}
.eightss-progress-block strong {
  color: var(--fg-1);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}
.eightss-progress-block small {
  color: var(--fg-2);
  font-size: 12px;
}
.eightss-progress-bar {
  height: 8px;
  overflow: hidden;
  margin-top: 5px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--stroke-1) 72%, transparent);
}
.eightss-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-accent), color-mix(in oklab, var(--gold-500) 68%, var(--blue-accent)));
}
.eightss-touch-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}
.eightss-touch-strip > div {
  min-width: 0;
  padding: 12px;
  border-left: 1px solid var(--stroke-1);
}
.eightss-touch-strip > div:first-child { border-left: 0; }
.eightss-touch-strip strong {
  display: block;
  margin-top: 5px;
  color: var(--fg-1);
  font-size: 14px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.eightss-week-table {
  min-width: 780px;
}
.eightss-week-table td:nth-child(3),
.eightss-week-table td:nth-child(4) {
  min-width: 210px;
}
.eightss-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.eightss-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid var(--stroke-1);
  border-radius: 7px;
  background: color-mix(in oklab, var(--bg-subtle) 78%, var(--bg-surface));
  color: var(--fg-2);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.15;
  white-space: nowrap;
}
.eightss-chip.done,
.eightss-chip.complete {
  border-color: color-mix(in oklab, var(--success) 24%, var(--stroke-1));
  background: color-mix(in oklab, var(--success) 8%, var(--bg-surface));
  color: var(--fg-1);
}
.eightss-chip.gap {
  border-color: color-mix(in oklab, var(--warning) 26%, var(--stroke-1));
  background: color-mix(in oklab, var(--warning) 7%, var(--bg-surface));
}
.eightss-chip.more {
  color: var(--fg-3);
}
.customer-record-table th,
.customer-record-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--stroke-1);
  color: var(--fg-2);
  text-align: left;
  vertical-align: top;
}
.customer-record-table th {
  color: var(--fg-3);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.customer-record-table tr:last-child td { border-bottom: 0; }
.customer-record-table td:first-child {
  color: var(--fg-1);
  font-weight: 700;
}
.customer-record-table td:first-child a {
  color: var(--fg-1);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--gold-500) 48%, transparent);
  text-underline-offset: 3px;
}
.customer-record-table tr.warn td:first-child { border-left: 3px solid var(--warning); }
.customer-record-table tr.risk td:first-child { border-left: 3px solid var(--error); }
.customer-record-table tr.critical td:first-child { border-left: 5px solid #ff1f1f; }
.customer-record-table tr.critical td {
  background: color-mix(in oklab, #ff1f1f 9%, var(--bg-surface));
}
.customer-record-table tr.success td:first-child { border-left: 3px solid var(--success); }
.customer-detail-metrics,
.customer-money-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.customer-detail-metric {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--stroke-1);
  border-top: 3px solid var(--blue-accent);
  border-radius: 8px;
  background: var(--bg-surface);
}
.customer-detail-metric.success { border-top-color: var(--success); }
.customer-detail-metric.warn { border-top-color: var(--warning); background: color-mix(in oklab, var(--warning) 5%, var(--bg-surface)); }
.customer-detail-metric.risk { border-top-color: var(--error); background: color-mix(in oklab, var(--error) 5%, var(--bg-surface)); }
.customer-detail-metric.critical {
  border-color: color-mix(in oklab, #ff1f1f 46%, var(--stroke-1));
  border-top-color: #ff1f1f;
  background: linear-gradient(135deg, color-mix(in oklab, #ff1f1f 15%, var(--bg-surface)), color-mix(in oklab, var(--warning) 9%, var(--bg-surface)));
  box-shadow: 0 0 0 2px color-mix(in oklab, #ff1f1f 16%, transparent);
}
.customer-detail-metric span {
  display: block;
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.customer-detail-metric strong {
  display: block;
  margin-top: 5px;
  color: var(--fg-1);
  font-size: 20px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}
.customer-detail-metric small {
  display: block;
  margin-top: 4px;
  color: var(--fg-3);
  font-size: 12px;
  line-height: 1.24;
}
.customer-priority-list,
.customer-compact-list {
  display: grid;
  gap: 8px;
}

.customer-detail-priority .customer-priority-list {
  overflow: hidden;
  gap: 0;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
}

.customer-detail-lazy-body {
  min-height: 72px;
}
.customer-priority,
.customer-compact-item {
  display: block;
  padding: 10px;
  border: 1px solid var(--stroke-1);
  border-left: 3px solid var(--blue-accent);
  border-radius: 8px;
  background: var(--bg-surface);
  text-decoration: none;
}
.customer-priority.warn,
.customer-compact-item.warn { border-left-color: var(--warning); background: color-mix(in oklab, var(--warning) 5%, var(--bg-surface)); }
.customer-priority.risk,
.customer-compact-item.risk { border-left-color: var(--error); background: color-mix(in oklab, var(--error) 5%, var(--bg-surface)); }
.customer-priority.critical,
.customer-compact-item.critical {
  border-left-color: #ff1f1f;
  background: linear-gradient(135deg, color-mix(in oklab, #ff1f1f 12%, var(--bg-surface)), color-mix(in oklab, var(--warning) 7%, var(--bg-surface)));
}
.customer-priority.success,
.customer-compact-item.success { border-left-color: var(--success); }

.customer-detail-priority .customer-priority {
  position: relative;
  border: 0;
  border-bottom: 1px solid var(--stroke-1);
  border-radius: 0;
  background: transparent;
  padding: 12px 12px 12px 16px;
}

.customer-detail-priority .customer-priority:last-child {
  border-bottom: 0;
}

.customer-detail-priority .customer-priority::before {
  content: "";
  position: absolute;
  inset: 11px auto 11px 0;
  width: 3px;
  border-radius: 999px;
  background: var(--blue-accent);
}

.customer-detail-priority .customer-priority.warn::before { background: var(--warning); }
.customer-detail-priority .customer-priority.risk::before { background: var(--error); }
.customer-detail-priority .customer-priority.critical::before {
  width: 5px;
  background: #ff1f1f;
  box-shadow: 0 0 14px color-mix(in oklab, #ff1f1f 72%, transparent);
}
.customer-detail-priority .customer-priority.success::before { background: var(--success); }

.customer-priority strong,
.customer-compact-item strong {
  display: block;
  color: var(--fg-1);
  font-size: 14px;
  line-height: 1.18;
}
.customer-priority p,
.customer-compact-item p {
  margin: 5px 0 0;
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.34;
}
.customer-priority small,
.customer-compact-item small {
  display: block;
  margin-top: 6px;
  color: var(--fg-3);
  font-size: 11px;
  line-height: 1.25;
}
.customer-signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.customer-signal {
  padding: 10px;
  border: 1px solid var(--stroke-1);
  border-top: 3px solid var(--blue-accent);
  border-radius: 8px;
  background: var(--bg-surface);
}
.customer-signal.success { border-top-color: var(--success); }
.customer-signal.warn { border-top-color: var(--warning); }
.customer-signal.risk { border-top-color: var(--error); }
.customer-signal > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.customer-signal strong { color: var(--fg-1); font-size: 14px; line-height: 1.15; }
.customer-signal span { color: var(--fg-1); font-weight: 800; }
.customer-signal p {
  margin: 6px 0 0;
  color: var(--fg-3);
  font-size: 12px;
  line-height: 1.28;
}

.search-form { display: grid; grid-template-columns: 160px minmax(220px, 1fr) auto; gap: 12px; align-items: center; }
.customer-lookup-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}
.customer-lookup-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 22px;
}
.customer-lookup-head h2 {
  margin-top: 4px;
  font-size: clamp(28px, 3.1vw, 42px);
  font-weight: 900;
  line-height: 1;
}
.customer-lookup-head p:not(.eyebrow) {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--fg-2);
  font-size: 16px;
}
.customer-lookup-source-note {
  min-width: 260px;
  padding: 11px 13px;
  border: 1px solid var(--stroke-1);
  border-left: 3px solid var(--gold-500);
  border-radius: 8px;
  background: var(--bg-subtle);
}
.customer-lookup-source-note strong,
.customer-lookup-source-note span {
  display: block;
}
.customer-lookup-source-note strong { color: var(--fg-1); line-height: 1.2; }
.customer-lookup-source-note span { margin-top: 3px; color: var(--fg-3); font-size: 12px; line-height: 1.25; }
.customer-lookup-form {
  display: grid;
  grid-template-columns: 82px minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.customer-lookup-form label {
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.customer-lookup-input input {
  height: 48px;
  padding-left: 42px;
  font-size: 17px;
}
.customer-lookup-input-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 15px;
  color: var(--fg-3);
  transform: translateY(-50%);
  pointer-events: none;
}
.customer-search-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-left: 92px;
}
.customer-search-hints span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 700;
}
.command-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}
.command-form label {
  display: grid;
  gap: 6px;
  color: var(--fg-3);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.10em;
  line-height: 1;
  text-transform: uppercase;
}
.command-form .wide { grid-column: span 2; }
.command-form textarea { grid-column: auto; min-height: 92px; }
.command-form .button { align-self: stretch; min-height: 44px; }
.endpoint-filter-form {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}
.endpoint-filter-form label {
  display: grid;
  gap: 6px;
  color: var(--fg-3);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.10em;
  line-height: 1;
  text-transform: uppercase;
}
label { color: var(--fg-1); font-weight: 700; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 11px 12px;
  border: 1px solid var(--stroke-2);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--fg-1);
}
textarea { min-height: 86px; grid-column: 2 / -1; resize: vertical; }
.endpoint-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.endpoint-summary-strip span {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 700;
}
.endpoint-summary-strip strong {
  color: var(--fg-1);
  font-size: 15px;
}
.endpoint-table table { font-size: 12px; }
.endpoint-table th:nth-child(1) { min-width: 360px; }
.endpoint-table th:nth-child(2) { min-width: 170px; }
.endpoint-table td { vertical-align: top; }
.endpoint-table td p {
  max-width: 560px;
  margin: 7px 0 0;
  color: var(--fg-2);
  line-height: 1.35;
}
.endpoint-operation {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 23px;
  padding: 0 8px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--fg-2);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.method-badge.get { color: #166a50; background: rgba(46, 125, 91, 0.11); border-color: rgba(46, 125, 91, 0.24); }
.method-badge.post { color: #7a4b00; background: rgba(255, 183, 42, 0.15); border-color: rgba(255, 183, 42, 0.32); }
.method-badge.put,
.method-badge.patch { color: #234fa8; background: rgba(72, 118, 255, 0.12); border-color: rgba(72, 118, 255, 0.28); }
.method-badge.delete { color: #a60000; background: rgba(192, 0, 0, 0.10); border-color: rgba(192, 0, 0, 0.24); }
.method-badge.rpc { color: #67308a; background: rgba(163, 78, 196, 0.12); border-color: rgba(163, 78, 196, 0.28); }
.pill.read,
.pill.implemented { color: #166a50; background: rgba(46, 125, 91, 0.11); border-color: rgba(46, 125, 91, 0.24); }
.pill.write,
.pill.planned_command_bridge { color: #7a4b00; background: rgba(255, 183, 42, 0.15); border-color: rgba(255, 183, 42, 0.32); }
.pill.planned_read_model { color: #234fa8; background: rgba(72, 118, 255, 0.12); border-color: rgba(72, 118, 255, 0.28); }
.pill.sensitive_write,
.pill.financial_write,
.pill.blocked_or_deferred { color: #a60000; background: rgba(192, 0, 0, 0.10); border-color: rgba(192, 0, 0, 0.24); }
.pill.destructive { color: #fff; background: #9f1717; border-color: #9f1717; }
.pill.catalog_only { color: #67308a; background: rgba(163, 78, 196, 0.12); border-color: rgba(163, 78, 196, 0.28); }
.definition-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.definition-grid article {
  padding: 14px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-subtle);
}
.definition-grid strong { display: block; margin-bottom: 6px; font-size: 15px; }
.definition-grid p { margin: 0; color: var(--fg-3); line-height: 1.4; }
.source-browser-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.data-surface-card {
  min-height: 245px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--bg-surface) 96%, white), var(--bg-subtle));
  box-shadow: var(--shadow-xs);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.data-surface-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--gold-500) 38%, var(--stroke-1));
  box-shadow: var(--shadow-sm);
}
.data-surface-card.disabled { opacity: .64; }
.surface-card-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.surface-card-icon { width: 40px; height: 40px; }
.surface-money .surface-card-icon { color: var(--success); background: color-mix(in oklab, var(--success) 10%, var(--bg-surface)); border-color: color-mix(in oklab, var(--success) 24%, transparent); }
.surface-access .surface-card-icon { color: var(--warning); background: color-mix(in oklab, var(--warning) 10%, var(--bg-surface)); border-color: color-mix(in oklab, var(--warning) 24%, transparent); }
.surface-support .surface-card-icon { color: var(--magenta-500); background: color-mix(in oklab, var(--magenta-500) 8%, var(--bg-surface)); border-color: color-mix(in oklab, var(--magenta-500) 20%, transparent); }
.surface-work .surface-card-icon { color: var(--blue-accent); background: color-mix(in oklab, var(--blue-accent) 8%, var(--bg-surface)); border-color: color-mix(in oklab, var(--blue-accent) 22%, transparent); }
.data-surface-card h2 {
  margin: 5px 0 0;
  font-size: 27px;
  font-weight: 900;
  line-height: 1;
}
.surface-card-body { min-height: 88px; }
.data-surface-card p:not(.eyebrow) {
  max-width: 720px;
  margin: 0;
  color: var(--fg-2);
  font-size: 16px;
  line-height: 1.4;
}
.surface-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--stroke-1);
}
.data-browser-search { margin-bottom: 12px; }
.data-browser-filters {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-top: 6px;
}
.data-browser-filters label {
  display: grid;
  gap: 6px;
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.data-browser-filters.inline-browse-filters {
  grid-template-columns: minmax(150px, 220px) minmax(190px, 280px) minmax(220px, 340px) auto auto;
  align-items: end;
  justify-content: start;
  gap: 10px;
  padding-top: 14px;
}
.data-browser-filters.inline-browse-filters .button {
  width: auto;
  min-width: 82px;
  min-height: 42px;
  justify-self: start;
  padding-inline: 16px;
}
.data-browser-filters.support-inline-filters {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
  justify-content: stretch;
}
.data-browser-filters.support-inline-filters label {
  min-width: 0;
}
.data-browser-filters.support-inline-filters .button {
  width: 100%;
}
.browse-metrics {
  margin-bottom: 18px;
  padding: 0;
  border: 0;
  background: transparent;
}
.compact-panel { padding: 16px; }
.records-panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.records-filter-menu {
  position: relative;
}
.records-filter-menu summary {
  list-style: none;
  cursor: pointer;
}
.records-filter-menu summary::-webkit-details-marker {
  display: none;
}
.records-filter-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 6px;
  width: min(280px, calc(100vw - 40px));
  padding: 8px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
}
.records-filter-menu .quick-filter {
  justify-content: flex-start;
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 8px;
  box-shadow: none;
}
.records-filter-menu .quick-filter span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quick-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg-surface) 72%, var(--bg-subtle));
  color: var(--fg-2);
  text-decoration: none;
  box-shadow: var(--shadow-xs);
}
.quick-filter:hover {
  border-color: color-mix(in oklab, var(--gold-500) 42%, var(--stroke-1));
  color: var(--fg-1);
}
.quick-filter strong {
  color: var(--fg-1);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}
.quick-filter span {
  color: var(--fg-3);
  font-size: 12px;
}
.data-browser-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.browse-result-list {
  display: grid;
  gap: 12px;
}
.browse-result-list.compact { gap: 10px; }
.browse-result-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}
.browse-result-card.compact {
  gap: 10px;
  padding: 12px;
}
.browse-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.browse-result-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.08;
}
.browse-result-head p {
  margin: 5px 0 0;
  color: var(--fg-3);
}
.browse-result-head .button {
  min-height: 32px;
  padding: 7px 11px;
  white-space: nowrap;
}
.command-actions,
.command-decision-forms {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
.command-decision-forms form { margin: 0; }
.command-readiness-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.command-readiness-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}
.command-readiness-card h2 {
  margin: 5px 0 8px;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.05;
}
.command-readiness-card p:not(.eyebrow) {
  margin: 0;
  color: var(--fg-2);
  line-height: 1.4;
}
.command-readiness-card.success { border-top: 3px solid var(--success); }
.command-readiness-card.warning { border-top: 3px solid var(--warning); }
.browse-field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
.browse-field {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-subtle);
}
.browse-field.wide { grid-column: span 2; }
.browse-field dt {
  margin: 0 0 4px;
  color: var(--fg-3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}
.browse-field dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 14px;
  line-height: 1.25;
}
.tag-meaning-panel,
.rich-source-text {
  padding: 16px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-subtle);
}
.tag-meaning-panel p,
.rich-source-text {
  color: var(--fg-2);
  font-size: 15px;
  line-height: 1.55;
}
.tag-signal-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.autocomplete-wrap { position: relative; min-width: 0; }
.autocomplete-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--stroke-2);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-md);
}
.autocomplete-option {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--stroke-1);
  border-radius: 0;
  background: var(--bg-surface);
  text-align: left;
}
.autocomplete-option:hover,
.autocomplete-option.active { background: var(--bg-row-hover); }
.autocomplete-option strong { display: block; font-size: 17px; }
.autocomplete-option small { display: block; margin-top: 2px; }
.autocomplete-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; max-width: 48%; }
.autocomplete-meta em {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-fg);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}
.autocomplete-note { padding: 11px 14px; color: var(--fg-3); border-bottom: 1px solid var(--stroke-1); }
.search-hints { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-left: 172px; }
.search-hints span {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--fg-3);
  font-size: 13px;
}
.warning-list { color: var(--warning); margin-top: 0; }

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.data-table { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--stroke-1); vertical-align: top; }
th { color: var(--fg-3); font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.success, .healthy, .fresh { color: var(--success); }
.error, .denied, .disabled { color: var(--error); }
.partial, .degraded, .warn { color: var(--warning); }
pre {
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  border-radius: 8px;
  background: var(--bg-sunken);
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.match-card { margin: 12px 0; display: grid; grid-template-columns: 1fr auto; gap: 14px; }
.source-pills { grid-column: 1 / -1; }
.source-pills.compact {
  grid-column: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-content: center;
}
.source-pills.compact span {
  margin: 0;
  padding: 2px 7px;
  font-size: 10px;
}
.suggestion-card .warning-list { grid-column: 1 / -1; margin: 0; }
.customer-results-panel { padding: 16px; }
.customer-results-head { align-items: flex-end; margin-bottom: 12px; }
.customer-results-head p { margin: 4px 0 0; color: var(--fg-3); }
.customer-search-source-note {
  display: grid;
  gap: 4px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in oklab, var(--warning) 24%, transparent);
  border-left: 3px solid var(--warning);
  border-radius: 8px;
  background: color-mix(in oklab, var(--warning) 7%, var(--bg-surface));
  color: var(--fg-2);
}
.customer-search-source-note p { margin: 0; font-size: 12px; line-height: 1.35; }
.customer-results-list {
  overflow: hidden;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-surface);
}
.customer-results-header,
.customer-result-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) minmax(220px, 1fr) minmax(240px, 1.15fr) 74px;
  gap: 14px;
  align-items: center;
}
.customer-results-header {
  min-height: 36px;
  padding: 0 14px;
  border-bottom: 1px solid var(--stroke-1);
  background: var(--bg-subtle);
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.customer-result-row {
  min-height: 74px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--stroke-1);
  color: inherit;
  transition: background 120ms, box-shadow 120ms;
}
.customer-result-row:last-child { border-bottom: 0; }
.customer-result-row:hover {
  background: var(--bg-row-hover);
  box-shadow: inset 3px 0 0 var(--gold-500);
}
.customer-result-row.identity-review-required {
  border-left: 3px solid var(--warning);
  background: color-mix(in oklab, var(--warning) 6%, var(--bg-surface));
}
.customer-result-row.identity-review-required:hover {
  background: color-mix(in oklab, var(--warning) 10%, var(--bg-surface));
  box-shadow: inset 3px 0 0 var(--warning);
}
.customer-result-row.identity-review-required .customer-result-action {
  border-color: color-mix(in oklab, var(--warning) 34%, transparent);
  color: var(--warning);
}
.customer-result-row.identity-review-required:hover .customer-result-action {
  border-color: var(--warning);
  background: var(--warning);
  color: var(--accent-ink);
}
.customer-result-row.disabled { color: var(--fg-3); pointer-events: none; }
.customer-result-primary,
.customer-result-match {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.customer-result-primary strong {
  color: var(--fg-1);
  font-size: 16px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}
.customer-result-primary span,
.customer-result-match small {
  color: var(--fg-3);
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.customer-result-action {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 62px;
  padding: 0 10px;
  border: 1px solid var(--stroke-2);
  border-radius: 7px;
  color: var(--fg-1);
  font-size: 12px;
  font-weight: 800;
}
.customer-result-row:hover .customer-result-action {
  border-color: color-mix(in oklab, var(--gold-500) 45%, transparent);
  background: var(--gold-500);
  color: var(--accent-ink);
}
.confidence-badge {
  justify-self: start;
  padding: 2px 8px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-fg);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.confidence-badge.high {
  color: var(--success);
  background: color-mix(in oklab, var(--success) 10%, var(--bg-surface));
  border-color: color-mix(in oklab, var(--success) 22%, transparent);
}
.confidence-badge.medium {
  color: var(--warning);
  background: color-mix(in oklab, var(--warning) 10%, var(--bg-surface));
  border-color: color-mix(in oklab, var(--warning) 22%, transparent);
}
.confidence-badge.low {
  color: var(--fg-3);
}
.empty-state.compact {
  padding: 18px;
  border: 1px dashed var(--stroke-2);
  border-radius: 8px;
  color: var(--fg-3);
  background: var(--bg-subtle);
}
.empty-state.compact strong,
.empty-state.compact span {
  display: block;
}
.avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  color: var(--accent-ink);
  font-weight: 900;
  object-fit: cover;
}
.user-menu { position: relative; }
.user-menu summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 2px 8px 2px 2px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  background: var(--bg-surface);
  cursor: pointer;
  list-style: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.user-menu[open] summary,
.user-menu summary:hover {
  border-color: color-mix(in oklab, var(--gold-500) 40%, var(--stroke-1));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--gold-500) 10%, transparent);
}
.user-menu summary > span:not(.avatar) {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg-1);
  font-size: 13px;
  font-weight: 800;
}
.user-menu summary .ui-icon { color: var(--fg-3); }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 40;
  width: min(318px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid var(--stroke-2);
  border-radius: 12px;
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--navy-900) 98%, black) 0 42%, var(--bg-surface) 42% 100%);
  box-shadow: var(--shadow-lg);
}
.user-menu-identity {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 22px 18px 18px;
  background:
    radial-gradient(circle at 50% 0%, color-mix(in oklab, var(--gold-500) 30%, transparent) 0%, transparent 34%),
    linear-gradient(135deg, color-mix(in oklab, var(--navy-900) 96%, black) 0%, var(--navy-700) 58%, color-mix(in oklab, var(--gold-500) 32%, var(--navy-700)) 100%);
  color: white;
  text-align: center;
}
.user-menu-identity .avatar {
  width: 56px;
  height: 56px;
  border: 2px solid color-mix(in oklab, white 72%, transparent);
  box-shadow: 0 8px 18px rgb(0 0 0 / .22);
}
.user-menu-identity strong,
.user-menu-identity span {
  display: block;
  min-width: 0;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-identity strong {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.05;
}
.user-menu-identity span {
  margin-top: 4px;
  color: color-mix(in oklab, white 78%, var(--gold-100));
  font-size: 12.5px;
  font-weight: 650;
}
.user-menu-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 14px 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--stroke-1);
  border: 1px solid var(--stroke-1);
  border-radius: 9px;
  background: color-mix(in oklab, var(--bg-subtle) 80%, var(--bg-surface));
}
.user-menu-meta span {
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.user-menu-meta strong {
  padding: 4px 9px;
  border: 1px solid color-mix(in oklab, var(--gold-500) 28%, var(--stroke-1));
  border-radius: 7px;
  background: color-mix(in oklab, var(--gold-500) 10%, var(--bg-surface));
  color: var(--fg-1);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sign-out-button, button.sign-out-button {
  width: calc(100% - 24px);
  justify-content: center;
  margin: 12px;
  min-height: 40px;
  border-radius: 8px;
  color: var(--fg-1);
  font-weight: 850;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 183, 42, .22), transparent 30%),
    linear-gradient(135deg, #0a1438, #20385f);
}
.login-panel {
  width: min(520px, 100%);
  padding: 34px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
}
.login-panel h1 { margin: 7px 0 12px; font-size: 48px; font-weight: 900; line-height: 1; }
.result-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 130px auto;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--stroke-1);
}

.page-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 11, 34, .34);
  backdrop-filter: blur(6px);
}
.page-loading-overlay[hidden] { display: none; }
.page-loading-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(460px, 100%);
  padding: 18px;
  border: 1px solid var(--stroke-2);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
}
.page-loading-card strong { display: block; color: var(--fg-1); font-size: 22px; line-height: 1.1; }
.page-loading-card p { margin: 5px 0 0; color: var(--fg-3); line-height: 1.35; }

.portal-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 14, 30, .58);
  backdrop-filter: blur(10px);
}
.portal-modal-overlay[hidden] { display: none; }
.portal-modal-shell {
  width: min(1120px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
}
.portal-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--stroke-1);
  background: var(--bg-surface);
}
.portal-modal-head h2 {
  margin: 0;
  color: var(--fg-1);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.05;
}
.modal-close {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--stroke-2);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--fg-1);
  font-family: var(--font-display);
  font-weight: 800;
  cursor: pointer;
}
.portal-modal-body {
  min-height: 220px;
  overflow: auto;
  padding: 20px;
  background: var(--bg-surface);
}
.modal-active body { overflow: hidden; }

@media (max-width: 1340px) and (min-width: 1181px) {
  .topbar {
    grid-template-columns: minmax(170px, .8fr) minmax(320px, 460px) max-content;
    gap: 14px;
    padding-right: 22px;
    padding-left: 22px;
  }
  .topbar-customer-search {
    width: 100%;
  }
}

@media (max-width: 1180px) {
  .c360-care-grid,
  .signal-groups,
  .mini-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c360-stat-strip { gap: 18px; }
  .home-workflow-grid,
  .home-ops-grid,
  .command-readiness-grid,
  .customer-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .customer-detail-summary,
  .customer-detail-priority,
  .customer-detail-source-map,
  .customer-detail-record-card,
  .netsuite-validation-card { grid-column: span 2; }
  .customer-detail-wide { grid-column: 1 / -1; }
  .payment-summary-rail dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .payment-summary-rail dl > div:nth-child(3) {
    border-top: 1px solid var(--stroke-1);
    border-left: 0;
  }
  .payment-summary-rail dl > div:nth-child(4) {
    border-top: 1px solid var(--stroke-1);
  }
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .topbar-title {
    grid-column: 1;
  }
  .topbar-actions {
    grid-column: 2;
  }
  .topbar-customer-search {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: none;
  }
  .topbar-autocomplete-panel {
    max-height: min(460px, calc(100vh - 146px));
  }
  .home-intro { flex-direction: column; }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
    display: block;
    padding: 10px 12px 8px;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--stroke-sidebar);
  }
  .brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 0 2px 9px;
    font-size: 32px;
  }
  .brand::after { font-size: 9px; letter-spacing: .12em; }
  .sidebar nav {
    display: flex;
    gap: 8px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
    contain: inline-size paint;
  }
  .nav-section {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    align-content: center;
  }
  .nav-section h2 { display: none; }
  .sidebar nav a {
    min-height: 36px;
    flex: 0 0 auto;
    padding: 8px 11px;
    white-space: nowrap;
    scroll-snap-align: start;
  }
  .sidebar nav a.active::before {
    top: auto;
    right: 10px;
    bottom: 3px;
    left: 10px;
    width: auto;
    height: 2px;
  }
  main { padding: 18px; }
  .topbar {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 16px 18px;
  }
  .topbar-actions {
    width: auto;
    justify-content: flex-end;
  }
  .topbar-search-wrap input {
    height: 40px;
    min-height: 40px;
  }
  .theme-button, button.theme-button { width: 42px; min-width: 42px; padding: 0; }
  .kpi-grid, .card-grid, .section-grid, .concierge-sections, .insight-grid, .c360-care-grid, .definition-grid, .source-browser-grid, .customer-search-shell, .customer-detail-grid, .source-validation-grid { grid-template-columns: 1fr; }
  .source-card-meta { grid-template-columns: 1fr; }
  .customer-detail-summary,
  .customer-detail-priority,
  .customer-detail-source-map,
  .customer-detail-record-card,
  .netsuite-validation-card { grid-column: auto; }
  .customer-detail-wide { grid-column: auto; }
  .payment-workspace { grid-column: auto; }
  .payment-workspace-columns { grid-template-columns: 1fr; }
  .c360-card-meta { justify-content: flex-start; }
  .c360-card-meta .platform-badges { justify-content: flex-start; }
  .c360-section-notes > div { grid-template-columns: 1fr; }
  .c360-section-notes small { grid-column: auto; }
  .customer-detail-header { flex-direction: column; }
  .customer-detail-actions { justify-content: flex-start; }
  .c360-profile-card { flex-direction: column; }
  .c360-divider { display: none; }
  .c360-stat-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .platform-strip { align-items: flex-start; flex-direction: column; }
  .search-form, .customer-search-form, .command-form, .endpoint-filter-form, .match-card, .result-row { grid-template-columns: 1fr; }
  .access-add-permissions { grid-template-columns: 1fr; }
  .access-add-user-row { grid-template-columns: minmax(0, 1fr) auto; }
  .customer-lookup-head { align-items: flex-start; flex-direction: column; }
  .customer-lookup-source-note { width: 100%; min-width: 0; }
  .customer-lookup-form { grid-template-columns: 1fr; align-items: stretch; }
  .customer-search-hints { padding-left: 0; }
  .customer-results-list { overflow-x: auto; }
  .customer-results-header,
  .customer-result-row {
    grid-template-columns: minmax(190px, 1.1fr) minmax(190px, 1fr) minmax(220px, 1fr) 70px;
    min-width: 760px;
  }
  .order-record-search,
  .zendesk-record-search { grid-template-columns: 1fr; align-items: stretch; }
  .order-autocomplete-panel { width: 100%; }
  .order-sheet-hero { flex-direction: column; }
  .order-sheet-status { justify-content: flex-start; }
  .order-sheet-parties,
  .order-money-ledger,
  .order-sheet-grid { grid-template-columns: 1fr; }
  .order-sheet-group dl > div { grid-template-columns: 1fr; gap: 4px; }
  .strategy-session-hero { flex-direction: column; }
  .strategy-session-status { justify-content: flex-start; }
  .strategy-session-lane,
  .strategy-session-grid,
  .strategy-role-list { grid-template-columns: 1fr; }
  .strategy-lane-step {
    border-right: 0;
    border-bottom: 1px solid var(--stroke-1);
  }
  .strategy-lane-step:last-child { border-bottom: 0; }
  .strategy-session-panel dl > div { grid-template-columns: 1fr; gap: 4px; }
  .tag-detail-hero { flex-direction: column; }
  .tag-detail-signal-strip { justify-content: flex-start; max-width: none; }
  .tag-detail-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tag-detail-copy-grid { grid-template-columns: 1fr; }
  .zendesk-ticket-hero { flex-direction: column; }
  .zendesk-ticket-actions { justify-content: flex-start; }
  .zendesk-ticket-layout { grid-template-columns: 1fr; }
  .zendesk-ticket-side { border-left: 0; border-top: 1px solid var(--stroke-1); }
  .zendesk-property-row { grid-template-columns: minmax(100px, .34fr) minmax(0, .66fr); }
  .zendesk-property-group dl > div { grid-template-columns: minmax(120px, .36fr) minmax(0, .64fr); }
  .asana-task-hero { flex-direction: column; }
  .asana-task-actions { justify-content: flex-start; }
  .asana-task-layout { grid-template-columns: 1fr; }
  .asana-task-side { border-left: 0; border-top: 1px solid var(--stroke-1); }
  .asana-field-grid { grid-template-columns: 1fr; }
  .asana-field-list > div { grid-template-columns: minmax(120px, .36fr) minmax(0, .64fr); }
  .asana-property-group dl > div { grid-template-columns: minmax(120px, .36fr) minmax(0, .64fr); }
  .asana-property-row { grid-template-columns: minmax(96px, .32fr) minmax(0, .68fr); }
	  .section-table-tools { grid-template-columns: 1fr; align-items: stretch; }
	  .section-table-tools span { text-align: left; }
	  .eightss-tracker-summary {
	    grid-template-columns: 1fr;
	  }
	  .eightss-touch-strip {
	    grid-template-columns: repeat(2, minmax(0, 1fr));
	  }
	  .eightss-touch-strip > div:nth-child(odd) {
	    border-left: 0;
	  }
	  .eightss-touch-strip > div:nth-child(n + 3) {
	    border-top: 1px solid var(--stroke-1);
	  }
	  .customer-brief-row {
	    grid-template-columns: minmax(105px, .42fr) minmax(120px, .58fr);
	  }
  .customer-brief-detail {
    grid-column: 2;
  }
  .customer-money-strip {
    grid-template-columns: 1fr;
  }
  .data-browser-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .command-form .wide { grid-column: auto; }
  .customer-search-note { grid-column: auto; }
  .search-hints { padding-left: 0; }
  .browse-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .security-policy-grid,
  .security-ban-form,
  .security-policy-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .security-ban-summary .panel-head { flex-direction: column; }
  .security-ban-actions { justify-content: flex-start; }
  .security-ban-form .button { grid-column: 1 / -1; }
  .autocomplete-meta { max-width: 100%; justify-content: flex-start; }
  .autocomplete-option { align-items: flex-start; flex-direction: column; }
  .tag-filter-autocomplete-option .order-autocomplete-meta {
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .tag-filter-autocomplete-option .order-autocomplete-meta em {
    max-width: min(100%, 240px);
  }
  .activity-card { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sidebar nav { display: flex; grid-template-columns: none; }
  .customer-identity-choice-list {
    grid-template-columns: 1fr;
    padding-bottom: 68px;
  }
  .customer-identity-choice {
    grid-template-columns: 42px minmax(0, 1fr);
  }
  .customer-identity-choice-action {
    grid-column: 2;
    justify-self: start;
  }
  .customer-workspace-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }
  .customer-workspace-tabs a {
    min-width: 0;
  }
  .customer-relationship-strip {
    grid-template-columns: 1fr;
  }
  .customer-relationship-strip > div {
    border-top: 1px solid var(--stroke-1);
    border-left: 0;
  }
  .customer-relationship-strip > div:first-child {
    border-top: 0;
  }
  .payment-command-panel {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px 14px 16px 18px;
  }
  .payment-command-copy {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
  }
  .payment-status-mark {
    width: 34px;
    height: 34px;
  }
  .payment-summary-rail dl { grid-template-columns: 1fr; }
  .payment-summary-rail dl > div {
    border-top: 1px solid var(--stroke-1);
    border-left: 0;
  }
  .payment-summary-rail dl > div:first-child { border-top: 0; }
  .payment-workspace-section,
  .payment-attention-section { padding: 13px; }
  .payment-record {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .payment-record-title {
    align-items: flex-start;
    flex-direction: column;
  }
  .payment-inline-facts {
    display: grid;
    gap: 4px;
  }
  .payment-inline-facts li + li::before { content: none; }
  .payment-action { grid-template-columns: 1fr; }
  .payment-action button {
    width: 100%;
    min-height: 40px;
  }
  .payment-activity-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding-left: 17px;
  }
  .payment-activity-date,
  .payment-activity-copy { grid-column: 1; }
  .payment-activity-amount {
    grid-column: 2;
    grid-row: 1;
  }
  .payment-empty-state {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
  }
  .payment-empty-state > span {
    width: 34px;
    height: 34px;
  }
  .customer-workspace .customer-detail-identity {
    align-items: center;
    flex-direction: row;
  }
  .c360-stat-strip,
  .signal-groups,
  .browse-field-grid,
  .mini-metrics,
  .home-ops-grid,
  .home-workflow-grid,
  .command-readiness-grid,
  .customer-detail-metrics,
  .customer-money-row,
  .customer-money-inline,
  .customer-signal-grid,
  .data-browser-filters { grid-template-columns: 1fr; }
  .security-policy-grid,
  .security-ban-form,
  .security-policy-detail { grid-template-columns: 1fr; }
  .security-ban-actions,
  .security-ban-actions .button { width: 100%; }
  .security-ban-form .button { width: 100%; }
  .home-work-item {
    grid-template-columns: 8px minmax(0, 1fr);
  }
  .home-work-meta {
    grid-column: 2;
    justify-self: start;
    max-width: 100%;
  }
  .customer-brief-count { display: none; }
  .customer-brief-row {
    grid-template-columns: 1fr;
    gap: 4px;
    min-height: 0;
    padding: 11px 12px 11px 16px;
  }
  .customer-brief-detail { grid-column: auto; }
  .customer-money-item {
    padding: 9px 0;
    border-top: 1px solid var(--stroke-1);
    border-left: 0;
  }
  .customer-money-item:first-child {
    padding-top: 0;
    border-top: 0;
  }
  .customer-lookup-panel { padding: 14px; }
  .customer-results-panel { padding: 12px; }
  .customer-results-header { display: none; }
  .customer-results-list { border: 0; background: transparent; overflow: visible; }
  .customer-result-row {
    display: grid;
    grid-template-columns: 1fr;
    min-width: 0;
    gap: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--stroke-1);
    border-radius: 8px;
    background: var(--bg-surface);
  }
  .customer-result-row:last-child { margin-bottom: 0; border-bottom: 1px solid var(--stroke-1); }
  .customer-result-action { justify-self: stretch; }
  .customer-detail-record-card .customer-record-table table,
  .customer-detail-source-map .customer-record-table table,
  .netsuite-validation-card .customer-record-table table {
    min-width: 560px;
  }
	  .customer-detail-wide .customer-record-table table {
	    min-width: 720px;
	  }
	  .eightss-touch-strip {
	    grid-template-columns: 1fr;
	  }
	  .eightss-touch-strip > div {
	    border-left: 0;
	    border-top: 1px solid var(--stroke-1);
	  }
	  .eightss-touch-strip > div:first-child {
	    border-top: 0;
	  }
	  .eightss-week-table {
	    min-width: 680px;
	  }
	  .customer-detail-status-signals .customer-record-table table,
	  .customer-detail-known-owners .customer-record-table table {
	    min-width: 560px;
  }
  .data-browser-filters.inline-browse-filters {
    grid-template-columns: 1fr;
  }
  .data-browser-filters.inline-browse-filters .button {
    width: 100%;
  }
  .access-add-form,
  .access-add-user-row,
  .access-manage-hero {
    grid-template-columns: 1fr;
  }
  .access-add-form .button,
  .access-manage-actions .button,
  .access-manage-danger .button {
    width: 100%;
  }
  .access-manage-status,
  .access-manage-actions,
  .access-manage-danger {
    justify-content: flex-start;
  }
  .access-user-option {
    align-items: flex-start;
    grid-template-columns: auto minmax(0, 1fr);
  }
  .access-user-option-meta {
    grid-column: 2;
    justify-content: flex-start;
  }
  .tag-detail-facts { grid-template-columns: 1fr; }
  .zendesk-ticket-hero,
  .zendesk-ticket-main { padding: 16px; }
  .zendesk-ticket-title-block h2 { font-size: 23px; }
  .zendesk-property-row,
  .zendesk-property-group dl > div { grid-template-columns: 1fr; gap: 4px; }
  .zendesk-comment-card header { flex-direction: column; }
  .zendesk-comment-type { align-self: flex-start; }
  .asana-task-hero,
  .asana-task-main { padding: 16px; }
  .asana-task-title-row h2 { font-size: 23px; }
  .asana-property-row { grid-template-columns: 1fr; gap: 4px; }
  .asana-field-list > div { grid-template-columns: 1fr; gap: 4px; }
  .asana-property-group dl > div { grid-template-columns: 1fr; gap: 4px; }
  .inline-table-search-shell {
    width: 100%;
  }
  .inline-table-filters,
  .inline-table-filters label,
  .inline-table-filters select {
    width: 100%;
    max-width: none;
  }
  .customer-detail-identity { align-items: flex-start; flex-direction: column; }
  .customer-workspace .customer-detail-identity { align-items: center; flex-direction: row; }
  .browse-result-head { flex-direction: column; }
  .browse-result-head .button { width: 100%; }
  .browse-field.wide { grid-column: auto; }
  .login-panel { padding: 26px; }
  .login-panel h1 { font-size: 40px; }
}
@media (forced-colors: active) {
  .customer-workspace-tabs a[aria-current="page"] {
    border-color: Highlight;
  }
  .customer-workspace-tabs a[aria-current="page"]::after {
    background: Highlight;
  }
  .customer-relationship-strip .customer-relationship-attention {
    border-top: 3px solid CanvasText;
    box-shadow: none;
  }
  .payment-command-panel,
  .payment-summary-rail,
  .payment-workspace-section,
  .payment-attention-section,
  .payment-record {
    border-color: CanvasText;
  }
  .payment-command-panel::before,
  .payment-activity-item::before {
    background: Highlight;
  }
  .payment-action button:disabled {
    border-color: GrayText;
    color: GrayText;
  }
}
@media (max-width: 460px) {
  .topbar {
    gap: 12px;
    padding: 14px;
  }
  .topbar h1 {
    font-size: 22px;
  }
  .topbar-search-wrap input {
    padding-left: 38px;
    font-size: 13px;
  }
  .topbar-search-icon {
    left: 13px;
  }
  .theme-button, button.theme-button {
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
  }
}

.portal-chat {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  display: grid;
  justify-items: end;
  pointer-events: none;
}
.portal-chat * { pointer-events: auto; }
.portal-chat-launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid color-mix(in oklab, var(--accent) 52%, var(--stroke-2));
  border-radius: 999px;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
  box-shadow: var(--shadow-lg);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.portal-chat-launcher .ui-icon {
  width: 19px;
  height: 19px;
}
.portal-chat-panel {
  position: relative;
  width: min(460px, calc(100vw - 48px));
  height: min(720px, calc(100vh - 112px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  overflow: hidden;
  border: 1px solid var(--stroke-2);
  border-radius: 14px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
}
.portal-chat.open .portal-chat-launcher { display: none; }
.portal-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 14px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 183, 42, 0.18), transparent 40%),
    linear-gradient(135deg, var(--navy-900), var(--navy-700));
}
.portal-chat-brand {
  min-width: 0;
  display: grid;
}
.portal-chat-brand img {
  display: block;
  width: min(102px, 38vw);
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: left center;
}
.portal-chat-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.icon-button {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--stroke-2);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--fg-1);
  font-size: 12px;
  font-weight: 800;
}
.portal-chat-head .icon-button {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.09);
  color: #fff;
}
.portal-chat-new-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 78px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  color: #fff;
  background: rgba(255,255,255,0.09);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.portal-chat-new-button:hover,
.portal-chat-new-button:focus-visible,
.portal-chat-head .icon-button:hover,
.portal-chat-head .icon-button:focus-visible {
  border-color: rgba(255,255,255,0.34);
  background: rgba(255,255,255,0.16);
}
.portal-chat-new-button .ui-icon {
  width: 16px;
  height: 16px;
}
.portal-chat-report-chat-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 8px;
  color: rgba(255,255,255,0.74);
  background: rgba(255,255,255,0.06);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}
.portal-chat-report-chat-button .ui-icon {
  width: 14px;
  height: 14px;
}
.portal-chat-report-chat-button:hover,
.portal-chat-report-chat-button:focus-visible {
  border-color: rgba(255,255,255,0.34);
  color: #fff;
  background: rgba(255,255,255,0.12);
}
.portal-chat-report-chat-button:disabled:hover {
  border-color: rgba(255,255,255,0.20);
  color: rgba(255,255,255,0.74);
  background: rgba(255,255,255,0.06);
}
.portal-chat-copy-button[data-copy-state="copied"] {
  border-color: color-mix(in oklab, var(--success) 56%, rgba(255,255,255,0.22));
  color: var(--success);
}
.portal-chat-copy-button[data-copy-state="error"] {
  border-color: color-mix(in oklab, var(--error) 56%, rgba(255,255,255,0.22));
  color: var(--error);
}
.portal-chat-user-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px 18px;
  border-bottom: 1px solid var(--stroke-1);
  background: var(--bg-subtle);
}
.portal-chat-user-strip div {
  min-width: 0;
  display: grid;
  line-height: 1.15;
}
.portal-chat-user-strip strong,
.portal-chat-user-strip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.portal-chat-user-strip span {
  color: var(--fg-3);
  font-size: 12px;
}
.portal-chat-messages {
  min-height: 0;
  overflow-y: auto;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--bg-subtle) 70%, transparent), transparent 180px),
    var(--bg-surface);
}
.portal-chat-empty {
  margin: auto;
  max-width: 300px;
  padding: 18px;
  border: 1px dashed var(--stroke-2);
  border-radius: 10px;
  color: var(--fg-2);
  text-align: center;
}
.portal-chat-empty strong {
  display: block;
  color: var(--fg-1);
  font-size: 17px;
  line-height: 1.2;
}
.portal-chat-empty-connectors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 13px;
}
.portal-chat-connector-logo {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid var(--stroke-1);
  border-radius: 7px;
  background: color-mix(in oklab, var(--bg-surface) 78%, var(--bg-subtle));
}
.portal-chat-connector-logo img {
  display: block;
  max-width: 17px;
  max-height: 17px;
  filter: grayscale(1) saturate(0) opacity(0.66);
}
.portal-chat-connector-logo:hover img,
.portal-chat-connector-logo:focus-within img {
  filter: grayscale(1) saturate(0) opacity(0.86);
}
.portal-chat-message {
  width: min(100%, 380px);
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 6px;
}
.portal-chat-message.user {
  align-self: flex-end;
}
.portal-chat-message.assistant {
  align-self: flex-start;
}
.portal-chat-message.assistant.streaming .portal-chat-message-body::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 1em;
  margin-left: 2px;
  border-radius: 999px;
  background: var(--accent);
  vertical-align: -0.16em;
  animation: portal-chat-caret 1s ease-in-out infinite;
}
.portal-chat-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--fg-3);
  font-size: 12px;
  letter-spacing: 0;
}
.portal-chat-message-person {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--fg-2);
}
.portal-chat-message-person strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
}
.portal-chat-message-person .avatar,
.portal-chat-ai-avatar {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}
.portal-chat-ai-avatar {
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--navy-900);
}
.portal-chat-ai-avatar img {
  width: 35px;
  max-width: none;
  height: auto;
}
.portal-chat-message-body {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
  overflow-wrap: anywhere;
  word-break: normal;
  padding: 12px 13px;
  border: 1px solid var(--stroke-1);
  border-radius: 11px;
  color: var(--fg-1);
  background: var(--bg-subtle);
  box-shadow: var(--shadow-xs);
  font-size: 14px;
  line-height: 1.42;
}
.portal-chat-message-body * {
  min-width: 0;
  max-width: 100%;
}
.portal-chat-message.user .portal-chat-message-body {
  border-color: color-mix(in oklab, var(--accent) 42%, var(--stroke-2));
  background: var(--gold-100);
  color: var(--navy-900);
}
:root[data-theme="dark"] .portal-chat-message.user .portal-chat-message-body {
  background: rgba(255, 183, 42, 0.16);
  color: var(--fg-1);
}
.portal-chat-message-body p,
.portal-chat-message-body ul,
.portal-chat-message-body ol,
.portal-chat-message-body h3,
.portal-chat-message-body h4 {
  margin: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}
.portal-chat-message-body p + p,
.portal-chat-message-body p + ul,
.portal-chat-message-body p + ol,
.portal-chat-message-body ul + p,
.portal-chat-message-body ol + p,
.portal-chat-message-body h3 + p,
.portal-chat-message-body h4 + p,
.portal-chat-message-body .portal-chat-table-scroll + p,
.portal-chat-message-body p + .portal-chat-table-scroll {
  margin-top: 9px;
}
.portal-chat-message-body ul,
.portal-chat-message-body ol {
  padding-left: 18px;
}
.portal-chat-message-body li {
  overflow-wrap: anywhere;
  word-break: normal;
}
.portal-chat-message-body h3,
.portal-chat-message-body h4 {
  color: var(--fg-1);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}
.portal-chat-message-body code {
  padding: 1px 4px;
  border-radius: 5px;
  background: color-mix(in oklab, var(--fg-1) 8%, transparent);
  font-size: 0.92em;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
@keyframes portal-chat-caret {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 0.95;
  }
}
.portal-chat-table-scroll {
  max-width: 100%;
  overflow-x: clip;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
}
.portal-chat-table-scroll table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
  line-height: 1.22;
  white-space: normal;
}
.portal-chat-table-scroll th,
.portal-chat-table-scroll td {
  min-width: 0;
  padding: 7px 7px;
  border-bottom: 1px solid var(--stroke-1);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}
.portal-chat-table-scroll th {
  color: var(--fg-3);
  background: color-mix(in oklab, var(--fg-1) 5%, transparent);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.portal-chat-table-scroll tbody tr:last-child td {
  border-bottom: 0;
}
.portal-chat-table-scroll.compact table {
  font-size: 11px;
}
.portal-chat-table-scroll.compact th,
.portal-chat-table-scroll.compact td {
  padding: 6px 5px;
}
.portal-chat-table-scroll.dense table {
  font-size: 10px;
}
.portal-chat-table-scroll.dense th,
.portal-chat-table-scroll.dense td {
  padding: 5px 4px;
}
.portal-chat-table-scroll code {
  white-space: normal;
  overflow-wrap: anywhere;
}
.portal-chat-message-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 9px;
  max-width: 100%;
  padding: 0 2px;
  color: var(--fg-3);
  font-size: 10.5px;
  line-height: 1.25;
}
.portal-chat-message-footer span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.portal-chat-message-footer strong {
  color: color-mix(in oklab, var(--fg-2) 84%, var(--fg-3));
  font-weight: 850;
}
.portal-chat-report-row {
  flex: 0 0 100%;
  display: flex;
  justify-content: center;
  padding-top: 2px;
}
.portal-chat-report-link {
  display: inline;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: color-mix(in oklab, var(--fg-3) 88%, var(--fg-2));
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-weight: 850;
  line-height: 1.25;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--fg-3) 46%, transparent);
  opacity: .82;
  text-decoration-thickness: 1px;
}
.portal-chat-report-link:hover,
.portal-chat-report-link:focus-visible {
  color: var(--fg-1);
  background: transparent;
  border-bottom-color: color-mix(in oklab, var(--fg-1) 62%, transparent);
  opacity: 1;
}
.portal-chat-activity {
  width: min(100%, 390px);
}
.portal-chat-activity-body {
  padding: 12px;
  border: 1px solid color-mix(in oklab, var(--gold-500) 42%, var(--stroke-1));
  border-radius: 11px;
  background:
    linear-gradient(135deg, color-mix(in oklab, var(--gold-500) 10%, transparent), transparent 58%),
    var(--bg-subtle);
  box-shadow: var(--shadow-xs);
}
.portal-chat-activity-body[data-tone="tool"] {
  border-color: color-mix(in oklab, var(--teal-500) 42%, var(--stroke-1));
}
.portal-chat-activity-body[data-tone="complete"] {
  border-color: color-mix(in oklab, var(--success) 36%, var(--stroke-1));
}
.portal-chat-activity-body[data-tone="error"] {
  border-color: color-mix(in oklab, var(--error) 42%, var(--stroke-1));
}
.portal-chat-activity-current {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: var(--fg-1);
  font-size: 13px;
  line-height: 1.25;
}
.portal-chat-activity-current strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.portal-chat-activity-pulse {
  width: 10px;
  height: 10px;
  margin-left: 3px;
  border-radius: 999px;
  background: var(--gold-500);
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--gold-500) 48%, transparent);
  animation: portal-chat-pulse 1.25s ease-out infinite;
}
.portal-chat-activity.complete .portal-chat-activity-pulse {
  background: var(--success);
  animation: none;
}
@keyframes portal-chat-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--gold-500) 48%, transparent); }
  70% { box-shadow: 0 0 0 8px color-mix(in oklab, var(--gold-500) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--gold-500) 0%, transparent); }
}
.portal-chat-status {
  margin: 0 18px 12px;
  padding: 9px 11px;
  border: 1px solid var(--stroke-1);
  border-radius: 9px;
  color: var(--fg-2);
  background: var(--bg-subtle);
  font-size: 13px;
}
.portal-chat-status[data-tone="tool"] {
  border-color: color-mix(in oklab, var(--teal-500) 35%, var(--stroke-1));
}
.portal-chat-status[data-tone="error"] {
  border-color: color-mix(in oklab, var(--error) 35%, var(--stroke-1));
  color: var(--error);
}
.portal-chat-run-details {
  margin: 0 18px 12px;
  border: 1px solid var(--stroke-1);
  border-radius: 9px;
  background: var(--bg-subtle);
}
.portal-chat-run-details summary {
  cursor: pointer;
  padding: 9px 11px;
  color: var(--fg-2);
  font-weight: 800;
}
.portal-chat-run-details dl {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0 11px 11px;
}
.portal-chat-run-details dl > div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 8px;
}
.portal-chat-run-details dt {
  color: var(--fg-3);
  font-size: 12px;
  text-transform: uppercase;
}
.portal-chat-run-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}
.portal-chat-composer {
  display: block;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--stroke-1);
  background: var(--bg-surface);
}
.portal-chat-input-shell {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 10px;
  border: 1px solid var(--stroke-2);
  border-radius: 9px;
  background: var(--bg-subtle);
  box-shadow: inset 0 1px 0 color-mix(in oklab, #fff 40%, transparent);
}
:root[data-theme="dark"] .portal-chat-input-shell {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.portal-chat-input-shell:focus-within {
  border-color: color-mix(in oklab, var(--gold-500) 58%, var(--stroke-2));
  box-shadow:
    0 0 0 3px color-mix(in oklab, var(--gold-500) 18%, transparent),
    inset 0 1px 0 color-mix(in oklab, #fff 34%, transparent);
}
:root[data-theme="dark"] .portal-chat-input-shell:focus-within {
  box-shadow:
    0 0 0 3px color-mix(in oklab, var(--gold-500) 18%, transparent),
    inset 0 1px 0 rgba(255,255,255,0.04);
}
.portal-chat-input-shell textarea {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  min-height: 34px;
  max-height: 132px;
  resize: none;
  padding: 7px 2px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fg-1);
  line-height: 20px;
  box-sizing: border-box;
}
.portal-chat-input-shell .voice-button,
.portal-chat-input-shell .portal-chat-send {
  flex: 0 0 34px;
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-color: transparent;
  color: var(--fg-3);
  background: transparent;
}
.portal-chat-input-shell .voice-button:hover,
.portal-chat-input-shell .voice-button:focus-visible,
.portal-chat-input-shell .portal-chat-send:hover,
.portal-chat-input-shell .portal-chat-send:focus-visible {
  border-color: var(--stroke-1);
  color: var(--fg-1);
  background: var(--bg-surface);
}
.portal-chat-send {
  color: var(--accent);
}
.portal-chat-input-shell .portal-chat-send:disabled {
  cursor: default;
  opacity: 0.38;
  color: var(--fg-3);
}
.portal-chat-input-shell .portal-chat-send:disabled:hover {
  border-color: transparent;
  color: var(--fg-3);
  background: transparent;
}
.voice-button.recording {
  color: #fff;
  background: var(--magenta-500);
  border-color: var(--magenta-500);
}
.portal-chat-input-shell .voice-button.recording {
  color: #fff;
  background: var(--magenta-500);
  border-color: var(--magenta-500);
}
.portal-chat-feedback-modal {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 18px;
}
.portal-chat-feedback-modal[hidden] {
  display: none;
}
.portal-chat-feedback-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in oklab, var(--navy-900) 54%, transparent);
  backdrop-filter: blur(6px);
}
.portal-chat-feedback-card {
  position: relative;
  z-index: 1;
  width: min(100%, 390px);
  max-height: 100%;
  overflow: auto;
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--stroke-2);
  border-radius: 12px;
  color: var(--fg-1);
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
}
.portal-chat-feedback-card header,
.portal-chat-feedback-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.portal-chat-feedback-card h3,
.portal-chat-feedback-card .eyebrow {
  margin: 0;
}
.portal-chat-feedback-card h3 {
  font-size: 20px;
  line-height: 1.1;
}
.portal-chat-feedback-card label {
  display: grid;
  gap: 7px;
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.portal-chat-feedback-card textarea {
  width: 100%;
  min-height: 82px;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid var(--stroke-2);
  border-radius: 9px;
  color: var(--fg-1);
  background: var(--bg-subtle);
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
}
.portal-chat-feedback-card textarea:focus {
  outline: 0;
  border-color: color-mix(in oklab, var(--gold-500) 58%, var(--stroke-2));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--gold-500) 16%, transparent);
}
.portal-chat-feedback-status {
  margin: 0;
  padding: 9px 10px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  color: var(--fg-2);
  background: var(--bg-subtle);
  font-size: 13px;
}
.portal-chat-feedback-status[data-tone="success"] {
  border-color: color-mix(in oklab, var(--success) 40%, var(--stroke-1));
  color: var(--success);
}
.portal-chat-feedback-status[data-tone="error"] {
  border-color: color-mix(in oklab, var(--error) 40%, var(--stroke-1));
  color: var(--error);
}
.portal-chat-feedback-card footer {
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .portal-chat {
    inset: auto 12px 12px;
  }
  .portal-chat-panel {
    width: calc(100vw - 24px);
    height: min(82vh, 760px);
    border-radius: 14px;
  }
  .portal-chat-launcher {
    min-height: 46px;
    padding: 0 15px;
  }
}

@media (max-width: 460px) {
  .portal-chat {
    inset: auto 0 0;
  }
  .portal-chat-panel {
    width: 100vw;
    height: 88vh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 16px 16px 0 0;
  }
  .portal-chat-launcher {
    margin-right: 14px;
    margin-bottom: 14px;
  }
  .portal-chat-message {
    width: min(100%, 340px);
  }
  .portal-chat-composer {
    padding: 12px 12px 14px;
  }
}

.ai-training-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
  align-items: center;
  overflow: hidden;
  border-color: color-mix(in oklab, var(--accent) 24%, var(--stroke-1));
  background:
    linear-gradient(135deg, color-mix(in oklab, var(--accent) 8%, var(--bg-surface)) 0%, color-mix(in oklab, var(--success) 5%, var(--bg-surface)) 100%);
}
.ai-training-overview.completed {
  border-color: color-mix(in oklab, var(--success) 32%, var(--stroke-1));
  background:
    linear-gradient(135deg, color-mix(in oklab, var(--success) 10%, var(--bg-surface)), var(--bg-surface));
}
.ai-training-overview-copy,
.ai-training-overview-copy h2,
.ai-training-overview-copy p {
  min-width: 0;
}
.ai-training-overview-copy h2 {
  margin: 0;
  font-size: clamp(24px, 2.3vw, 36px);
  line-height: 1.02;
}
.ai-training-overview-copy p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--fg-2);
}
.ai-training-overview .eyebrow {
  color: var(--accent-ink);
}
.ai-training-completion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.ai-training-overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}
.ai-training-score-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid color-mix(in oklab, var(--success) 35%, var(--stroke-1));
  border-radius: 999px;
  color: var(--success-ink);
  background: color-mix(in oklab, var(--success) 12%, var(--bg-surface));
  font-size: 13px;
  font-weight: 900;
}
.ai-training-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ai-training-stat-grid div {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: color-mix(in oklab, var(--bg-surface) 86%, var(--accent));
}
.ai-training-stat-grid strong {
  font-size: 28px;
  line-height: 1;
}
.ai-training-stat-grid span,
.ai-training-card-meta {
  color: var(--fg-3);
  font-size: 13px;
}
.ai-training-detail-grid,
.ai-training-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 380px);
  gap: 18px;
  align-items: start;
}
.ai-training-main-panel,
.ai-training-builder-main {
  min-width: 0;
}
.ai-training-lesson-list {
  display: grid;
  gap: 12px;
}
.ai-training-lesson-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--bg-surface), color-mix(in oklab, var(--bg-subtle) 48%, var(--bg-surface)));
}
.ai-training-lesson-card h3 {
  margin: 8px 0 7px;
  font-size: 21px;
  line-height: 1.12;
}
.ai-training-lesson-card p,
.ai-training-lesson-card-main,
.ai-training-prose,
.ai-training-message {
  min-width: 0;
}
.ai-training-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  color: var(--fg-2);
  background: var(--bg-subtle);
  font-size: 12px;
  font-weight: 800;
}
.ai-training-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.ai-training-leaderboard-panel {
  display: grid;
  gap: 14px;
  overflow: hidden;
}
.ai-training-leaderboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.ai-training-leaderboard-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.ai-training-leaderboard-title h2 {
  margin: 0;
}
.ai-training-leaderboard-title p {
  margin: 0;
  color: var(--fg-3);
  font-size: 14px;
}
.ai-training-leaderboard-head .button {
  flex: 0 0 auto;
}
.ai-training-leaderboard-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.ai-training-leaderboard-toggle {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg-subtle) 74%, var(--bg-surface));
}
.ai-training-leaderboard-toggle a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.ai-training-leaderboard-toggle a:hover {
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  color: var(--fg-1);
}
.ai-training-leaderboard-toggle a.active {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 7px 16px color-mix(in oklab, var(--accent) 20%, transparent);
}
.ai-training-leaderboard-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ai-training-leaderboard-summary span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid color-mix(in oklab, var(--accent) 14%, var(--stroke-1));
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg-subtle) 72%, var(--bg-surface));
}
.ai-training-leaderboard-summary small,
.ai-training-rank-score span {
  overflow: hidden;
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-training-leaderboard-summary strong {
  overflow: hidden;
  color: var(--fg-1);
  font-size: 14px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-training-rank-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  border: 2px solid color-mix(in oklab, var(--bg-surface) 88%, var(--accent));
  background: color-mix(in oklab, var(--accent) 18%, var(--bg-surface));
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-weight: 900;
  box-shadow: 0 8px 18px color-mix(in oklab, var(--accent) 12%, transparent);
}
.ai-training-avatar-image {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}
.ai-training-avatar-initials {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}
.ai-training-rank-person strong {
  overflow: hidden;
  color: var(--fg-1);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-training-score-meter {
  --score: 0;
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 10%, var(--stroke-1));
}
.ai-training-score-meter i {
  display: block;
  width: calc(var(--score) * 1%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-500), var(--accent));
  box-shadow: 0 0 14px color-mix(in oklab, var(--accent) 24%, transparent);
}
.ai-training-score-meter.compact {
  grid-column: auto;
  height: 6px;
}
.ai-training-rank-list {
  display: grid;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--stroke-1);
  border-radius: 14px;
  background: var(--bg-surface);
  list-style: none;
}
.ai-training-user-card {
  display: grid;
  grid-template-columns: 34px 48px minmax(0, 1fr) minmax(82px, auto);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--stroke-1);
  background: transparent;
  transition: background .16s ease;
}
.ai-training-user-card:last-child {
  border-bottom: 0;
}
.ai-training-user-card:hover {
  background: color-mix(in oklab, var(--accent) 5%, transparent);
}
.ai-training-user-card.top-rank {
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--gold-500) 13%, transparent), transparent 42%),
    color-mix(in oklab, var(--bg-surface) 92%, var(--gold-500));
}
.ai-training-user-card.is-current-user {
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--accent) 12%, transparent), transparent 42%),
    color-mix(in oklab, var(--bg-surface) 94%, var(--accent));
}
.ai-training-rank-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: var(--fg-2);
  font-weight: 900;
  background: color-mix(in oklab, var(--accent) 8%, var(--bg-surface));
}
.ai-training-rank-avatar {
  width: 48px;
  height: 48px;
  font-size: 14px;
}
.ai-training-user-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.ai-training-rank-person {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ai-training-rank-person strong {
  min-width: 0;
}
.ai-training-current-user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid color-mix(in oklab, var(--accent) 30%, var(--stroke-1));
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 12%, var(--bg-surface));
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}
.ai-training-user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.ai-training-user-meta span {
  overflow: hidden;
  color: var(--fg-3);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-training-user-meta span + span::before {
  content: "/";
  margin-right: 8px;
  color: color-mix(in oklab, var(--fg-3) 54%, transparent);
}
.ai-training-rank-score {
  display: grid;
  justify-items: end;
  min-width: 74px;
}
.ai-training-rank-score strong {
  color: var(--fg-1);
  font-size: 20px;
  line-height: 1;
}
.ai-training-meta-list {
  display: grid;
  gap: 12px;
  margin: 0;
}
.ai-training-meta-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--stroke-1);
}
.ai-training-meta-list dt {
  color: var(--fg-3);
  font-weight: 800;
}
.ai-training-meta-list dd {
  margin: 0;
  text-align: right;
}
.ai-training-target-note {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-subtle);
}
.ai-training-builder-main {
  display: grid;
  gap: 16px;
}
.ai-training-builder-header-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  gap: 16px;
  align-items: center;
  border-color: color-mix(in oklab, var(--accent) 20%, var(--stroke-1));
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 7%, var(--bg-surface)), var(--bg-surface));
}
.ai-training-builder-header-panel h2,
.ai-training-builder-header-panel p {
  margin: 0;
}
.ai-training-builder-header-panel h2 {
  margin-top: 4px;
  font-size: clamp(26px, 2.4vw, 38px);
  line-height: 1.04;
}
.ai-training-builder-header-panel p:not(.eyebrow) {
  margin-top: 8px;
  color: var(--fg-2);
}
.ai-training-builder-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ai-training-builder-kpis div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: color-mix(in oklab, var(--bg-surface) 84%, var(--gold-500));
}
.ai-training-builder-kpis span,
.ai-training-question-type,
.ai-training-question-points {
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ai-training-builder-kpis strong {
  overflow: hidden;
  color: var(--fg-1);
  font-size: 20px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-training-admin-list {
  display: grid;
  gap: 14px;
}
.ai-training-admin-toolbar {
  display: grid;
  grid-template-columns: auto minmax(260px, 420px) auto;
  gap: 12px;
  align-items: center;
}
.ai-training-admin-tabs {
  display: inline-flex;
  gap: 4px;
  width: fit-content;
  padding: 4px;
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
  background: color-mix(in oklab, var(--bg-subtle) 70%, var(--bg-surface));
}
.ai-training-admin-tabs button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  color: var(--fg-2);
  background: transparent;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
}
.ai-training-admin-tabs button.active {
  color: var(--fg-1);
  background: var(--bg-surface);
  box-shadow: 0 6px 16px color-mix(in oklab, var(--ink-900) 8%, transparent);
}
.ai-training-admin-tabs button span {
  display: inline-grid;
  min-width: 24px;
  min-height: 22px;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--accent-ink);
  background: color-mix(in oklab, var(--accent) 12%, var(--bg-surface));
  font-size: 12px;
}
.ai-training-admin-search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}
.ai-training-admin-search .ui-icon {
  position: absolute;
  left: 13px;
  color: var(--fg-3);
  pointer-events: none;
}
.ai-training-admin-search input {
  width: 100%;
  min-height: 42px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  color: var(--fg-1);
  background: var(--bg-surface);
  font-size: 15px;
  font-weight: 650;
}
.ai-training-admin-search input::placeholder {
  color: var(--fg-3);
  font-weight: 600;
}
.ai-training-admin-count {
  justify-self: end;
  color: var(--fg-3);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.ai-training-admin-panel {
  display: grid;
  gap: 12px;
}
.ai-training-admin-table {
  min-width: 880px;
  font-size: 14px;
}
.ai-training-admin-table th {
  padding-block: 11px;
  color: var(--fg-2);
  font-size: 11px;
}
.ai-training-admin-table td {
  padding-block: 14px;
  color: var(--fg-2);
  font-size: 14px;
  line-height: 1.42;
}
.ai-training-admin-lesson-cell {
  max-width: 520px;
}
.ai-training-admin-lesson-title {
  display: block;
  color: var(--fg-1);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
}
.ai-training-admin-lesson-title:hover {
  color: var(--blue-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ai-training-admin-lesson-cell span {
  display: block;
  margin-top: 4px;
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.38;
}
.ai-training-admin-lesson-cell small,
.ai-training-admin-table td small {
  display: block;
  margin-top: 3px;
  color: var(--fg-3);
  font-size: 12px;
  line-height: 1.25;
}
.ai-training-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  color: var(--fg-2);
  background: var(--bg-subtle);
  font-size: 12px;
  font-weight: 900;
}
.ai-training-status-pill.published {
  border-color: color-mix(in oklab, var(--success) 34%, var(--stroke-1));
  color: var(--success-ink);
  background: color-mix(in oklab, var(--success) 10%, var(--bg-surface));
}
.ai-training-status-pill.draft {
  border-color: color-mix(in oklab, var(--accent) 24%, var(--stroke-1));
  color: var(--accent-ink);
  background: color-mix(in oklab, var(--accent) 8%, var(--bg-surface));
}
.ai-training-status-pill.archived {
  color: var(--fg-3);
}
.ai-training-admin-date {
  color: var(--fg-2);
  font-weight: 750;
}
.ai-training-admin-empty-row td {
  color: var(--fg-3);
  font-size: 14px;
  text-align: center;
}
.ai-training-builder-section,
.ai-training-question-admin-panel {
  display: grid;
  gap: 14px;
}
.ai-training-builder-grid,
.ai-training-prompt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.ai-training-prompt-grid {
  margin-top: 16px;
}
.ai-training-builder .field.wide {
  grid-column: 1 / -1;
}
.ai-training-builder textarea,
.ai-training-builder input,
.ai-training-builder select {
  width: 100%;
}
.ai-training-builder textarea {
  resize: vertical;
}
.ai-training-builder textarea.invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--error) 18%, transparent);
}
.ai-training-question-count {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid color-mix(in oklab, var(--accent) 20%, var(--stroke-1));
  border-radius: 999px;
  color: var(--accent-ink);
  background: color-mix(in oklab, var(--accent) 8%, var(--bg-surface));
  font-size: 12px;
  font-weight: 900;
}
.ai-training-question-set-fields {
  display: grid;
  grid-template-columns: minmax(220px, 0.38fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid color-mix(in oklab, var(--accent) 14%, var(--stroke-1));
  border-radius: 12px;
  background: color-mix(in oklab, var(--bg-subtle) 62%, var(--bg-surface));
}
.ai-training-question-set-fields .field.wide {
  grid-column: auto;
}
.ai-training-question-builder,
.ai-training-choice-editor-list,
.ai-training-criterion-list {
  display: grid;
  gap: 12px;
}
.ai-training-question-builder-actions {
  display: flex;
  justify-content: flex-end;
}
.ai-training-question-empty {
  border: 1px dashed var(--stroke-2);
  border-radius: 12px;
}
.ai-training-question-editor {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--stroke-1);
  border-radius: 14px;
  background:
    linear-gradient(180deg, var(--bg-surface), color-mix(in oklab, var(--bg-subtle) 50%, var(--bg-surface)));
  box-shadow: 0 10px 24px color-mix(in oklab, var(--ink-900) 4%, transparent);
}
.ai-training-question-editor-head,
.ai-training-answer-editor-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}
.ai-training-question-editor-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.ai-training-question-editor-title strong {
  color: var(--fg-1);
  font-size: 14px;
}
.ai-training-question-editor-title > span:last-child {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  color: var(--fg-3);
  background: var(--bg-subtle);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.ai-training-question-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.icon-button.compact {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 900;
}
.icon-button.compact:disabled {
  cursor: not-allowed;
  opacity: .45;
}
.icon-danger-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in oklab, var(--error) 24%, var(--stroke-1));
  border-radius: 10px;
  color: var(--error);
  background: color-mix(in oklab, var(--error) 5%, var(--bg-surface));
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}
.icon-danger-button:hover {
  border-color: color-mix(in oklab, var(--error) 48%, var(--stroke-1));
  background: color-mix(in oklab, var(--error) 9%, var(--bg-surface));
}
.ai-training-question-editor-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px;
  gap: 12px;
}
.ai-training-question-editor-grid .wide {
  grid-column: 1 / -1;
}
.ai-training-answer-editor {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid color-mix(in oklab, var(--accent) 12%, var(--stroke-1));
  border-radius: 12px;
  background: color-mix(in oklab, var(--bg-subtle) 52%, var(--bg-surface));
}
.ai-training-answer-editor-head h3 {
  margin: 0;
  font-size: 17px;
}
.ai-training-answer-editor-head p {
  margin: 3px 0 0;
  color: var(--fg-3);
  font-size: 13px;
}
.ai-training-choice-editor {
  display: grid;
  grid-template-columns: 96px 76px minmax(0, 1fr) 38px;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
  background: var(--bg-surface);
}
.ai-training-choice-editor .icon-danger-button {
  justify-self: end;
}
.ai-training-correct-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.ai-training-correct-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--success);
}
.ai-training-criterion-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px 38px;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
  background: var(--bg-surface);
}
.ai-training-criterion-editor .wide {
  grid-column: 1 / 3;
}
.ai-training-criterion-editor .icon-danger-button {
  grid-column: 3;
  grid-row: 1;
  align-self: end;
  justify-self: end;
}
.ai-training-admin-question-list {
  display: grid;
  gap: 12px;
}
.ai-training-admin-question-card {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--bg-surface), color-mix(in oklab, var(--bg-subtle) 54%, var(--bg-surface)));
}
.ai-training-admin-question-head {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}
.ai-training-question-number {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--accent-ink);
  background: color-mix(in oklab, var(--accent) 12%, var(--bg-surface));
  font-size: 12px;
  font-weight: 900;
}
.ai-training-question-type,
.ai-training-question-points {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  background: var(--bg-subtle);
}
.ai-training-admin-question-card h3 {
  margin: 0;
  font-size: clamp(18px, 1.6vw, 24px);
  line-height: 1.16;
}
.ai-training-admin-choice-list {
  display: grid;
  gap: 8px;
}
.ai-training-admin-choice-list div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 9px 10px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
}
.ai-training-admin-choice-list div.correct {
  border-color: color-mix(in oklab, var(--success) 36%, var(--stroke-1));
  background: color-mix(in oklab, var(--success) 8%, var(--bg-surface));
}
.ai-training-admin-choice-list strong {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--fg-1);
  background: var(--bg-subtle);
  font-size: 12px;
}
.ai-training-admin-choice-list span,
.ai-training-admin-grading-key li,
.ai-training-admin-explanation {
  color: var(--fg-2);
  font-size: 14px;
  line-height: 1.45;
}
.ai-training-admin-grading-key {
  display: grid;
  gap: 7px;
  padding: 11px 12px;
  border: 1px dashed var(--stroke-2);
  border-radius: 10px;
  background: color-mix(in oklab, var(--bg-subtle) 72%, var(--bg-surface));
}
.ai-training-admin-grading-key strong {
  color: var(--fg-1);
  font-size: 13px;
}
.ai-training-admin-grading-key ul {
  margin: 0;
  padding-left: 18px;
}
.ai-training-admin-explanation {
  margin: 0;
  padding-top: 2px;
}
.ai-training-schema-editor {
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
  background: var(--bg-subtle);
}
.ai-training-schema-editor summary {
  padding: 12px 14px;
  color: var(--fg-1);
  cursor: pointer;
  font-weight: 900;
}
.ai-training-schema-editor .field {
  padding: 0 14px 14px;
}
.ai-training-target-builder {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 36px);
  overflow: auto;
}
.ai-training-target-collections {
  display: grid;
  gap: 12px;
}
.ai-training-target-collection {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
  background: color-mix(in oklab, var(--bg-subtle) 72%, var(--bg-surface));
}
.ai-training-target-collection-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.ai-training-target-chip-list,
.ai-training-target-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.ai-training-target-chip {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  max-width: 100%;
  min-height: 30px;
  padding: 4px 5px 4px 8px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--fg-2);
  font-size: 12px;
}
.ai-training-target-chip strong {
  color: var(--fg-3);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ai-training-target-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-training-target-chip button {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fg-3);
  cursor: pointer;
}
.ai-training-target-chip button:hover {
  background: var(--bg-subtle);
  color: var(--danger);
}
.ai-training-target-empty {
  color: var(--fg-3);
  font-size: 13px;
}
.ai-training-target-search-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ai-training-target-search-grid .field {
  position: relative;
}
.ai-training-target-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--stroke-2);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
}
.ai-training-target-results[hidden] {
  display: none;
}
.ai-training-target-result {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--fg-1);
  text-align: left;
  cursor: pointer;
}
.ai-training-target-result:hover {
  background: var(--bg-subtle);
}
.ai-training-target-result strong,
.ai-training-target-result span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-training-target-result span,
.ai-training-target-result.muted {
  color: var(--fg-3);
  font-size: 12px;
}
.ai-training-target-toggle {
  margin: 0;
}
.ai-training-orgunit-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.ai-training-orgunit-suggestions button {
  padding: 6px 9px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  color: var(--fg-2);
  background: var(--bg-subtle);
  cursor: pointer;
}
.ai-training-orgunit-suggestions span {
  color: var(--fg-3);
}
.ai-training-form-status {
  min-height: 34px;
  padding: 9px 10px;
  border: 1px solid var(--stroke-1);
  border-radius: 9px;
  color: var(--fg-2);
  background: var(--bg-subtle);
  font-size: 13px;
}
.full-width {
  width: 100%;
}
.ai-training-runner {
  display: grid;
  gap: 14px;
  min-height: calc(100vh - 122px);
  grid-template-rows: auto minmax(0, 1fr);
  --training-sticky-top: 74px;
}
.ai-training-runner-head {
  position: sticky;
  top: var(--training-sticky-top);
  z-index: 18;
  display: grid;
  grid-template-columns: auto minmax(190px, 1fr) minmax(360px, 560px) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 11px;
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
  border-color: color-mix(in oklab, var(--accent) 18%, var(--stroke-1));
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 9%, var(--bg-surface)), color-mix(in oklab, var(--bg-surface) 94%, transparent));
  box-shadow: 0 14px 34px color-mix(in oklab, var(--shadow-color, #0a1438) 10%, transparent);
  backdrop-filter: blur(14px);
}
.ai-training-runner-head h2,
.ai-training-runner-head p {
  margin: 0;
}
.ai-training-runner-title {
  min-width: 0;
}
.ai-training-runner-title .eyebrow {
  font-size: 9.5px;
}
.ai-training-runner-title h2 {
  max-width: 100%;
  overflow: hidden;
  color: var(--fg-1);
  font-size: clamp(17px, 1.45vw, 22px);
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-training-runner-title p:not(.eyebrow) {
  margin-top: 4px;
  overflow: hidden;
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-training-progress-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 88px)) minmax(84px, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
  max-width: none;
}
.ai-training-progress-strip > div:not(.ai-training-progress-track) {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid color-mix(in oklab, var(--accent) 16%, var(--stroke-1));
  border-radius: 9px;
  background: color-mix(in oklab, var(--bg-surface) 76%, transparent);
}
.ai-training-progress-strip span {
  color: var(--fg-3);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.ai-training-progress-strip strong {
  color: var(--fg-1);
  font-size: 13px;
  line-height: 1.1;
}
.ai-training-progress-track {
  position: relative;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in oklab, var(--stroke-1) 70%, var(--bg-surface));
}
.ai-training-progress-track i {
  display: block;
  width: calc(var(--progress, 0) * 1%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in oklab, var(--success) 68%, var(--accent)));
  box-shadow: 0 0 18px color-mix(in oklab, var(--accent) 34%, transparent);
  transition: width 360ms cubic-bezier(.2, .8, .2, 1);
}
.ai-training-runner-status {
  padding: 6px 9px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  color: var(--fg-2);
  background: var(--bg-subtle);
  font-size: 12px;
  font-weight: 900;
}
.ai-training-runner-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
}
.ai-training-runner-actions form {
  margin: 0;
}
.ai-training-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}
.ai-training-workspace-single {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-height: 0;
}
.ai-training-lesson-rail,
.ai-training-chat-shell {
  min-width: 0;
  border: 1px solid var(--stroke-1);
  border-radius: 14px;
  background: color-mix(in oklab, var(--bg-subtle) 32%, var(--bg-surface));
}
.ai-training-lesson-rail {
  display: grid;
  align-content: start;
  gap: 16px;
  max-height: calc(100vh - 230px);
  overflow: auto;
  padding: 16px;
}
.ai-training-criteria {
  display: grid;
  gap: 10px;
}
.ai-training-criteria div,
.ai-training-score-items div {
  padding: 11px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-subtle);
}
.ai-training-criteria div {
  display: grid;
  gap: 3px;
}
.ai-training-criteria span,
.ai-training-score-items span {
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 900;
}
.ai-training-chat-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.ai-training-question-stage {
  display: grid;
  align-content: center;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  padding: clamp(16px, 3vw, 40px);
}
.ai-training-question-card {
  width: min(880px, 100%);
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  justify-self: center;
  padding: clamp(18px, 2.4vw, 30px);
  border: 1px solid color-mix(in oklab, var(--gold-500) 34%, var(--stroke-1));
  border-radius: 18px;
  background:
    radial-gradient(circle at 0% 0%, color-mix(in oklab, var(--gold-500) 13%, transparent), transparent 35%),
    linear-gradient(180deg, color-mix(in oklab, var(--bg-surface) 95%, var(--gold-500)), var(--bg-surface));
  box-shadow: 0 18px 42px color-mix(in oklab, var(--gold-500) 10%, transparent);
}
.ai-training-question-card.complete {
  text-align: center;
}
.ai-training-complete-submit {
  margin-top: 16px;
  justify-self: center;
}
.ai-training-complete-form {
  display: grid;
  justify-items: center;
  margin: 0;
}
.ai-training-question-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 13px;
  padding: 5px 10px;
  border: 1px solid color-mix(in oklab, var(--gold-500) 34%, var(--stroke-1));
  border-radius: 999px;
  color: var(--fg-2);
  background: color-mix(in oklab, var(--gold-500) 12%, var(--bg-surface));
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
}
.ai-training-question-card h3 {
  max-width: 820px;
  margin: 0 0 20px;
  color: var(--fg-1);
  font-family: var(--font-display);
  font-size: clamp(23px, 2.5vw, 34px);
  font-weight: 900;
  line-height: 1.08;
  overflow-wrap: anywhere;
  word-break: normal;
}
.ai-training-choice-list {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}
.ai-training-choice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid color-mix(in oklab, var(--accent) 12%, var(--stroke-1));
  border-radius: 13px;
  background: color-mix(in oklab, var(--bg-subtle) 62%, var(--bg-surface));
  color: var(--fg-2);
  cursor: pointer;
  font: inherit;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}
.ai-training-choice span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--gold-500) 20%, var(--bg-surface));
  color: var(--fg-1);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
}
.ai-training-choice strong {
  display: block;
  min-width: 0;
  max-width: 100%;
  color: inherit;
  font-size: clamp(15px, 1.15vw, 17px);
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}
.ai-training-choice:hover,
.ai-training-choice:focus-visible {
  border-color: color-mix(in oklab, var(--gold-500) 52%, var(--stroke-1));
  background: color-mix(in oklab, var(--gold-500) 10%, var(--bg-surface));
  box-shadow: 0 10px 24px color-mix(in oklab, var(--gold-500) 11%, transparent);
  outline: none;
  transform: translateY(-1px);
}
.ai-training-choice.selected {
  border-color: color-mix(in oklab, var(--gold-500) 72%, var(--stroke-1));
  background: color-mix(in oklab, var(--gold-500) 16%, var(--bg-surface));
  box-shadow:
    0 0 0 3px color-mix(in oklab, var(--gold-500) 16%, transparent),
    0 14px 30px color-mix(in oklab, var(--gold-500) 13%, transparent);
  transform: translateY(-1px) scale(1.006);
}
.ai-training-choice.is-selecting {
  animation: ai-choice-select 420ms cubic-bezier(.2,.8,.2,1);
}
.ai-training-choice.selected span {
  background: var(--gold-500);
  color: var(--accent-ink);
  box-shadow: 0 0 0 5px color-mix(in oklab, var(--gold-500) 14%, transparent);
}
.ai-training-freeform {
  display: grid;
  gap: 12px;
}
.ai-training-freeform textarea {
  width: 100%;
  min-height: 124px;
  max-height: 210px;
  resize: vertical;
  padding: 14px 15px;
  border: 1px solid color-mix(in oklab, var(--accent) 14%, var(--stroke-1));
  border-radius: 13px;
  background: color-mix(in oklab, var(--bg-subtle) 68%, var(--bg-surface));
  color: var(--fg-1);
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}
.ai-training-freeform textarea:focus {
  border-color: color-mix(in oklab, var(--gold-500) 58%, var(--stroke-2));
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--gold-500) 16%, transparent);
}
.ai-training-freeform-submit {
  justify-self: end;
}
.ai-training-freeform-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ai-training-freeform-loading {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid color-mix(in oklab, var(--gold-500) 30%, var(--stroke-1));
  border-radius: 999px;
  background: color-mix(in oklab, var(--gold-500) 10%, var(--bg-surface));
  color: var(--fg-2);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: 0 8px 20px color-mix(in oklab, var(--gold-500) 8%, transparent);
}
.ai-training-freeform-loading[hidden] {
  display: none;
}
.ai-training-freeform-loading .spinner {
  width: 16px;
  height: 16px;
  border-color: color-mix(in oklab, var(--gold-500) 28%, transparent);
  border-top-color: var(--gold-500);
}
.ai-training-question-card.is-submitting-freeform {
  border-color: color-mix(in oklab, var(--gold-500) 50%, var(--stroke-1));
  box-shadow:
    0 0 0 3px color-mix(in oklab, var(--gold-500) 12%, transparent),
    0 20px 48px color-mix(in oklab, var(--gold-500) 13%, transparent);
}
.ai-training-question-card.is-submitting-freeform textarea {
  border-color: color-mix(in oklab, var(--gold-500) 42%, var(--stroke-2));
}
.ai-training-answer-feedback {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  width: min(880px, 100%);
  justify-self: center;
  overflow: visible;
  padding: 14px 15px;
  border: 1px solid color-mix(in oklab, var(--success) 34%, var(--stroke-1));
  border-radius: 16px;
  background:
    radial-gradient(circle at 0% 0%, color-mix(in oklab, var(--success) 16%, transparent), transparent 42%),
    linear-gradient(180deg, color-mix(in oklab, var(--success) 8%, var(--bg-surface)), var(--bg-surface));
  color: var(--fg-2);
  box-shadow: 0 14px 34px color-mix(in oklab, var(--success) 10%, transparent);
  animation: ai-feedback-in 420ms cubic-bezier(.2,.8,.2,1);
}
.ai-training-answer-feedback[hidden] {
  display: none;
}
.ai-training-answer-feedback.incorrect {
  border-color: color-mix(in oklab, var(--danger) 30%, var(--stroke-1));
  background:
    radial-gradient(circle at 0% 0%, color-mix(in oklab, var(--danger) 10%, transparent), transparent 42%),
    linear-gradient(180deg, color-mix(in oklab, var(--danger) 5%, var(--bg-surface)), var(--bg-surface));
  box-shadow: 0 14px 34px color-mix(in oklab, var(--danger) 7%, transparent);
}
.ai-training-feedback-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in oklab, var(--success) 15%, var(--bg-surface));
  color: var(--success);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--success) 35%, transparent);
}
.ai-training-answer-feedback.correct.is-celebrating .ai-training-feedback-icon {
  animation: ai-feedback-check-pop 540ms cubic-bezier(.18,.84,.28,1) both;
}
.ai-training-feedback-icon::before {
  content: "";
  width: 16px;
  height: 9px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(-45deg) translate(1px, -1px);
}
.ai-training-answer-feedback.incorrect .ai-training-feedback-icon {
  background: color-mix(in oklab, var(--danger) 10%, var(--bg-surface));
  color: var(--danger);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--danger) 30%, transparent);
}
.ai-training-answer-feedback.incorrect .ai-training-feedback-icon::before {
  width: 16px;
  height: 16px;
  border: 0;
  background:
    linear-gradient(currentColor, currentColor) center / 3px 18px no-repeat,
    linear-gradient(90deg, currentColor, currentColor) center / 18px 3px no-repeat;
  transform: rotate(45deg);
}
.ai-training-feedback-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.ai-training-feedback-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ai-training-answer-feedback strong {
  color: var(--fg-1);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
}
.ai-training-feedback-score {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--success) 13%, var(--bg-surface));
  color: color-mix(in oklab, var(--success) 72%, var(--fg-1));
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}
.ai-training-answer-feedback.correct.is-celebrating .ai-training-feedback-score {
  animation: ai-feedback-score-pop 620ms cubic-bezier(.18,.84,.28,1) both;
}
.ai-training-answer-feedback.incorrect .ai-training-feedback-score {
  background: color-mix(in oklab, var(--danger) 9%, var(--bg-surface));
  color: color-mix(in oklab, var(--danger) 72%, var(--fg-1));
}
.ai-training-answer-feedback p,
.ai-training-answer-feedback small {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}
.ai-training-answer-feedback small {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  color: var(--fg-3);
}
.ai-training-answer-feedback small span {
  color: var(--fg-1);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.ai-training-celebration {
  position: absolute;
  top: 12px;
  right: 18px;
  width: 64px;
  height: 44px;
  pointer-events: none;
  z-index: 2;
}
.ai-training-celebration i {
  position: absolute;
  left: 30px;
  top: 18px;
  width: 7px;
  height: 10px;
  border-radius: 2px;
  background: hsl(calc(var(--i) * 38deg), 78%, 58%);
  transform: rotate(calc(var(--i) * 31deg));
  animation: ai-confetti-chip 760ms cubic-bezier(.18,.78,.28,1) both;
  animation-delay: calc(var(--i) * 17ms);
}
@keyframes ai-choice-select {
  0% { transform: translateY(0) scale(1); }
  42% { transform: translateY(-2px) scale(1.012); }
  100% { transform: translateY(-1px) scale(1.006); }
}
@keyframes ai-feedback-in {
  0% { opacity: 0; transform: translateY(-8px) scale(.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ai-feedback-check-pop {
  0% { transform: scale(.82); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--success) 35%, transparent), 0 0 0 0 color-mix(in oklab, var(--success) 0%, transparent); }
  45% { transform: scale(1.12); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--success) 35%, transparent), 0 0 0 8px color-mix(in oklab, var(--success) 13%, transparent); }
  100% { transform: scale(1); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--success) 35%, transparent), 0 0 0 0 color-mix(in oklab, var(--success) 0%, transparent); }
}
@keyframes ai-feedback-score-pop {
  0% { transform: scale(.92); }
  42% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes ai-confetti-chip {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(calc(var(--i) * 31deg)) scale(.4);
  }
  16% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate(var(--x), var(--y)) rotate(calc(var(--i) * 72deg)) scale(1);
  }
}
.ai-training-closed-state {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  min-height: 260px;
  padding: 24px;
  text-align: center;
}
.ai-training-closed-state span {
  color: var(--fg-3);
}
.ai-training-messages {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}
.ai-training-message {
  width: min(760px, 100%);
  padding: 13px;
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
  background: var(--bg-subtle);
  animation: aiTrainingMessageIn 220ms cubic-bezier(.2, .8, .2, 1);
  transform-origin: 50% 100%;
}
.ai-training-message.assistant {
  background: color-mix(in oklab, var(--success) 6%, var(--bg-surface));
}
.ai-training-message.assistant.question {
  width: min(980px, 100%);
  padding: clamp(17px, 1.9vw, 24px);
  border-radius: 18px;
  border-color: color-mix(in oklab, var(--gold-500) 34%, var(--stroke-1));
  background:
    radial-gradient(circle at 0% 0%, color-mix(in oklab, var(--gold-500) 18%, transparent), transparent 34%),
    linear-gradient(180deg, color-mix(in oklab, var(--bg-surface) 92%, var(--gold-500)), var(--bg-surface));
  box-shadow: 0 18px 42px color-mix(in oklab, var(--gold-500) 12%, transparent);
}
.ai-training-message.user {
  justify-self: end;
  background: color-mix(in oklab, var(--accent) 11%, var(--bg-surface));
}
.ai-training-message.grader {
  border-color: color-mix(in oklab, var(--success) 34%, var(--stroke-1));
}
.ai-training-message header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--fg-3);
  font-size: 12px;
}
.ai-training-message.question header {
  margin-bottom: 16px;
}
.ai-training-prose {
  overflow-wrap: anywhere;
}
.ai-training-prose h2,
.ai-training-prose h3,
.ai-training-prose h4 {
  margin: 14px 0 7px;
  line-height: 1.12;
}
.ai-training-prose p,
.ai-training-prose ul {
  margin: 0 0 10px;
}
.ai-training-prose pre {
  max-width: 100%;
  overflow: auto;
  white-space: pre-wrap;
}
.ai-training-message.question .ai-training-prose :is(h2, h3, h4) {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0 0 12px;
  padding: 5px 10px;
  border: 1px solid color-mix(in oklab, var(--gold-500) 34%, var(--stroke-1));
  border-radius: 999px;
  color: var(--fg-2);
  background: color-mix(in oklab, var(--gold-500) 12%, var(--bg-surface));
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
}
.ai-training-message.question .ai-training-prose :is(h2, h3, h4) + p {
  max-width: 850px;
  margin: 0 0 18px;
  color: var(--fg-1);
  font-family: var(--font-display);
  font-size: clamp(23px, 2.6vw, 34px);
  font-weight: 900;
  line-height: 1.06;
}
.ai-training-message.question .ai-training-prose :is(h2, h3, h4) + p ~ p {
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid color-mix(in oklab, var(--accent) 12%, var(--stroke-1));
  border-radius: 13px;
  background: color-mix(in oklab, var(--bg-subtle) 62%, var(--bg-surface));
  color: var(--fg-2);
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.35;
}
.ai-training-message.question .ai-training-prose .ai-training-choice {
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
  user-select: none;
}
.ai-training-message.question .ai-training-prose .ai-training-choice:hover,
.ai-training-message.question .ai-training-prose .ai-training-choice:focus-visible {
  border-color: color-mix(in oklab, var(--gold-500) 52%, var(--stroke-1));
  background: color-mix(in oklab, var(--gold-500) 10%, var(--bg-surface));
  box-shadow: 0 10px 24px color-mix(in oklab, var(--gold-500) 11%, transparent);
  outline: none;
  transform: translateY(-1px);
}
.ai-training-message.question .ai-training-prose .ai-training-choice.selected {
  border-color: color-mix(in oklab, var(--gold-500) 72%, var(--stroke-1));
  background: color-mix(in oklab, var(--gold-500) 16%, var(--bg-surface));
}
.ai-training-runner.is-busy .ai-training-choice {
  cursor: progress;
  opacity: .68;
  pointer-events: none;
}
.ai-training-message.question .ai-training-prose :is(h2, h3, h4) + p ~ p strong:first-child {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  margin-right: 8px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--gold-500) 20%, var(--bg-surface));
  color: var(--fg-1);
  font-family: var(--font-display);
  font-size: 14px;
}
.ai-training-message.question .ai-training-prose :is(h2, h3, h4) + p ~ p:last-child {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg-3);
  font-size: 13px;
  font-weight: 800;
}
.ai-training-composer {
  display: block;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--stroke-1);
  background: var(--bg-surface);
}
.ai-training-composer-hidden {
  display: none;
}
.ai-training-input-shell {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 10px;
  border: 1px solid var(--stroke-2);
  border-radius: 9px;
  background: var(--bg-subtle);
  box-shadow: inset 0 1px 0 color-mix(in oklab, #fff 40%, transparent);
}
:root[data-theme="dark"] .ai-training-input-shell {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.ai-training-input-shell:focus-within {
  border-color: color-mix(in oklab, var(--gold-500) 58%, var(--stroke-2));
  box-shadow:
    0 0 0 3px color-mix(in oklab, var(--gold-500) 18%, transparent),
    inset 0 1px 0 color-mix(in oklab, #fff 34%, transparent);
}
:root[data-theme="dark"] .ai-training-input-shell:focus-within {
  box-shadow:
    0 0 0 3px color-mix(in oklab, var(--gold-500) 18%, transparent),
    inset 0 1px 0 rgba(255,255,255,0.04);
}
.ai-training-composer textarea {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  min-height: 34px;
  max-height: 132px;
  resize: none;
  padding: 7px 2px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fg-1);
  line-height: 20px;
  box-sizing: border-box;
}
.ai-training-send {
  flex: 0 0 34px;
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-color: transparent;
  color: var(--accent);
  background: transparent;
}
.ai-training-send:hover,
.ai-training-send:focus-visible {
  border-color: var(--stroke-1);
  color: var(--fg-1);
  background: var(--bg-surface);
}
.ai-training-send:disabled,
.ai-training-send:disabled:hover {
  cursor: default;
  opacity: 0.38;
  border-color: transparent;
  color: var(--fg-3);
  background: transparent;
}
.ai-training-live-status {
  margin: 10px 12px 0;
  padding: 8px 10px;
  border: 1px solid color-mix(in oklab, var(--accent) 18%, var(--stroke-1));
  border-radius: 10px;
  background: color-mix(in oklab, var(--accent) 5%, var(--bg-surface));
  color: var(--fg-2);
  font-size: 12px;
}
.ai-training-live-status[hidden] {
  display: none;
}
.ai-training-live-status[data-tone="tool"] {
  border-color: color-mix(in oklab, var(--success) 24%, var(--stroke-1));
  background: color-mix(in oklab, var(--success) 6%, var(--bg-surface));
}
.ai-training-live-status[data-tone="error"] {
  border-color: color-mix(in oklab, var(--danger) 28%, var(--stroke-1));
  background: color-mix(in oklab, var(--danger) 6%, var(--bg-surface));
}
.ai-training-message.streaming {
  border-color: color-mix(in oklab, var(--accent) 26%, var(--stroke-1));
}
.ai-training-submit-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-top: 1px solid var(--stroke-1);
  background: color-mix(in oklab, var(--bg-subtle) 70%, var(--bg-surface));
}
.ai-training-score-panel {
  display: grid;
  gap: 16px;
  padding: 16px;
  border-top: 1px solid var(--stroke-1);
}
.ai-training-score-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.ai-training-score-ring {
  --score: 0;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--bg-surface) 58%, transparent 60%),
    conic-gradient(var(--accent) calc(var(--score) * 1%), var(--stroke-1) 0);
}
.ai-training-score-ring strong {
  font-size: 20px;
}
.ai-training-score-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ai-training-score-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 1180px) {
  .ai-training-runner {
    --training-sticky-top: 128px;
  }
  .ai-training-runner-head {
    grid-template-columns: auto minmax(160px, 1fr) minmax(280px, 420px) auto;
  }
  .ai-training-hero,
  .ai-training-dashboard-grid,
  .ai-training-detail-grid,
  .ai-training-builder,
  .ai-training-workspace {
    grid-template-columns: 1fr;
  }
  .ai-training-target-builder,
  .ai-training-lesson-rail,
  .ai-training-chat-shell {
    position: static;
  }
}

@media (max-width: 860px) {
  .ai-training-runner-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .ai-training-progress-strip {
    grid-column: 1 / -1;
  }
}

@keyframes aiTrainingMessageIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 720px) {
  .ai-training-runner {
    --training-sticky-top: 136px;
  }
  .ai-training-runner-head {
    display: block;
    padding: 5px 7px 6px;
    border-radius: 0 0 9px 9px;
    margin: 0 -10px;
  }
  .ai-training-runner-head > .button.ghost {
    display: none;
  }
  .ai-training-runner-title {
    display: none;
  }
  .ai-training-runner-actions {
    display: none;
  }
  .ai-training-progress-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }
  .ai-training-progress-track {
    grid-column: 1 / -1;
    height: 3px;
  }
  .ai-training-progress-strip > div:not(.ai-training-progress-track) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    min-height: 24px;
    padding: 3px 6px;
    border-radius: 7px;
  }
  .ai-training-progress-strip span {
    font-size: 8px;
  }
  .ai-training-progress-strip strong {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-training-message {
    animation: none;
  }
  .ai-training-progress-track i {
    transition: none;
  }
}

@media (max-width: 760px) {
  .ai-training-admin-toolbar {
    grid-template-columns: 1fr;
  }
  .ai-training-admin-tabs,
  .ai-training-admin-search,
  .ai-training-admin-count {
    width: 100%;
  }
  .ai-training-admin-tabs {
    justify-content: stretch;
  }
  .ai-training-admin-tabs button {
    flex: 1;
    justify-content: center;
  }
  .ai-training-admin-count {
    justify-self: start;
  }
  .ai-training-admin-table {
    min-width: 780px;
  }
  .ai-training-builder-grid,
  .ai-training-prompt-grid,
  .ai-training-question-set-fields,
  .ai-training-question-editor-grid,
  .ai-training-target-search-grid,
  .ai-training-score-items {
    grid-template-columns: 1fr;
  }
  .ai-training-choice-editor,
  .ai-training-criterion-editor {
    grid-template-columns: 1fr;
  }
  .ai-training-criterion-editor .wide,
  .ai-training-question-set-fields .field.wide {
    grid-column: 1;
  }
  .ai-training-criterion-editor .icon-danger-button {
    grid-column: auto;
    grid-row: auto;
    justify-self: end;
  }
  .ai-training-question-editor-head,
  .ai-training-answer-editor-head {
    display: grid;
  }
  .ai-training-question-editor-actions {
    justify-content: start;
  }
  .ai-training-correct-toggle {
    min-height: 28px;
  }
  .ai-training-builder-header-panel {
    grid-template-columns: 1fr;
  }
  .ai-training-builder-header-panel h2 {
    font-size: clamp(24px, 7vw, 32px);
  }
  .ai-training-builder-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .ai-training-builder-kpis div {
    padding: 8px;
  }
  .ai-training-builder-kpis span {
    font-size: 9px;
  }
  .ai-training-builder-kpis strong {
    font-size: 15px;
  }
  .ai-training-overview {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .ai-training-overview-copy h2 {
    font-size: clamp(22px, 7vw, 30px);
  }
  .ai-training-stat-grid {
    gap: 6px;
  }
  .ai-training-stat-grid div {
    min-height: 58px;
    padding: 8px;
  }
  .ai-training-stat-grid strong {
    font-size: 23px;
  }
  .ai-training-stat-grid span {
    font-size: 11px;
  }
  .ai-training-lesson-card,
  .ai-training-submit-row,
  .ai-training-score-head {
    grid-template-columns: 1fr;
  }
  .ai-training-overview-actions .button,
  .ai-training-completion-row .button {
    flex: 1 1 130px;
    justify-content: center;
  }
  .ai-training-submit-row,
  .ai-training-score-actions {
    align-items: stretch;
  }
  .ai-training-lesson-card .button {
    width: 100%;
    justify-content: center;
    justify-items: stretch;
  }
  .ai-training-runner {
    min-height: calc(100vh - 174px);
  }
  .ai-training-message.assistant.question {
    padding: 15px;
    border-radius: 16px;
  }
  .ai-training-question-stage {
    align-content: start;
    padding: 16px;
  }
  .ai-training-question-card {
    padding: 16px;
    border-radius: 16px;
  }
  .ai-training-question-card h3 {
    font-size: clamp(21px, 6vw, 28px);
    line-height: 1.08;
  }
  .ai-training-choice {
    grid-template-columns: 32px minmax(0, 1fr);
    padding: 10px 11px;
  }
  .ai-training-choice strong {
    font-size: 15px;
  }
  .ai-training-freeform textarea {
    min-height: 112px;
    font-size: 15px;
  }
  .ai-training-freeform-submit {
    width: 100%;
    justify-self: stretch;
  }
  .ai-training-message.question .ai-training-prose :is(h2, h3, h4) + p {
    font-size: clamp(21px, 6.1vw, 28px);
    line-height: 1.08;
  }
  .ai-training-message.question .ai-training-prose :is(h2, h3, h4) + p ~ p {
    padding: 10px 11px;
    font-size: 15px;
  }
  .ai-training-leaderboard-head {
    align-items: stretch;
    flex-direction: column;
  }
  .ai-training-leaderboard-head .button {
    align-self: flex-start;
  }
  .ai-training-leaderboard-actions {
    align-items: flex-start;
    flex-direction: column;
  }
  .ai-training-leaderboard-summary {
    gap: 6px;
  }
  .ai-training-leaderboard-summary span {
    min-height: 28px;
    padding: 4px 8px;
  }
  .ai-training-user-card {
    grid-template-columns: 28px 42px minmax(0, 1fr) 52px;
    gap: 9px;
    padding: 10px;
  }
  .ai-training-rank-score {
    grid-column: auto;
    justify-content: end;
    justify-items: end;
    min-width: 0;
  }
  .ai-training-rank-score strong {
    font-size: 18px;
  }
  .ai-training-rank-score span {
    font-size: 11px;
  }
  .ai-training-user-meta {
    display: grid;
    gap: 2px;
  }
  .ai-training-user-meta span + span::before {
    content: "";
    margin-right: 0;
  }
}

.pricing-list-panel,
.pricing-editor {
  display: grid;
  gap: 16px;
}

.pricing-search-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, .32fr) minmax(260px, auto) auto;
  gap: 12px;
  align-items: end;
}

.pricing-search-form label,
.pricing-status-chips legend,
.pricing-mutation-form label {
  display: grid;
  gap: 6px;
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pricing-search-form input,
.pricing-search-form select,
.pricing-mutation-form input,
.pricing-mutation-form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--stroke-2);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--fg-1);
  font: inherit;
}

.pricing-search-form input,
.pricing-search-form select {
  padding: 8px 10px;
}

.pricing-status-chips {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.pricing-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pricing-status-chips legend {
  flex-basis: 100%;
  margin-bottom: 0;
}

.pricing-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.pricing-chip.selected {
  border-color: color-mix(in oklab, var(--gold-500) 44%, var(--stroke-1));
  background: color-mix(in oklab, var(--gold-500) 12%, var(--bg-surface));
  color: var(--fg-1);
}

.pricing-chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.pricing-product-table {
  min-width: 860px;
}

.pricing-product-table td:nth-child(3),
.pricing-product-table td:nth-child(4) {
  font-variant-numeric: tabular-nums;
}

.pricing-unavailable {
  display: grid;
  gap: 8px;
}

.pricing-product-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.pricing-product-kpis div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-subtle);
}

.pricing-product-kpis span,
.pricing-product-kpis small,
.pricing-option-card dt {
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.pricing-product-kpis strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 18px;
  line-height: 1.1;
}

.pricing-form-status {
  padding: 9px 11px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-subtle);
  color: var(--fg-2);
  font-weight: 700;
}

.pricing-form-status.error {
  border-color: rgba(192, 0, 0, 0.28);
  color: var(--error);
  background: color-mix(in srgb, var(--bg-surface) 70%, #ffe8e8);
}

.pricing-form-status.success {
  border-color: color-mix(in oklab, var(--success) 32%, var(--stroke-1));
  color: var(--success);
  background: color-mix(in oklab, var(--success) 8%, var(--bg-surface));
}

.pricing-create-form,
.pricing-mutation-panel {
  padding: 16px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: color-mix(in oklab, var(--bg-subtle) 62%, var(--bg-surface));
}

.pricing-mutation-panel[hidden],
.pricing-create-form[hidden],
.pricing-form-status[hidden] {
  display: none !important;
}

.pricing-mutation-panel {
  display: grid;
  gap: 14px;
}

.pricing-mutation-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.pricing-mutation-panel-head h3 {
  margin: 0;
  color: var(--fg-1);
  font-size: 20px;
  line-height: 1.1;
}

.pricing-mutation-form {
  display: grid;
  gap: 14px;
}

.pricing-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.pricing-form-grid[hidden],
.pricing-retire-copy[hidden] {
  display: none !important;
}

.pricing-mutation-form input,
.pricing-mutation-form select {
  padding: 8px 10px;
}

.pricing-form-actions,
.pricing-option-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.pricing-retire-copy {
  margin: 0;
  color: var(--fg-2);
  font-weight: 700;
}

.pricing-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.pricing-option-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--stroke-1);
  border-top: 4px solid var(--blue-accent);
  border-radius: 8px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}

.pricing-option-card.upcoming {
  border-top-color: var(--gold-500);
}

.pricing-option-card.history,
.pricing-option-card.retired {
  border-top-color: var(--fg-3);
  opacity: .86;
}

.pricing-option-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.pricing-option-card h3 {
  margin: 0;
  color: var(--fg-1);
  font-size: 18px;
  line-height: 1.08;
}

.pricing-option-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
}

.pricing-option-card dl div {
  min-width: 0;
}

.pricing-option-card dl div.wide {
  grid-column: 1 / -1;
}

.pricing-option-card dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 16px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.pricing-option-card .pill.active,
.pricing-option-card .pill.upcoming {
  background: color-mix(in oklab, var(--success) 12%, var(--bg-surface));
  color: var(--success);
}

@media (max-width: 980px) {
  .pricing-search-form,
  .pricing-product-kpis {
    grid-template-columns: 1fr;
  }
}

.shadow-order-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  margin-bottom: 18px;
  padding: 8px 12px;
  border: 1px solid rgba(196, 122, 0, 0.28);
  border-radius: 8px;
  color: var(--fg-1);
  background: color-mix(in srgb, var(--gold-100) 62%, var(--bg-surface));
  box-shadow: var(--shadow-xs);
  font-size: 13px;
  font-weight: 800;
}

:root[data-theme="dark"] .shadow-order-banner {
  background: rgba(255, 183, 42, 0.12);
}

.shadow-order-root {
  display: grid;
  gap: 0;
}

.order-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.order-flow-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  max-width: 860px;
}

.order-flow-column .table-wrap {
  overflow-x: auto;
}

.shadow-order-section {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.shadow-order-section-label {
  margin: 0;
  color: var(--fg-1);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.05;
}

.shadow-order-grid,
.shadow-order-meta-grid,
.shadow-order-commission-grid,
.shadow-order-plan-grid,
.shadow-order-process-grid {
  display: grid;
  gap: 12px;
  align-items: start;
}

.shadow-order-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.shadow-order-meta-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shadow-order-commission-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shadow-order-plan-grid {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.shadow-order-process-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 720px;
  padding: 12px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-subtle);
}

.shadow-order-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-weight: 700;
}

.shadow-order-field span,
.shadow-order-field label,
.shadow-order-channel-control legend {
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.shadow-order-field input,
.shadow-order-field select,
.shadow-order-field textarea,
.shadow-order-lines input,
.shadow-order-lines select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--stroke-2);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--fg-1);
  font: inherit;
}

.shadow-order-field textarea {
  min-height: 84px;
  resize: vertical;
}

.shadow-order-lines input[readonly] {
  border-color: color-mix(in oklab, var(--success) 30%, var(--stroke-1));
  background: color-mix(in oklab, var(--success) 7%, var(--bg-subtle));
  color: var(--fg-2);
  cursor: not-allowed;
}

.shadow-order-search-wrap > .customer-lookup-input-icon + input {
  padding-left: 42px;
}

.shadow-order-customer-entry {
  position: relative;
  min-height: 104px;
}

.shadow-order-customer-search-panel,
.shadow-order-selected {
  transition: opacity 120ms ease;
}

.shadow-order-selected,
.order-summary-customer {
  display: grid;
  gap: 4px;
  align-self: stretch;
  min-height: 80px;
  padding: 12px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-subtle);
}

.shadow-order-person-card,
.order-summary-customer {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
}

.shadow-order-person-card.readonly {
  padding: 0;
  border: 0;
  background: transparent;
}

.shadow-order-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--gold-500) 24%, var(--bg-surface));
  color: var(--fg-1);
  font-weight: 900;
}

.shadow-order-person-card small,
.order-summary-customer small,
.shadow-order-person-card em,
.order-summary-customer em {
  display: block;
  margin-top: 2px;
  color: var(--fg-2);
  font-size: 12px;
  font-style: normal;
}

.shadow-order-text-action {
  justify-self: start;
  padding-inline: 0;
  color: var(--fg-1);
}

.shadow-order-program-top-row,
.shadow-order-item-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.shadow-order-item-search-row {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 190px);
}

.shadow-order-channel-control,
.shadow-order-payment-modes,
.shadow-card-demo-modes {
  display: grid;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--stroke-2);
  border-radius: 999px;
  background: var(--bg-subtle);
}

.shadow-order-channel-control {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.shadow-order-payment-modes,
.shadow-card-demo-modes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(420px, 100%);
}

.shadow-order-channel-control legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.shadow-order-channel-control label,
.shadow-order-payment-modes label,
.shadow-card-demo-modes label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-weight: 800;
  white-space: nowrap;
}

.shadow-order-channel-control input,
.shadow-order-payment-modes input,
.shadow-card-demo-modes input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.shadow-order-channel-control label:has(input:checked),
.shadow-order-payment-modes label:has(input:checked),
.shadow-card-demo-modes label:has(input:checked) {
  border-color: var(--gold-500);
  background: var(--gold-500);
  color: var(--accent-ink);
  box-shadow: var(--shadow-xs);
}

.shadow-order-division-card {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 40px;
  color: var(--fg-2);
  font-size: 13px;
  font-weight: 800;
}

.shadow-order-division-card .shadow-order-field {
  min-width: 240px;
}

.shadow-order-catalog-status,
.shadow-order-note,
.shadow-order-form-status,
.shadow-order-promotion-result,
.shadow-order-netsuite-status {
  padding: 9px 11px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-subtle);
  color: var(--fg-2);
}

.shadow-order-catalog-status {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
}

.shadow-order-catalog-status details {
  position: relative;
}

.shadow-order-catalog-status summary {
  cursor: pointer;
  color: var(--fg-1);
  font-weight: 700;
}

.shadow-order-catalog-status ul {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  width: min(520px, 86vw);
  margin: 0;
  padding: 10px 12px 10px 28px;
  border: 1px solid var(--stroke-2);
  border-radius: 8px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-md);
  white-space: normal;
}

.shadow-order-catalog-status.error,
.shadow-order-form-status.error,
.shadow-order-promotion-result.error,
.shadow-order-netsuite-status.error {
  border-color: rgba(192, 0, 0, 0.28);
  color: var(--error);
  background: color-mix(in srgb, var(--bg-surface) 70%, #ffe8e8);
}

.shadow-order-form-status.info,
.shadow-order-promotion-result.info,
.shadow-order-netsuite-status.info,
.shadow-order-netsuite-status.idle {
  color: var(--fg-1);
}

.shadow-order-promotion-result.success,
.shadow-order-netsuite-status.success {
  border-color: color-mix(in oklab, var(--success) 32%, var(--stroke-1));
  color: var(--success);
  background: color-mix(in oklab, var(--success) 8%, var(--bg-surface));
}

.shadow-order-netsuite-status.warning {
  border-color: color-mix(in oklab, var(--warning) 36%, var(--stroke-1));
  color: var(--warning);
  background: color-mix(in oklab, var(--warning) 8%, var(--bg-surface));
}

.shadow-order-netsuite-push {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  margin-top: 12px;
}

.shadow-order-netsuite-status {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.shadow-order-netsuite-status strong {
  color: var(--fg-1);
}

.shadow-order-netsuite-status span {
  overflow-wrap: anywhere;
}

.shadow-order-netsuite-rows {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shadow-order-promotion-result ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--fg-2);
}

.shadow-order-program-results {
  max-height: 460px;
}

.shadow-order-program-option {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 100%;
}

.shadow-order-program-option > span:first-child {
  min-width: 0;
}

.shadow-order-program-option > span:first-child strong {
  display: block;
  overflow-wrap: anywhere;
  white-space: normal;
}

.shadow-order-program-option em {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-fg);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.shadow-order-price-preview {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 200px;
  color: var(--fg-1);
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: normal;
}

.shadow-order-schedule th:last-child,
.shadow-order-schedule td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.shadow-order-schedule {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.shadow-order-schedule .schedule-step {
  width: 52%;
}

.shadow-order-schedule .schedule-date {
  width: 27%;
}

.shadow-order-schedule .schedule-amount {
  width: 21%;
}

.shadow-order-schedule th:nth-child(2),
.shadow-order-schedule td:nth-child(2),
.shadow-order-schedule th:nth-child(3),
.shadow-order-schedule td:nth-child(3) {
  white-space: nowrap;
}

.shadow-order-schedule th:nth-child(2),
.shadow-order-schedule td:nth-child(2) {
  text-align: right;
}

.shadow-order-schedule td:first-child {
  overflow-wrap: anywhere;
}

.shadow-order-schedule td {
  vertical-align: top;
}

.shadow-order-program-list {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.shadow-order-program-empty {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 96px;
  padding: 20px;
  border: 1px dashed var(--stroke-2);
  border-radius: 12px;
  color: var(--fg-3);
  background: var(--bg-subtle);
  text-align: center;
}

.shadow-order-program-empty strong {
  color: var(--fg-2);
}

.shadow-order-program-loading {
  display: grid;
  gap: 8px;
  min-height: 96px;
  padding: 20px;
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
  background: var(--bg-surface);
}

.shadow-order-program-loading span {
  height: 16px;
  width: min(100%, 520px);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bg-subtle), color-mix(in oklab, var(--bg-subtle) 70%, var(--fg-3)), var(--bg-subtle));
  background-size: 200% 100%;
  animation: shadow-order-skeleton 1.1s linear infinite;
}

.shadow-order-program-loading span:nth-child(2) {
  width: min(72%, 380px);
}

.shadow-order-program-loading span:nth-child(3) {
  width: min(45%, 220px);
}

.shadow-order-program-loading small {
  color: var(--fg-3);
  font-weight: 700;
}

@keyframes shadow-order-skeleton {
  to { background-position: -200% 0; }
}

.shadow-order-warning-inline {
  max-width: 340px;
  margin: 8px 0 0;
  padding: 7px 8px;
  border-radius: 8px;
  color: #6f4400;
  background: rgba(255, 183, 42, 0.18);
  font-size: 12px;
  font-weight: 800;
}

:root[data-theme="dark"] .shadow-order-warning-inline {
  color: var(--gold-400);
}

.shadow-order-program-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--stroke-1);
  border-radius: 14px;
  background: var(--bg-surface);
  box-shadow: 0 8px 24px rgba(9, 24, 58, 0.06);
}

.shadow-order-program-card-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(200px, 280px) 44px;
  gap: 20px;
  align-items: end;
  padding: 20px 20px 16px;
}

.shadow-order-program-identity {
  min-width: 0;
}

.shadow-order-program-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--gold-700);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.shadow-order-program-identity h3 {
  margin: 0;
  color: var(--fg-1);
  font-family: var(--font-display);
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.shadow-order-program-identity small {
  display: block;
  margin-top: 6px;
  color: var(--fg-3);
  font-weight: 700;
}

.shadow-order-channel-item {
  align-self: end;
}

.shadow-order-remove-program {
  align-self: end;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border-color: transparent;
  color: var(--fg-3);
}

.shadow-order-remove-program:hover {
  border-color: color-mix(in oklab, var(--danger) 28%, var(--stroke-1));
  color: var(--danger);
  background: color-mix(in oklab, var(--danger) 7%, var(--bg-surface));
}

.shadow-order-program-prices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "list discount agreed pif"
    "reason reason reason reason";
  gap: 14px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--stroke-1);
  background: color-mix(in oklab, var(--bg-subtle) 44%, var(--bg-surface));
}

.shadow-order-program-card input,
.shadow-order-program-card select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--stroke-2);
  border-radius: 9px;
  background: var(--bg-surface);
  color: var(--fg-1);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.shadow-order-program-card input[readonly] {
  border-color: color-mix(in oklab, var(--success) 32%, var(--stroke-1));
  background: color-mix(in oklab, var(--success) 7%, var(--bg-surface));
  color: var(--fg-2);
  cursor: not-allowed;
}

.shadow-order-discount-cell {
  display: contents;
}

.shadow-order-list-price {
  grid-area: list;
}

.shadow-order-discount-price {
  grid-area: discount;
}

.shadow-order-agreed-price {
  grid-area: agreed;
}

.shadow-order-pif-price {
  grid-area: pif;
}

.shadow-order-discount-reason {
  grid-area: reason;
  width: min(100%, 540px);
  padding-top: 2px;
}

.shadow-order-program-prices > .shadow-order-field,
.shadow-order-discount-cell > .shadow-order-field {
  align-self: start;
  align-content: start;
  grid-auto-rows: max-content;
}

.shadow-order-field-error {
  color: var(--error);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.shadow-order-program-card input[aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--error) 12%, transparent);
}

.shadow-order-agreed-price strong {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--fg-1);
  font-family: var(--font-display);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.shadow-order-agreed-price.invalid strong,
.shadow-order-agreed-price.invalid small {
  color: var(--error);
}

.shadow-order-agreed-price small {
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.shadow-order-program-card > .shadow-order-warning-inline {
  max-width: none;
  margin: 16px 20px 0;
}

.shadow-order-current-pricing {
  margin: 0 20px 20px;
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--success) 30%, var(--stroke-1));
  border-radius: 12px;
  background: var(--bg-surface);
}

.shadow-order-current-pricing > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--stroke-1);
  background: color-mix(in oklab, var(--success) 6%, var(--bg-subtle));
}

.shadow-order-current-pricing > header > div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.shadow-order-current-pricing header small,
.shadow-order-pricing-option small {
  color: var(--fg-3);
  font-weight: 700;
}

.shadow-order-pricing-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shadow-order-pricing-option {
  display: grid;
  grid-template-rows: auto auto minmax(28px, 1fr) auto;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 16px;
}

.shadow-order-pricing-option + .shadow-order-pricing-option {
  border-left: 1px solid var(--stroke-1);
}

.shadow-order-pricing-option > span {
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.shadow-order-pricing-option > strong {
  color: var(--fg-1);
  font-family: var(--font-display);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.shadow-order-pricing-option .button {
  justify-content: center;
  justify-self: stretch;
  margin-top: 8px;
  border: 1px solid var(--stroke-2);
  background: var(--bg-surface);
  white-space: normal;
}

.shadow-order-pricing-option .button[aria-pressed="true"] {
  border-color: color-mix(in oklab, var(--gold-500) 62%, var(--stroke-2));
  background: color-mix(in oklab, var(--gold-100) 52%, var(--bg-surface));
  color: var(--fg-1);
}

.shadow-order-pricing-state {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 20px 20px;
  padding: 12px 14px;
  border: 1px dashed var(--stroke-2);
  border-radius: 10px;
  color: var(--fg-3);
  background: var(--bg-subtle);
  font-size: 13px;
  font-weight: 700;
}

.shadow-order-pricing-state.warning {
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
  color: var(--fg-2);
}

.shadow-order-inline-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--stroke-2);
  border-top-color: var(--gold-600);
  border-radius: 50%;
  animation: shadow-order-spin 700ms linear infinite;
}

@keyframes shadow-order-spin {
  to { transform: rotate(360deg); }
}

.shadow-order-deposit-minimum-warning {
  grid-column: 1 / -1;
  max-width: none;
  margin-top: 0;
}

.shadow-order-deposit-override {
  max-width: 720px;
}

.shadow-order-plan-exception {
  max-width: fit-content;
}

.shadow-order-pif-preview {
  display: grid;
  gap: 10px;
  width: min(50%, 430px);
  min-width: 280px;
  padding: 12px;
  border: 1px solid rgba(196, 122, 0, 0.28);
  border-radius: 8px;
  background: color-mix(in srgb, var(--gold-100) 48%, var(--bg-surface));
}

:root[data-theme="dark"] .shadow-order-pif-preview {
  background: rgba(255, 183, 42, 0.10);
}

.shadow-order-pif-preview strong {
  color: var(--fg-1);
}

.shadow-order-pif-preview dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 0;
}

.shadow-order-pif-preview div {
  display: grid;
  gap: 2px;
}

.shadow-order-pif-preview dt,
.shadow-order-pif-preview small {
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 700;
}

.shadow-order-pif-preview dd {
  margin: 0;
  color: var(--fg-1);
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.shadow-card-demo {
  display: grid;
  gap: 14px;
  max-width: 760px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--blue-accent) 38%, var(--stroke-2));
  border-radius: 14px;
  background:
    radial-gradient(circle at 94% 4%, rgba(74, 126, 255, 0.13), transparent 34%),
    linear-gradient(145deg, color-mix(in srgb, var(--bg-surface) 94%, #eef4ff), var(--bg-surface));
  box-shadow: 0 12px 32px rgba(19, 39, 84, 0.08);
}

:root[data-theme="dark"] .shadow-card-demo {
  background:
    radial-gradient(circle at 94% 4%, rgba(74, 126, 255, 0.18), transparent 34%),
    var(--bg-surface);
}

.shadow-card-demo-heading,
.shadow-card-demo-title,
.shadow-card-demo-footer,
.shadow-card-saved-method {
  display: flex;
  align-items: center;
}

.shadow-card-demo-heading {
  justify-content: space-between;
  gap: 12px;
}

.shadow-card-demo-title {
  gap: 10px;
}

.shadow-card-demo-title > div,
.shadow-card-amount-control,
.shadow-card-saved-method > span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.shadow-card-demo-title span,
.shadow-card-amount-input {
  color: var(--fg-1);
  font-size: 16px;
  font-weight: 900;
}

.shadow-card-demo-title small,
.shadow-card-demo-footer small,
.shadow-card-demo-footer span,
.shadow-card-saved-method small {
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 750;
}

.shadow-card-demo-lock {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--blue-accent) 14%, var(--bg-surface));
  color: var(--blue-accent);
}

.shadow-card-demo-notice {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(32, 157, 117, 0.24);
  border-radius: 10px;
  background: rgba(32, 157, 117, 0.08);
  color: var(--fg-2);
  font-size: 12px;
}

.shadow-card-demo-notice strong {
  color: var(--success);
}

.shadow-card-demo-modes {
  width: fit-content;
}

.shadow-card-hosted-shell {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--stroke-2);
  border-radius: 12px;
  background: var(--bg-surface);
}

.shadow-card-hosted-label,
.shadow-card-input-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shadow-card-hosted-label {
  grid-column: 1 / -1;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--stroke-1);
  color: var(--fg-3);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.shadow-card-hosted-label em {
  color: var(--blue-accent);
  font-size: 11px;
  font-style: normal;
  letter-spacing: 0.04em;
}

.shadow-card-number {
  grid-column: 1 / -1;
}

.shadow-card-input-wrap {
  gap: 10px;
  padding-right: 10px;
  border: 1px solid var(--stroke-2);
  border-radius: 8px;
  background: var(--bg-subtle);
}

.shadow-card-input-wrap input {
  min-width: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.shadow-card-input-wrap span {
  color: var(--fg-3);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.05em;
}

.shadow-card-detail-grid {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.shadow-card-saved-method {
  width: 100%;
  justify-content: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--blue-accent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--blue-accent) 7%, var(--bg-surface));
  color: var(--fg-1);
  text-align: left;
}

.shadow-card-saved-method > span:last-child {
  margin-left: auto;
  color: var(--success);
  font-weight: 950;
}

.shadow-card-brand-mark {
  display: grid;
  width: 48px;
  height: 30px;
  place-items: center;
  border-radius: 6px;
  background: #152d79;
  color: #fff;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.shadow-card-demo-footer {
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 2px;
}

.shadow-card-demo-footer > div {
  min-width: 190px;
  margin-right: auto;
}

.shadow-card-amount-control {
  min-width: 210px;
  margin-right: auto;
}

.shadow-card-amount-input {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 160px;
}

.shadow-card-amount-input > span {
  color: var(--fg-1);
  font-size: 22px;
}

.shadow-card-amount-input input {
  width: 132px;
  padding: 4px 8px;
  border: 1px solid var(--stroke-2);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--fg-1);
  font: inherit;
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.shadow-card-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.shadow-card-progress span {
  position: relative;
  padding-top: 11px;
  color: var(--fg-3);
  font-size: 10px;
  font-weight: 850;
  text-align: center;
}

.shadow-card-progress span::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  border-radius: 4px;
  background: var(--stroke-2);
  content: "";
}

.shadow-card-progress span.complete {
  color: var(--success);
}

.shadow-card-progress span.complete::before {
  background: var(--success);
}

.shadow-card-demo-status {
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(32, 157, 117, 0.10);
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
}

.shadow-card-demo-status.error {
  background: rgba(203, 61, 61, 0.10);
  color: var(--error);
}

.shadow-order-schedule-disclosure {
  max-width: 720px;
}

.shadow-order-schedule-disclosure summary {
  cursor: pointer;
  color: var(--fg-1);
  font-weight: 900;
}

.shadow-order-commissions-group {
  display: grid;
  gap: 12px;
  padding-top: 8px;
}

.shadow-order-commissions-group h3 {
  margin: 0;
  color: var(--fg-1);
  font-size: 17px;
  font-weight: 900;
}

.order-summary-rail {
  position: sticky;
  top: calc(74px + 16px);
}

.order-summary-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--stroke-2);
  border-radius: 8px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.order-summary-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.order-summary-badge-row small {
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.order-summary-line-list {
  display: grid;
  gap: 8px;
}

.order-summary-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid var(--stroke-1);
}

.order-summary-line strong:last-child {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.order-summary-line small,
.order-summary-empty {
  display: block;
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 700;
}

.order-summary-totals {
  display: grid;
  gap: 6px;
}

.order-summary-totals div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--fg-2);
}

.order-summary-totals span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.order-summary-totals strong {
  color: var(--fg-1);
  font-size: 17px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.order-summary-totals .emphasis {
  padding-top: 8px;
  border-top: 1px solid var(--stroke-2);
}

.order-summary-totals .emphasis strong {
  font-size: 22px;
}

.order-summary-payment {
  padding: 10px;
  border-radius: 8px;
  background: var(--bg-subtle);
  color: var(--fg-1);
  font-size: 13px;
  font-weight: 800;
}

.order-summary-gates {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-subtle);
}

.order-summary-gates.detail {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 12px 0;
}

.order-summary-gates div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 800;
}

.order-summary-gates strong {
  color: var(--fg-1);
  text-align: right;
}

.order-summary-gates strong.success {
  color: var(--success);
}

.order-summary-gates strong.warn {
  color: #9a5c00;
}

.order-summary-warnings {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(196, 122, 0, 0.28);
  border-radius: 8px;
  background: rgba(255, 183, 42, 0.16);
  color: #6f4400;
  font-size: 12px;
  font-weight: 900;
}

:root[data-theme="dark"] .order-summary-warnings {
  color: var(--gold-400);
}

.order-summary-save {
  width: 100%;
}

.order-mobile-summary,
.order-summary-sheet {
  display: none;
}

.shadow-order-root :is(input, select, textarea, button):focus-visible,
.shadow-order-typeahead .autocomplete-option:focus-visible,
.shadow-order-channel-control label:has(input:focus-visible),
.shadow-order-payment-modes label:has(input:focus-visible),
.shadow-card-demo-modes label:has(input:focus-visible) {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 183, 42, 0.16);
}

.shadow-order-root .button,
.shadow-order-root button {
  min-height: 40px;
}

.shadow-order-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.shadow-order-detail-grid p {
  margin: 4px 0;
}

.shadow-order-drafts-table {
  min-width: 900px;
}

@media (max-width: 1100px) {
  .retention-coverage-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .retention-coverage-strip > div:nth-child(2) { border-right: 0; }
  .retention-coverage-strip > div:nth-child(-n + 2) { border-bottom: 1px solid var(--stroke-1); }
  .order-workspace {
    grid-template-columns: 1fr;
  }

  .order-flow-column {
    max-width: none;
  }

  .order-summary-rail {
    display: none;
  }

  .order-mobile-summary {
    position: sticky;
    z-index: 18;
    bottom: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-top: 24px;
    padding: 10px;
    border: 1px solid var(--stroke-2);
    border-radius: 8px;
    background: var(--bg-surface);
    box-shadow: var(--shadow-md);
  }

  .order-mobile-summary-details {
    display: grid;
    justify-items: start;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--fg-1);
    font-weight: 900;
  }

  .order-mobile-summary-details span {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
  }

  .order-mobile-summary-details small {
    color: var(--fg-3);
    font-size: 12px;
    font-weight: 800;
  }

  .order-summary-sheet:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: block;
  }

  .order-summary-sheet-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    min-height: 100%;
    border: 0;
    background: rgba(0, 0, 0, 0.42);
  }

  .order-summary-sheet-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: min(86vh, 720px);
    overflow: auto;
    padding: 14px;
    border-radius: 8px 8px 0 0;
    background: var(--bg-surface);
    box-shadow: var(--shadow-md);
  }

  .order-summary-sheet-panel > .icon-button {
    justify-self: end;
    margin-bottom: 8px;
  }
}

@media (max-width: 760px) {
  .shadow-order-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .shadow-order-program-top-row,
  .shadow-order-item-search-row,
  .shadow-order-meta-grid,
  .shadow-order-commission-grid,
  .shadow-order-plan-grid,
  .shadow-order-process-grid {
    grid-template-columns: 1fr;
  }

  .shadow-order-division-card {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .shadow-order-channel-control {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 8px;
  }

  .shadow-order-channel-control label {
    border-radius: 8px;
  }

  .shadow-order-program-card-header {
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 14px;
    padding: 16px;
  }

  .shadow-order-program-identity {
    padding-right: 4px;
  }

  .shadow-order-channel-item {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .shadow-order-remove-program {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }

  .shadow-order-program-prices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "list discount"
      "agreed pif"
      "reason reason";
    padding: 16px;
  }

  .shadow-order-current-pricing,
  .shadow-order-pricing-state {
    margin-right: 16px;
    margin-left: 16px;
    margin-bottom: 16px;
  }

  .shadow-order-current-pricing > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .shadow-order-current-pricing > header > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .shadow-order-pricing-options {
    grid-template-columns: 1fr;
  }

  .shadow-order-pricing-option + .shadow-order-pricing-option {
    border-top: 1px solid var(--stroke-1);
    border-left: 0;
  }

  .shadow-order-pif-preview {
    width: 100%;
    min-width: 0;
  }

  .shadow-card-demo {
    padding: 14px;
  }

  .shadow-card-hosted-shell,
  .shadow-card-detail-grid {
    grid-template-columns: 1fr;
  }

  .shadow-card-demo-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .shadow-card-amount-control {
    margin-right: 0;
  }

  .shadow-card-demo-footer .button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .shadow-order-program-prices {
    grid-template-columns: 1fr;
    grid-template-areas:
      "list"
      "discount"
      "reason"
      "agreed"
      "pif";
  }

  .shadow-order-agreed-price {
    padding: 2px 0;
  }
}

/* Shadow order entry: four-stage order ledger */
.shadow-order-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
  padding: 4px 2px 16px;
  border-bottom: 1px solid var(--stroke-1);
}

.shadow-order-intro > div {
  max-width: 760px;
}

.shadow-order-intro .eyebrow,
.order-summary-heading .eyebrow {
  margin: 0 0 5px;
}

.shadow-order-intro h2 {
  margin: 0;
  color: var(--fg-1);
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1;
}

.shadow-order-intro p:last-child {
  max-width: 690px;
  margin: 10px 0 0;
  color: var(--fg-2);
  font-size: 15px;
  line-height: 1.55;
}

.shadow-order-intro .button {
  flex: 0 0 auto;
}

.shadow-order-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 48px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border-color: color-mix(in oklab, var(--gold-500) 46%, var(--stroke-1));
  border-radius: 10px;
  box-shadow: none;
  line-height: 1.45;
}

.shadow-order-banner-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--gold-500) 26%, var(--bg-surface));
  color: var(--fg-1);
}

.shadow-order-banner strong {
  color: var(--fg-1);
}

.shadow-order-runway {
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  padding: 16px 18px 14px;
  border: 1px solid color-mix(in oklab, var(--navy-900, #0b173d) 84%, white);
  border-radius: 12px;
  background:
    radial-gradient(circle at 92% -30%, rgba(255, 183, 42, 0.24), transparent 36%),
    linear-gradient(135deg, #071331, #10234f);
  box-shadow: 0 12px 32px rgba(7, 19, 49, 0.14);
  color: white;
}

.shadow-order-runway-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.shadow-order-runway-heading span {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.shadow-order-runway-heading strong {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 800;
}

.shadow-order-progress-meter {
  height: 3px;
  overflow: hidden;
  margin-bottom: 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
}

.shadow-order-progress-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gold-500);
  transition: width 180ms ease;
}

.shadow-order-runway ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shadow-order-runway li {
  min-width: 0;
}

.shadow-order-runway a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.66);
  text-decoration: none;
}

.shadow-order-runway a:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

.shadow-order-runway li[data-state="current"] a {
  border-color: rgba(255, 183, 42, 0.52);
  background: rgba(255, 183, 42, 0.12);
  color: white;
}

.shadow-order-runway li[data-state="complete"] a {
  color: white;
}

.shadow-order-stage-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.shadow-order-runway li[data-state="current"] .shadow-order-stage-number {
  border-color: var(--gold-500);
  background: var(--gold-500);
  color: #071331;
}

.shadow-order-runway li[data-state="complete"] .shadow-order-stage-number {
  border-color: #7bd8a6;
  background: #7bd8a6;
  color: #071331;
}

.shadow-order-runway a > span:last-child {
  min-width: 0;
}

.shadow-order-runway strong,
.shadow-order-runway small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shadow-order-runway strong {
  font-size: 13px;
  white-space: nowrap;
}

.shadow-order-runway small {
  margin-top: 2px;
  color: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shadow-order-global-status {
  margin: 0 0 18px;
  font-weight: 800;
}

.order-workspace {
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 26px;
}

.order-flow-column {
  gap: 22px;
  max-width: 920px;
}

.shadow-order-section {
  scroll-margin-top: 92px;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}

.shadow-order-section-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--stroke-1);
}

.shadow-order-section-heading > div,
.shadow-order-program-top-row,
.shadow-order-item-search-row,
.shadow-order-program-top-row > *,
.shadow-order-item-search-row > * {
  min-width: 0;
}

.shadow-order-program-top-row,
.shadow-order-item-search-row {
  width: 100%;
  max-width: 100%;
}

.shadow-order-channel-control {
  box-sizing: border-box;
  width: 100%;
  min-inline-size: 0;
}

.shadow-order-section-number {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in oklab, var(--gold-500) 50%, var(--stroke-1));
  border-radius: 9px;
  background: color-mix(in oklab, var(--gold-500) 11%, var(--bg-surface));
  color: var(--fg-1);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
}

.shadow-order-section-heading p {
  margin: 0 0 3px;
  color: var(--fg-3);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.shadow-order-section-heading .shadow-order-section-label {
  font-family: var(--font-display);
  font-size: 25px;
  letter-spacing: -0.012em;
}

.shadow-order-section-heading div > span {
  display: block;
  margin-top: 5px;
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.4;
}

.shadow-order-section-heading > em {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--fg-3);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shadow-order-subsection {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: color-mix(in oklab, var(--bg-subtle) 58%, var(--bg-surface));
}

.shadow-order-subsection-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.shadow-order-subsection-heading h3 {
  margin: 0;
  color: var(--fg-1);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 900;
}

.shadow-order-subsection-heading span {
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 800;
}

.shadow-order-process-grid {
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
}

.shadow-order-commissions-group {
  padding-top: 16px;
}

.shadow-order-payment-review {
  display: grid;
  gap: 12px;
}

.shadow-order-schedule-disclosure {
  padding: 11px 13px;
  border: 1px solid var(--stroke-1);
  border-radius: 9px;
  background: var(--bg-subtle);
}

.shadow-order-schedule-disclosure[open] summary {
  margin-bottom: 12px;
}

.shadow-payment-sandbox {
  overflow: hidden;
  border: 1px solid color-mix(in oklab, #4267d6 42%, var(--stroke-1));
  border-radius: 11px;
  background: color-mix(in oklab, #4267d6 4%, var(--bg-surface));
}

.shadow-payment-sandbox > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.shadow-payment-sandbox > summary::-webkit-details-marker {
  display: none;
}

.shadow-payment-sandbox > summary:hover {
  background: color-mix(in oklab, #4267d6 7%, transparent);
}

.shadow-payment-sandbox-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: color-mix(in oklab, #4267d6 13%, var(--bg-surface));
  color: #4267d6;
}

.shadow-payment-sandbox > summary strong,
.shadow-payment-sandbox > summary small {
  display: block;
}

.shadow-payment-sandbox > summary strong {
  color: var(--fg-1);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
}

.shadow-payment-sandbox > summary small {
  margin-top: 3px;
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 700;
}

.shadow-payment-sandbox[open] > summary {
  border-bottom: 1px solid color-mix(in oklab, #4267d6 28%, var(--stroke-1));
}

.shadow-payment-sandbox .shadow-card-demo {
  margin: 0;
  padding: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.order-summary-rail {
  top: 16px;
}

.order-summary-card {
  gap: 13px;
  padding: 18px;
  border-radius: 12px;
  border-top: 4px solid var(--gold-500);
  box-shadow: 0 10px 28px rgba(7, 19, 49, 0.1);
}

.order-summary-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.order-summary-heading h2 {
  margin: 0;
  color: var(--fg-1);
  font-family: var(--font-display);
  font-size: 23px;
  line-height: 1;
}

.order-summary-boundary {
  margin: -2px 0 0;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--stroke-1);
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.order-summary-save-note {
  margin-top: -5px;
  color: var(--fg-3);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.shadow-order-meta-grid + .shadow-order-field {
  margin-top: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .shadow-order-progress-meter span {
    transition: none;
  }
}

@media (max-width: 1100px) {
  .order-workspace {
    grid-template-columns: 1fr;
  }

  .order-flow-column {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .shadow-order-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .shadow-order-banner {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .shadow-order-banner > div {
    grid-column: 2;
  }

  .shadow-order-runway {
    padding: 14px;
  }

  .shadow-order-runway ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shadow-order-runway a {
    min-height: 50px;
  }

  .shadow-order-section {
    padding: 17px;
  }

  .shadow-order-section-heading {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .shadow-order-section-heading > em {
    grid-column: 2;
    justify-self: start;
    margin-top: -7px;
  }

  .shadow-order-subsection-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .shadow-order-catalog-status {
    width: 100%;
    white-space: normal;
  }

  .shadow-order-item-search-row .autocomplete-wrap,
  .shadow-order-item-search-row .shadow-order-field {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .shadow-order-intro h2 {
    font-size: 30px;
  }

  .shadow-order-runway-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .shadow-order-runway a {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .shadow-order-stage-number {
    width: 26px;
    height: 26px;
  }

  .shadow-order-runway strong {
    white-space: normal;
  }

  .shadow-order-section {
    padding: 14px;
  }

  .shadow-order-section-heading {
    gap: 10px;
  }

  .shadow-order-section-number {
    width: 34px;
    height: 34px;
  }

  .shadow-order-section-heading .shadow-order-section-label {
    font-size: 22px;
  }

  .shadow-payment-sandbox > summary {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .shadow-payment-sandbox > summary .pill {
    grid-column: 2;
    justify-self: start;
  }
}

/* Content Intelligence */
.content-intelligence-intro {
  align-items: center;
  background:
    radial-gradient(circle at 88% 20%, color-mix(in oklab, var(--gold-500) 16%, transparent), transparent 34%),
    linear-gradient(135deg, var(--bg-surface), var(--bg-subtle));
}

.content-intelligence-intro__status {
  display: grid;
  min-width: 180px;
  justify-items: end;
  gap: 2px;
}

.content-intelligence-intro__status strong {
  color: var(--fg-1);
  font-size: 42px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.content-intelligence-intro__status > span:last-child {
  color: var(--fg-3);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.content-intelligence-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.content-intelligence-metric {
  position: relative;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 16px 18px;
  overflow: hidden;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  color: var(--fg-1);
  text-decoration: none;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.content-intelligence-metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--gold-500);
}

.content-intelligence-metric:nth-child(2)::before { background: var(--teal-500); }
.content-intelligence-metric:nth-child(3)::before { background: var(--violet-500); }
.content-intelligence-metric:nth-child(4)::before { background: var(--magenta-500); }

.content-intelligence-metric:hover,
.content-intelligence-metric.active {
  border-color: color-mix(in oklab, var(--gold-500) 52%, var(--stroke-2));
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.content-intelligence-metric span,
.content-intelligence-metric small {
  overflow: hidden;
  color: var(--fg-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-intelligence-metric span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.content-intelligence-metric strong {
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.content-intelligence-search {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.content-intelligence-search label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.content-intelligence-search input,
.content-intelligence-search select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--stroke-2);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--fg-1);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}

.content-intelligence-search input:focus,
.content-intelligence-search select:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--gold-500) 18%, transparent);
  outline: none;
}

.content-intelligence-search__query { grid-column: span 2; }
.content-intelligence-search__actions { display: flex; grid-column: 3 / -1; gap: 8px; align-items: center; justify-content: flex-end; }

.content-intelligence-results .panel-head { align-items: end; }
.content-intelligence-results__hint { max-width: 240px; color: var(--fg-3); font-size: 13px; text-align: right; }

.content-intelligence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.content-record-card {
  display: flex;
  min-width: 0;
  min-height: 300px;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: var(--bg-subtle);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.content-record-card:hover {
  border-color: var(--stroke-2);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.content-record-card__topline,
.content-record-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.content-record-card__topline time,
.content-record-card footer {
  color: var(--fg-3);
  font-size: 12px;
}

.content-type-badge {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid color-mix(in oklab, var(--gold-500) 35%, transparent);
  border-radius: 999px;
  background: color-mix(in oklab, var(--gold-500) 10%, var(--bg-surface));
  color: var(--fg-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.content-type-badge.type-story { border-color: color-mix(in oklab, var(--teal-500) 42%, transparent); }
.content-type-badge.type-framework { border-color: color-mix(in oklab, var(--violet-500) 42%, transparent); }
.content-type-badge.type-supplementary_video { border-color: color-mix(in oklab, var(--magenta-500) 42%, transparent); }

.content-record-card h3 { margin: 14px 0 0; font-size: 21px; line-height: 1.15; }
.content-record-card h3 a { color: var(--fg-1); text-decoration: none; }
.content-record-card h3 a:hover { color: color-mix(in oklab, var(--gold-600) 80%, var(--fg-1)); }
.content-record-card__lesson { margin: 7px 0 0; color: var(--fg-3); font-size: 13px; font-weight: 700; }
.content-record-card__summary { margin: 14px 0; color: var(--fg-2); font-size: 14px; line-height: 1.52; }

.content-record-card__facets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.content-record-card__facets span,
.content-payload-pill {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-fg);
  font-size: 11px;
}

.content-record-card footer { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--stroke-1); }
.content-record-card footer a { color: var(--fg-1); font-weight: 800; text-decoration: none; }

.content-intelligence-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--stroke-1);
  color: var(--fg-3);
  font-size: 13px;
}

.content-intelligence-pagination > :last-child { justify-self: end; }
.content-intelligence-empty { display: grid; justify-items: center; gap: 8px; padding: 60px 20px; text-align: center; }
.content-intelligence-empty strong { font-size: 22px; }
.content-intelligence-empty p { margin: 0 0 8px; color: var(--fg-3); }

.content-intelligence-detail-head {
  margin-top: 20px;
  padding: 28px;
  border: 1px solid var(--stroke-1);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--bg-surface), var(--bg-subtle));
  box-shadow: var(--shadow-xs);
}

.content-intelligence-back { display: inline-block; margin-bottom: 28px; color: var(--fg-2); font-size: 13px; font-weight: 800; text-decoration: none; }
.content-intelligence-detail-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--fg-3); font-size: 13px; }
.content-intelligence-detail-head h2 { max-width: 900px; margin: 16px 0 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.02; }
.content-intelligence-canonical { margin: 10px 0 0; color: var(--fg-3); font-weight: 700; }
.content-intelligence-detail-summary { max-width: 940px; margin: 22px 0 0; color: var(--fg-2); font-size: 18px; line-height: 1.6; }

.content-intelligence-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 20px;
  align-items: start;
}

.content-intelligence-detail-main { min-width: 0; }
.content-intelligence-prose p:last-child { margin: 12px 0 0; white-space: pre-line; color: var(--fg-2); font-size: 16px; line-height: 1.7; }
.content-intelligence-source-card { position: sticky; top: 82px; }
.content-intelligence-source-card h3 { margin: 8px 0 16px; font-size: 20px; }
.content-intelligence-source-card dl,
.content-intelligence-payload dl { display: grid; gap: 0; margin: 0; }
.content-intelligence-source-card dl div,
.content-intelligence-payload dl div { display: grid; gap: 5px; padding: 12px 0; border-top: 1px solid var(--stroke-1); }
.content-intelligence-source-card dt,
.content-intelligence-payload dt { color: var(--fg-3); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.content-intelligence-source-card dd,
.content-intelligence-payload dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--fg-1); }
.content-intelligence-source-card .button { width: 100%; margin-top: 16px; }
.content-intelligence-payload pre { max-height: 420px; margin: 0; overflow: auto; white-space: pre-wrap; }

@media (max-width: 1120px) {
  .content-intelligence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-intelligence-search { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-intelligence-search__query { grid-column: 1 / -1; }
  .content-intelligence-search__actions { grid-column: auto; justify-content: flex-start; }
}

@media (max-width: 820px) {
  .content-intelligence-intro { align-items: flex-start; }
  .content-intelligence-intro__status { justify-items: start; }
  .content-intelligence-metrics,
  .content-intelligence-grid,
  .content-intelligence-detail-layout { grid-template-columns: 1fr; }
  .content-intelligence-source-card { position: static; }
  .content-intelligence-results .panel-head { align-items: flex-start; }
  .content-intelligence-results__hint { max-width: none; text-align: left; }
}

@media (max-width: 560px) {
  .content-intelligence-search { grid-template-columns: 1fr; }
  .content-intelligence-search__query { grid-column: auto; }
  .content-intelligence-search__actions { grid-column: 1; }
  .content-intelligence-detail-head { padding: 20px; }
  .content-record-card footer { align-items: flex-start; flex-direction: column; }
}

/* Order agreement tracking */
.shadow-order-release-policy-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.shadow-agreement-card {
  overflow: hidden;
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}

.shadow-agreement-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--stroke-1);
}

.shadow-agreement-icon {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 9px;
  background: color-mix(in oklab, var(--gold-500) 15%, var(--bg-subtle));
  color: color-mix(in oklab, var(--gold-600) 86%, var(--fg-1));
}

.shadow-agreement-icon .ui-icon {
  width: 20px;
  height: 20px;
}

.shadow-agreement-heading > div {
  min-width: 0;
  flex: 1;
}

.shadow-agreement-heading p {
  margin: 0 0 3px;
  color: var(--fg-3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.shadow-agreement-heading h4 {
  margin: 0;
  color: var(--fg-1);
  font-size: 19px;
  line-height: 1.15;
}

.shadow-agreement-facts {
  display: grid;
  grid-template-columns: 1.35fr .9fr 1fr 1fr;
  border-bottom: 1px solid var(--stroke-1);
}

.shadow-agreement-facts > div {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  padding: 16px 18px;
}

.shadow-agreement-facts > div + div {
  border-left: 1px solid var(--stroke-1);
}

.shadow-agreement-facts span,
.shadow-agreement-facts small {
  color: var(--fg-3);
  font-size: 11px;
}

.shadow-agreement-facts span {
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.shadow-agreement-facts strong {
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 13px;
  line-height: 1.35;
}

.shadow-agreement-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1px solid var(--stroke-1);
  list-style: none;
}

.shadow-agreement-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding-right: 12px;
}

.shadow-agreement-timeline li:not(:last-child)::after {
  position: absolute;
  top: 13px;
  right: 5px;
  left: 31px;
  height: 1px;
  background: var(--stroke-2);
  content: "";
}

.shadow-agreement-timeline li > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--stroke-2);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 900;
}

.shadow-agreement-timeline li[data-state="complete"] > span {
  border-color: color-mix(in oklab, var(--success) 70%, var(--stroke-1));
  background: var(--success);
  color: #fff;
}

.shadow-agreement-timeline li[data-state="complete"]::after {
  background: color-mix(in oklab, var(--success) 55%, var(--stroke-1));
}

.shadow-agreement-timeline div {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2px;
  min-width: 0;
  padding-top: 1px;
  background: var(--bg-surface);
}

.shadow-agreement-timeline strong {
  color: var(--fg-1);
  font-size: 12px;
  line-height: 1.2;
}

.shadow-agreement-timeline small {
  color: var(--fg-3);
  font-size: 10px;
  line-height: 1.25;
}

.shadow-agreement-manual {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-subtle);
}

.shadow-agreement-manual-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.shadow-agreement-manual-heading > div {
  display: grid;
  gap: 3px;
}

.shadow-agreement-manual-heading strong {
  color: var(--fg-1);
  font-size: 14px;
}

.shadow-agreement-manual-heading span {
  color: var(--fg-3);
  font-size: 12px;
  line-height: 1.4;
}

.shadow-agreement-manual-heading > span {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid var(--stroke-1);
  border-radius: 6px;
  background: var(--bg-surface);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.shadow-agreement-manual-grid {
  display: grid;
  grid-template-columns: minmax(170px, .75fr) minmax(260px, 1.5fr);
  gap: 12px;
}

.shadow-agreement-manual .shadow-order-field small {
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.shadow-agreement-custom > span {
  display: flex;
  align-items: center;
  gap: 9px;
}

.shadow-agreement-custom input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold-600);
}

.shadow-agreement-custom textarea {
  margin-top: 8px;
}

.shadow-agreement-automation {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  border-top: 1px solid color-mix(in oklab, var(--teal-500) 28%, var(--stroke-1));
  background: color-mix(in oklab, var(--teal-500) 7%, var(--bg-surface));
}

.shadow-agreement-automation strong {
  color: var(--fg-1);
  font-size: 12px;
}

.shadow-agreement-automation span {
  color: var(--fg-2);
  font-size: 11px;
  line-height: 1.45;
}

.shadow-agreement-automation em {
  padding: 4px 7px;
  border: 1px solid color-mix(in oklab, var(--teal-500) 35%, var(--stroke-1));
  border-radius: 6px;
  color: var(--fg-2);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .07em;
  white-space: nowrap;
}

/* Order detail program and pricing */
.shadow-order-detail-workspace .order-flow-column {
  max-width: none;
  gap: 24px;
}

body:has(.shadow-order-root) .portal-chat,
body:has(.shadow-order-detail-workspace) .portal-chat {
  display: none !important;
}

.shadow-order-items-panel {
  min-width: 0;
}

.shadow-order-detail-lines-wrap {
  overflow-x: auto;
  border: 1px solid var(--stroke-1);
  border-radius: 9px;
}

.shadow-order-detail-lines {
  min-width: 660px;
  table-layout: fixed;
}

.shadow-order-detail-lines th {
  position: static;
  padding: 11px 14px;
}

.shadow-order-detail-lines th:first-child {
  width: 40%;
}

.shadow-order-detail-lines th:not(:first-child) {
  width: 15%;
  text-align: right;
}

.shadow-order-detail-lines td {
  padding: 16px 14px;
  vertical-align: top;
}

.shadow-order-detail-lines td:first-child > strong {
  display: block;
  color: var(--fg-1);
  font-size: 14px;
  line-height: 1.35;
}

.shadow-order-detail-lines td:first-child > small {
  display: block;
  margin-top: 4px;
  color: var(--fg-3);
  font-size: 11px;
}

.shadow-order-detail-lines td.money {
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.shadow-order-detail-lines td.money small {
  display: block;
  max-width: 160px;
  margin: 7px 0 0 auto;
  color: var(--fg-3);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
}

.shadow-order-detail-lines td.emphasis {
  color: var(--fg-1);
  font-size: 15px;
}

.shadow-order-detail-lines td .pill {
  display: inline-flex;
  margin-top: 8px;
}

.shadow-order-detail-price-source {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
}

.shadow-order-detail-price-source .pill {
  margin: 0;
}

.shadow-order-detail-price-source small {
  color: var(--fg-3);
  font-size: 10px;
}

.shadow-order-totals.detail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--stroke-1);
  border-radius: 9px;
  background: var(--bg-subtle);
}

.shadow-order-totals.detail > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 14px 16px;
}

.shadow-order-totals.detail > div + div {
  border-left: 1px solid var(--stroke-1);
}

.shadow-order-totals.detail span {
  color: var(--fg-3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.shadow-order-totals.detail strong {
  color: var(--fg-1);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.shadow-order-totals.detail .emphasis {
  background: color-mix(in oklab, var(--gold-500) 10%, var(--bg-surface));
}

.shadow-order-agreement-record {
  display: grid;
  grid-template-columns: 1fr;
  margin: 16px 0;
  overflow: hidden;
  border: 1px solid var(--stroke-1);
  border-radius: 9px;
  background: var(--bg-subtle);
}

.shadow-order-agreement-block {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 13px 14px;
}

.shadow-order-agreement-block + .shadow-order-agreement-block,
.shadow-order-agreement-actions {
  border-top: 1px solid var(--stroke-1);
}

.shadow-order-agreement-record span {
  color: var(--fg-3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.shadow-order-agreement-record strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--fg-1);
  font-size: 12px;
}

.shadow-order-agreement-record a {
  color: var(--fg-1);
  text-underline-offset: 2px;
}

.shadow-order-agreement-block > p {
  margin: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--stroke-1);
  color: var(--fg-2);
  font-size: 12px;
}

.shadow-order-agreement-rows {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shadow-order-agreement-rows > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.shadow-order-agreement-connected-head,
.shadow-order-envelope {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.shadow-order-agreement-connected-head strong { margin-left: auto; }
.shadow-order-envelope { margin: 0; }
.shadow-order-envelope strong { display: flex; flex-wrap: wrap; gap: 8px; }
.shadow-agreement-timeline.connected { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 8px 0 0; border: 0; }
.shadow-agreement-timeline.connected .pill { display: inline-flex; padding: 2px 5px; font-size: 8px; }
.shadow-order-agreement-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 16px 14px; background: var(--bg-surface); }
.shadow-order-agreement-actions > div { display: grid; align-content: start; justify-items: start; gap: 8px; }
.shadow-order-agreement-actions p { margin: 0; padding: 0; border: 0; }
.shadow-order-agreement-actions [data-shadow-agreement-result].success { color: var(--success); }

@media (max-width: 820px) {
  .shadow-agreement-facts,
  .shadow-agreement-manual-grid {
    grid-template-columns: 1fr;
  }

  .shadow-agreement-facts > div + div {
    border-top: 1px solid var(--stroke-1);
    border-left: 0;
  }

  .shadow-agreement-timeline {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .shadow-agreement-timeline li {
    min-height: 36px;
    padding: 0;
  }

  .shadow-agreement-timeline li:not(:last-child)::after {
    top: 27px;
    bottom: -13px;
    left: 13px;
    width: 1px;
    height: auto;
  }

  .shadow-agreement-timeline div {
    align-content: start;
  }

  .shadow-agreement-automation {
    grid-template-columns: 1fr auto;
  }

  .shadow-agreement-automation span {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .shadow-order-totals.detail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shadow-order-totals.detail > div:nth-child(3) {
    border-top: 1px solid var(--stroke-1);
    border-left: 0;
  }

  .shadow-order-totals.detail > div:nth-child(4) {
    border-top: 1px solid var(--stroke-1);
  }

  .shadow-order-agreement-record {
    grid-template-columns: 1fr;
  }

  .shadow-order-agreement-record > div + div {
    border-top: 1px solid var(--stroke-1);
    border-left: 0;
  }

  .shadow-order-agreement-rows,
  .shadow-order-agreement-actions,
  .shadow-agreement-timeline.connected { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .shadow-order-release-policy-grid {
    grid-template-columns: 1fr;
  }

  .shadow-agreement-heading,
  .shadow-agreement-manual-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .shadow-agreement-heading .pill {
    margin-left: 54px;
  }

  .shadow-order-promotion .panel-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .shadow-order-promotion .panel-actions,
  .shadow-order-promotion .panel-actions .button,
  .shadow-order-netsuite-push,
  .shadow-order-netsuite-push .button {
    width: 100%;
  }

  .shadow-order-promotion .panel-actions {
    display: grid;
  }

  .shadow-order-netsuite-push {
    grid-template-columns: 1fr;
  }

  .shadow-order-detail-lines {
    display: block;
    min-width: 0;
  }

  .shadow-order-detail-lines thead {
    display: none;
  }

  .shadow-order-detail-lines tbody,
  .shadow-order-detail-lines tr,
  .shadow-order-detail-lines td {
    display: block;
    width: 100%;
  }

  .shadow-order-detail-lines tr {
    padding: 14px;
  }

  .shadow-order-detail-lines tr + tr {
    border-top: 1px solid var(--stroke-1);
  }

  .shadow-order-detail-lines td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 7px 0;
    border: 0;
    text-align: right;
  }

  .shadow-order-detail-lines td::before {
    color: var(--fg-3);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .shadow-order-detail-lines td:first-child {
    display: block;
    padding-top: 0;
    padding-bottom: 12px;
    text-align: left;
  }

  .shadow-order-detail-lines td:first-child::before {
    content: none;
  }

  .shadow-order-detail-lines td.money small {
    max-width: 210px;
    margin-left: auto;
  }
}

/* Program selection is a decision card, not a horizontally scrolling data table. */
.shadow-order-line-shell {
  max-width: 100%;
  overflow-x: auto;
}

@media (max-width: 760px) {
  .shadow-order-program-card-header {
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 14px;
    padding: 16px;
  }

  .shadow-order-channel-item {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .shadow-order-remove-program {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }

  .shadow-order-program-prices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px;
  }

  .shadow-order-current-pricing,
  .shadow-order-pricing-state {
    margin-right: 16px;
    margin-left: 16px;
    margin-bottom: 16px;
  }

  .shadow-order-current-pricing > header,
  .shadow-order-current-pricing > header > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .shadow-order-pricing-options {
    grid-template-columns: 1fr;
  }

  .shadow-order-pricing-option + .shadow-order-pricing-option {
    border-top: 1px solid var(--stroke-1);
    border-left: 0;
  }
}

@media (max-width: 480px) {
  .shadow-order-program-prices {
    grid-template-columns: 1fr;
  }

  .order-mobile-summary {
    position: static;
    bottom: auto;
  }

  .shadow-order-schedule .schedule-step {
    width: 45%;
  }

  .shadow-order-schedule .schedule-date {
    width: 31%;
  }

  .shadow-order-schedule .schedule-amount {
    width: 24%;
  }

  .shadow-order-schedule th,
  .shadow-order-schedule td {
    padding-right: 6px;
    padding-left: 6px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shadow-order-program-loading span,
  .shadow-order-inline-spinner {
    animation: none;
  }
}

/* Identity review keeps source records visually separate and makes every
   consequential decision explicit before the canonical service records it. */
.identity-review-notice {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
  font-weight: 750;
}

.identity-review-notice.success {
  border-color: color-mix(in oklab, var(--success) 35%, var(--stroke-1));
  color: var(--success);
}

.identity-review-notice.warn {
  border-color: color-mix(in oklab, var(--warning) 35%, var(--stroke-1));
  color: var(--warning);
}

.identity-review-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.identity-review-summary .mini-metric {
  padding: 16px;
  border-radius: 12px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}

.identity-review-panel {
  overflow: hidden;
}

.identity-review-panel .panel-head p,
.identity-review-unavailable .panel-head p {
  max-width: 70ch;
  margin: 7px 0 0;
  color: var(--fg-3);
}

.identity-review-list {
  display: grid;
  gap: 16px;
}

.identity-review-item {
  overflow: hidden;
  border: 1px solid var(--stroke-2);
  border-radius: 14px;
  background: var(--bg-subtle);
}

.identity-review-item > header,
.identity-review-item > footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
}

.identity-review-item > header {
  border-bottom: 1px solid var(--stroke-1);
}

.identity-review-item h3,
.identity-review-item h4,
.identity-review-item p {
  margin: 0;
}

.identity-review-item h3 {
  margin-top: 3px;
  font-size: 21px;
  line-height: 1.15;
}

.identity-review-item header > div:first-child > p:last-child {
  max-width: 70ch;
  margin-top: 7px;
  color: var(--fg-3);
}

.identity-review-state {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 8px;
  color: var(--fg-3);
  font-size: 13px;
}

.identity-review-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, auto) minmax(0, 1fr);
  align-items: stretch;
}

.identity-review-contact {
  min-width: 0;
  padding: 22px 20px;
  background: var(--bg-surface);
}

.identity-review-contact h4 {
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.2;
}

.identity-review-contact dl {
  display: grid;
  gap: 9px;
  margin: 18px 0 0;
}

.identity-review-contact dl > div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
}

.identity-review-contact dt {
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.identity-review-contact dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.identity-review-contact code {
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: normal;
}

.identity-review-separator {
  display: grid;
  place-items: center;
  padding: 14px;
  border-right: 1px solid var(--stroke-1);
  border-left: 1px solid var(--stroke-1);
  background: var(--bg-sunken);
}

.identity-review-separator span {
  color: var(--warning);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
}

.identity-review-item > footer {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr);
  border-top: 1px solid var(--stroke-1);
  color: var(--fg-3);
}

.identity-review-item > footer > div {
  display: grid;
  gap: 4px;
}

.identity-review-item > footer strong {
  color: var(--fg-1);
}

.identity-review-item > footer p {
  grid-column: 1 / -1;
  padding-top: 12px;
  border-top: 1px solid var(--stroke-1);
  font-size: 13px;
}

.identity-review-decision-panel {
  border-top: 1px solid var(--stroke-1);
  background: var(--bg-surface);
}

.identity-review-decision-panel > summary {
  padding: 15px 20px;
  color: var(--fg-1);
  font-weight: 850;
  cursor: pointer;
}

.identity-review-decision-panel[open] > summary {
  border-bottom: 1px solid var(--stroke-1);
}

.identity-review-decision-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.identity-review-decision-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
  background: var(--bg-subtle);
}

.identity-review-decision-card h4 {
  margin-top: 3px;
  font-size: 19px;
}

.identity-review-decision-card > div > p:last-child {
  margin-top: 6px;
  color: var(--fg-3);
}

.identity-review-decision-card label {
  display: grid;
  gap: 6px;
  color: var(--fg-2);
  font-size: 13px;
  font-weight: 750;
}

.identity-review-decision-card textarea,
.identity-review-decision-card select {
  width: 100%;
}

.identity-review-decision-card .button {
  width: 100%;
  margin-top: auto;
}

.identity-review-same-person {
  border-color: color-mix(in oklab, var(--gold-500) 38%, var(--stroke-1));
}

.identity-review-confirmation {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.identity-review-confirmation input {
  margin-top: 3px;
}

.identity-review-limit {
  margin: 16px 0 0;
}

.identity-review-unavailable {
  border-left: 4px solid var(--warning);
}

.identity-decision-preview {
  display: grid;
  gap: 18px;
  max-width: 1120px;
  margin-inline: auto;
}

.identity-decision-preview .panel-head p {
  max-width: 72ch;
  margin: 7px 0 0;
  color: var(--fg-3);
}

.identity-decision-preview .identity-review-pair {
  overflow: hidden;
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
}

.identity-decision-preview-facts {
  display: grid;
  gap: 0;
  margin: 0;
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
  background: var(--bg-subtle);
}

.identity-decision-preview-facts > div {
  display: grid;
  grid-template-columns: minmax(150px, .32fr) minmax(0, 1fr);
  gap: 18px;
  padding: 14px 16px;
}

.identity-decision-preview-facts > div + div {
  border-top: 1px solid var(--stroke-1);
}

.identity-decision-preview-facts dt {
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.identity-decision-preview-facts dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.identity-decision-preview-facts ul {
  margin: 0;
  padding-left: 18px;
}

.identity-decision-preview-warning {
  padding: 15px 16px;
  border: 1px solid color-mix(in oklab, var(--warning) 42%, var(--stroke-1));
  border-radius: 12px;
  background: color-mix(in oklab, var(--warning) 9%, var(--bg-surface));
}

.identity-decision-preview-warning p {
  max-width: 76ch;
  margin: 5px 0 0;
  color: var(--fg-2);
}

.identity-decision-preview-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.identity-decision-preview-actions form {
  margin: 0;
}

@media (max-width: 840px) {
  .identity-review-summary {
    grid-template-columns: 1fr;
  }

  .identity-review-item > header,
  .identity-review-item > footer {
    grid-template-columns: 1fr;
  }

  .identity-review-state {
    justify-items: start;
  }

  .identity-review-pair {
    grid-template-columns: 1fr;
  }

  .identity-review-decision-grid {
    grid-template-columns: 1fr;
  }

  .identity-review-separator {
    border: 0;
    border-top: 1px solid var(--stroke-1);
    border-bottom: 1px solid var(--stroke-1);
  }

  .identity-decision-preview-facts > div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .identity-decision-preview-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .identity-decision-preview-actions .button {
    width: 100%;
  }
}

/* App-scoped identity verification extends the established identity review
   language while keeping every new rule isolated to this workspace. */
.identity-verify-crosslink {
  margin: 10px 0 0;
  color: var(--fg-3);
}

.identity-verify-notice {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  background: var(--bg-surface);
  font-weight: 750;
}

.identity-verify-notice.success {
  border-color: color-mix(in oklab, var(--success) 35%, var(--stroke-1));
  color: var(--success);
}

.identity-verify-notice.warn {
  border-color: color-mix(in oklab, var(--warning) 35%, var(--stroke-1));
  color: var(--warning);
}

.identity-verify-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.identity-verify-summary .mini-metric {
  min-width: 0;
  padding: 16px;
  border-radius: 12px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}

.identity-verify-panel {
  overflow: hidden;
}

.identity-verify-filters {
  display: flex;
  align-items: end;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--stroke-1);
}

.identity-verify-filters label {
  display: grid;
  gap: 6px;
  min-width: 180px;
  color: var(--fg-2);
  font-size: 13px;
  font-weight: 750;
}

.identity-verify-list {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.identity-verify-card {
  overflow: hidden;
  border: 1px solid var(--stroke-2);
  border-radius: 14px;
  background: var(--bg-subtle);
}

.identity-verify-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--stroke-1);
  background: var(--bg-surface);
}

.identity-verify-card-head p {
  margin: 7px 0 0;
}

.identity-verify-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.identity-verify-title-row h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.15;
}

.identity-verify-title-row code,
.identity-verify-facts code,
.identity-verify-preview-facts code {
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.identity-verify-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  background: var(--bg-surface);
}

.identity-verify-facts > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--stroke-1);
}

.identity-verify-facts > div:nth-child(odd) {
  border-right: 1px solid var(--stroke-1);
}

.identity-verify-facts dt,
.identity-verify-preview-facts dt {
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.identity-verify-facts dd,
.identity-verify-preview-facts dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.identity-verify-shared {
  display: grid;
  gap: 7px;
  margin: 0 0 6px;
  padding-left: 18px;
}

.identity-verify-edge-count {
  display: block;
  margin-top: 5px;
}

.identity-verify-decision-panel input[type="text"] {
  width: 100%;
}

.identity-verify-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--stroke-1);
}

.identity-verify-pagination nav {
  display: flex;
  gap: 8px;
}

.identity-verify-unavailable {
  border-left: 4px solid var(--warning);
}

.identity-verify-unavailable .panel-head p {
  max-width: 70ch;
  margin: 7px 0 0;
  color: var(--fg-3);
}

.identity-verify-preview {
  display: grid;
  gap: 18px;
  max-width: 960px;
  margin-inline: auto;
}

.identity-verify-preview-facts {
  display: grid;
  margin: 0;
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
  background: var(--bg-subtle);
}

.identity-verify-preview-facts > div {
  display: grid;
  grid-template-columns: minmax(150px, .3fr) minmax(0, 1fr);
  gap: 18px;
  padding: 14px 16px;
}

.identity-verify-preview-facts > div + div {
  border-top: 1px solid var(--stroke-1);
}

.identity-verify-preview-facts blockquote {
  margin: 0;
  padding-left: 14px;
  border-left: 3px solid var(--stroke-2);
}

.identity-verify-expiry {
  margin: 0;
}

@media (max-width: 1100px) {
  .identity-verify-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .identity-verify-summary,
  .identity-verify-facts {
    grid-template-columns: 1fr;
  }

  .identity-verify-filters,
  .identity-verify-card-head,
  .identity-verify-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .identity-verify-filters label {
    min-width: 0;
  }

  .identity-verify-facts > div,
  .identity-verify-preview-facts > div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .identity-verify-facts > div:nth-child(odd) {
    border-right: 0;
  }

  .identity-verify-pagination nav,
  .identity-verify-pagination .button {
    width: 100%;
  }

  .identity-verify-pagination .button {
    justify-content: center;
  }
}

/* Agreement preview and mapped-field disclosure */
.shadow-agreement-willpopulate-block {
  display: grid;
  gap: 10px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--stroke-1);
  background: color-mix(in oklab, var(--teal-500) 5%, var(--bg-surface));
}

.shadow-agreement-willpopulate-block[hidden] { display: none; }

.shadow-agreement-willpopulate-block h5 {
  margin: 0;
  color: var(--fg-1);
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.shadow-agreement-willpopulate {
  display: grid;
  grid-template-columns: minmax(150px, .75fr) minmax(0, 1.25fr);
  gap: 6px 18px;
  margin: 0;
}

.shadow-agreement-willpopulate dt,
.shadow-agreement-willpopulate dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.4;
}

.shadow-agreement-willpopulate dt { color: var(--fg-3); font-weight: 800; }
.shadow-agreement-willpopulate dd { color: var(--fg-1); }
.shadow-agreement-willpopulate-block > p { margin: 0; font-size: 11px; }

@media (max-width: 640px) {
  .shadow-agreement-willpopulate { grid-template-columns: 1fr; gap: 2px; }
  .shadow-agreement-willpopulate dd + dt { margin-top: 7px; }
  .shadow-agreement-heading [data-shadow-agreement-preview] { margin-left: 54px; }
}

/* agreement next-step hint on the order entry card */
.shadow-agreement-next { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--stroke-1); }
.shadow-agreement-next small { max-width: 460px; }
.retention-standalone-shell { min-height: 100vh; background: var(--bg-app); }
.retention-standalone-bar { position: sticky; z-index: 40; top: 0; display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 24px; padding: 10px clamp(18px, 4vw, 54px); border-bottom: 1px solid var(--stroke-1); background: color-mix(in srgb, var(--bg-app) 92%, transparent); backdrop-filter: blur(14px); }
.retention-standalone-brand { display: flex; align-items: baseline; gap: 12px; color: var(--fg-1); }
.retention-standalone-brand strong { color: var(--navy-700); font-size: 26px; font-weight: 900; letter-spacing: -.04em; }
:root[data-theme="dark"] .retention-standalone-brand strong { color: var(--gold-500); }
.retention-standalone-brand span { color: var(--fg-3); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.retention-standalone-actions { display: flex; align-items: center; gap: 10px; }
.retention-standalone-viewer { max-width: 220px; overflow: hidden; color: var(--fg-2); font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.retention-sign-out { min-height: 40px; }
.retention-report { display: grid; gap: 18px; width: min(1560px, 100%); margin-inline: auto; padding: clamp(22px, 3vw, 42px) clamp(16px, 3vw, 42px) 56px; }
.retention-page-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 32px; padding-bottom: 22px; border-bottom: 1px solid var(--stroke-1); }
.retention-page-intro h1 { margin: 3px 0 7px; font-size: clamp(2.2rem, 4vw, 3.45rem); line-height: .98; letter-spacing: -.035em; }
.retention-page-intro > div > p:last-child { max-width: 760px; margin: 0; color: var(--fg-2); font-size: 16px; line-height: 1.55; }
.retention-freshness { display: grid; grid-template-columns: repeat(2, auto); gap: 8px 24px; margin: 0; padding: 12px 0 2px 24px; border-left: 2px solid var(--gold-500); }
.retention-freshness div { display: grid; gap: 3px; }
.retention-freshness dt { color: var(--fg-3); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.retention-freshness dd { margin: 0; color: var(--fg-1); font-size: 13px; font-weight: 800; white-space: nowrap; }
.retention-coverage-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--stroke-1); border-radius: 14px; background: linear-gradient(120deg, color-mix(in srgb, var(--navy-700) 6%, var(--bg-surface)), var(--bg-surface)); box-shadow: var(--shadow-xs); }
.retention-coverage-strip > div { display: grid; gap: 2px; min-height: 82px; align-content: center; padding: 14px 20px; border-right: 1px solid var(--stroke-1); }
.retention-coverage-strip > div:last-child { border-right: 0; }
.retention-coverage-strip strong { color: var(--fg-1); font-family: var(--font-mono); font-size: 27px; line-height: 1; font-variant-numeric: tabular-nums; }
.retention-coverage-strip strong span { color: var(--fg-3); font-size: 14px; }
.retention-coverage-strip > div > span { color: var(--fg-3); font-size: 11px; font-weight: 800; line-height: 1.35; }
.retention-research-pending { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; align-items: start; padding: 17px 20px; border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--stroke-1)); border-radius: 14px; background: color-mix(in srgb, var(--warning) 7%, var(--bg-surface)); }
.retention-research-pending > div:first-child { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, var(--bg-surface)); }
.retention-research-pending strong { display: block; margin: 2px 0 4px; }
.retention-research-pending p:last-child { margin: 0; color: var(--fg-2); }
.retention-queues { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--stroke-1); border-radius: 14px; background: var(--bg-surface); box-shadow: var(--shadow-xs); }
.retention-queues button { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; min-height: 66px; padding: 12px 18px; border: 0; border-right: 1px solid var(--stroke-1); color: var(--fg-2); text-align: left; background: transparent; }
.retention-queues button:last-child { border-right: 0; }
.retention-queues button::after { position: absolute; right: 16px; bottom: 0; left: 16px; height: 3px; border-radius: 999px 999px 0 0; background: var(--gold-500); content: ""; opacity: 0; }
.retention-queues button:hover { background: var(--bg-row-hover); }
.retention-queues button[aria-pressed="true"] { color: var(--fg-1); background: color-mix(in srgb, var(--gold-500) 8%, var(--bg-surface)); }
.retention-queues button[aria-pressed="true"]::after { opacity: 1; }
.retention-queues strong { color: var(--fg-1); font-family: var(--font-mono); font-size: 22px; font-variant-numeric: tabular-nums; }
.retention-queues span { font-size: 13px; font-weight: 800; }
.retention-answer-summary { display: grid; grid-template-columns: minmax(300px, .88fr) minmax(520px, 1.12fr); gap: 30px; padding: 22px 24px; border: 1px solid var(--stroke-1); border-radius: 14px; background: var(--bg-surface); }
.retention-answer-copy h2 { margin: 3px 0 9px; font-size: clamp(1.45rem, 2.5vw, 2.1rem); line-height: 1.08; }
.retention-answer-copy > p:last-of-type { margin: 0; color: var(--fg-2); line-height: 1.58; }
.retention-window-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--stroke-1); }
.retention-window-note strong { color: var(--fg-1); font-family: var(--font-mono); font-size: 12px; }
.retention-window-note span { color: var(--fg-3); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.retention-answer-empty { grid-template-columns: 1fr; }
.retention-reasons { display: grid; gap: 12px; }
.retention-reasons > summary { position: relative; display: grid; gap: 2px; padding-right: 28px; cursor: pointer; list-style: none; }
.retention-reasons > summary::-webkit-details-marker { display: none; }
.retention-reasons > summary strong { color: var(--fg-1); font-size: 16px; }
.retention-reasons-chevron { position: absolute; right: 4px; top: 50%; color: var(--fg-3); transform: translateY(-50%); transition: transform .18s ease; }
.retention-reasons[open] .retention-reasons-chevron { transform: translateY(-50%) rotate(180deg); }
.retention-reason-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px 14px; }
.retention-reason-list button { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; min-height: 31px; padding: 4px; overflow: hidden; border: 0; color: var(--fg-2); text-align: left; background: transparent; }
.retention-reason-list button:hover, .retention-reason-list button[aria-pressed="true"] { color: var(--fg-1); }
.retention-reason-list button[aria-pressed="true"] { font-weight: 800; }
.retention-reason-list button strong { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.retention-reason-list button i { grid-column: 1 / -1; display: block; width: var(--reason-width); min-width: 4px; height: 2px; border-radius: 999px; background: var(--gold-500); opacity: .7; }
.retention-data-panel { overflow: hidden; border: 1px solid var(--stroke-1); border-radius: 14px; background: var(--bg-surface); box-shadow: var(--shadow-sm); }
.retention-data-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 20px 22px 14px; }
.retention-data-heading h2 { margin: 2px 0 3px; font-size: 22px; }
.retention-data-heading p:last-child { margin: 0; color: var(--fg-3); font-size: 12px; }
.retention-toolbar { display: flex; align-items: center; gap: 10px; padding: 0 22px 18px; }
.retention-search-control { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 9px; width: min(560px, 100%); min-height: 42px; padding: 0 12px; border: 1px solid var(--stroke-2); border-radius: 9px; background: var(--bg-subtle); }
.retention-search-control .ui-icon { color: var(--fg-3); }
.retention-search-control input { width: 100%; min-width: 0; height: 40px; padding: 0; border: 0; outline: 0; color: var(--fg-1); background: transparent; }
.retention-more-filters { position: relative; }
.retention-more-filters > summary { display: inline-flex; min-height: 42px; align-items: center; padding: 0 14px; border: 1px solid var(--stroke-2); border-radius: 9px; color: var(--fg-1); font-weight: 800; background: var(--bg-surface); cursor: pointer; list-style: none; }
.retention-more-filters > summary::-webkit-details-marker { display: none; }
.retention-more-filters > div { position: absolute; z-index: 12; top: calc(100% + 7px); right: 0; display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 12px; width: min(520px, calc(100vw - 32px)); padding: 16px; border: 1px solid var(--stroke-2); border-radius: 12px; background: var(--bg-surface); box-shadow: var(--shadow-lg); }
.retention-more-filters label, .retention-import label { display: grid; gap: 6px; color: var(--fg-3); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.retention-more-filters select, .retention-import input { width: 100%; min-height: 42px; }
.retention-clear-filters { min-height: 42px; white-space: nowrap; }
.retention-table-shell { border-top: 1px solid var(--stroke-1); }
.retention-table-wrap { max-height: min(66vh, 720px); overflow: auto; background: var(--bg-surface); scrollbar-gutter: stable; }
.retention-table-wrap:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue-accent) 34%, transparent); outline-offset: -3px; }
.retention-table { width: 100%; min-width: 1080px; table-layout: fixed; border-spacing: 0; border-collapse: separate; }
.retention-table col.retention-col-client { width: 19%; }
.retention-table col.retention-col-system { width: 36%; }
.retention-table col.retention-col-reason { width: 15%; }
.retention-table col.retention-col-relation { width: 15%; }
.retention-table col.retention-col-evidence { width: 15%; }
.retention-table th { position: sticky; z-index: 3; top: 0; height: 46px; padding: 0 16px; border-bottom: 1px solid var(--stroke-1); color: var(--fg-3); text-align: left; background: color-mix(in srgb, var(--bg-subtle) 92%, var(--bg-surface)); white-space: nowrap; }
.retention-table th button { display: inline-flex; align-items: center; gap: 7px; width: 100%; min-height: 42px; padding: 0; border: 0; color: inherit; background: transparent; font: inherit; font-size: 10px; font-weight: 800; letter-spacing: .075em; text-align: left; text-transform: uppercase; }
.retention-table th button:hover { color: var(--fg-1); }
.retention-sort-icon { width: 9px; height: 9px; opacity: .28; transition: transform .16s ease, opacity .16s ease; }
.retention-table th[aria-sort="ascending"] .retention-sort-icon { opacity: 1; transform: rotate(180deg); }
.retention-table th[aria-sort="descending"] .retention-sort-icon { opacity: 1; transform: rotate(0); }
.retention-table td { padding: 14px 16px; border-bottom: 1px solid var(--stroke-1); vertical-align: top; line-height: 1.4; overflow-wrap: anywhere; background: var(--bg-surface); }
.retention-table tr[data-retention-row] { cursor: pointer; }
.retention-table tr[data-retention-row]:hover td { background: var(--bg-row-hover); }
.retention-cell-stack { display: grid; gap: 3px; }
.retention-cell-stack > strong { color: var(--fg-1); font-size: 14px; }
.retention-cell-stack > span, .retention-cell-stack > small { color: var(--fg-3); }
.retention-cell-stack > small { font-size: 11px; }
.retention-table td > small { display: block; margin-top: 7px; color: var(--fg-3); font-size: 11px; line-height: 1.4; }
.retention-system-summary { display: -webkit-box; margin: 0; overflow: hidden; color: var(--fg-1); font-size: 13px; line-height: 1.48; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.retention-continuation { display: inline-block; margin-top: 7px; color: var(--navy-700); font-size: 11px; font-weight: 800; }
.retention-badge { display: inline-flex; width: fit-content; max-width: 100%; padding: 4px 8px; border: 1px solid var(--stroke-1); border-radius: 999px; color: var(--fg-1); background: var(--bg-subtle); font-size: 11px; font-weight: 800; line-height: 1.3; white-space: normal; }
.retention-badge.coverage-partial, .retention-badge.coverage-unavailable, .retention-badge.relation-unresolved { color: var(--warning); background: color-mix(in srgb, var(--warning) 11%, var(--bg-surface)); }
.retention-badge.coverage-complete, .retention-badge.relation-confirms { color: var(--success); background: color-mix(in srgb, var(--success) 10%, var(--bg-surface)); }
.retention-badge.relation-qualifies { color: var(--navy-700); background: color-mix(in srgb, var(--blue-accent) 11%, var(--bg-surface)); }
.retention-badge.relation-contradicts { color: var(--error); background: color-mix(in srgb, var(--error) 9%, var(--bg-surface)); }
:root[data-theme="dark"] .retention-badge.finding-no_recent_session, :root[data-theme="dark"] .retention-badge.finding-program_ended_no_continuation { color: #a9c3ff; }
.retention-open-record { display: inline-flex; min-height: 36px; align-items: center; margin-top: 7px; padding: 0; border: 0; color: var(--navy-700); font: inherit; font-weight: 800; text-align: left; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; background: transparent; cursor: pointer; }
.retention-open-record:focus-visible { border-radius: 4px; outline: 3px solid color-mix(in srgb, var(--gold-500) 55%, transparent); outline-offset: 2px; }
:root[data-theme="dark"] .retention-open-record { color: var(--gold-500); }
.retention-empty, .retention-no-data { padding: 48px 24px; text-align: center; }
.retention-empty p, .retention-no-data p { color: var(--fg-3); }
.retention-table-footer { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; min-height: 62px; padding: 10px 20px; border-top: 1px solid var(--stroke-1); background: var(--bg-subtle); }
.retention-table-footer label { display: flex; align-items: center; gap: 9px; color: var(--fg-3); font-size: 11px; font-weight: 800; }
.retention-table-footer select { min-width: 68px; min-height: 38px; }
.retention-table-footer > span { color: var(--fg-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.retention-table-footer nav { display: flex; justify-content: flex-end; gap: 8px; }
.retention-table-footer .button { min-width: 82px; min-height: 38px; }
.retention-table-footer .button:disabled { cursor: not-allowed; opacity: .48; }
.retention-record-dialog { inset: 0; width: min(1020px, calc(100vw - 48px)); max-width: none; height: min(840px, calc(100dvh - 48px)); max-height: none; margin: auto; padding: 0; overflow: hidden; border: 1px solid var(--stroke-2); border-radius: 16px; color: var(--fg-1); background: var(--bg-app); box-shadow: var(--shadow-lg); }
.retention-record-dialog::backdrop { background: color-mix(in srgb, var(--navy-900) 58%, transparent); backdrop-filter: blur(3px); }
.retention-record-dialog-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
.retention-record-dialog-header { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 13px; min-height: 72px; padding: 10px 16px; border-bottom: 1px solid var(--stroke-1); background: var(--bg-surface); box-shadow: var(--shadow-xs); }
.retention-record-dialog-header h2 { margin: 1px 0 0; font-size: clamp(20px, 2.5vw, 27px); line-height: 1.05; overflow-wrap: anywhere; }
.retention-record-dialog-header p:last-child { margin: 3px 0 0; color: var(--fg-3); font-family: var(--font-mono); font-size: 10px; overflow-wrap: anywhere; }
.retention-record-close { display: inline-grid; width: 44px; height: 44px; place-items: center; border: 1px solid var(--stroke-2); border-radius: 10px; color: var(--fg-1); background: var(--bg-surface); }
.retention-record-close:hover { border-color: var(--gold-500); background: var(--bg-row-hover); }
.retention-record-dialog-body { min-height: 0; padding: 20px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.retention-record-dialog footer { display: flex; justify-content: flex-end; padding: 10px 16px; border-top: 1px solid var(--stroke-1); background: var(--bg-surface); }
.retention-record { display: grid; gap: 16px; }
.retention-system-conclusion { display: grid; grid-template-columns: minmax(230px, .72fr) minmax(0, 1.28fr); gap: 12px 24px; padding: 20px; border: 1px solid color-mix(in srgb, var(--gold-500) 38%, var(--stroke-1)); border-radius: 13px; background: linear-gradient(130deg, color-mix(in srgb, var(--gold-500) 8%, var(--bg-surface)), var(--bg-surface) 45%); }
.retention-conclusion-heading h3 { margin: 3px 0 10px; font-size: clamp(24px, 3vw, 34px); line-height: 1; letter-spacing: -.025em; }
.retention-conclusion-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--fg-3); font-size: 11px; font-weight: 800; }
.retention-conclusion-summary { margin: 0; color: var(--fg-1); font-size: 15px; line-height: 1.65; }
.retention-system-conclusion dl, .retention-record-provenance dl, .retention-workbook-details dl { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 16px; margin: 6px 0 0; padding-top: 14px; border-top: 1px solid var(--stroke-1); }
.retention-system-conclusion dt, .retention-record-provenance dt, .retention-workbook-details dt { color: var(--fg-3); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.retention-system-conclusion dd, .retention-record-provenance dd, .retention-workbook-details dd { margin: 3px 0 0; overflow-wrap: anywhere; color: var(--fg-1); font-size: 12px; }
.retention-comparison { display: grid; grid-template-columns: minmax(0, 1fr) 130px minmax(0, 1fr); align-items: stretch; gap: 0; }
.retention-comparison-source, .retention-comparison-result { padding: 18px; border: 1px solid var(--stroke-1); border-radius: 12px; background: var(--bg-surface); }
.retention-comparison-source { border-radius: 12px 0 0 12px; }
.retention-comparison-result { border-color: color-mix(in srgb, var(--gold-500) 36%, var(--stroke-1)); border-radius: 0 12px 12px 0; }
.retention-comparison h3 { margin: 3px 0 7px; font-size: 17px; }
.retention-comparison p:last-child { margin: 0; color: var(--fg-2); line-height: 1.55; }
.retention-comparison-marker { display: grid; place-content: center; justify-items: center; gap: 7px; padding: 10px; border-block: 1px solid var(--stroke-1); color: var(--navy-700); background: var(--bg-subtle); text-align: center; }
.retention-comparison-marker span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: var(--navy-900); background: var(--gold-500); }
.retention-comparison-arrow { transform: rotate(-90deg); }
.retention-comparison-marker strong { font-size: 10px; line-height: 1.25; text-transform: uppercase; }
.retention-record-provenance { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.retention-record-provenance > div { padding: 16px; border: 1px solid var(--stroke-1); border-radius: 12px; background: var(--bg-surface); }
.retention-record-provenance > div > .eyebrow { margin-bottom: 12px; }
.retention-record-provenance dl { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 0; border-top: 0; }
.retention-reference-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.retention-reference-list li { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--stroke-1); color: var(--fg-2); font-family: var(--font-mono); font-size: 11px; }
.retention-reference-list li:last-child { border-bottom: 0; }
.retention-workbook-details { border: 1px solid var(--stroke-1); border-radius: 12px; background: var(--bg-surface); }
.retention-workbook-details > summary { min-height: 46px; padding: 13px 16px; color: var(--fg-2); font-size: 12px; font-weight: 800; cursor: pointer; }
.retention-workbook-details > div { padding: 0 16px 16px; border-top: 1px solid var(--stroke-1); }
.retention-record-warning { padding: 14px 16px; border-left: 3px solid var(--warning); border-radius: 0 10px 10px 0; background: color-mix(in srgb, var(--warning) 10%, var(--bg-surface)); }
.retention-record-warning p { margin: 4px 0 0; color: var(--fg-2); }
.retention-record-actions { display: flex; align-items: center; justify-content: flex-end; min-height: 44px; color: var(--fg-3); }
.retention-modal-active body { overflow: hidden; }
.retention-method, .retention-import { border: 1px solid var(--stroke-1); border-radius: 12px; background: var(--bg-surface); }
.retention-method > summary, .retention-import > summary { min-height: 48px; padding: 14px 18px; color: var(--fg-1); font-weight: 800; cursor: pointer; }
.retention-method > div { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 32px; padding: 2px 18px 20px; border-top: 1px solid var(--stroke-1); }
.retention-method h2 { margin: 3px 0 8px; }
.retention-method p { color: var(--fg-2); line-height: 1.6; }
.retention-method dl { display: grid; gap: 10px; margin: 16px 0 0; }
.retention-method dl > div { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px; }
.retention-method dt { color: var(--fg-3); font-weight: 800; }
.retention-method dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.retention-import { padding: 0; }
.retention-import summary span { margin-left: 8px; color: var(--fg-3); font-size: 11px; font-weight: 500; }
.retention-import form { display: grid; grid-template-columns: 1fr 2fr 1fr 1.5fr auto; gap: 12px; align-items: end; padding: 18px; border-top: 1px solid var(--stroke-1); }
.retention-import form > p { grid-column: 1 / -1; margin: 0; }
.retention-admin-tools { display: grid; gap: 10px; }
.retention-research-import form { grid-template-columns: minmax(280px, 1fr) auto; }
.retention-toast { position: fixed; z-index: 70; right: 24px; bottom: 24px; padding: 12px 16px; border-radius: 10px; color: white; background: var(--navy-900); box-shadow: var(--shadow-md); }
@media (max-width: 1100px) {
  .retention-answer-summary { grid-template-columns: 1fr; }
  .retention-reason-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .retention-import form { grid-template-columns: repeat(2, 1fr); }
  .retention-table-wrap { max-height: none; overflow: visible; padding: 12px; background: var(--bg-subtle); }
  .retention-table { min-width: 0; table-layout: auto; }
  .retention-table colgroup { display: none; }
  .retention-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
  .retention-table, .retention-table tbody { display: block; width: 100%; }
  .retention-table tr[data-retention-row] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 10px; padding: 10px 14px; border: 1px solid var(--stroke-1); border-radius: 12px; background: var(--bg-surface); }
  .retention-table tr[data-retention-row]:last-child { margin-bottom: 0; }
  .retention-table td { display: grid; grid-template-columns: 118px minmax(0, 1fr); align-content: start; gap: 4px 10px; min-width: 0; padding: 8px 0; border: 0; background: transparent !important; }
  .retention-table td:first-child, .retention-table td[data-label="System finding"] { grid-column: 1 / -1; }
  .retention-table td::before { grid-column: 1; grid-row: 1 / span 3; color: var(--fg-3); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; content: attr(data-label); }
  .retention-table td > * { grid-column: 2; }
}
@media (max-width: 760px) {
  .retention-standalone-bar { min-height: 58px; padding: 8px 14px; }
  .retention-standalone-brand span, .retention-standalone-viewer, .retention-sign-out span { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
  .retention-standalone-brand strong { font-size: 23px; }
  .retention-sign-out { width: 42px; padding-inline: 0; }
  .retention-page-intro { grid-template-columns: 1fr; gap: 16px; }
  .retention-page-intro h1 { font-size: 2.35rem; }
  .retention-page-intro > div > p:last-child { font-size: 14px; }
  .retention-coverage-strip > div { min-height: 70px; padding: 12px 15px; }
  .retention-freshness { grid-template-columns: 1fr 1fr; padding-left: 14px; }
  .retention-freshness dd { white-space: normal; }
  .retention-queues { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .retention-queues button:nth-child(2) { border-right: 0; }
  .retention-queues button:nth-child(-n + 2) { border-bottom: 1px solid var(--stroke-1); }
  .retention-queues button { min-height: 58px; padding: 10px 13px; }
  .retention-answer-summary { gap: 22px; padding: 18px; }
  .retention-reasons { gap: 10px; padding-top: 2px; border-top: 1px solid var(--stroke-1); }
  .retention-reasons > summary { position: relative; min-height: 48px; justify-content: center; padding-right: 28px; }
  .retention-reason-list { grid-template-columns: 1fr; }
  .retention-data-heading { align-items: flex-start; flex-direction: column; padding: 18px 16px 12px; }
  .retention-toolbar { align-items: stretch; flex-direction: column; padding: 0 16px 16px; }
  .retention-search-control { width: 100%; }
  .retention-more-filters > summary { justify-content: center; width: 100%; }
  .retention-more-filters > div { position: static; grid-template-columns: 1fr; width: 100%; margin-top: 8px; box-shadow: none; }
  .retention-table tr[data-retention-row] { grid-template-columns: 1fr; padding: 9px 12px; }
  .retention-table td, .retention-table td:first-child, .retention-table td[data-label="System finding"] { grid-column: 1 / -1; grid-template-columns: 86px minmax(0, 1fr); gap: 4px 8px; padding: 7px 0; }
  .retention-table td::before { display: block; margin: 1px 0 0; }
  .retention-table td > * { grid-column: 2; }
  .retention-open-record { width: fit-content; min-height: 32px; margin-top: 3px; }
  .retention-table-footer { grid-template-columns: 1fr auto; padding: 12px 14px; }
  .retention-table-footer > span { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .retention-table-footer label { grid-column: 1; grid-row: 2; }
  .retention-table-footer nav { grid-column: 2; grid-row: 2; }
  .retention-table-footer .button { min-width: 0; padding-inline: 10px; }
  .retention-record-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); border-radius: 13px; }
  .retention-record-dialog-header { padding-inline: 10px; }
  .retention-record-dialog-body { padding: 10px; }
  .retention-system-conclusion, .retention-record-provenance, .retention-method > div { grid-template-columns: 1fr; }
  .retention-system-conclusion { gap: 16px; padding: 16px; }
  .retention-system-conclusion dl, .retention-workbook-details dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .retention-comparison { grid-template-columns: 1fr; }
  .retention-comparison-source, .retention-comparison-result { border-radius: 12px; }
  .retention-comparison-marker { grid-template-columns: auto 1fr; border: 0; padding: 9px; }
  .retention-comparison-marker .ui-icon { transform: rotate(0); }
  .retention-import form { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .retention-report *, .retention-record-dialog * { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
