
@font-face {
  font-family: "Manrope Variable";
  src: url("/assets/fonts/manrope-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Manrope Variable";
  src: url("/assets/fonts/manrope-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-024F, U+1E00-1EFF, U+2000-206F, U+20A0-20CF;
}

@font-face {
  font-family: "Onest Variable";
  src: url("/assets/fonts/onest-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-024F, U+1E00-1EFF, U+2000-206F, U+20A0-20CF;
}

:root {
  color-scheme: light;
  --wp-ink: #0b1020;
  --wp-paper: #ffffff;
  --wp-canvas: #f4f6f8;
  --wp-subtle: #f7f9fc;
  --wp-muted: #667085;
  --wp-border: #e9edf5;
  --wp-border-strong: #c8d0de;
  --wp-blue: #3852db;
  --wp-blue-bright: #4d6bfe;
  --wp-blue-soft: #eef1ff;
  --wp-lime: #b7f34b;
  --wp-success: #247a43;
  --wp-success-soft: #ecfdf3;
  --wp-warning: #b54708;
  --wp-warning-soft: #fef0c7;
  --wp-danger: #d92d20;
  --wp-danger-soft: #fee4e2;
  --wp-violet: #7147ed;
  --wp-violet-soft: #f2edff;
  --wp-focus: #3852db;
  --wp-radius-lg: 20px;
  --wp-radius: 18px;
  --wp-radius-md: 12px;
  --wp-radius-sm: 8px;
  --wp-radius-full: 999px;
  --wp-space-1: 4px;
  --wp-space-2: 8px;
  --wp-space-3: 12px;
  --wp-space-4: 16px;
  --wp-space-5: 20px;
  --wp-space-6: 24px;
  --wp-shadow-focus: 0 0 0 4px rgba(56, 82, 219, 0.18);
  font-family: "Manrope Variable", Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { min-width: 320px; background: var(--wp-canvas); }

body {
  margin: 0;
  background: var(--wp-canvas);
  color: var(--wp-ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }

a { color: var(--wp-blue); text-underline-offset: 3px; }
a:hover { color: #263eb8; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--wp-focus);
  outline-offset: 2px;
  box-shadow: var(--wp-shadow-focus);
}

h1, h2, h3, h4, p, dl, dd { margin-top: 0; }
h1, h2, h3, h4 { color: var(--wp-ink); }
h1 { margin-bottom: 5px; font-size: 28px; font-weight: 800; line-height: 36px; letter-spacing: -0.4px; }
h2 { margin-bottom: 18px; font-size: 22px; font-weight: 700; line-height: 30px; letter-spacing: -0.2px; }
h3 { margin-bottom: 14px; font-size: 18px; font-weight: 600; line-height: 26px; }
h4 { margin-bottom: 10px; font-size: 14px; font-weight: 700; line-height: 20px; }
.eyebrow { margin-bottom: 6px; font-size: 11px; font-weight: 700; line-height: 16px; letter-spacing: 0.7px; text-transform: uppercase; }

.sr-only,
.skip:not(:focus) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip:focus {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: var(--wp-radius-sm);
  background: var(--wp-paper);
  color: var(--wp-ink);
  font-weight: 700;
}

/* App chrome */
.app-bar,
.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 72px;
  gap: 28px;
  padding: 0 32px;
  background: var(--wp-ink);
  color: var(--wp-paper);
}

.app-bar a,
.topbar a { color: inherit; text-decoration: none; }

.brand { display: inline-flex; align-items: center; gap: 12px; flex: 0 0 auto; color: var(--wp-paper); }
.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 34px;
  border-radius: 11px;
  background: var(--wp-lime);
  color: var(--wp-ink);
  font-family: "Onest Variable", Onest, sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.25px;
}
.brand-wordmark {
  font-family: "Onest Variable", Onest, sans-serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 26px;
  letter-spacing: -0.25px;
  white-space: nowrap;
}
.app-nav { display: flex; align-items: center; gap: 24px; font-weight: 600; line-height: 20px; }
.app-account { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.app-account form, .topbar form { display: inline-flex; margin: 0; }
.app-account .muted { color: rgba(255, 255, 255, 0.72); font-size: 12px; line-height: 18px; }
.app-bar .button,
.app-bar button,
.topbar .button,
.topbar button {
  min-height: 32px;
  padding: 6px 8px;
  border-color: transparent;
  background: transparent;
  color: var(--wp-paper);
  font-size: 12px;
  line-height: 16px;
}

/* Workspace and case shell */
.workspace,
.shell {
  width: 100%;
  padding: 28px 48px 36px;
}

.workspace-shell {
  display: flex;
  width: min(100%, 1344px);
  margin: 0 auto;
  flex-direction: column;
  gap: 18px;
}

.case-header {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 14px;
  padding: 20px 24px;
  overflow: hidden;
  border: 1px solid var(--wp-border);
  border-radius: var(--wp-radius-lg);
  background: var(--wp-paper);
}

.case-header-top {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  color: var(--wp-muted);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.2px;
}
.case-header-top a { font-size: 14px; font-weight: 600; line-height: 20px; text-decoration: none; }
.case-header-main { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-width: 0; }
.case-header-main > * { min-width: 0; }
.case-header-main h1 { overflow-wrap: anywhere; }
.case-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--wp-muted); font-size: 12px; line-height: 18px; }

.case-tabs {
  display: flex;
  width: 100%;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--wp-border-strong) transparent;
}
.case-tab {
  position: relative;
  display: inline-flex;
  width: 150px;
  min-width: 150px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-bottom: 1px solid var(--wp-border);
  border-radius: 0;
  background: transparent;
  color: var(--wp-muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-decoration: none;
}
.case-tab:hover { color: var(--wp-ink); }
.case-tab[aria-current="page"], .case-tab.active {
  border-bottom: 3px solid var(--wp-blue);
  color: var(--wp-blue);
}
.case-tab[aria-disabled="true"], .case-tab:disabled { color: #98a2b3; cursor: not-allowed; }

.case-body,
.history-layout {
  display: grid;
  width: min(100%, 1244px);
  grid-template-columns: minmax(0, 820px) minmax(320px, 404px);
  gap: 20px;
  align-items: start;
}
.case-body > .history-layout { grid-column: 1 / -1; }
.case-primary, .case-sidebar { display: flex; min-width: 0; flex-direction: column; gap: 18px; }

/* Cards and content groups */
.panel,
.card,
.filter-card,
.login-card,
.agent-card,
.offer-card,
.engagement-card {
  min-width: 0;
  padding: 20px 24px;
  border: 1px solid var(--wp-border);
  border-radius: var(--wp-radius-lg);
  background: var(--wp-paper);
}
.case-sidebar > .panel,
.case-sidebar > .card,
.case-sidebar > .engagement-card { padding: 20px 22px; border-color: transparent; }
.panel > :last-child,
.card > :last-child,
.notice > :last-child,
.agent-card > :last-child,
.engagement-card > :last-child { margin-bottom: 0; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.panel-header > :is(h2, h3, p) { margin-bottom: 0; }

.next-action {
  display: flex;
  min-height: 140px;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px;
  overflow: hidden;
  border-radius: var(--wp-radius-lg);
  background: var(--wp-lime);
  color: var(--wp-ink);
}
.next-action > :last-child { margin-bottom: 0; }
.next-action h2 { margin: 0; }
.next-action .muted { color: var(--wp-ink); }
.next-action .eyebrow,
.summary-item dt {
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 16px;
}
.summary-item { min-height: 58px; margin: 0; overflow: hidden; }
.summary-item dt { margin-bottom: 5px; color: var(--wp-muted); }
.summary-item dd { margin: 0; color: var(--wp-ink); font-size: 14px; font-weight: 600; line-height: 20px; overflow-wrap: anywhere; }

.facts { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 8px 18px; margin-bottom: 0; }
.facts dt { color: var(--wp-muted); font-weight: 400; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }

/* Status and notification language. Symbols make every state understandable without color. */
.status,
.badge {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: var(--wp-radius-full);
  background: #edf0f5;
  color: #475467;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.2px;
  vertical-align: middle;
}
.status::before, .badge::before { content: "○"; flex: 0 0 auto; font-size: 11px; line-height: 1; }
.status-neutral { background: #f2f4f7; color: #475467; }
.status-success, .badge.success { background: var(--wp-success-soft); color: var(--wp-success); }
.status-success::before, .badge.success::before { content: "✓"; }
.status-warning, .badge.attention { background: var(--wp-warning-soft); color: var(--wp-warning); }
.status-warning::before, .badge.attention::before { content: "!"; font-weight: 800; }
.status-danger, .badge.high, .badge.critical { background: var(--wp-danger-soft); color: var(--wp-danger); }
.status-danger::before, .badge.high::before, .badge.critical::before { content: "×"; font-weight: 800; }
.status-violet { background: var(--wp-violet); color: var(--wp-paper); }
.status-violet::before { content: "◆"; font-size: 8px; }
.badge.archived { background: #eaecf0; color: #344054; }
.badge.archived::before { content: "—"; }

.notice,
.archive-notice {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--wp-blue-bright);
  border-radius: var(--wp-radius);
  background: var(--wp-subtle);
}
.notice::before,
.archive-notice::before {
  content: "i";
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--wp-paper);
  color: var(--wp-blue);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
}
.notice > :not(.sr-only), .archive-notice > :not(.sr-only) { grid-column: 2; }
.notice > :first-child:not(.sr-only), .archive-notice > :first-child:not(.sr-only) { margin-top: 0; }
.notice strong { display: block; margin-bottom: 4px; font-size: 14px; line-height: 20px; }
.notice p, .archive-notice p { margin-bottom: 4px; }
.notice-info { border-color: var(--wp-blue-bright); background: var(--wp-subtle); }
.notice-warning { border-color: var(--wp-warning); background: var(--wp-warning-soft); }
.notice-warning::before { content: "!"; color: var(--wp-warning); }
.notice-danger { border-color: var(--wp-danger); background: var(--wp-danger-soft); }
.notice-danger::before { content: "×"; color: var(--wp-danger); }

/* Answers, agents, offers, operations, history */
.answer-list { display: flex; flex-direction: column; }
.answer-row {
  display: grid;
  min-height: 54px;
  grid-template-columns: minmax(180px, 300px) minmax(0, 420px);
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--wp-border);
}
.answer-row:last-child { border-bottom: 0; }
.answer-row > :first-child { color: var(--wp-muted); }
.answer-row > :last-child { overflow-wrap: anywhere; }

.agents-workspace {
  display: flex;
  grid-column: 1 / -1;
  min-width: 0;
  flex-direction: column;
  gap: 20px;
}
.agents-overview .panel-header { margin-bottom: 20px; }
.agents-overview .panel-header > div { max-width: 720px; }
.agent-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
}
.agent-stage {
  display: flex;
  min-width: 0;
  min-height: 286px;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  scroll-margin-top: 24px;
  border: 1px solid var(--wp-border);
  border-radius: var(--wp-radius-lg);
  background: var(--wp-paper);
}
.agent-stage-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.agent-stage-number {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--wp-blue);
  color: var(--wp-paper);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
}
.agent-stage h3 { margin-bottom: 6px; font-size: 22px; line-height: 30px; }
.agent-stage-result {
  display: flex;
  min-height: 88px;
  margin-top: auto;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  border-radius: var(--wp-radius-md);
  background: var(--wp-subtle);
  overflow-wrap: anywhere;
}
.agent-stage-result span { color: var(--wp-muted); font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.agent-stage-result strong { font-size: 14px; line-height: 21px; }
.agent-stage-time { margin-bottom: 0; font-size: 12px; line-height: 18px; }
.agent-flow-bridge {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: var(--wp-muted);
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}
.agent-flow-bridge strong { color: var(--wp-ink); }
.agent-flow-arrow { color: var(--wp-blue); font-size: 34px; font-weight: 400; line-height: 34px; }
.agent-history > .panel-header { margin: 4px 0 14px; }
.agent-history-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.agent-card { display: flex; min-height: 220px; flex-direction: column; gap: 12px; padding: 20px 22px; }
.agent-card .panel-header { margin-bottom: 0; }
.agent-card p { margin-bottom: 0; }
.agent-card pre { max-height: 260px; margin-bottom: 0; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.agent-run-timing { color: var(--wp-muted); font-size: 12px; line-height: 18px; }
.agent-assumptions ul { margin: 8px 0 0; padding-left: 20px; }
.agent-technical { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--wp-border); }
.agent-technical summary { color: var(--wp-blue); font-weight: 600; cursor: pointer; }
.agent-technical .facts { margin-top: 14px; font-size: 12px; }
.agent-empty { grid-column: 1 / -1; min-height: 120px; justify-content: center; }
.agent-context { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.agent-context > div:first-child { min-width: 0; }
.agent-context h3 { margin-bottom: 4px; }
.agent-context p:last-child { margin-bottom: 0; overflow-wrap: anywhere; }
.agent-context-action { display: flex; flex: 0 0 auto; align-items: flex-end; flex-direction: column; gap: 10px; }
.agent-context-action .button { white-space: nowrap; }

.offer-card { padding: 16px 20px 20px; overflow: hidden; }
.offer-table, .queue-table { width: 100%; }
.offer-versions { display: flex; flex-direction: column; gap: 14px; }
.offer-version {
  padding: 16px 0 2px;
  border-top: 1px solid var(--wp-border);
}
.offer-version:first-child { padding-top: 0; border-top: 0; }
.offer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
.offer-links > div {
  min-width: 0;
  padding: 14px;
  border-radius: var(--wp-radius-md);
  background: var(--wp-subtle);
}
.offer-links dt { margin-bottom: 5px; color: var(--wp-muted); font-size: 12px; font-weight: 600; line-height: 16px; text-transform: uppercase; }
.offer-links dd { margin: 0; overflow-wrap: anywhere; }
.proposal-actions form { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin: 0; }
.proposal-actions form button { width: 100%; overflow-wrap: anywhere; }
.proposal-actions .checkbox-label { max-width: none; }
.proposal-actions .notice { margin-top: 4px; }

.qualification-access .panel-header { margin-bottom: 18px; }
.access-stack { display: flex; flex-direction: column; gap: 16px; }
.access-link { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.access-link > .muted { font-size: 12px; font-weight: 600; line-height: 16px; text-transform: uppercase; }
.access-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-radius: var(--wp-radius-md);
  background: var(--wp-subtle);
}
.access-actions form { margin: 0; }
.access-test-form { display: flex; }
.access-customer-form { display: flex; align-items: center; gap: 14px; }
.access-customer-form .checkbox-label { max-width: none; }
.qualification-engagement { width: 100%; padding: 16px 20px; }
.qualification-engagement h3 { margin-bottom: 10px; }
.access-help { margin: 0; }
.delivery-status { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--wp-border); }
.delivery-status p { margin: 0; }

.effect-list { min-width: 720px; table-layout: fixed; }
.effect-list th:nth-child(1) { width: 28%; }
.effect-list th:nth-child(2) { width: 19%; }
.effect-list th:nth-child(3) { width: 10%; }
.effect-list th:nth-child(4) { width: 18%; }
.effect-list th:nth-child(5) { width: 25%; }
.effect-row td { padding-block: 14px; vertical-align: middle; }
.effect-row .actions { justify-content: flex-end; }
.effect-row .actions form,
.effect-row .actions button { width: 100%; }
.effect-code { display: block; margin-top: 4px; color: var(--wp-muted); font: 11px/16px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }

.timeline { position: relative; margin: 0; padding: 18px 0 0; list-style: none; }
.timeline::before { content: ""; position: absolute; top: 30px; bottom: 18px; left: 9px; width: 2px; background: var(--wp-border); }
.timeline > li { position: relative; min-height: 72px; padding: 0 0 24px 40px; }
.timeline > li::before {
  content: "✓";
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--wp-success-soft);
  color: var(--wp-success);
  font-size: 11px;
  font-weight: 800;
}
.timeline > li.current::before { content: "•"; background: var(--wp-blue); color: var(--wp-paper); font-size: 16px; }
.timeline > li.failed::before { content: "×"; background: var(--wp-danger-soft); color: var(--wp-danger); }
.timeline p { margin-bottom: 2px; }
.timeline dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 8px 0 0; }
.timeline dt { font-weight: 700; }
.timeline dd { margin: 0; overflow-wrap: anywhere; }

