:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #273449;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --ok: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --border: #334155;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.brand { font-weight: 700; margin-right: auto; }
.topbar nav { display: flex; gap: 0.9rem; }
.role-pill {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}
.session { display: flex; align-items: center; gap: 0.6rem; }
.inline { display: inline; margin: 0; }
.linklike {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font: inherit; padding: 0;
}
.linklike:hover { text-decoration: underline; }

main { padding: 1.25rem; max-width: 1100px; margin: 0 auto; }
.footer { padding: 1rem 1.25rem; color: var(--muted); font-size: 0.85rem; text-align: center; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }

.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td {
  text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th { color: var(--muted); font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; }
.sha { font-size: 0.72rem; word-break: break-all; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

.login-card { max-width: 380px; margin: 3rem auto; }
.login-card form { display: flex; flex-direction: column; gap: 0.5rem; }
label { color: var(--muted); font-size: 0.85rem; }
input, select {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 0.5rem 0.6rem; font: inherit;
}

button.primary, a.primary, button.danger {
  display: inline-block; border: none; border-radius: 6px; padding: 0.5rem 0.9rem;
  font: inherit; cursor: pointer; color: #04121f; font-weight: 600;
}
button.primary, a.primary { background: var(--accent); }
button.danger { background: var(--bad); color: #fff; }
a.primary:hover { text-decoration: none; }

.alert { color: var(--bad); border: 1px solid var(--bad); border-radius: 6px; padding: 0.5rem; }
.log { background: #0b1220; border: 1px solid var(--border); border-radius: 6px; padding: 0.6rem; overflow-x: auto; font-size: 0.78rem; max-height: 240px; }

@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .brand { margin-right: 0; }
  .table { font-size: 0.8rem; }
}

/* Customer dashboard redesign ------------------------------------------------ */
:root {
  --canvas: #f4f6f3;
  --surface: #ffffff;
  --surface-subtle: #f8faf8;
  --surface-strong: #e9eee9;
  --ink: #17221c;
  --ink-soft: #3e4c43;
  --ink-muted: #68756d;
  --line: #dce3dd;
  --line-strong: #c4cec6;
  --brand: #183c2d;
  --brand-hover: #102d21;
  --brand-pale: #e4efe9;
  --success: #176b45;
  --success-bg: #e4f3eb;
  --warning: #8a5512;
  --warning-bg: #fff3d6;
  --danger: #9b2d2d;
  --danger-bg: #fce9e7;
  --info: #285d78;
  --info-bg: #e8f2f7;
  --active: #275a8b;
  --active-bg: #e8f1fa;
  --focus: #3b82f6;
  --shadow-sm: 0 1px 2px rgba(23, 34, 28, 0.05);
  --shadow-md: 0 12px 32px rgba(23, 34, 28, 0.08);
  --radius-sm: 7px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
a { color: var(--success); text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
::selection { background: #cce4d6; color: var(--ink); }

.icon { display: inline-block; flex: 0 0 auto; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon--xs { width: 12px; height: 12px; stroke-width: 2.1; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 24px; height: 24px; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; z-index: 1000; top: 12px; left: 12px;
  transform: translateY(-160%);
  padding: 10px 14px;
  background: var(--surface); color: var(--ink);
  border: 2px solid var(--focus); border-radius: var(--radius-sm);
}
.skip-link:focus { transform: translateY(0); }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30;
  display: flex; flex-direction: column;
  width: 264px; padding: 24px 18px;
  color: #f5faf6; background: #14271e;
  border-right: 1px solid rgba(255,255,255,0.08);
}
.brand {
  display: flex; align-items: center; gap: 12px;
  color: inherit; text-decoration: none; font-weight: inherit;
}
.brand:hover { color: inherit; text-decoration: none; }
.brand__mark {
  display: grid; place-items: center; flex: 0 0 40px; height: 40px;
  color: #eff9f2; background: #2f694e;
  border: 1px solid rgba(255,255,255,.16); border-radius: 11px;
  font-size: 12px; font-weight: 800; letter-spacing: .08em;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: -.01em; }
.brand small { margin-top: 1px; color: #aebdb4; font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.primary-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 34px; }
.primary-nav a {
  display: flex; align-items: center; gap: 12px;
  min-height: 43px; padding: 9px 12px;
  color: #c8d5cd; border-radius: 9px;
  font-size: 14px; font-weight: 600; text-decoration: none;
}
.primary-nav a span { width: 18px; color: #8fa79a; font-size: 17px; text-align: center; }
.primary-nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.primary-nav a[aria-current="page"] { color: #fff; background: #2a4f3c; box-shadow: inset 3px 0 #7bc59d; }
.primary-nav a[aria-current="page"] span { color: #a6dfbd; }
.sidebar__footer { display: grid; gap: 14px; margin-top: auto; }
.trust-label { display: flex; align-items: center; gap: 10px; padding: 12px; color: #c8d5cd; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; }
.trust-label > span:first-child { display: grid; place-items: center; width: 24px; height: 24px; color: #102d21; background: #9ed7b6; border-radius: 50%; font-weight: 900; }
.trust-label strong, .trust-label small { display: block; }
.trust-label strong { color: #eef7f1; font-size: 12px; }
.trust-label small { margin-top: 1px; color: #9dafA4; font-size: 10px; }
.session-card { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.session-card form { margin: 0; }
.role-pill { padding: 3px 8px; color: #dfeae3; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); font-weight: 700; }
.text-button { padding: 5px; color: #b9c8bf; background: transparent; border: 0; cursor: pointer; }
.text-button:hover { color: #fff; text-decoration: underline; }

.workspace { display: flex; flex-direction: column; min-height: 100vh; margin-left: 264px; }
.mobile-header { display: none; }
.main-content { width: 100%; max-width: 1500px; margin: 0 auto; padding: 38px 42px 64px; }
.footer { display: flex; justify-content: space-between; gap: 20px; margin-top: auto; padding: 18px 42px; color: var(--ink-muted); background: transparent; border-top: 1px solid var(--line); font-size: 12px; text-align: left; }

h1, h2, h3 { color: var(--ink); line-height: 1.2; letter-spacing: -.025em; }
h1 { margin: 2px 0 8px; font-size: clamp(28px, 3vw, 38px); }
h2 { margin: 0 0 5px; font-size: 20px; }
h3 { margin: 0 0 5px; font-size: 16px; }
p { margin: 0 0 12px; }
.muted { color: var(--ink-muted); }
.compact { margin: 7px 0 0; }
.block { display: block; }
.eyebrow { margin: 0 0 5px; color: var(--success); font-size: 11px; font-weight: 800; letter-spacing: .105em; text-transform: uppercase; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 30px; }
.page-header > div:first-child { max-width: 760px; }
.page-header > div:first-child > p:last-child { margin: 0; color: var(--ink-soft); font-size: 16px; }
.page-header__actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.section-heading, .panel__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.section-heading { margin: 32px 0 14px; }
.section-heading p, .panel__header p { margin: 0; color: var(--ink-muted); }
.panel__header { margin-bottom: 20px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 9px 15px;
  border: 1px solid transparent; border-radius: 8px;
  font-size: 13px; font-weight: 750; line-height: 1.25; text-align: center; text-decoration: none;
  box-shadow: var(--shadow-sm); cursor: pointer;
}
.button:hover { text-decoration: none; }
.button--primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.button--primary:hover { color: #fff; background: var(--brand-hover); }
.button--secondary { color: var(--brand); background: var(--surface); border-color: var(--line-strong); }
.button--secondary:hover, .button--ghost:hover { color: var(--brand); background: var(--brand-pale); border-color: #a8c2b1; }
.button--ghost { color: var(--ink-soft); background: transparent; border-color: var(--line); box-shadow: none; }
.button--danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.button--danger:hover { color: #fff; background: #7d2020; }
.button--wide { width: 100%; }
.button--small { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.button[disabled] { opacity: .58; cursor: not-allowed; }
.text-link { flex: 0 0 auto; font-weight: 700; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(145px, 1fr)); gap: 12px; }
.metric-card { min-height: 126px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.metric-card--success { border-top: 3px solid var(--success); }
.metric-card--warning { border-top: 3px solid #cf8c28; }
.metric-card--danger { border-top: 3px solid var(--danger); }
.metric-card--muted { background: var(--surface-subtle); }
.metric-card__label { margin: 0 0 8px; color: var(--ink-muted); font-size: 12px; font-weight: 700; }
.metric-card__value { max-width: 100%; margin: 0; overflow: hidden; color: var(--ink); font-size: 25px; font-weight: 750; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.metric-card__help { margin: 5px 0 0; color: var(--ink-muted); font-size: 11px; line-height: 1.35; }

.panel { margin: 22px 0; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.panel--compact { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.panel--compact .panel__header { flex: 1; margin: 0; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; width: max-content; max-width: 100%; padding: 4px 8px; border: 1px solid transparent; border-radius: 999px; font-size: 11px; font-weight: 750; line-height: 1.2; text-transform: capitalize; white-space: nowrap; }
.status-badge--success { color: var(--success); background: var(--success-bg); border-color: #b8ddc8; }
.status-badge--active { color: var(--active); background: var(--active-bg); border-color: #bed4e8; }
.status-badge--warning { color: var(--warning); background: var(--warning-bg); border-color: #ead49c; }
.status-badge--danger { color: var(--danger); background: var(--danger-bg); border-color: #efc4bf; }
.status-badge--neutral { color: var(--ink-soft); background: #eef1ef; border-color: #d7ded9; }
.status-legend { display: flex; align-items: center; gap: 14px; margin: 0 0 20px; padding: 12px 14px; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 12px; }
.status-legend > div { display: flex; flex-wrap: wrap; gap: 6px; }
.status-legend small { margin-left: auto; color: var(--ink-muted); }

.alert-stack { margin-top: 32px; }
.alert { display: flex; align-items: flex-start; gap: 13px; margin: 12px 0; padding: 15px 16px; border: 1px solid; border-radius: 10px; }
.alert p { margin: 3px 0 0; color: inherit; font-size: 13px; }
.alert a { display: inline-block; margin-top: 7px; color: inherit; font-weight: 750; }
.alert__icon { display: grid; place-items: center; flex: 0 0 24px; height: 24px; border: 1px solid currentColor; border-radius: 50%; font-size: 12px; font-weight: 900; }
.alert--warning { color: #6f440d; background: var(--warning-bg); border-color: #e3c679; }
.alert--danger { color: #7b2424; background: var(--danger-bg); border-color: #e8b7b2; }
.alert--success { color: #145b3c; background: var(--success-bg); border-color: #b0d9c1; }
.alert--info { color: #204d64; background: var(--info-bg); border-color: #b9d5e3; }
.connection-banner { margin: -12px 0 24px; padding: 10px 13px; color: #6f440d; background: var(--warning-bg); border: 1px solid #e3c679; border-radius: 8px; font-size: 12px; }

.table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; }
.data-table { width: 100%; min-width: 760px; border-collapse: collapse; color: var(--ink-soft); font-size: 13px; }
.data-table th, .data-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data-table th { color: var(--ink-muted); background: var(--surface-subtle); font-size: 11px; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafcfa; }
.data-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.data-table--sites { min-width: 1180px; }
.data-table--sites td { vertical-align: top; }
.site-name { color: var(--ink); font-weight: 750; text-transform: capitalize; }
.identifier { display: inline-block; max-width: 260px; overflow: hidden; color: var(--ink-soft); font: 600 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; vertical-align: middle; white-space: nowrap; }
.friendly-reference { display: inline-block; color: var(--ink-soft); font-size: 11px; font-weight: 650; white-space: nowrap; }
.checksum { overflow-wrap: anywhere; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.subtle-label { color: var(--ink-muted); font-size: 11px; text-transform: none; }
.cell-stack { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.number-pair { display: flex; gap: 18px; }
.number-pair span { display: grid; }
.number-pair strong { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.number-pair small { color: var(--ink-muted); font-size: 10px; }
.blocker-text { max-width: 320px; margin: 8px 0 0; color: var(--warning); font-size: 11px; line-height: 1.45; }

.site-operator { border-top: 4px solid var(--guns-red); }
.site-picker { display: grid; grid-template-columns: minmax(180px, 320px) 1fr; align-items: end; gap: 5px 18px; margin-bottom: 18px; padding: 14px; background: var(--surface-subtle); border: 1px solid var(--line); }
.site-picker label { grid-column: 1; color: var(--ink-soft); font-size: 11px; font-weight: 750; }
.site-picker select { grid-column: 1; }
.site-picker p { grid-column: 2; grid-row: 2; margin: 0; color: var(--ink-muted); font-size: 11px; }
.site-control-panels { display: grid; gap: 12px; min-width: 0; }
[data-site-operator][data-enhanced="true"] .site-control-panels { display: block; }
.site-control-panel { min-width: 0; overflow: hidden; border: 1px solid var(--line-strong); background: var(--surface); }
.site-control-panel__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 18px; border-bottom: 1px solid var(--line); }
.site-control-panel__header > div:first-child { min-width: 0; }
.site-control-panel__header p:last-child { margin: 6px 0 0; color: var(--ink-muted); font-size: 12px; }
.execution-place { display: grid; grid-template-columns: 36px auto; grid-template-rows: auto auto; column-gap: 10px; flex: 0 0 auto; min-width: 190px; padding: 10px 12px; color: var(--ink-soft); background: var(--surface-subtle); border: 1px solid var(--line); }
.execution-place .icon { grid-row: 1 / 3; align-self: center; color: var(--guns-red); }
.execution-place span { font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.execution-place strong { color: var(--ink); font-size: 12px; }
.site-control-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.site-control-summary > div { display: grid; align-content: start; gap: 5px; min-width: 0; min-height: 82px; padding: 13px 15px; border-right: 1px solid var(--line); }
.site-control-summary > div:last-child { border-right: 0; }
.site-control-summary span:first-child, .schedule-summary span { color: var(--ink-muted); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.site-control-summary strong { color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.site-control-body { display: grid; grid-template-columns: minmax(250px, 1.15fr) minmax(250px, 1fr) minmax(280px, 1.15fr); }
.site-control-body > section { min-width: 0; padding: 18px; border-right: 1px solid var(--line); }
.site-control-body > section:last-child { border-right: 0; }
.site-control-body h4 { margin: 0 0 12px; font-size: 14px; }
.site-control-actions { display: flex; flex-direction: column; align-items: flex-start; }
.site-control-actions form { width: 100%; }
.site-control-actions .button { max-width: 100%; }
.queue-placeholder { display: grid; gap: 5px; padding: 14px; background: var(--surface-subtle); border: 1px solid var(--line); }
.queue-placeholder strong { color: var(--ink); font-size: 12px; }
.queue-placeholder span, .control-note { color: var(--ink-muted); font-size: 11px; line-height: 1.5; }
.control-note { margin: 9px 0 0; }
.run-preflight { width: 100%; margin: 0 0 12px; padding: 12px; background: var(--surface-subtle); border: 1px solid var(--line); }
.run-preflight > strong { display: block; margin-bottom: 8px; font-size: 12px; }
.run-preflight dl { display: grid; gap: 7px; margin: 0; }
.run-preflight dl div { display: grid; grid-template-columns: minmax(90px, .65fr) 2fr; gap: 8px; }
.run-preflight dt { color: var(--ink-muted); font-size: 11px; font-weight: 800; }
.run-preflight dd { min-width: 0; margin: 0; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.companion-safety { width: 100%; margin: 0 0 12px; padding: 13px; color: #6f440d; background: var(--warning-bg); border: 1px solid #e3c679; border-left: 4px solid #a87900; }
.companion-safety__title { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.companion-safety dl { display: grid; gap: 7px; margin: 0; }
.companion-safety dl div { display: grid; grid-template-columns: minmax(85px, .6fr) 2fr; gap: 8px; }
.companion-safety dt { font-size: 11px; font-weight: 800; }
.companion-safety dd { margin: 0; font-size: 12px; line-height: 1.5; }
.companion-safety p { margin: 10px 0 0; padding-top: 9px; border-top: 1px solid #e3c679; font-size: 12px; line-height: 1.5; }
.companion-safety--persistent { margin: 0; border-width: 0 0 1px 4px; }
.companion-safety ul { margin: 8px 0 0; padding-left: 18px; font-size: 12px; line-height: 1.5; }
.schedule-summary { display: grid; gap: 10px; margin-bottom: 12px; }
.schedule-summary > div { display: grid; gap: 3px; }
.schedule-summary strong { color: var(--ink); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.schedule-summary small { color: var(--ink-muted); font-size: 10px; line-height: 1.45; }
.schedule-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 6px 8px; }
.schedule-form label { grid-column: 1 / -1; color: var(--ink-soft); font-size: 11px; font-weight: 750; }
.schedule-form .form-feedback { grid-column: 1 / -1; }
.custom-days { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; grid-column: 1 / -1; padding: 9px; background: var(--surface-subtle); border: 1px solid var(--line); }
.custom-days label { grid-column: auto; }
.custom-days small { color: var(--ink-muted); font-size: 10px; }
.technical-details--boxed { border: 0; border-top: 1px solid var(--line); }
.site-control-panel:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.friendly-reference { color: var(--ink-soft); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.run-control-cell { min-width: 220px; }
.run-control { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.run-control summary { padding: 10px 12px; color: var(--success); font-size: 11px; font-weight: 800; cursor: pointer; }
.run-control summary:hover { background: var(--surface-subtle); }
.run-control__body { display: grid; gap: 10px; padding: 0 12px 12px; border-top: 1px solid var(--line); }
.run-control__body > p:first-child { margin: 10px 0 0; }
.run-control__body form { margin: 0; }
.inline-warning { padding: 9px; color: var(--warning); background: var(--warning-bg); border: 1px solid #ead8a8; border-radius: 6px; font-size: 10px; line-height: 1.45; }

.filter-bar { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(2, minmax(145px, 1fr)) auto; align-items: end; gap: 10px; margin-bottom: 18px; padding: 14px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: 9px; }
.catalogue-preview .filter-bar { grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(125px, 1fr)); }
.field, .search-field { display: grid; gap: 5px; }
.field label, .search-field label, .form-stack label { color: var(--ink-soft); font-size: 11px; font-weight: 750; }
input, select { width: 100%; min-height: 40px; padding: 8px 10px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 7px; }
input::placeholder { color: #89948d; }
input:disabled, select:disabled { color: var(--ink-muted); background: #edf0ed; cursor: not-allowed; }

.progress-block + .progress-block { margin-top: 11px; }
.progress-block { min-width: 180px; }
.progress-block__heading { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; color: var(--ink-soft); font-size: 10px; }
.progress-block__heading strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.progress-track { height: 6px; overflow: hidden; background: #e4e9e5; border-radius: 99px; }
.progress-track__fill { display: block; width: var(--progress-value); height: 100%; background: var(--success); border-radius: inherit; }
.progress-block__detail { margin: 4px 0 0; color: var(--ink-muted); font-size: 9px; line-height: 1.35; }

.empty-state { padding: 44px 20px; text-align: center; }
.empty-state--bordered { margin-top: 18px; background: var(--surface-subtle); border: 1px dashed var(--line-strong); border-radius: 10px; }
.empty-state__icon { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 13px; color: var(--success); background: var(--brand-pale); border-radius: 50%; font-size: 18px; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { max-width: 680px; margin: 0 auto; color: var(--ink-muted); font-size: 13px; }
.empty-state__action { margin-top: -22px; padding-bottom: 30px; text-align: center; }
.catalogue-table-preview { opacity: .62; }

.catalogue-cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-subtle); }
.catalogue-cta p { margin: 5px 0 0; color: var(--text-muted); }
.catalogue-filters { grid-template-columns: minmax(260px, 2fr) repeat(4, minmax(130px, 1fr)); align-items: end; }
.catalogue-filter-panel { margin-bottom: 18px; overflow: hidden; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: 10px; }
.catalogue-filter-panel__primary { display: grid; grid-template-columns: minmax(280px, 2fr) minmax(180px, .7fr) auto; align-items: end; gap: 12px; padding: 15px; }
.catalogue-filter-panel__advanced { border-top: 1px solid var(--line); }
.catalogue-filter-panel__advanced summary { display: flex; align-items: center; gap: 8px; padding: 12px 15px; color: var(--ink-soft); font-size: 12px; font-weight: 750; cursor: pointer; }
.catalogue-filter-panel__advanced summary:hover { background: var(--surface); }
.filter-count { padding: 2px 7px; color: var(--success); background: var(--success-bg); border-radius: 99px; font-size: 10px; }
.catalogue-filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; padding: 15px; border-top: 1px solid var(--line); }
.catalogue-filter-grid fieldset { min-width: 0; margin: 0; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.catalogue-filter-grid legend { padding: 0 5px; color: var(--ink); font-size: 11px; font-weight: 800; }
.check-option { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 7px; min-height: 31px; color: var(--ink-soft); font-size: 11px; cursor: pointer; }
.check-option input { width: 16px; min-height: 16px; margin: 0; }
.check-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-option small { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.filter-option-scroll { max-height: 165px; overflow: auto; padding-right: 4px; }
.range-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.range-fields legend { grid-column: 1 / -1; }
.range-fields label { display: grid; gap: 5px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.catalogue-filter-panel__advanced > .filter-actions { justify-content: flex-end; padding: 0 15px 15px; }
.comparison-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.compact-ranking { display: grid; gap: 0; }
.compact-ranking > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.compact-ranking > div:last-child { border-bottom: 0; }
.compact-ranking strong { color: var(--ink); font-size: 12px; }
.compact-ranking span { color: var(--ink-muted); font-size: 11px; text-align: right; }
.exact-match-list { display: grid; gap: 14px; }
.exact-match { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
.exact-match__heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; background: var(--surface-subtle); border-bottom: 1px solid var(--line); }
.exact-match__heading > div { display: grid; gap: 2px; }
.exact-match__heading strong { color: var(--ink); font-size: 13px; }
.exact-match__heading span { color: var(--ink-muted); font-size: 11px; }
.filter-actions { display: flex; gap: 8px; align-items: center; }
.catalogue-table td { vertical-align: top; }
.catalogue-table td:nth-child(2) { min-width: 250px; }
.catalogue-table td:nth-child(5) { min-width: 180px; }
.product-thumbnail, .thumbnail-placeholder { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-subtle); object-fit: contain; }
.thumbnail-placeholder { color: var(--text-muted); }
.table-link { display: block; width: fit-content; margin-top: 5px; font-size: .78rem; font-weight: 700; }
.evidence-cell { display: grid; gap: 5px; min-width: 180px; }
.evidence-cell small { color: var(--text-muted); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; color: var(--text-muted); }
.pagination > div { display: flex; gap: 8px; }
.source-chip-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.source-chip { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-subtle); }
.source-chip small { color: var(--text-muted); }

.run-list, .job-list { display: grid; gap: 12px; }
.run-card, .job-card { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.run-card__header, .job-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.title-line h3 { margin: 0; }
.run-card__totals { display: flex; gap: 24px; }
.run-card__totals span { display: grid; text-align: right; }
.run-card__totals strong { color: var(--ink); font-size: 17px; font-variant-numeric: tabular-nums; }
.run-card__totals small { color: var(--ink-muted); font-size: 9px; }
.run-card__body { display: grid; grid-template-columns: minmax(300px, 1.3fr) minmax(320px, 1fr); gap: 28px; padding: 18px; }
.progress-stack { padding-right: 12px; border-right: 1px solid var(--line); }
.run-meta, .job-meta, .companion-state, .export-stats, .key-value { margin: 0; }
.run-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 20px; }
.run-meta div, .job-meta div, .companion-state div, .export-stats div { min-width: 0; }
.run-meta dt, .job-meta dt, .companion-state dt, .export-stats dt, .key-value dt { color: var(--ink-muted); font-size: 10px; font-weight: 700; }
.run-meta dd, .job-meta dd, .companion-state dd, .export-stats dd, .key-value dd { margin: 2px 0 0; color: var(--ink-soft); font-size: 12px; }
.technical-details { border-top: 1px solid var(--line); }
.technical-details summary { padding: 11px 17px; color: var(--ink-soft); font-size: 11px; font-weight: 750; cursor: pointer; }
.technical-details summary:hover { background: var(--surface-subtle); }
.technical-details--compact { margin-top: 8px; border: 1px solid var(--line); }
.technical-details--compact summary { padding: 7px 9px; font-size: 10px; }
.technical-details--compact .details-content { padding: 0 9px 9px; overflow-wrap: anywhere; }
.details-content { padding: 0 17px 15px; color: var(--ink-soft); font-size: 12px; }
.details-content p:last-child, .details-content ul:last-child { margin-bottom: 0; }
.technical-details--boxed { margin: 14px 0; border: 1px solid var(--line); border-radius: 8px; }

.export-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.export-card { display: flex; flex-direction: column; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-subtle); }
.export-card__icon { display: grid; place-items: center; width: 46px; height: 40px; margin-bottom: 15px; color: var(--success); background: var(--success-bg); border: 1px solid #b8ddc8; border-radius: 7px; font-size: 10px; font-weight: 900; }
.export-card__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.export-card > p { flex: 1; color: var(--ink-muted); font-size: 12px; }
.export-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 8px 0 14px; padding: 11px 0; border-block: 1px solid var(--line); }
.export-stats dd { color: var(--ink); font-size: 15px; font-weight: 750; }
.source-runs { display: grid; gap: 4px; margin-bottom: 12px; font-size: 10px; }
.source-runs > span:first-child { color: var(--ink-muted); font-weight: 700; }
.export-card .technical-details { margin: 0 0 14px; border: 1px solid var(--line); border-radius: 7px; }
.key-value { display: grid; grid-template-columns: auto 1fr; gap: 7px 10px; }
.key-value > .technical-value { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(110px, auto) minmax(0, 1fr) auto; align-items: start; gap: 7px 10px; }
.copy-button { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 5px 8px; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line-strong); cursor: pointer; font-size: 10px; font-weight: 750; }
.copy-button:hover, .copy-button--done { color: var(--brand); background: var(--brand-pale); border-color: var(--brand); }
.copy-fallback { position: fixed; left: -9999px; width: 1px; height: 1px; }
.language-switch { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; padding: 3px; background: var(--surface-subtle); border: 1px solid var(--line-strong); }
.language-switch button { min-width: 34px; min-height: 30px; padding: 5px 8px; color: var(--ink-soft); background: transparent; border: 0; cursor: pointer; font-size: 10px; font-weight: 850; letter-spacing: .06em; }
.language-switch button:hover { color: var(--brand); background: var(--brand-pale); }
.language-switch button:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.language-switch .language-switch__option--active { color: #fff; background: var(--brand); }
.login-panel { position: relative; }
.login-panel > .language-switch { position: absolute; top: 18px; right: 18px; }
.brand-ribbon > .language-switch { margin: -5px 0 -5px auto; }
.button--compact { min-height: 34px; padding: 7px 10px; font-size: 10px; }
.export-picker { display: grid; gap: 14px; }
.export-picker__primary { display: grid; grid-template-columns: minmax(280px, 2fr) minmax(260px, 1fr) auto; align-items: end; gap: 12px; padding: 14px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: 9px; }
.export-picker__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.export-picker__grid fieldset { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.export-picker__grid legend { padding: 0 5px; color: var(--ink); font-size: 11px; font-weight: 800; }
.export-fields { grid-column: span 2; }
.export-preview { display: grid; grid-template-columns: repeat(3, minmax(140px, .7fr)) minmax(220px, 1.5fr); gap: 12px; padding: 15px; color: var(--ink-soft); background: var(--brand-pale); border: 1px solid #b8ddc8; border-radius: 9px; }
.export-preview > div { display: grid; gap: 2px; }
.export-preview strong { color: var(--ink); font-size: 17px; font-variant-numeric: tabular-nums; }
.export-preview span { font-size: 10px; }
.export-preview__sources { display: flex !important; flex-wrap: wrap; align-content: center; gap: 5px; }
.export-preview__sources span { padding: 4px 7px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; }
.export-picker__actions { justify-content: flex-end; }
.export-history-list { display: grid; gap: 12px; }
.export-history-item { display: grid; grid-template-columns: minmax(190px, .8fr) minmax(260px, 1.4fr) auto; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; }
.export-history-item > div:first-child { display: grid; gap: 3px; }
.export-history-item > div:first-child span { color: var(--ink-muted); font-size: 10px; }
.export-history-item .source-chip { display: inline-flex; padding: 5px 8px; font-size: 10px; }
.export-history-item__files { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.export-history-item__files form { margin: 0; }
.export-history-item > .technical-details { grid-column: 1 / -1; }

.job-card__header .eyebrow { margin-bottom: 4px; }
.job-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 24px; padding: 16px 18px; }
.queue-accounting { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 16px; }
.queue-accounting > div { min-width: 140px; padding: 9px 11px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: 7px; }
.queue-accounting span, .queue-accounting strong { display: block; }
.queue-accounting span { color: var(--ink-muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.queue-accounting strong { margin-top: 2px; color: var(--ink-soft); font-size: 11px; }
.job-card__actions { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 10px; padding: 0 18px 16px; }
.job-card__actions form { margin: 0; }
.job-card__actions .technical-details--inline { min-width: min(100%, 260px); margin: 0; }
.technical-details--inline summary { padding: 9px 12px; }
.log { max-height: 240px; margin: 0; padding: 12px; overflow: auto; color: #d9e5dc; background: #122019; border: 1px solid #30483b; border-radius: 7px; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }

.companion-panel { border-top: 3px solid var(--active); }
.companion-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: center; gap: 10px; margin: 4px 0 20px; padding: 14px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: 9px; }
.companion-flow > div { display: grid; grid-template-columns: 30px 1fr; align-items: center; column-gap: 9px; }
.companion-flow > div > span { grid-row: 1 / 3; display: grid; place-items: center; width: 28px; height: 28px; color: #fff; background: var(--brand); border-radius: 50%; font-size: 11px; font-weight: 800; }
.companion-flow strong { font-size: 11px; }
.companion-flow small { color: var(--ink-muted); font-size: 9px; }
.companion-flow i { color: var(--line-strong); font-style: normal; }
.companion-state { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.companion-state div { min-height: 78px; padding: 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.companion-state div:nth-child(4n) { border-right: 0; }
.companion-state div:nth-last-child(-n + 4) { border-bottom: 0; }
.companion-panel > form { margin-top: 16px; }

.action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.action-card { display: grid; grid-template-columns: 42px 1fr; grid-template-rows: 1fr auto; gap: 0 14px; padding: 19px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.action-card--wide { grid-column: 1 / -1; }
.action-card__icon { display: grid; place-items: center; width: 40px; height: 40px; color: var(--brand); background: var(--brand-pale); border-radius: 9px; font-size: 18px; }
.action-card > div:nth-child(2) { grid-column: 2; }
.action-card > form { grid-column: 2; margin-top: 13px; }
.action-card p { color: var(--ink-muted); font-size: 12px; }
.scope-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 12px 0 0; list-style: none; }
.scope-list li { padding: 3px 7px; color: var(--ink-soft); background: var(--surface-strong); border-radius: 5px; font-size: 10px; }
.form-feedback { min-height: 16px; margin: 5px 0 0 !important; color: var(--ink-muted) !important; font-size: 10px !important; }
.run-mode-field { margin: 0 0 10px; }
.form-feedback--warning { color: var(--warn, #8a5a00) !important; font-weight: 700; }

.login-page { min-height: 100vh; color: var(--ink); background: #e9eeea; }
.login-layout { display: grid; grid-template-columns: minmax(380px, 1.2fr) minmax(360px, .8fr); width: min(1060px, calc(100% - 48px)); min-height: 620px; margin: 7vh auto; padding: 0; overflow: hidden; background: var(--surface); border: 1px solid #d4ddd6; border-radius: 20px; box-shadow: var(--shadow-md); }
.login-intro { display: flex; flex-direction: column; justify-content: space-between; padding: 44px; color: #ecf5ef; background: #173526; }
.brand--login { width: max-content; }
.login-intro h1 { max-width: 580px; color: #fff; font-size: clamp(34px, 5vw, 52px); }
.login-intro > div > p:last-child { max-width: 560px; color: #c3d2c8; font-size: 16px; }
.login-intro .eyebrow { color: #91cfaa; }
.feature-list { display: grid; gap: 9px; padding: 0; margin: 0; color: #d7e5dc; list-style: none; font-size: 13px; }
.feature-list span { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 7px; color: #173526; background: #8dcaa6; border-radius: 50%; font-size: 10px; font-weight: 900; }
.login-panel { align-self: center; padding: 52px; }
.login-panel h2 { margin-bottom: 10px; font-size: 26px; }
.login-panel > .muted { margin-bottom: 25px; font-size: 13px; }
.form-stack { display: grid; gap: 16px; }
.form-stack .button { margin-top: 4px; }
.privacy-note { margin: 20px 0 0; color: var(--ink-muted); font-size: 10px; line-height: 1.45; }
.privacy-note span { margin-right: 4px; color: var(--success); }

.product-title-link { color: var(--ink); }
.product-title-link:hover { color: var(--brand); }
.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--ink-muted); font-size: 12px; }
.breadcrumb span:last-child { max-width: 48ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-detail-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(310px, .8fr); gap: 18px; align-items: start; }
.product-facts { display: grid; gap: 18px; }
.product-facts .panel--compact { align-items: stretch; flex-direction: column; min-width: 0; }
.product-facts .panel--compact .panel__header,
.product-facts .detail-list { width: 100%; min-width: 0; }
.product-facts .identifier { max-width: 100%; }
.product-gallery__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.product-gallery figure { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-strong); }
.product-gallery figure a { display: grid; place-items: center; min-height: 220px; padding: 10px; background: #fff; }
.product-gallery figure img { width: 100%; max-height: 360px; object-fit: contain; }
.gallery-image-placeholder { display: grid; place-items: center; min-height: 220px; padding: 20px; color: var(--ink-muted); background: var(--surface-subtle); font-size: 12px; text-align: center; }
.product-gallery figcaption { padding: 8px 10px; color: var(--ink-muted); font-size: 10px; }
.detail-list { display: grid; gap: 0; margin: 0; }
.detail-list > div { display: grid; grid-template-columns: minmax(110px, .8fr) minmax(0, 1.2fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--ink-muted); font-size: 11px; }
.detail-list dd { min-width: 0; margin: 0; color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.detail-list dd code { font-size: 10px; }
.alert--compact { margin-top: 14px; padding: 11px; }

.skeleton { position: relative; overflow: hidden; color: transparent; background: #e7ece8; border-radius: 5px; }
.skeleton::after { position: absolute; inset: 0; content: ""; background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent); transform: translateX(-100%); animation: skeleton 1.4s infinite; }
@keyframes skeleton { to { transform: translateX(100%); } }
[hidden] { display: none !important; }

@media (max-width: 1180px) {
  .main-content { padding-inline: 28px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .export-grid { grid-template-columns: repeat(2, 1fr); }
  .companion-state { grid-template-columns: repeat(2, 1fr); }
  .companion-state div:nth-child(2n) { border-right: 0; }
  .companion-state div:nth-last-child(-n + 4) { border-bottom: 1px solid var(--line); }
  .companion-state div:nth-last-child(-n + 2) { border-bottom: 0; }
  .site-control-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-control-body > section:nth-child(2) { border-right: 0; }
  .site-control-body > section:last-child { grid-column: 1 / -1; border-top: 1px solid var(--line); }
}

@media (max-width: 900px) {
  .workspace { margin-left: 0; }
  .mobile-header { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 10px 20px; color: #fff; background: #14271e; box-shadow: var(--shadow-sm); }
  .brand--mobile .brand__mark { flex-basis: 34px; height: 34px; }
  .nav-toggle { display: grid; place-items: center; width: 40px; height: 40px; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; font-size: 19px; cursor: pointer; }
  .sidebar { top: 64px; width: min(310px, 88vw); transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow-md); }
  .nav-open .sidebar { transform: translateX(0); }
  .nav-open::after { position: fixed; z-index: 20; inset: 64px 0 0; content: ""; background: rgba(12, 24, 17, .45); }
  .main-content { padding: 28px 22px 50px; }
  .footer { padding-inline: 22px; }
  .filter-bar, .catalogue-preview .filter-bar, .catalogue-filters, .catalogue-filter-panel__primary { grid-template-columns: repeat(2, 1fr); }
  .comparison-grid { grid-template-columns: 1fr; }
  .catalogue-filter-panel__primary .button { grid-column: 1 / -1; }
  .catalogue-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-field { grid-column: 1 / -1; }
  .run-card__body { grid-template-columns: 1fr; }
  .progress-stack { padding: 0 0 17px; border-right: 0; border-bottom: 1px solid var(--line); }
  .job-meta { grid-template-columns: repeat(2, 1fr); }
  .companion-flow { grid-template-columns: repeat(4, 1fr); }
  .companion-flow > i { display: none; }
  .companion-flow > div { grid-template-columns: 26px 1fr; }
  .action-grid { grid-template-columns: 1fr; }
  .action-card--wide { grid-column: auto; }
  .product-detail-layout { grid-template-columns: 1fr; }
  .export-picker__primary, .export-picker__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .export-picker__primary .button { grid-column: 1 / -1; }
  .export-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .export-history-item { grid-template-columns: 1fr; }
  .export-history-item__files { justify-content: flex-start; }
  .site-control-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-control-summary > div:nth-child(2) { border-right: 0; }
  .site-control-summary > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 680px) {
  .main-content { padding: 24px 14px 42px; }
  .page-header { align-items: flex-start; flex-direction: column; margin-bottom: 24px; }
  .page-header__actions { width: 100%; flex-wrap: wrap; }
  .page-header__actions .button { flex: 1; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric-card { min-height: 116px; padding: 14px; }
  .metric-card__value { font-size: 21px; }
  .panel { padding: 16px; border-radius: 10px; }
  .panel__header, .section-heading { flex-direction: column; gap: 9px; }
  .panel--compact { align-items: stretch; flex-direction: column; }
  .status-legend { align-items: flex-start; flex-direction: column; }
  .status-legend small { margin-left: 0; }
  .filter-bar, .catalogue-preview .filter-bar, .catalogue-filters, .catalogue-filter-panel__primary, .catalogue-filter-grid { grid-template-columns: 1fr; }
  .catalogue-filter-panel__primary .button { grid-column: auto; }
  .catalogue-cta, .pagination { align-items: stretch; flex-direction: column; }
  .search-field { grid-column: auto; }
  .run-card__header, .job-card__header { flex-direction: column; }
  .run-card__totals { width: 100%; justify-content: space-between; gap: 10px; }
  .run-card__totals span { text-align: left; }
  .run-meta, .job-meta { grid-template-columns: 1fr 1fr; }
  .export-grid { grid-template-columns: 1fr; }
  .export-picker__primary, .export-picker__grid, .export-preview { grid-template-columns: 1fr; }
  .export-picker__primary .button, .export-fields { grid-column: auto; }
  .companion-flow { grid-template-columns: repeat(2, 1fr); }
  .companion-state { grid-template-columns: 1fr; }
  .companion-state div, .companion-state div:nth-child(2n), .companion-state div:nth-last-child(-n + 2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .companion-state div:last-child { border-bottom: 0; }
  .action-card { grid-template-columns: 36px 1fr; padding: 16px; }
  .footer { align-items: flex-start; flex-direction: column; padding: 16px; }
  .login-layout { grid-template-columns: 1fr; width: min(100% - 24px, 560px); margin: 12px auto; }
  .login-intro { min-height: 360px; padding: 28px; }
  .login-intro h1 { font-size: 34px; }
  .login-panel { padding: 32px 28px; }
  .login-panel { padding-top: 72px; }
  .brand-ribbon > .language-switch { margin: 0 0 0 auto; }
  .product-gallery__grid { grid-template-columns: 1fr; }
  .product-gallery figure a { min-height: 180px; }
  .site-picker { grid-template-columns: 1fr; }
  .site-picker p { grid-column: 1; grid-row: auto; }
  .site-control-panel__header { flex-direction: column; }
  .execution-place { width: 100%; }
  .site-control-body { grid-template-columns: 1fr; }
  .site-control-body > section, .site-control-body > section:nth-child(2), .site-control-body > section:last-child { grid-column: auto; border-right: 0; border-top: 1px solid var(--line); }
  .site-control-body > section:first-child { border-top: 0; }
}

@media (max-width: 420px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: auto; }
  .run-meta, .job-meta { grid-template-columns: 1fr; }
  .companion-flow { grid-template-columns: 1fr; }
  .action-card { display: block; }
  .action-card__icon { margin-bottom: 12px; }
  .action-card > form { margin-top: 15px; }
  .site-control-summary { grid-template-columns: 1fr; }
  .site-control-summary > div, .site-control-summary > div:nth-child(2), .site-control-summary > div:nth-child(-n + 2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .site-control-summary > div:last-child { border-bottom: 0; }
  .schedule-form { grid-template-columns: 1fr; }
  .companion-safety dl div { grid-template-columns: 1fr; gap: 2px; }
  .run-preflight dl div { grid-template-columns: 1fr; gap: 2px; }
  .key-value > .technical-value { grid-template-columns: 1fr auto; }
  .key-value > .technical-value dt { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .sidebar, .mobile-header, .page-header__actions, .filter-bar, .footer, form { display: none !important; }
  .workspace { margin: 0; }
  .main-content { max-width: none; padding: 0; }
  .panel, .metric-card, .run-card, .job-card { box-shadow: none; break-inside: avoid; }
}

/* Kali Guns customer theme -------------------------------------------------- */
:root {
  --canvas: #f7f7f7; --surface: #fff; --surface-subtle: #f2f2f2;
  --surface-strong: #e7e7e7; --ink: #040f16; --ink-soft: #394348;
  --ink-muted: #626b6e; --line: #dedede; --line-strong: #b9b9b9;
  --guns-red: #ee1b24; --brand: #c9161f; --brand-hover: #a81017;
  --brand-pale: #fff0f0; --danger: #b71920; --danger-bg: #fff0f0;
  --focus: #111; --shadow-sm: none; --radius-sm: 2px;
  --radius-md: 3px; --radius-lg: 4px;
}
body { font-family: Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--brand); }
::selection { color: var(--ink); background: #ffd4d6; }
.sidebar { color: var(--ink); background: #fff; border-right-color: var(--line); box-shadow: inset 5px 0 var(--guns-red); }
.brand__mark { color: #fff; background: var(--guns-red); border-color: var(--guns-red); border-radius: 0; }
.brand strong { color: var(--guns-red); font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif; font-size: 18px; letter-spacing: .025em; }
.brand small { color: var(--ink-muted); }
.primary-nav a { color: var(--ink-soft); border-radius: 0; font-size: 13px; font-weight: 750; letter-spacing: .025em; text-transform: uppercase; }
.primary-nav a span { color: var(--guns-red); }
.primary-nav a:hover { color: var(--ink); background: #f2f2f2; }
.primary-nav a[aria-current="page"] { color: #fff; background: var(--brand); box-shadow: none; }
.primary-nav a[aria-current="page"] span { color: #fff; }
.trust-label { color: var(--ink-soft); background: var(--surface-subtle); border-color: var(--line); border-radius: 0; }
.trust-label > span:first-child { color: #fff; background: var(--guns-red); border-radius: 0; }
.trust-label strong { color: var(--ink); }
.trust-label small { color: var(--ink-muted); }
.role-pill { color: var(--ink-soft); background: #f2f2f2; border-color: var(--line); border-radius: 0; }
.text-button { color: var(--brand); }
.brand-ribbon { display: flex; align-items: center; justify-content: center; gap: 34px; min-height: 34px; padding: 7px 24px; color: #fff; background: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .075em; text-align: center; text-transform: uppercase; }
.brand-ribbon span + span { padding-left: 34px; border-left: 1px solid rgba(255,255,255,.35); }
h1, h2, h3 { font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif; letter-spacing: .025em; }
.eyebrow { color: var(--brand); }
.button, input, select, .panel, .metric-card, .status-badge, .alert, .connection-banner,
.table-scroll, .filter-bar, .run-card, .job-card, .export-card, .action-card,
.technical-details--boxed, .run-control, .inline-warning { border-radius: 0; }
.button { font-size: 12px; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.metric-card, .panel { box-shadow: none; }
.metric-card::before { display: block; width: 28px; height: 3px; margin-bottom: 14px; background: var(--guns-red); content: ""; }
.status-badge { font-size: 10px; letter-spacing: .025em; text-transform: uppercase; }
.alert { border-left-width: 4px; }
.data-table th { color: #fff; background: var(--ink); }
.data-table tbody tr:hover { background: #fff4f4; }
.progress-track, .progress-track__fill { border-radius: 0; }
.progress-track__fill { background: var(--guns-red); }
.companion-panel { border-top: 4px solid var(--guns-red); }
.companion-flow > div > span, .action-card__icon, .empty-state__icon { color: #fff; background: var(--guns-red); border-radius: 0; }
.login-page { background: #ececec; }
.login-layout { border-radius: 0; }
.login-intro { background: #050505; }
.login-intro .eyebrow, .privacy-note span { color: var(--guns-red); }
.feature-list span { color: #fff; background: var(--guns-red); border-radius: 0; }

@media (max-width: 760px) { .brand-ribbon { display: none; } }
