/* BaitOps Console stylesheet. Extracted from the original dashboard and evolved into the product shell. */
:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --panel: #ffffff;
  --ink: #17202c;
  --muted: #617080;
  --line: #d8e0e7;
  --blue: #1e63d6;
  --blue-dark: #174ea8;
  --teal: #167761;
  --amber: #9a5b00;
  --red: #b42318;
  --steel: #30445c;
  --shadow: 0 1px 2px rgba(23, 32, 44, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}
header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  padding: 0 24px;
}
.brand {
  display: grid;
  gap: 4px;
  min-width: 220px;
}
.brand h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1;
  font-weight: 760;
}
.brand span {
  color: var(--muted);
  font-size: 13px;
}
nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
button, input, select, textarea {
  font: inherit;
  letter-spacing: 0;
}
.tab, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  cursor: pointer;
}
.tab.active, .button.primary {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
}
.operator-key {
  width: 150px;
  min-height: 36px;
  padding: 0 10px;
}
.auth-username {
  width: 132px;
}
.button.primary:hover { background: var(--blue-dark); }
.button:disabled {
  cursor: wait;
  opacity: 0.62;
}
main {
  padding: 20px 24px 32px;
  max-width: 1440px;
  margin: 0 auto;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 16px;
}
.client-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 12px;
}
.client-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.client-title h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}
.client-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}
.status-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: #ffffff;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  display: inline-block;
}
.view { display: none; }
.view.active { display: block; }
.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.metric, .panel, .decoy-item, .intel-card, .playbook-card, .phase-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.metric {
  padding: 14px;
  min-height: 82px;
}
.metric .label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
}
.metric .value {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 740;
  margin-top: 8px;
}
.metric .hint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  margin-bottom: 16px;
}
.coverage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.coverage-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}
.coverage-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}
.coverage-item span {
  color: var(--muted);
  font-size: 12px;
}
.action-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.action-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fbfa;
  font-size: 13px;
  color: var(--steel);
}
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 16px;
}
/* Utilidad: reemplaza style="margin-top:16px" inline para poder quitar
   'unsafe-inline' de la CSP (style-src). */
.mt-16 {
  margin-top: 16px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.panel {
  overflow: hidden;
}
.view > .panel + .panel {
  margin-top: 16px;
}
.panel-header {
  min-height: 48px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 720;
}
.panel-body {
  padding: 14px;
}
.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.sensor-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.32fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.sensor-inventory {
  min-width: 0;
}
.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sensor-actions {
  margin-top: 8px;
}
.row-actions .button {
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  text-transform: uppercase;
  white-space: nowrap;
}
tr:last-child td { border-bottom: 0; }
.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}
.intel-grid, .playbook-grid, .phase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.intel-grid.single {
  grid-template-columns: 1fr;
}
.integration-targets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.integration-target {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}
.integration-target span,
.integration-target code {
  color: var(--muted);
  font-size: 12px;
}
.report-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 16px;
  margin-bottom: 14px;
}
.report-hero h3 {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.25;
}
.report-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 760px;
}
.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.report-card {
  display: grid;
  gap: 7px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}
.report-card span,
.report-card small {
  color: var(--muted);
  font-size: 12px;
}
.report-card strong {
  font-size: 22px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.report-card.compact {
  min-height: 82px;
}
.ops-command {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(360px, 0.7fr);
  gap: 16px;
  align-items: start;
}
.posture-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfe;
  margin-bottom: 14px;
}
.posture-hero span,
.posture-hero small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.posture-hero strong {
  display: block;
  margin: 4px 0;
  font-size: 34px;
  line-height: 1;
}
.control-grid,
.health-grid,
.ops-mini-grid {
  display: grid;
  gap: 10px;
}
.control-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.health-grid,
.ops-mini-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.control-card,
.health-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  display: grid;
  gap: 7px;
  min-height: 104px;
}
.control-card.pass,
.health-card.pass,
.health-card.operational {
  border-color: var(--success);
}
.control-card.warning,
.health-card.warning {
  border-color: var(--warning);
}
.control-card.gap,
.health-card.gap,
.health-card.degraded {
  border-color: var(--danger);
}
.health-card span,
.health-card small {
  color: var(--muted);
  font-size: 12px;
}
.health-card strong {
  font-size: 18px;
  line-height: 1.15;
  text-transform: capitalize;
}
.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: #fbfcfe;
}
.case-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.case-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}
.case-stat strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}
.case-stat span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}
.case-controls {
  display: grid;
  grid-template-columns: 130px minmax(130px, 0.7fr) minmax(180px, 1fr);
  gap: 8px;
  align-items: end;
}
.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.step-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
  display: grid;
  gap: 9px;
  min-height: 168px;
}
.command-row {
  display: grid;
  gap: 8px;
}
.command-block {
  min-height: 0;
  max-height: 150px;
  background: #0f1720;
  color: #d8e3ef;
  border-radius: 6px;
  padding: 10px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.check-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.check-item {
  border: 1px solid var(--line);
  background: #f7faff;
  padding: 10px;
  border-radius: 6px;
  min-height: 86px;
}
.intel-card, .playbook-card, .phase-card {
  padding: 14px;
  display: grid;
  gap: 9px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}
.card-head strong {
  overflow-wrap: anywhere;
}
.card-line {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.decoy-list {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
}
.decoy-menu {
  display: grid;
  gap: 8px;
  align-content: start;
}
.decoy-item {
  width: 100%;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  border-color: var(--line);
}
.decoy-item.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.12);
}
.decoy-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 720;
  margin-bottom: 5px;
}
.decoy-route {
  color: var(--muted);
  overflow-wrap: anywhere;
}
pre {
  margin: 0;
  background: #0f1720;
  color: #d8e3ef;
  border-radius: 8px;
  padding: 14px;
  min-height: 360px;
  max-height: 560px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
form {
  display: grid;
  gap: 12px;
}
label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  text-transform: uppercase;
}
input, select, textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--ink);
  resize: vertical;
}
textarea {
  min-height: 116px;
  text-transform: none;
  font-weight: 500;
  color: var(--ink);
}
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.result {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  color: var(--muted);
  background: #fbfcfe;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  background: #edf4ff;
  color: #0b4eb3;
  white-space: nowrap;
}
.badge.sim, .badge.low { background: #e9f8f0; color: #146044; }
.badge.warn, .badge.medium, .badge.guarded, .badge.elevated { background: #fff4dc; color: var(--amber); }
.badge.err, .badge.offline { background: #fff0ee; color: var(--red); }
.badge.high, .badge.critical { background: #fff0ee; color: var(--red); }
.badge.degraded { background: #fff4dc; color: var(--amber); }
.badge.quiet { background: #edf4ff; color: #0b4eb3; }
.event-table {
  max-height: 620px;
  overflow: auto;
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
}
.table-scroll table {
  min-width: 900px;
}

.sensor-inventory .table-scroll {
  border-radius: 8px;
}

.sensor-inventory th:last-child,
.sensor-inventory td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 220px;
  background: #ffffff;
  box-shadow: -10px 0 18px rgba(21,21,26,0.06);
}

.sensor-inventory th:last-child {
  z-index: 3;
  background: #fbfcfe;
}
hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  margin: 4px 0;
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover { text-decoration: underline; }
@media (max-width: 980px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 14px 16px; }
  nav { justify-content: flex-start; }
  main { padding: 16px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace, .ops-grid, .coverage-grid, .grid-2, .grid-3, .section-grid, .sensor-layout, .decoy-list, .intel-grid, .playbook-grid, .phase-grid, .integration-targets, .report-grid, .case-stats, .case-controls, .tutorial-grid, .check-grid, .ops-command, .control-grid, .health-grid, .ops-mini-grid { grid-template-columns: 1fr; }
  .report-hero { align-items: flex-start; flex-direction: column; }
}

/* BaitOps enterprise shell */
:root {
  --brand-purple: #6d35b8;
  --brand-purple-dark: #4d2489;
  --app-bg: #f5f6f8;
  --surface: #ffffff;
  --graphite: #15151a;
  --line: #d9dde5;
  --success: #147d64;
  --warning: #b7791f;
  --danger: #c2410c;
  --bg: var(--app-bg);
  --panel: var(--surface);
  --ink: var(--graphite);
  --blue: var(--brand-purple);
  --blue-dark: var(--brand-purple-dark);
  --teal: var(--success);
  --amber: var(--warning);
  --red: var(--danger);
  --shadow: 0 1px 2px rgba(21, 21, 26, 0.08), 0 12px 32px rgba(21, 21, 26, 0.06);
}

body {
  background: var(--app-bg);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #111116;
  color: #f5f6f8;
  border-right: 1px solid #252532;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand-lockup {
  display: grid;
  gap: 10px;
  margin: 12px;
  padding: 12px;
  background: #f5f6f8;
  color: var(--graphite);
  border: 1px solid #2b2535;
  border-radius: 8px;
}

.brand-logo {
  width: 100%;
  max-width: 214px;
  height: 78px;
  object-fit: contain;
  object-position: left center;
  display: block;
}

.brand-lockup h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand-lockup span {
  display: block;
  margin-top: 4px;
  color: #4d5868;
  font-size: 11px;
  line-height: 1.35;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 12px 10px;
  overflow-y: auto;
}

.side-nav .tab {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  background: transparent;
  border-color: transparent;
  color: #c8cfda;
  border-radius: 6px;
  min-height: 38px;
}

.side-nav .tab:hover {
  background: rgba(109, 53, 184, 0.18);
  color: #ffffff;
}

.side-nav .tab.active {
  background: var(--brand-purple);
  color: #ffffff;
  border-color: var(--brand-purple);
}

.app-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  min-height: 66px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 0 22px;
}

.topbar .brand {
  min-width: 0;
}

.topbar .brand h1 {
  color: var(--graphite);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hidden {
  display: none !important;
}

.content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 22px;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.status-row {
  gap: 8px;
}

.client-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.client-title {
  min-width: 220px;
}

.client-meta {
  justify-content: flex-end;
  gap: 10px;
}

.client-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfe;
}

.client-card,
.panel,
.metric,
.decoy-item,
.intel-card,
.playbook-card,
.phase-card {
  border-radius: 8px;
}

.empty-state {
  min-height: 140px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fafbfc;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
}

.status-tag,
.severity-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.detail-drawer {
  border: 1px solid var(--line);
  border-block: 0;
  border-inline-end: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .brand-logo {
    max-width: 180px;
    height: 64px;
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
  }

  .side-nav .tab {
    width: auto;
    white-space: nowrap;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .toolbar {
    justify-content: flex-start;
  }

  .content {
    padding: 16px;
  }

  .client-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .client-meta {
    justify-content: flex-start;
  }
}

/* C-Vault-inspired interaction polish for the BaitOps product shell */
:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-raised: 0 16px 42px rgba(21, 21, 26, 0.12);
  --sidebar-bg: #111116;
  --sidebar-bg-2: #0b0b10;
}

body {
  overflow-x: hidden;
}

.app-shell {
  transition: grid-template-columns 0.2s var(--ease-out);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(109, 53, 184, 0.18), transparent 28%),
    linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.04);
  transition: transform 0.22s var(--ease-out), background 0.16s var(--ease-out);
}

.brand-lockup {
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  background: rgba(255,255,255,0.035);
  color: #f7f5fb;
  border-color: rgba(154, 108, 224, 0.28);
  box-shadow: 0 12px 30px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}

.brand-lockup::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(151, 95, 235, 0.9), transparent);
  pointer-events: none;
}