/* Forms and controls */
label { display: block; color: var(--wp-ink); font-size: 12px; font-weight: 600; line-height: 18px; }
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--wp-border-strong);
  border-radius: var(--wp-radius-md);
  background: var(--wp-paper);
  color: var(--wp-ink);
  line-height: 20px;
}
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #98a2b3; opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: #98a2b3; }
input:disabled, select:disabled, textarea:disabled { background: #f2f4f7; color: #98a2b3; cursor: not-allowed; }

.checkbox-label { display: flex; align-items: flex-start; gap: 8px; max-width: 34rem; font-size: 13px; font-weight: 500; line-height: 20px; }
.checkbox-label input, input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; margin: 1px 0 0; flex: 0 0 18px; accent-color: var(--wp-blue); }

button,
.button {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--wp-blue);
  border-radius: var(--wp-radius-md);
  background: var(--wp-blue);
  color: var(--wp-paper);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { border-color: #263eb8; background: #263eb8; color: var(--wp-paper); }
.button-secondary, button.secondary, .button.secondary {
  border-color: var(--wp-border-strong);
  background: var(--wp-paper);
  color: var(--wp-blue);
}
.button-secondary:hover, button.secondary:hover, .button.secondary:hover { border-color: var(--wp-blue); background: var(--wp-blue-soft); color: var(--wp-blue); }
.button-danger, button.danger, .button.danger { border-color: var(--wp-danger); background: var(--wp-danger); color: var(--wp-paper); }
.button-danger:hover, button.danger:hover, .button.danger:hover { border-color: #b42318; background: #b42318; }
button:disabled, .button[aria-disabled="true"] { border-color: #f2f4f7; background: #f2f4f7; color: #98a2b3; cursor: not-allowed; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack > * { margin-bottom: 0; }
.actions, .capability-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.actions form, .capability-actions form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.capability-actions .checkbox-label { max-width: 18rem; }

.filters-grid {
  display: grid;
  grid-template-columns: minmax(200px, 1.35fr) repeat(4, minmax(132px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}
.filter-card { padding: 18px 20px; }
.filter-actions { display: flex; gap: 10px; white-space: nowrap; }

.archive-notice { border-color: var(--wp-border-strong); background: var(--wp-subtle); }
.archive-notice::before { content: "—"; color: var(--wp-muted); }
.danger-zone { border-color: #fecdca; background: #fffbfa; }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-spacing: 0; border-collapse: collapse; font-size: 12px; line-height: 18px; }
caption { padding: 0 0 12px; color: var(--wp-ink); font-size: 14px; font-weight: 600; line-height: 20px; text-align: left; }
thead { background: var(--wp-subtle); color: var(--wp-muted); }
th { font-size: 11px; font-weight: 600; line-height: 16px; letter-spacing: 0.2px; text-transform: uppercase; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--wp-border); text-align: left; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(247, 249, 252, 0.65); }
td { color: var(--wp-ink); overflow-wrap: anywhere; }

/* Queue, login and generic status/error pages */
.queue-table table { min-width: 980px; }
.queue-table td:first-child { min-width: 180px; }

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 16px;
  background: linear-gradient(145deg, var(--wp-ink) 0 34%, var(--wp-canvas) 34% 100%);
}
.login-card { width: min(100%, 430px); padding: 28px; box-shadow: 0 18px 50px rgba(11, 16, 32, 0.13); }
.login-card .brand { margin-bottom: 22px; color: var(--wp-ink); }
.login-card button { width: 100%; }
.login { width: min(calc(100% - 32px), 430px); margin: 8vh auto; }

.muted { color: var(--wp-muted); }
.critical { color: var(--wp-danger); font-weight: 600; }
.warning { color: var(--wp-warning); font-weight: 600; }
.success { color: var(--wp-success); }
pre { margin: 0; padding: 14px; overflow-wrap: anywhere; white-space: pre-wrap; border: 1px solid var(--wp-border); border-radius: var(--wp-radius-md); background: var(--wp-subtle); font: 12px/18px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

@media (max-width: 1180px) {
  .workspace, .shell { padding-inline: 28px; }
  .case-body, .history-layout { grid-template-columns: minmax(0, 1.8fr) minmax(300px, 1fr); }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-actions { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  body { font-size: 14px; }
  h1 { font-size: 24px; line-height: 32px; letter-spacing: -0.3px; }
  h2 { font-size: 20px; line-height: 28px; }

  .app-bar, .topbar { min-height: 64px; gap: 12px; padding: 0 16px; }
  .brand { gap: 10px; }
  .brand-mark { width: 32px; height: 32px; flex-basis: 32px; border-radius: 10px; }
  .brand-wordmark { font-size: 21px; }
  .app-nav { display: none; }
  .app-account { gap: 8px; }
  .app-account .muted, .app-account form, .topbar form { display: none; }

  .workspace, .shell { padding: 28px 16px 32px; }
  .workspace-shell { gap: 16px; }

  .case-header { position: relative; min-height: 200px; margin-top: 48px; padding: 18px; gap: 14px; overflow: visible; }
  .case-header-top { min-height: 28px; }
  .case-header-top a { position: absolute; top: -48px; left: 0; display: inline-flex; height: 32px; align-items: center; }
  .case-header-top > [aria-hidden="true"] { display: none; }
  .case-header-main { display: block; }
  .case-header-main > :first-child { margin-top: 54px; }
  .case-header-main > .actions { position: absolute; top: 18px; right: 18px; max-width: 58%; justify-content: flex-end; }
  .case-meta { display: none; }

  .case-tabs { gap: 0; margin-inline: 0; }
  .case-tab { width: auto; min-width: max-content; padding: 0 18px; }
  .case-tab:first-child { padding-left: 18px; }

  .case-body, .history-layout { display: flex; width: 100%; flex-direction: column; gap: 14px; }
  .agents-workspace { width: 100%; gap: 14px; }
  .case-primary, .case-sidebar { width: 100%; gap: 14px; }

  .panel, .card, .filter-card, .login-card, .agent-card, .offer-card, .engagement-card,
  .case-sidebar > .panel, .case-sidebar > .card, .case-sidebar > .engagement-card { padding: 18px; border-radius: 18px; }
  .next-action { min-height: 170px; padding: 18px; }
  .next-action .button, .next-action button { margin-top: auto; }

  .summary-grid { grid-template-columns: 1fr; gap: 0; }
  .summary-item { display: grid; min-height: 68px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; gap: 12px; padding: 6px 0; }
  .summary-item dt, .summary-item dd { margin: 0; }
  .summary-item dd { text-align: right; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 10px; }

  .notice, .archive-notice { width: 100%; }
  .answer-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .agent-flow { grid-template-columns: 1fr; gap: 10px; }
  .agent-stage { min-height: 0; padding: 18px; }
  .agent-flow-bridge { min-height: 96px; }
  .agent-flow-arrow { transform: rotate(90deg); }
  .agent-history-list { grid-template-columns: 1fr; }
  .agent-context { align-items: stretch; flex-direction: column; }
  .agent-context-action { align-items: stretch; }
  .agent-context-action .button { width: 100%; white-space: normal; }
  .offer-links { grid-template-columns: 1fr; }
  .access-actions { align-items: stretch; padding: 14px; }
  .access-test-form, .access-test-form button { width: 100%; }
  .access-customer-form { align-items: stretch; flex-direction: column; gap: 12px; }
  .access-customer-form button { width: 100%; }
  .effect-list { min-width: 0; table-layout: auto; }
  .effect-row .actions { justify-content: flex-start; }

  .filters-grid { grid-template-columns: 1fr; }
  .filter-actions { grid-column: auto; }
  .filter-actions > * { flex: 1; }

  .actions, .capability-actions { align-items: stretch; }
  .actions > form, .capability-actions > form { width: 100%; }
  .actions > form > button, .capability-actions > form > button { width: 100%; }

  .table-wrap:not(.queue-table) table,
  .table-wrap:not(.queue-table) tbody,
  .table-wrap:not(.queue-table) tr,
  .table-wrap:not(.queue-table) td { display: block; width: 100%; }
  .table-wrap:not(.queue-table) thead { display: none; }
  .table-wrap:not(.queue-table) tr { padding: 10px 0; border-bottom: 1px solid var(--wp-border); }
  .table-wrap:not(.queue-table) td { display: grid; grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.2fr); gap: 12px; padding: 6px 0; border: 0; }
  .table-wrap:not(.queue-table) td::before { content: attr(data-label); color: var(--wp-muted); font-weight: 600; }

  .queue-table table { min-width: 760px; }
  .login-shell { background: var(--wp-canvas); }
  .login-card { padding: 24px 20px; }
}

@media (prefers-reduced-motion: no-preference) {
  a, button, .button, input, select, textarea { transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease; }
}

@media (prefers-contrast: more) {
  :root { --wp-border: #aab3c1; --wp-border-strong: #667085; }
  .status, .badge { border: 1px solid currentColor; }
}