.brand-mark-frame {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(151, 95, 235, 0.42);
  border-radius: 8px;
  background: #08080c;
  box-shadow: 0 0 0 3px rgba(109,53,184,0.12), 0 12px 24px rgba(0,0,0,0.28);
}

.brand-logo.brand-mark {
  width: 96px;
  max-width: none;
  height: 54px;
  object-fit: cover;
  object-position: left center;
  transform: scale(1.25);
  transform-origin: left center;
  filter: saturate(1.08) contrast(1.12);
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1 {
  color: #ffffff;
}

.brand-copy span {
  color: #b7afc8;
  font-size: 10px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--graphite);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  line-height: 1;
  transition: transform 0.12s var(--ease-out), box-shadow 0.15s var(--ease-out), border-color 0.15s var(--ease-out), background 0.15s var(--ease-out);
}

.icon-button:hover {
  border-color: rgba(109, 53, 184, 0.36);
  box-shadow: 0 8px 20px rgba(109, 53, 184, 0.14);
  transform: translateY(-1px);
}

.icon-button:active,
.button:active,
.tab:active {
  transform: scale(0.97);
}

.sidebar-close {
  display: none;
  background: rgba(255,255,255,0.06);
  color: #f7f5fb;
  border-color: rgba(255,255,255,0.14);
}

.nav-section {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px 4px;
  color: #787187;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.nav-section::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(151,95,235,0.36), transparent);
}

.side-nav .tab {
  gap: 10px;
  position: relative;
  min-height: 40px;
  border-radius: 0 7px 7px 0;
  margin-right: 6px;
  transition: transform 0.16s var(--ease-spring), background 0.16s var(--ease-out), color 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out);
}

.side-nav .tab::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
  transition: background 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out);
}

.side-nav .tab:hover {
  background: rgba(255,255,255,0.055);
  transform: translateX(2px);
}

.side-nav .tab.active {
  background: linear-gradient(90deg, rgba(109, 53, 184, 0.95), rgba(109, 53, 184, 0.42));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 10px 24px rgba(109, 53, 184, 0.18);
}

.side-nav .tab.active::before {
  background: #c7a8ff;
  box-shadow: 0 0 12px rgba(199,168,255,0.8);
}

.tab-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  color: #e9ddff;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0;
  transition: transform 0.2s var(--ease-spring), background 0.16s var(--ease-out);
}

.side-nav .tab:hover .tab-icon {
  transform: translateX(1px);
  background: rgba(151,95,235,0.22);
}

.tab-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  min-width: 22px;
  min-height: 19px;
  padding: 2px 6px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: #f7f5fb;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.10);
  font-size: 11px;
  font-weight: 800;
}

.nav-badge.danger:not(:empty) {
  background: rgba(194,65,12,0.24);
  border-color: rgba(194,65,12,0.36);
  color: #ffd8cb;
}

.nav-badge:empty,
.nav-badge.is-empty {
  display: none;
}

.side-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: grid;
  gap: 8px;
  color: #b7afc8;
  font-size: 12px;
}

.api-r {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.api-r span:last-child,
.side-footline {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dot.ok {
  box-shadow: 0 0 0 0 rgba(20,125,100,0.5);
  animation: dotPulse 2s infinite;
}

@keyframes dotPulse {
  0% { box-shadow: 0 0 0 0 rgba(20,125,100,0.45); }
  70% { box-shadow: 0 0 0 7px rgba(20,125,100,0); }
  100% { box-shadow: 0 0 0 0 rgba(20,125,100,0); }
}

.side-mini {
  min-height: 30px;
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  color: #f7f5fb;
  border-color: rgba(255,255,255,0.12);
}

.app-shell.sidebar-collapsed .brand-lockup {
  grid-template-columns: 1fr;
  justify-items: center;
  margin: 10px;
  padding: 9px;
}

.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .nav-section,
.app-shell.sidebar-collapsed .tab-label,
.app-shell.sidebar-collapsed .nav-badge,
.app-shell.sidebar-collapsed .side-footline,
.app-shell.sidebar-collapsed .side-mini {
  display: none;
}

.app-shell.sidebar-collapsed .side-nav {
  padding-inline: 8px;
}

.app-shell.sidebar-collapsed .side-nav .tab {
  justify-content: center;
  margin-right: 0;
  border-radius: 7px;
  padding: 0;
}

.app-shell.sidebar-collapsed .side-nav .tab::before {
  left: -8px;
}

.app-shell.sidebar-collapsed .api-r {
  justify-content: center;
}

.app-shell.sidebar-collapsed .api-r span:last-child {
  display: none;
}

.topbar {
  box-shadow: 0 1px 0 rgba(21,21,26,0.03), 0 10px 24px rgba(21,21,26,0.06);
}

.topbar-left {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.view-search {
  width: min(270px, 30vw);
  display: grid;
  gap: 4px;
  text-transform: none;
  font-weight: 650;
  color: var(--muted);
}

.view-search span {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.view-search input {
  min-height: 34px;
  border-radius: 999px;
  padding-inline: 14px;
  background: #fbfcfe;
}

.quick-menu {
  position: relative;
}

.quick-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  min-width: 220px;
  display: none;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-raised);
}

.quick-menu-panel.open {
  display: grid;
}

.quick-menu-panel button,
.quick-menu-panel a {
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.quick-menu-panel button:hover,
.quick-menu-panel a:hover {
  background: #f4effc;
  color: var(--brand-purple-dark);
}

.button,
.metric,
.panel,
.intel-card,
.playbook-card,
.phase-card,
.decoy-item,
.report-card,
.control-card,
.health-card,
.case-stat,
.check-item,
.step-card,
.integration-target {
  transition: transform 0.16s var(--ease-out), box-shadow 0.18s var(--ease-out), border-color 0.18s var(--ease-out), background 0.18s var(--ease-out);
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(21,21,26,0.08);
  border-color: rgba(109,53,184,0.28);
}

.button.primary {
  background: linear-gradient(180deg, #7a43c9, var(--brand-purple));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 8px 22px rgba(109,53,184,0.18);
}

.button.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #8752d5, #5e2da1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 12px 28px rgba(109,53,184,0.24);
}

.button.loading::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.metric:hover,
.panel:hover,
.intel-card:hover,
.playbook-card:hover,
.phase-card:hover,
.decoy-item:hover,
.report-card:hover,
.control-card:hover,
.health-card:hover,
.case-stat:hover,
.check-item:hover,
.step-card:hover,
.integration-target:hover {
  border-color: rgba(109,53,184,0.24);
  box-shadow: var(--shadow-raised);
}

.metric:hover,
.intel-card:hover,
.playbook-card:hover,
.phase-card:hover,
.decoy-item:hover,
.report-card:hover,
.control-card:hover,
.health-card:hover,
.case-stat:hover,
.check-item:hover,
.step-card:hover,
.integration-target:hover {
  transform: translateY(-1px);
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fbfcfe;
}

tbody tr {
  transition: background 0.14s var(--ease-out);
}

tbody tr:hover {
  background: #faf7ff;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(109,53,184,0.5);
  box-shadow: 0 0 0 3px rgba(109,53,184,0.10);
}

.is-filtered-out {
  display: none !important;
}

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9000;
  display: grid;
  gap: 6px;
  pointer-events: none;
}

.toast {
  max-width: min(340px, calc(100vw - 32px));
  border: 1px solid rgba(21,21,26,0.12);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow-raised);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
  animation: toastIn 0.18s var(--ease-out);
}

.toast.ok { border-color: var(--success); }
.toast.warn { border-color: var(--warning); }
.toast.err { border-color: var(--danger); }

@keyframes toastIn {
  from { opacity: 0; transform: translate(8px, 8px) scale(0.98); }
  to { opacity: 1; transform: translate(0, 0) scale(1); }
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 8500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s var(--ease-out);
}

.confirm-modal.on {
  opacity: 1;
  pointer-events: auto;
}

.cm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8,8,12,0.55);
  backdrop-filter: blur(5px) saturate(130%);
}

.cm-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(440px, calc(100vw - 32px));
  transform: translate(-50%, -48%);
  border: 1px solid rgba(109,53,184,0.28);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(21,21,26,0.28);
  padding: 20px;
  display: grid;
  gap: 12px;
}

.confirm-modal.on .cm-card {
  transform: translate(-50%, -50%);
}

.confirm-modal.danger .cm-card {
  border-color: rgba(194,65,12,0.42);
  box-shadow: 0 30px 90px rgba(194,65,12,0.18);
}

.cm-close {
  position: absolute;
  top: 10px;
  right: 10px;
}

.cm-title {
  padding-right: 42px;
  font-size: 17px;
  font-weight: 760;
}

.cm-body {
  color: var(--muted);
  line-height: 1.55;
}

.cm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(8,8,12,0.52);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s var(--ease-out);
}

@media (max-width: 980px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 60;
    left: 0;
    top: 0;
    width: min(310px, 88vw);
    height: 100vh;
    transform: translateX(-104%);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-close {
    display: inline-grid;
  }

  .topbar-left {
    width: 100%;
  }

  .toolbar {
    width: 100%;
  }

  .view-search {
    width: 100%;
  }

  .quick-menu {
    width: 100%;
  }

  .quick-menu > .button {
    width: 100%;
  }

  .quick-menu-panel {
    left: 0;
    right: auto;
    width: min(100%, 320px);
  }

  .auth-controls {
    width: 100%;
  }

  .auth-controls .button,
  .auth-controls input {
    flex: 1 1 140px;
  }
}

/* Refinement pass: calmer palette, full logo, clearer click targets */
:root {
  --brand-purple: #6840ad;
  --brand-purple-dark: #4c2f82;
  --brand-purple-soft: #eee8f7;
  --app-bg: #f4f6f8;
  --surface: #ffffff;
  --graphite: #18191f;
  --muted: #637083;
  --line: #dfe4ec;
  --success: #167761;
  --warning: #a36218;
  --danger: #b9471b;
  --sidebar-bg: #111217;
  --sidebar-bg-2: #0d0e13;
  --shadow: 0 1px 2px rgba(24, 25, 31, 0.06), 0 12px 28px rgba(24, 25, 31, 0.05);
  --shadow-raised: 0 14px 34px rgba(24, 25, 31, 0.11);
}

.app-shell {
  grid-template-columns: 280px minmax(0, 1fr);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 74px minmax(0, 1fr);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(104,64,173,0.16), transparent 24%),
    linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
}

.brand-lockup {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 90px;
  padding: 9px;
  background: linear-gradient(180deg, #e9eaed, #d7d8dd);
  border-color: rgba(177,151,220,0.34);
  overflow: visible;
}

.brand-logo-wrap {
  min-width: 0;
  display: grid;
  align-items: center;
}

.brand-logo.brand-full {
  width: 100%;
  max-width: 242px;
  height: 70px;
  object-fit: contain;
  object-position: left center;
  display: block;
  filter: saturate(1.03) contrast(1.08);
}

.brand-mark-frame,
.brand-copy {
  display: none;
}

.brand-mini {
  display: none !important;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(177,151,220,0.35);
  border-radius: 8px;
  place-items: center;
  color: #efe7ff;
  background: rgba(104,64,173,0.14);
  font-weight: 850;
  letter-spacing: 0;
}

.app-shell.sidebar-collapsed .brand-lockup {
  min-height: 66px;
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 10px;
}

.app-shell.sidebar-collapsed .brand-logo-wrap {
  display: none;
}

.app-shell.sidebar-collapsed .brand-mini {
  display: grid !important;
}

.nav-section {
  color: #8f879c;
  padding: 8px 8px 3px;
}

.side-nav .tab {
  cursor: pointer;
  color: #c9ced8;
  border-radius: 8px;
  margin: 1px 8px;
  padding: 0 10px;
  min-height: 34px;
}

.side-footer {
  padding: 9px 12px;
  gap: 5px;
}

.side-nav .tab::before {
  left: -8px;
}

.side-nav .tab:hover {
  background: rgba(255,255,255,0.07);
  color: #ffffff;
}

.side-nav .tab.active {
  background: linear-gradient(90deg, rgba(104,64,173,0.92), rgba(104,64,173,0.46));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 8px 22px rgba(104,64,173,0.18);
}

.tab-icon {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.045);
  color: #d9c7fb;
  font-size: 17px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.side-nav .tab.active .tab-icon {
  background: rgba(255,255,255,0.16);
  color: #ffffff;
  border-color: rgba(255,255,255,0.18);
}

.app-shell.sidebar-collapsed .side-nav .tab {
  margin: 3px 8px;
}

.app-shell.sidebar-collapsed .tab-icon {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  font-size: 19px;
}

.button,
.quick-menu-panel button,
.quick-menu-panel a,
.decoy-item,
.tab,
.icon-button {
  cursor: pointer;
}

.panel,
.metric,
.intel-card,
.playbook-card,
.phase-card,
.report-card,
.control-card,
.health-card,
.case-stat,
.check-item,
.step-card,
.integration-target {
  cursor: default;
}

.panel:hover,
.metric:hover,
.intel-card:hover,
.playbook-card:hover,
.phase-card:hover,
.report-card:hover,
.control-card:hover,
.health-card:hover,
.case-stat:hover,
.check-item:hover,
.step-card:hover,
.integration-target:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.decoy-item:hover,
.button:hover:not(:disabled),
.icon-button:hover,
.quick-menu-panel button:hover,
.quick-menu-panel a:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-raised);
}

.button {
  border-radius: 8px;
  font-weight: 700;
}

.button.primary {
  background: linear-gradient(180deg, #7650bb, var(--brand-purple));
  border-color: #5d389c;
}

.button.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #815cc7, var(--brand-purple-dark));
}

.quick-menu-panel {
  border-color: rgba(104,64,173,0.18);
}

.quick-menu-panel button:hover,
.quick-menu-panel a:hover {
  background: var(--brand-purple-soft);
  color: var(--brand-purple-dark);
}

.view.active {
  animation: baitopsViewIn 0.18s var(--ease-out);
}

@keyframes baitopsViewIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.badge {
  box-shadow: inset 0 0 0 1px rgba(24,25,31,0.03);
}

.badge.quiet,
.badge.sim,
.badge.low {
  background: #eaf7f3;
  color: #12614e;
}

.badge.warn,
.badge.medium,
.badge.guarded,
.badge.elevated,
.badge.degraded {
  background: #fff4e2;
  color: #8e5010;
}

.badge.err,
.badge.offline,
.badge.high,
.badge.critical {
  background: #fff0eb;
  color: #a33816;
}

@media (max-width: 980px) {
  .brand-lockup {
    min-height: 106px;
  }

  .brand-logo.brand-full {
    max-width: 230px;
    height: 84px;
  }

  .side-nav {
    display: grid;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .side-nav .tab {
    width: auto;
    white-space: normal;
  }

  .sidebar-close {
    display: inline-grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Impeccable product UX pass: analyst orientation, restrained color, clearer affordances */
:root {
  --bg: oklch(0.965 0.006 280);
  --panel: oklch(0.991 0.004 280);
  --app-bg: oklch(0.965 0.006 280);
  --surface: oklch(0.991 0.004 280);
  --ink: oklch(0.22 0.018 275);
  --graphite: oklch(0.22 0.018 275);
  --muted: oklch(0.49 0.026 265);
  --line: oklch(0.89 0.012 265);
  --brand-purple: oklch(0.47 0.16 300);
  --brand-purple-dark: oklch(0.37 0.14 300);
  --brand-purple-soft: oklch(0.94 0.025 300);
  --success: oklch(0.49 0.105 172);
  --warning: oklch(0.57 0.116 72);
  --danger: oklch(0.54 0.142 45);
  --sidebar-bg: oklch(0.19 0.018 285);
  --sidebar-bg-2: oklch(0.15 0.018 285);
  --focus-ring: oklch(0.72 0.11 300 / 0.28);
  --shadow: 0 1px 2px oklch(0.2 0.018 275 / 0.06), 0 14px 32px oklch(0.2 0.018 275 / 0.055);
  --shadow-raised: 0 16px 38px oklch(0.2 0.018 275 / 0.12);
}

body {
  background: var(--app-bg);
  color: var(--ink);
}

.skip-link {
  position: fixed;
  left: 14px;
  top: 12px;
  z-index: 10000;
  transform: translateY(-140%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-raised);
  padding: 9px 12px;
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

header,
.topbar {
  background: color-mix(in oklch, var(--surface), var(--app-bg) 18%);
}

.content {
  padding-top: 18px;
}

.brand-lockup {
  background: color-mix(in oklch, var(--sidebar-bg), var(--surface) 5%);
  border-color: oklch(0.54 0.11 300 / 0.32);
  box-shadow: inset 0 1px 0 oklch(0.96 0.01 280 / 0.06);
}

.brand-lockup::after {
  opacity: 0.46;
}

.brand-logo-wrap {
  min-height: 78px;
  padding: 5px;
  border-radius: 8px;
  background: oklch(0.77 0.004 280 / 0.28);
}

.brand-logo.brand-full {
  max-width: 100%;
  height: 78px;
  object-fit: contain;
  object-position: center;
  filter: saturate(1.04) contrast(1.06);
}

.topbar {
  min-height: 66px;
}

.brand h1 {
  font-size: 20px;
  letter-spacing: 0;
}

.brand span {
  max-width: 58ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.view-intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, oklch(0.995 0.004 280), oklch(0.976 0.007 280));
  box-shadow: var(--shadow);
}

.view-intro h2 {
  margin: 3px 0 4px;
  font-size: 21px;
  line-height: 1.18;
  font-weight: 780;
}

.view-intro p {
  margin: 0;
  max-width: 72ch;
  color: var(--muted);
  line-height: 1.45;
}

.eyebrow,
.quick-menu-label {
  color: var(--brand-purple-dark);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.view-intro-actions {
  display: inline-flex;
  gap: 8px;
  flex: 0 0 auto;
}

.empty-card {
  border-style: dashed;
}

.simulation-section {
  margin: 16px 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 760;
}

.simulation-grid {
  align-items: stretch;
}

.simulation-grid > .panel {
  min-width: 0;
}

.analyst-flow {
  margin-bottom: 16px;
}

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

.workflow-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s var(--ease-out), border-color 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out), background 0.16s var(--ease-out);
}

.workflow-step:hover {
  transform: translateY(-1px);
  border-color: oklch(0.58 0.12 300 / 0.42);
  box-shadow: var(--shadow-raised);
  background: color-mix(in oklch, var(--surface), var(--brand-purple-soft) 24%);
}

.workflow-step:focus-visible,
.button:focus-visible,
.icon-button:focus-visible,
.tab:focus-visible,
.quick-menu-panel a:focus-visible,
.quick-menu-panel button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.workflow-number {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: oklch(0.965 0.01 280);
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.workflow-step strong {
  display: block;
  font-size: 13px;
}

.workflow-step small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.workflow-step.ready .workflow-number {
  background: oklch(0.94 0.036 170);
  color: oklch(0.38 0.09 170);
  border-color: oklch(0.76 0.07 170);
}

.workflow-step.attention .workflow-number {
  background: oklch(0.94 0.055 55);
  color: oklch(0.47 0.11 55);
  border-color: oklch(0.78 0.09 55);
}

.workflow-step.todo .workflow-number {
  background: var(--brand-purple-soft);
  color: var(--brand-purple-dark);
  border-color: oklch(0.77 0.06 300);
}

.quick-menu-panel {
  min-width: 238px;
  gap: 2px;
}

.quick-menu-label {
  padding: 7px 9px 4px;
  color: var(--muted);
}

.quick-menu-panel button,
.quick-menu-panel a {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quick-menu-panel button::after,
.quick-menu-panel a::after {
  content: "›";
  color: color-mix(in oklch, var(--muted), var(--brand-purple) 24%);
  font-size: 16px;
}

.action-list {
  gap: 7px;
}

.action-list li {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px 9px 32px;
  background: color-mix(in oklch, var(--surface), var(--success) 5%);
  color: var(--ink);
}

.action-list li::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 15px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
}

.toast {
  border-width: 1px;
  border-color: var(--line);
  background: var(--surface);
}

.toast.ok {
  border-color: oklch(0.77 0.07 170);
  background: oklch(0.96 0.026 170);
}

.toast.warn {
  border-color: oklch(0.78 0.09 55);
  background: oklch(0.97 0.04 72);
}

.toast.err {
  border-color: oklch(0.76 0.09 45);
  background: oklch(0.97 0.035 45);
}

.result {
  word-break: break-word;
}

@media (max-width: 1200px) {
  .workflow-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body,
  .app-main,
  .content,
  .topbar,
  .toolbar,
  .workspace,
  .client-card,
  .view-intro,
  .panel {
    max-width: 100%;
  }

  .content {
    overflow-x: hidden;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .view-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .view-intro-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workflow-grid {
    grid-template-columns: 1fr;
  }

  .client-meta,
  .status-row {
    width: 100%;
  }

  .status-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .pill {
    max-width: 100%;
    min-width: 0;
  }

  .client-meta span,
  .status-row .pill {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .pill > * {
    min-width: 0;
  }

  .status-row .mono {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  .button {
    max-width: 100%;
  }

  .quick-menu > .button,
  .view-intro-actions .button,
  #refreshButton {
    width: 100%;
  }

  .auth-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .brand span {
    white-space: normal;
  }
}

/* Client presentation readiness pass */
.client-switcher,
.audience-switcher {
  width: min(250px, 24vw);
  display: grid;
  gap: 4px;
  text-transform: none;
  font-weight: 650;
  color: var(--muted);
}

.client-switcher span,
.audience-switcher span {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.client-switcher select,
.audience-switcher select {
  min-height: 34px;
  border-radius: 999px;
  padding-inline: 14px 34px;
  background: var(--surface);
  font-weight: 700;
}

.service-brief {
  margin-bottom: 16px;
  border-color: color-mix(in oklch, var(--line), var(--brand-purple) 16%);
}

.service-brief .panel-body {
  display: grid;
  gap: 12px;
}

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

.brief-card {
  min-height: 96px;
  display: grid;
  gap: 5px;
  align-content: start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in oklch, var(--surface), white 10%), color-mix(in oklch, var(--surface), var(--app-bg) 30%));
}

.brief-card span,
.brief-card small {
  color: var(--muted);
  font-size: 12px;
}

.brief-card span {
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 820;
  letter-spacing: 0.08em;
}

.brief-card strong {
  font-size: 27px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.brief-narrative {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 62px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in oklch, var(--surface), var(--brand-purple-soft) 18%);
  color: var(--muted);
  line-height: 1.5;
}

.brief-narrative strong {
  color: var(--ink);
}

.brief-narrative .button {
  flex: 0 0 auto;
}

.panel-header h2 {
  letter-spacing: 0;
}

.client-card {
  border-color: color-mix(in oklch, var(--line), var(--brand-purple) 12%);
}

.metrics .metric:first-child {
  border-color: color-mix(in oklch, var(--brand-purple), var(--line) 58%);
  background: color-mix(in oklch, var(--surface), var(--brand-purple-soft) 24%);
}

.empty-card,
.empty-state {
  background:
    linear-gradient(180deg, color-mix(in oklch, var(--surface), var(--app-bg) 22%), var(--surface));
}

@media (max-width: 1180px) {
  .client-switcher,
  .audience-switcher,
  .view-search {
    width: min(230px, 38vw);
  }

  .brief-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .client-switcher,
  .audience-switcher {
    width: 100%;
  }

  .brief-grid {
    grid-template-columns: 1fr;
  }

  .brief-narrative {
    align-items: stretch;
    flex-direction: column;
  }

  .brief-narrative .button {
    width: 100%;
  }
}

/* Cleaner client console pass */
:root {
  --app-bg: #f6f7f9;
  --surface: #ffffff;
  --panel: #ffffff;
  --ink: #1c2430;
  --graphite: #1c2430;
  --muted: #687386;
  --line: #e2e7ee;
  --brand-purple: #5f3ca0;
  --brand-purple-dark: #462a78;
  --brand-purple-soft: #f3effa;
  --success: #167761;
  --warning: #9a5b00;
  --danger: #b9471b;
  --shadow: 0 1px 2px rgba(28, 36, 48, 0.05);
  --shadow-raised: 0 8px 24px rgba(28, 36, 48, 0.08);
}

body {
  background: var(--app-bg);
}

.app-shell {
  grid-template-columns: 248px minmax(0, 1fr);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.sidebar {
  background: #171922;
  border-right: 1px solid #252936;
  box-shadow: none;
}

.brand-lockup {
  min-height: 76px;
  margin: 12px;
  padding: 10px;
  background: #202330;
  border-color: #31364a;
  box-shadow: none;
}

.brand-lockup::after {
  display: none;
}

.brand-logo-wrap {
  min-height: 54px;
  padding: 0;
  background: transparent;
}

.brand-logo.brand-full {
  height: 54px;
  object-position: left center;
  filter: none;
}

.side-nav {
  gap: 2px;
  padding: 8px;
}

.nav-section {
  padding: 13px 10px 5px;
  color: #8d94a5;
  letter-spacing: 0.08em;
}

.nav-section::after {
  background: #30364a;
}

.side-nav .tab {
  min-height: 38px;
  margin: 0;
  border-radius: 7px;
  color: #c8cfda;
  transition: background 0.14s ease, color 0.14s ease;
}

.side-nav .tab:hover {
  transform: none;
  background: #242838;
}

.side-nav .tab.active {
  background: #ffffff;
  color: #171922;
  border-color: transparent;
  box-shadow: none;
}

.side-nav .tab::before,
.side-nav .tab.active::before {
  display: none;
}

.tab-icon {
  background: transparent;
  border: 0;
  color: currentColor;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

.side-nav .tab.active .tab-icon {
  background: transparent;
  color: currentColor;
  border: 0;
}

.topbar {
  min-height: 64px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: none;
}

.content {
  padding: 18px 22px 28px;
}

.view-intro {
  padding: 0 0 14px;
  margin-bottom: 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.view-intro h2 {
  font-size: 20px;
}

.view-intro-actions {
  display: none;
}

.workspace {
  margin-bottom: 14px;
}

.client-card {
  padding: 14px 16px;
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.status-row {
  display: none;
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric,
.panel,
.decoy-item,
.intel-card,
.playbook-card,
.phase-card,
.report-card,
.control-card,
.health-card,
.case-stat,
.check-item,
.step-card,
.integration-target,
.brief-card {
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 76px;
  padding: 12px;
}

.metric .value {
  font-size: 24px;
}

.metrics .metric:first-child {
  background: var(--surface);
  border-color: var(--line);
}

.overview-clean-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.34fr);
  gap: 14px;
  margin-bottom: 14px;
  align-items: stretch;
}

.role-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
  align-items: stretch;
}

.workbench-list {
  display: grid;
  gap: 8px;
}

.workbench-item {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 0.16s var(--ease-out), border-color 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out);
}

.workbench-item:hover,
.workbench-item:focus-visible {
  background: #ffffff;
  border-color: #cfd8e4;
  box-shadow: var(--shadow);
  outline: 0;
}

.workbench-item strong,
.workbench-item small {
  display: block;
}

.workbench-item strong {
  font-size: 13px;
  line-height: 1.25;
}

.workbench-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.workbench-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(22, 119, 97, 0.12);
}

.workbench-item.attention .workbench-dot {
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(154, 91, 0, 0.14);
}

.workbench-item.todo .workbench-dot {
  background: var(--muted);
  box-shadow: 0 0 0 3px rgba(104, 115, 134, 0.12);
}

body.audience-engineer .engineer-workspace {
  order: -1;
}

body.audience-engineer .analyst-workspace,
body.audience-analyst .engineer-workspace {
  opacity: 0.82;
}

body.audience-client .engineer-workspace,
body.audience-client .analyst-flow,
body.audience-client #overview .grid-2,
body.audience-client .side-nav .tab[data-tab="operations"],
body.audience-client .side-nav .tab[data-tab="events"],
body.audience-client .side-nav .tab[data-tab="deploy"],
body.audience-client .quick-menu button[data-goto-tab="operations"],
body.audience-client .quick-menu button[data-goto-tab="events"],
body.audience-client .quick-menu button[data-goto-tab="deploy"],
body.audience-client .auth-controls {
  display: none;
}

body.audience-client .role-workspace-grid {
  grid-template-columns: minmax(0, 1fr);
}

body.audience-client .analyst-workspace {
  opacity: 1;
}

.service-brief {
  margin-bottom: 0;
  border-color: var(--line);
}

.brief-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.brief-card {
  min-height: 82px;
  background: #fbfcfe;
  padding: 11px;
}

.brief-card strong {
  font-size: 22px;
}

.brief-narrative {
  min-height: 0;
  background: #fbfcfe;
  border-color: var(--line);
}

.analyst-flow {
  margin-bottom: 14px;
}

.workflow-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.workflow-step {
  min-height: 62px;
  padding: 10px;
  box-shadow: none;
}

.workflow-step:hover {
  transform: none;
  box-shadow: var(--shadow);
  background: #fbfcfe;
}

#overview .ops-grid {
  grid-template-columns: 1fr;
  margin-bottom: 14px;
}

.coverage-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.coverage-item,
.action-list li,
.check-item,
.step-card,
.integration-target {
  background: #fbfcfe;
}

.action-list li {
  border-color: var(--line);
}

.panel:hover,
.metric:hover,
.intel-card:hover,
.playbook-card:hover,
.phase-card:hover,
.report-card:hover,
.control-card:hover,
.health-card:hover,
.case-stat:hover,
.check-item:hover,
.step-card:hover,
.integration-target:hover,
.brief-card:hover {
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.button.primary {
  background: var(--brand-purple);
  border-color: var(--brand-purple);
  box-shadow: none;
}

.button.primary:hover:not(:disabled) {
  background: var(--brand-purple-dark);
  box-shadow: var(--shadow);
}

.button:hover:not(:disabled),
.icon-button:hover,
.decoy-item:hover {
  transform: none;
  box-shadow: var(--shadow);
}

.quick-menu-panel {
  box-shadow: var(--shadow-raised);
}

@media (max-width: 1180px) {
  .overview-clean-grid,
  .role-workspace-grid,
  .ops-grid,
  .workflow-grid,
  .coverage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-brief {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app-shell,
  .app-shell.sidebar-collapsed,
  .metrics,
  .overview-clean-grid,
  .role-workspace-grid,
  .brief-grid,
  .workflow-grid,
  .coverage-grid {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 14px;
  }
}

/* Brand and focus reset */
:root {
  --app-bg: #f4f6f7;
  --surface: #ffffff;
  --panel: #ffffff;
  --ink: #17212b;
  --graphite: #17212b;
  --muted: #667481;
  --line: #dce4e9;
  --brand-purple: #0f6d7a;
  --brand-purple-dark: #0a4f5a;
  --brand-purple-soft: #e7f3f5;
  --blue: #1d5f82;
  --blue-dark: #154963;
  --teal: #0b7a75;
  --success: #19735f;
  --warning: #956116;
  --danger: #ad4a24;
  --sidebar-bg: #111820;
  --sidebar-bg-2: #0c1218;
  --shadow: 0 1px 2px rgba(23, 33, 43, 0.05);
  --shadow-raised: 0 10px 26px rgba(23, 33, 43, 0.09);
}

body {
  background: var(--app-bg);
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
  border-right-color: #22303b;
}

.brand-lockup {
  grid-template-columns: 52px minmax(0, 1fr) auto;
  min-height: 68px;
  align-items: center;
  gap: 10px;
  margin: 10px 10px 8px;
  padding: 8px 6px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.brand-logo-wrap {
  width: 52px;
  height: 52px;
  min-height: 0;
  overflow: hidden;
  display: block;
  border: 1px solid #2a3b47;
  border-radius: 12px;
  background: #0d1319;
}

.brand-logo.brand-full {
  width: auto;
  max-width: none;
  height: 52px;
  object-fit: contain;
  object-position: left center;
  filter: none;
}

.brand-copy {
  min-width: 0;
  display: grid !important;
  gap: 2px;
}

.brand-copy strong {
  color: #f5f8fa;
  font-size: 15px;
  line-height: 1.1;
  font-weight: 780;
}

.brand-copy span {
  color: #8ea0ad;
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.brand-mini {
  border-color: #2d4650;
  color: #d7edf0;
  background: #13242b;
}

.app-shell.sidebar-collapsed .brand-lockup {
  grid-template-columns: 1fr;
  justify-items: center;
}

.app-shell.sidebar-collapsed .brand-logo-wrap,
.app-shell.sidebar-collapsed .brand-copy {
  display: none !important;
}

.app-shell.sidebar-collapsed .brand-mini {
  display: grid !important;
}

.nav-section {
  color: #82919d;
}

.nav-section::after {
  background: #273742;
}

.side-nav .tab {
  color: #c4d0d7;
}

.side-nav .tab:hover {
  background: #182631;
  color: #ffffff;
}

.side-nav .tab.active {
  background: #e8f4f6;
  color: #0d3e47;
  border-color: #b7d9de;
}

.topbar {
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: var(--line);
}

.view-intro {
  margin-bottom: 10px;
}

.workspace {
  margin-bottom: 10px;
}

.client-card {
  padding: 12px 14px;
  border-color: var(--line);
  background: #ffffff;
}

.client-title h2 {
  font-size: 17px;
}

.client-meta {
  gap: 6px;
  font-size: 12px;
}

.metrics {
  gap: 8px;
  margin-bottom: 10px;
}

.metric {
  min-height: 68px;
  padding: 10px 12px;
}

.metric .value {
  margin-top: 5px;
  font-size: 22px;
}

.overview-clean-grid,
.role-workspace-grid {
  gap: 10px;
  margin-bottom: 10px;
}

.overview-clean-grid {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.3fr);
}

.panel-header {
  min-height: 44px;
  padding: 11px 13px;
}

.panel-body {
  padding: 12px;
}

.brief-grid {
  gap: 8px;
}

.brief-card {
  min-height: 72px;
  background: #f9fbfc;
}

.brief-card strong {
  font-size: 20px;
}

.brief-narrative {
  background: #f9fbfc;
}

.workbench-item {
  min-height: 52px;
  background: #f9fbfc;
}

#overview .analyst-flow,
#overview .ops-grid,
#overview > .grid-2 {
  display: none;
}

.button.primary {
  background: var(--blue);
  border-color: var(--blue);
}

.button.primary:hover:not(:disabled) {
  background: var(--blue-dark);
}

.badge.sim,
.badge.ok,
.badge.quiet,
.badge.ready {
  background: #e7f3f1;
  color: #14624f;
}

.badge.warn,
.badge.medium,
.badge.guarded,
.badge.elevated {
  background: #fff4dd;
  color: var(--warning);
}

.badge.err,
.badge.offline,
.badge.high,
.badge.critical {
  background: #fff0eb;
  color: var(--danger);
}

@media (max-width: 1180px) {
  .overview-clean-grid {
    grid-template-columns: 1fr;
  }
}

/* Implementation console overhaul */
:root {
  --app-bg: #f6f7f8;
  --surface: #ffffff;
  --panel: #ffffff;
  --ink: #111827;
  --graphite: #111827;
  --muted: #5f6f7a;
  --line: #dce3e8;
  --blue: #176b87;
  --blue-dark: #0f5067;
  --teal: #157a6e;
  --brand-purple: var(--blue);
  --brand-purple-dark: var(--blue-dark);
  --brand-purple-soft: #e8f3f5;
  --success: #17735e;
  --warning: #946116;
  --danger: #a94624;
  --sidebar-bg: #0f1720;
  --sidebar-bg-2: #0b1118;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-raised: 0 14px 30px rgba(17, 24, 39, 0.10);
}

body {
  background: var(--app-bg);
}

.app-shell {
  grid-template-columns: 236px minmax(0, 1fr);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 70px minmax(0, 1fr);
}

.sidebar {
  background: linear-gradient(180deg, #111b24 0%, var(--sidebar-bg-2) 100%);
  border-right: 1px solid #25323d;
}

.brand-lockup {
  grid-template-columns: 48px minmax(0, 1fr) auto;
  min-height: 62px;
  margin: 8px 10px 6px;
  padding: 6px 4px;
}

.brand-logo-wrap {
  width: 48px;
  height: 48px;
  border-radius: 10px;
}

.brand-logo.brand-full {
  height: 48px;
}

.brand-copy strong {
  font-size: 14px;
}

.brand-copy span {
  color: #9aacb6;
  font-size: 10px;
}

.side-nav {
  padding: 8px;
  gap: 1px;
}

.nav-section {
  padding: 12px 9px 4px;
  color: #7f909c;
  font-size: 10px;
}

.side-nav .tab {
  min-height: 36px;
  border-radius: 8px;
  color: #c9d5dc;
}

.side-nav .tab:hover {
  background: #172631;
}

.side-nav .tab.active {
  background: #e8f3f5;
  color: #0e4353;
  border-color: #bedde3;
}

.tab-icon {
  font-size: 13px;
}

.topbar {
  min-height: 58px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.97);
}

.topbar .brand h1 {
  font-size: 17px;
}

.topbar .brand span {
  font-size: 12px;
}

.toolbar {
  gap: 8px;
}

.view-search {
  width: min(230px, 22vw);
}

.client-switcher,
.audience-switcher {
  width: min(210px, 20vw);
}

.quick-menu-panel {
  border-color: var(--line);
}

.quick-menu-label {
  color: var(--blue-dark);
}

.content {
  padding: 16px 18px 26px;
}

.view-intro {
  margin-bottom: 8px;
  padding-bottom: 10px;
}

.view-intro h2 {
  font-size: 19px;
}

.workspace {
  margin-bottom: 8px;
}

.client-card {
  padding: 10px 12px;
  border-radius: 8px;
}

.client-title h2 {
  font-size: 16px;
}

.client-meta span:nth-child(2),
.client-meta span:nth-child(4) {
  display: none;
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.metric {
  min-height: 64px;
  padding: 10px;
}

.metric .label {
  font-size: 10px;
  letter-spacing: 0.06em;
}

.metric .value {
  font-size: 21px;
}

.implementation-ribbon,
.deployment-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
  padding: 15px 16px;
  border: 1px solid #cfe0e5;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f8fbfc);
  box-shadow: var(--shadow);
}

.implementation-ribbon h2,
.deployment-hero h2 {
  margin: 3px 0 4px;
  font-size: 20px;
  line-height: 1.18;
}

.implementation-ribbon p,
.deployment-hero p {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.ribbon-actions,
.deployment-hero-actions,
.brief-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.overview-clean-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.65fr);
  gap: 10px;
  margin-bottom: 10px;
}

.role-workspace-grid {
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 0;
}

body.audience-analyst .engineer-workspace,
body.audience-engineer .analyst-workspace,
body.audience-client .role-workspace-grid {
  display: none;
}

body.audience-engineer .engineer-workspace,
body.audience-analyst .analyst-workspace {
  opacity: 1;
}

.panel {
  border-radius: 10px;
}

.panel-header {
  min-height: 40px;
  padding: 10px 12px;
}

.panel-header h2 {
  font-size: 14px;
}

.panel-body {
  padding: 11px 12px 12px;
}

.service-brief .panel-body {
  gap: 10px;
}

.brief-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.brief-card {
  min-height: 68px;
  padding: 10px;
  border-radius: 8px;
}

.brief-card strong {
  font-size: 19px;
}

.brief-narrative {
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  background: #f8fbfc;
}

.next-action-panel .panel-body {
  padding-top: 6px;
}

.action-list {
  gap: 7px;
}

.action-list li {
  position: relative;
  padding: 8px 9px 8px 24px;
  background: #f8fbfc;
  font-size: 12px;
  line-height: 1.35;
}

.action-list li::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 10px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--teal);
}

.workbench-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.workbench-item {
  min-height: 76px;
  align-content: start;
  padding: 10px;
}

.workbench-item strong {
  font-size: 12px;
}

.workbench-item small {
  font-size: 11px;
}

#overview .analyst-flow,
#overview .ops-grid,
#overview > .grid-2 {
  display: none !important;
}

#deploy .panel {
  margin-bottom: 10px;
}

#deploy .grid-2[style],
#deploy .panel[style] {
  margin-top: 10px !important;
}

#deploy > .grid-2:last-child {
  display: none;
}

.check-grid,
.tutorial-grid,
.phase-grid {
  gap: 8px;
}

.check-item,
.step-card,
.phase-card {
  border-radius: 8px;
  background: #f9fbfc;
}

.command-block {
  background: #0d1720;
  color: #d8e7ed;
  border-radius: 8px;
}

.button {
  border-radius: 8px;
}

.button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
}

.button.primary:hover:not(:disabled) {
  background: var(--blue-dark);
}

.button:hover:not(:disabled),
.icon-button:hover,
.quick-menu-panel button:hover,
.quick-menu-panel a:hover {
  transform: none;
  box-shadow: var(--shadow);
}

@media (max-width: 1180px) {
  .implementation-ribbon,
  .deployment-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .ribbon-actions,
  .deployment-hero-actions,
  .brief-actions {
    justify-content: flex-start;
  }

  .overview-clean-grid,
  .brief-grid,
  .workbench-list {
    grid-template-columns: 1fr 1fr;
  }

  .client-switcher,
  .audience-switcher,
  .view-search {
    width: min(220px, 34vw);
  }
}

@media (max-width: 760px) {
  .content {
    padding: 12px;
  }

  .metrics,
  .overview-clean-grid,
  .brief-grid,
  .workbench-list {
    grid-template-columns: 1fr;
  }

  .implementation-ribbon,
  .deployment-hero {
    padding: 13px;
  }

  .ribbon-actions .button,
  .deployment-hero-actions .button,
  .brief-actions .button {
    width: 100%;
  }
}

/* Analyst console hardening */
:root {
  --app-bg: #f3f6f8;
  --surface: #ffffff;
  --panel: #ffffff;
  --ink: #101820;
  --graphite: #101820;
  --muted: #566672;
  --line: #d8e1e7;
  --blue: #155f78;
  --blue-dark: #0d485c;
  --teal: #0f766e;
  --success: #14735e;
  --warning: #92570c;
  --danger: #a43f23;
  --brand-purple: var(--blue);
  --brand-purple-dark: var(--blue-dark);
  --brand-purple-soft: #e7f2f5;
  --shadow: 0 1px 2px rgba(16, 24, 32, 0.05);
  --shadow-raised: 0 14px 34px rgba(16, 24, 32, 0.12);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 18px;
}

.topbar-left {
  min-width: 0;
}

.topbar .brand h1 {
  font-size: 18px;
  line-height: 1.05;
}

.topbar .brand span {
  display: block;
  max-width: 52ch;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  flex-wrap: nowrap;
}

.view-search,
.client-switcher,
.audience-switcher {
  display: block;
  min-width: 0;
  gap: 0;
}

.view-search {
  width: 220px;
}

.client-switcher {
  width: 218px;
}

.audience-switcher {
  width: 142px;
}

.view-search span,
.client-switcher span,
.audience-switcher span {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.view-search input,
.client-switcher select,
.audience-switcher select {
  width: 100%;
  min-height: 38px;
  border-radius: 8px;
  border-color: #cfd9e1;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.view-search input {
  padding-inline: 12px;
}

.client-switcher select,
.audience-switcher select {
  padding-inline: 12px 30px;
}

.quick-menu > .button {
  min-width: 132px;
}

.auth-controls.hidden {
  display: none !important;
}

.auth-controls {
  flex-wrap: nowrap;
}

.toolbar > .pill {
  min-height: 38px;
  white-space: nowrap;
}

#refreshButton {
  min-width: 92px;
}

.content {
  padding: 14px 18px 24px;
}

.view-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
  margin-bottom: 10px;
}

.view-intro h2 {
  font-size: 20px;
}

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

.metric {
  position: relative;
  min-height: 72px;
  border-color: var(--line);
  background: #ffffff;
}

.metric::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
}

.metric.status-attention::after,
.metric.status-elevated::after,
.metric.status-guarded::after,
.metric.status-medium::after {
  background: var(--warning);
}

.metric.status-critical::after,
.metric.status-high::after,
.metric.status-err::after {
  background: var(--danger);
}

.metric.status-todo::after {
  background: #8b99a5;
}

.metric .value {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.05;
}

.metric .hint {
  color: var(--muted);
}

.implementation-ribbon,
.deployment-hero {
  align-items: center;
  border-color: #ccdde4;
  background: #ffffff;
}

.implementation-ribbon h2,
.deployment-hero h2 {
  max-width: 760px;
  font-size: 20px;
}

.ribbon-actions,
.deployment-hero-actions,
.brief-actions {
  flex: 0 0 auto;
}

.overview-clean-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.7fr);
}

.panel,
.metric,
.client-card {
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.panel-header {
  background: #ffffff;
}

.panel-header h2 {
  color: var(--ink);
  font-weight: 760;
}

.brief-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.brief-card {
  border-color: #dfe7ec;
  background: #f9fbfc;
}

.brief-card span,
.brief-card small {
  color: var(--muted);
}

.brief-narrative {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border-color: #dfe7ec;
  color: #2f3f4b;
}

.brief-narrative > div:first-child {
  max-width: 74ch;
}

.brief-narrative strong {
  display: inline;
}

.brief-actions {
  justify-content: flex-start;
}

.brief-actions .button {
  min-height: 34px;
}

.next-action-panel .panel-body {
  min-height: 92px;
}

.action-list li {
  border-color: #dfe7ec;
  color: #263642;
}

.workbench-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workbench-item {
  border-color: #dfe7ec;
  background: #ffffff;
}

.workbench-item:hover,
.workbench-item:focus-visible {
  border-color: #b9cbd5;
  background: #f8fbfc;
}

.quick-menu-panel {
  z-index: 60;
}

.quick-menu-panel.open {
  display: grid;
}

.quick-menu-panel button::after,
.quick-menu-panel a::after {
  content: none !important;
}

.button,
.icon-button {
  font-weight: 720;
}

.button.primary {
  background: var(--blue);
  border-color: var(--blue);
}

.button.primary:hover:not(:disabled) {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

input:focus,
select:focus,
textarea:focus,
.button:focus-visible,
.icon-button:focus-visible,
.workbench-item:focus-visible {
  border-color: rgba(21, 95, 120, 0.55);
  box-shadow: 0 0 0 3px rgba(21, 95, 120, 0.14);
  outline: none;
}

@media (max-width: 1280px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .toolbar {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .view-search,
  .client-switcher {
    width: min(210px, 31vw);
  }
}

@media (max-width: 920px) {
  .view-intro {
    grid-template-columns: 1fr;
  }

  .metrics,
  .overview-clean-grid,
  .brief-grid,
  .workbench-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .topbar,
  .toolbar {
    width: 100%;
  }

  .toolbar > *,
  .view-search,
  .client-switcher,
  .audience-switcher,
  #refreshButton,
  .quick-menu,
  .quick-menu > .button,
  .toolbar > .pill {
    width: 100%;
  }

  .metrics,
  .overview-clean-grid,
  .brief-grid,
  .workbench-list {
    grid-template-columns: 1fr;
  }

  .brief-narrative,
  .implementation-ribbon,
  .deployment-hero {
    align-items: stretch;
    flex-direction: column;
  }
}

/* SOC active-defense console pass */
:root {
  --app-bg: #f2f5f7;
  --surface: #ffffff;
  --ink: #111820;
  --muted: #52616d;
  --line: #d6e0e7;
  --line-strong: #c4d2dc;
  --accent: #0f6178;
  --accent-strong: #0a4859;
  --state-ok: #0f766e;
  --state-warn: #9a5b0a;
  --state-danger: #a33f25;
  --sidebar-bg: #0d151d;
  --sidebar-bg-2: #080f15;
  --brand-purple: var(--accent);
  --brand-purple-dark: var(--accent-strong);
  --brand-purple-soft: #e5f2f5;
  --shadow: 0 1px 2px rgba(17, 24, 32, 0.04);
  --shadow-raised: 0 16px 32px rgba(17, 24, 32, 0.11);
}

body {
  background: var(--app-bg);
  color: var(--ink);
}

.content {
  padding: 14px 18px 22px;
}

.topbar {
  min-height: 60px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.view-intro {
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.view-intro h2 {
  font-size: 20px;
  letter-spacing: 0;
}

.client-card,
.metric,
.panel,
.intel-card,
.playbook-card,
.phase-card,
.report-card,
.control-card,
.health-card,
.case-stat,
.check-item,
.step-card,
.integration-target {
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: none;
}

.panel-header {
  min-height: 38px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.panel-body {
  padding: 12px;
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 8px;
}

.metric {
  min-height: 66px;
  padding: 9px 11px;
  background: var(--surface);
}

.metric .label,
.brief-card span,
.estate-heading {
  color: #586976;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.metric .value {
  margin-top: 4px;
  font-size: 24px;
}

.implementation-ribbon {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: 7px;
  background: #ffffff;
}

.implementation-ribbon h2 {
  margin: 1px 0 2px;
  font-size: 18px;
  line-height: 1.2;
}

.implementation-ribbon p {
  max-width: 92ch;
  font-size: 12px;
}

.defense-command-panel {
  margin-bottom: 10px;
  border-color: var(--line-strong);
}

.defense-command {
  display: grid;
  grid-template-columns: minmax(190px, 0.72fr) minmax(360px, 1.6fr) minmax(260px, 0.86fr);
  gap: 12px;
  align-items: stretch;
}

.defense-source,
.defense-empty {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafb;
}

.defense-source strong {
  font-size: 19px;
}

.defense-source small,
.defense-empty span,
.defense-foot,
.estate-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.defense-ladder {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #ffffff;
}

.defense-step {
  position: relative;
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 96px;
  padding: 12px;
  border-right: 1px solid var(--line);
}

.defense-step:last-child {
  border-right: 0;
}

.defense-step::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--state-ok);
}

.defense-step.attention::before {
  background: var(--state-warn);
}

.defense-step.todo::before {
  background: #8595a1;
}

.defense-step span {
  color: #586976;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.defense-step strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.defense-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-content: center;
}

.defense-actions .button:first-child {
  grid-column: 1 / -1;
}

.defense-foot {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
}

.overview-clean-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.72fr);
  margin-bottom: 10px;
}

.brief-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.brief-card {
  min-height: 64px;
  background: #f8fafb;
}

.brief-card strong {
  font-size: 22px;
}

.brief-narrative {
  border-radius: 7px;
  background: #f8fafb;
}

.honeypot-estate-panel {
  margin-bottom: 10px;
}

.honeypot-estate {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 12px;
}

.estate-column {
  display: grid;
  gap: 6px;
  align-content: start;
}

.estate-heading {
  padding: 0 2px 2px;
}

.estate-item {
  width: 100%;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.estate-item:hover,
.estate-item:focus-visible {
  border-color: #b7c8d2;
  background: #f8fafb;
  outline: none;
}

.estate-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--state-ok);
}

.estate-item.attention .estate-dot {
  background: var(--state-warn);
}

.estate-item.todo .estate-dot {
  background: #8595a1;
}

.estate-item strong,
.estate-item small {
  display: block;
}

.estate-item strong {
  font-size: 13px;
}

.estate-item code {
  color: #52616d;
  font-size: 11px;
}

.role-workspace-grid {
  margin-bottom: 0;
}

.workbench-item {
  min-height: 58px;
  border-radius: 7px;
}

.defense-card-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.defense-card-actions span {
  grid-column: 1 / -1;
  color: #586976;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.response-layout,
#response .intel-card {
  max-width: none;
}

#response .intel-card {
  background: #ffffff;
}

#response .intel-card .card-head strong {
  max-width: 54ch;
  font-size: 16px;
}

.button {
  min-height: 34px;
  border-radius: 7px;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
}

.button.primary:hover:not(:disabled) {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

@media (max-width: 1180px) {
  .defense-command,
  .honeypot-estate {
    grid-template-columns: 1fr;
  }

  .defense-ladder,
  .defense-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .defense-step:nth-child(2) {
    border-right: 0;
  }

  .defense-step:nth-child(1),
  .defense-step:nth-child(2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .implementation-ribbon,
  .overview-clean-grid,
  .brief-grid,
  .defense-ladder,
  .defense-actions,
  .defense-card-actions {
    grid-template-columns: 1fr;
  }

  .defense-step {
    min-height: 70px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .defense-step:last-child {
    border-bottom: 0;
  }

  .defense-foot {
    display: grid;
  }
}

/* Role-focused SOC workflow pass */
.response-queue-panel,
.score-request-panel {
  margin-bottom: 12px;
}

body.audience-analyst .engineering-tools,
body.audience-client .engineering-tools {
  display: none;
}

#responseQueue {
  grid-template-columns: minmax(0, 1fr);
}

.response-card {
  width: 100%;
}

.response-card-head {
  align-items: start;
  gap: 16px;
}

.response-badges {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.response-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
  margin-top: 12px;
}

.response-recommendation {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafb;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.response-evidence-list,
.defense-facts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.response-evidence-list div,
.defense-facts div {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.response-evidence-list dt,
.defense-facts dt,
.section-label {
  color: #586976;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.response-evidence-list dd,
.defense-facts dd {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.response-actions {
  display: grid;
  align-content: start;
  gap: 8px;
}

.response-button-grid,
.response-control-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.defense-card-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 4px;
  padding: 0;
  border-top: 0;
}

.section-label {
  margin-top: 4px;
}

.defense-command {
  grid-template-columns: minmax(230px, 0.8fr) minmax(420px, 1.45fr) minmax(220px, 0.7fr);
  align-items: start;
}

.defense-source {
  align-content: start;
}

.defense-facts {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.defense-runbook {
  display: grid;
  gap: 8px;
}

.defense-runbook-head {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafb;
}

.defense-runbook-head span {
  color: #586976;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.defense-runbook-head strong {
  font-size: 13px;
  line-height: 1.35;
}

.defense-ladder {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.defense-step {
  min-height: 0;
  padding: 10px 12px 10px 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.defense-step:last-child {
  border-right: 1px solid var(--line);
}

.defense-step::before {
  position: absolute;
  top: 14px;
  left: 13px;
}

.defense-actions {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafb;
}

@media (max-width: 1180px) {
  .response-card-grid,
  .defense-command {
    grid-template-columns: 1fr;
  }

  .defense-step,
  .defense-step:nth-child(1),
  .defense-step:nth-child(2),
  .defense-step:last-child {
    border: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .response-card-head,
  .response-badges {
    justify-content: flex-start;
  }

  .response-button-grid,
  .response-control-row,
  .defense-card-actions {
    grid-template-columns: 1fr;
  }

  .response-evidence-list div,
  .defense-facts div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* UI overflow hardening: keep production data readable at narrow widths. */
.topbar {
  min-height: 60px;
  height: auto;
}

.toolbar {
  flex-wrap: wrap;
  align-items: center;
}

.topbar .brand span {
  max-width: 42ch;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.view-search,
.client-switcher,
.audience-switcher {
  flex: 1 1 150px;
  width: auto;
  max-width: 240px;
}

.quick-menu > .button,
.toolbar > .button,
.toolbar > .pill {
  flex: 0 0 auto;
  white-space: nowrap;
}

.quick-menu > .button {
  min-width: 150px;
}

.operator-key {
  flex: 1 1 150px;
  max-width: 190px;
}

.response-card-head > div,
.response-card-head strong,
.response-badges,
.card-head > strong {
  min-width: 0;
}

.response-badges {
  max-width: 100%;
}

@media (max-width: 1280px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
    padding-block: 10px;
  }

  .toolbar {
    justify-content: flex-start;
    width: 100%;
  }
}

@media (max-width: 760px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    min-width: 0;
  }

  .metric .label,
  .metric .hint {
    overflow-wrap: anywhere;
  }

  .response-card-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .response-badges {
    justify-content: flex-start;
  }

  .response-card-grid {
    gap: 12px;
  }

  .sensor-inventory .table-scroll {
    overflow-x: visible;
  }

  .sensor-inventory table,
  .sensor-inventory thead,
  .sensor-inventory tbody,
  .sensor-inventory tr,
  .sensor-inventory th,
  .sensor-inventory td {
    display: block;
    width: 100%;
  }

  .sensor-inventory table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  .sensor-inventory thead {
    display: none;
  }

  .sensor-inventory tr {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
  }

  .sensor-inventory td {
    position: static !important;
    min-width: 0 !important;
    padding: 7px 0;
    border-bottom: 0;
    box-shadow: none !important;
    overflow-wrap: anywhere;
  }

  .sensor-inventory td::before {
    display: block;
    margin-bottom: 2px;
    color: #586976;
    font-size: 10px;
    font-weight: 780;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .sensor-inventory td:nth-child(1)::before { content: "ID"; }
  .sensor-inventory td:nth-child(2)::before { content: "Name / zone"; }
  .sensor-inventory td:nth-child(3)::before { content: "Health"; }
  .sensor-inventory td:nth-child(4)::before { content: "Version"; }
  .sensor-inventory td:nth-child(5)::before { content: "Network"; }
  .sensor-inventory td:nth-child(6)::before { content: "Last seen"; }
  .sensor-inventory td:nth-child(7)::before { content: "HB / events"; }
  .sensor-inventory td:nth-child(8)::before { content: "Token / actions"; }

  .sensor-actions .row-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sensor-actions .button {
    width: 100%;
  }

  .panel-body > table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

  .panel-body > table th,
  .panel-body > table td {
    min-width: 96px;
  }

  .panel-body > table td.mono,
  .panel-body > table th:first-child,
  .panel-body > table td:first-child {
    min-width: 150px;
  }
}

@media (max-width: 420px) {
  .metrics {
    grid-template-columns: 1fr;
  }

  .sensor-actions .row-actions {
    grid-template-columns: 1fr;
  }
}
