:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --line: #d9e4f4;
  --text: #061640;
  --muted: #60718e;
  --coral: #0757ff;
  --blue: #0757ff;
  --blue-2: #1c7dff;
  --navy: #061640;
  --soft: #eef5ff;
  --lime: #9bc22b;
  --orange: #ff8a2a;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button, input, select {
  font: inherit;
}

.top-links {
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 10;
  display: flex;
  gap: 8px;
}

.top-links a {
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid rgba(143, 171, 217, .55);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  color: var(--blue);
  text-decoration: none;
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 24px rgba(18, 55, 103, .10);
}

.top-links a:hover {
  color: #0047dc;
}

#app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #fff;
  border-right: 1px solid #d8dee7;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 14px 12px;
  gap: 18px;
  box-shadow: none;
}

.brand {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .04)),
    linear-gradient(135deg, #0757ff, #0047dc);
  box-shadow: 0 16px 34px rgba(7, 87, 255, .28);
  font-size: 26px;
  font-weight: 850;
  line-height: 1;
}

nav {
  display: grid;
  gap: 4px;
  overflow-y: auto;
  max-height: calc(100vh - 130px);
  padding-right: 2px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 241, 255, .52) rgba(255, 255, 255, .08);
}

nav::-webkit-scrollbar { width: 7px; }
nav::-webkit-scrollbar-track { background: rgba(255, 255, 255, .08); border-radius: 999px; }
nav::-webkit-scrollbar-thumb { background: rgba(232, 241, 255, .52); border-radius: 999px; }

.nav-item,
.gear {
  width: auto;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: #334155;
  cursor: pointer;
  border-radius: 6px;
  padding: 0 10px;
  text-align: left;
  font-weight: 750;
}

.nav-item svg,
.gear svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.active,
.nav-item:hover,
.gear:hover {
  color: #fff;
  background: #3b32ff;
  box-shadow: none;
}

.nav-item span {
  display: inline;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace {
  padding: 20px 20px 34px;
  min-width: 0;
}

.filter-rail {
  min-height: 58px;
  background: #303030;
  box-shadow: none;
  display: grid;
  grid-template-columns: 1fr 1.15fr 1.1fr 1.45fr 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 10px 14px;
  margin: -20px -20px 18px;
  border: 0;
  border-radius: 0;
}

label {
  color: #e5e7eb;
  font-weight: 700;
  display: grid;
  gap: 4px;
  min-width: 0;
  font-size: 11px;
}

input,
select {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 0 12px;
  color: #30415f;
  background: #fbfdff;
  outline: 0;
  box-shadow: inset 0 1px 2px rgba(7, 38, 94, .04);
}

input:focus,
select:focus {
  border-color: #75a3ff;
  box-shadow: 0 0 0 3px rgba(7, 87, 255, .12);
}

.status-control {
  display: flex;
  align-items: center;
  height: 40px;
  color: #60718e;
  min-width: 0;
}

.status-control .gear {
  width: 40px;
  height: 40px;
  justify-content: center;
  padding: 0;
  border-radius: 0 4px 4px 0;
}

.status-control span {
  height: 40px;
  min-width: 44px;
  padding: 0 10px;
  background: #eef5ff;
  display: grid;
  place-items: center;
  border-left: 1px solid #d9e4f4;
  font-weight: 800;
}

.run {
  height: 40px;
  min-width: 0;
  flex: 1 1 104px;
  border: 0;
  border-radius: 8px 0 0 8px;
  background: linear-gradient(135deg, #16a36f, #0f875b);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
  padding: 0 16px;
}

.run.paused {
  background: linear-gradient(135deg, #ef4444, #c81e1e);
}

.gear {
  background: linear-gradient(135deg, #0757ff, #0047dc);
  color: #fff;
  border-radius: 0 8px 8px 0;
}

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

.workflow-lead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  background: #fff;
}

.workflow-lead h2 {
  padding: 0 0 6px;
  font-size: 20px;
}

.workflow-lead p {
  max-width: 900px;
  margin: 0;
  color: #52627d;
  font-size: 13px;
  font-weight: 650;
}

.section-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 280px;
}

.section-tabs button {
  min-height: 32px;
  border: 1px solid #d8e6f8;
  border-radius: 999px;
  background: #f7fbff;
  color: #42526d;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 850;
}

.section-tabs button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.panel {
  background: var(--panel);
  border: 1px solid #d8dee7;
  border-radius: 4px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: visible;
}

.panel h2 {
  margin: 0;
  padding: 0 0 12px;
  color: #111827;
  font-size: 16px;
  line-height: 1.1;
  font-weight: 800;
}

.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding-bottom: 12px;
}

.panel-title-row h2 {
  padding: 0;
}

.help-tip {
  position: relative;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid #cfe0fb;
  background: #eff6ff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  cursor: help;
  z-index: 5;
}

.help-tip::after {
  content: attr(aria-label);
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(260px, 58vw);
  padding: 10px 12px;
  border: 1px solid #cfe0fb;
  border-radius: 10px;
  background: #061640;
  color: #fff;
  box-shadow: 0 18px 38px rgba(6, 22, 64, .22);
  font-size: 11px;
  line-height: 1.32;
  font-weight: 700;
  text-align: left;
  white-space: normal;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}

.help-tip:hover::after,
.help-tip:focus::after {
  opacity: 1;
  transform: translateY(0);
}

.panel {
  padding: 14px;
}

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  border-top: 5px solid transparent;
  gap: 0;
  margin-bottom: 8px;
}

.metric {
  border-top: 5px solid var(--bar);
  padding: 8px 8px 10px 0;
  min-width: 0;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.metric strong {
  font-size: 17px;
  line-height: 1.1;
  color: #5d666b;
}

.dashboard-primary-panel {
  padding: 16px;
}

.dashboard-primary-panel .metric-strip {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 4px 0 14px;
  border-top: 0;
}

.dashboard-primary-panel .metric {
  min-height: 72px;
  padding: 10px;
  border: 1px solid #dbe8f7;
  border-top: 7px solid var(--bar);
  border-radius: 10px;
  background: #fbfdff;
}

.dashboard-primary-panel .metric span {
  font-size: 13px;
  font-weight: 850;
}

.dashboard-primary-panel .metric strong {
  margin-top: 5px;
  color: #46515a;
  font-size: 22px;
  line-height: 1;
}

.dashboard-primary-panel .line-chart {
  height: 250px;
}

.dashboard-primary-panel .bars {
  min-height: 230px;
  padding-top: 18px;
}

.dashboard-primary-panel .bar-wrap {
  min-height: 210px;
}

.dashboard-primary-panel .runtime-table {
  table-layout: auto;
  font-size: 13px;
}

.dashboard-primary-panel .runtime-table th,
.dashboard-primary-panel .runtime-table td {
  padding: 12px;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

.dashboard-primary-panel .runtime-table td:first-child,
.dashboard-primary-panel .runtime-table th:first-child {
  min-width: 150px;
}

.dashboard-secondary-panel {
  padding: 16px;
}

.workbench-panel {
  background: #fff;
}

.workbench-table {
  min-width: 0;
  table-layout: fixed;
}

.workbench-table td:nth-child(3),
.workbench-table th:nth-child(3),
.workbench-table td:nth-child(4),
.workbench-table th:nth-child(4) {
  min-width: 300px;
  white-space: normal;
  text-align: left;
}

.dashboard-secondary-panel .metric-strip {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  border-top: 0;
}

.command-center {
  background:
    radial-gradient(circle at top right, rgba(7, 87, 255, .12), transparent 38%),
    #fff;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.health-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  min-height: 118px;
  padding: 14px;
  border: 1px solid #d6e6fb;
  border-radius: 10px;
  background: #fff;
  color: #061640;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(7, 87, 255, .08);
}

.health-card span {
  color: #60718e;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.health-card strong {
  color: #061640;
  font-size: 22px;
  line-height: 1.05;
}

.health-card small {
  color: #60718e;
  font-size: 12px;
  line-height: 1.3;
}

.health-card.healthy { border-top: 5px solid #3c8b68; }
.health-card.warning { border-top: 5px solid #f39b39; }
.health-card.danger { border-top: 5px solid #e3565a; }

.flow-panel {
  background:
    linear-gradient(135deg, rgba(7, 87, 255, .06), rgba(127, 193, 223, .04)),
    #fff;
}

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

.flow-step {
  position: relative;
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #d6e6fb;
  border-radius: 10px;
  background: #fff;
}

.flow-step b {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
}

.flow-step span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.flow-step strong {
  color: #061640;
  font-size: 16px;
  line-height: 1.15;
}

.flow-step p {
  margin: 0;
  color: #60718e;
  font-size: 12px;
  line-height: 1.38;
}

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

.condition-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  min-height: 132px;
  padding: 14px;
  border: 1px solid #d6e6fb;
  border-radius: 10px;
  background: #f7fbff;
  color: #061640;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(7, 87, 255, .08);
}

.condition-card span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.condition-card strong {
  font-size: 17px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.condition-card small {
  color: #60718e;
  font-size: 12px;
  line-height: 1.3;
}

.condition-card em {
  align-self: end;
  color: var(--blue);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.condition-card.remote { border-top: 4px solid #f39b39; }
.condition-card.reputation { border-top: 4px solid #e3565a; }
.condition-card.policy { border-top: 4px solid #8d75b8; }
.condition-card.healthy { border-top: 4px solid #3c8b68; }

.persona-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.persona-strip div {
  border-top: 5px solid #7fc1df;
  background: #f8fbfc;
  padding: 12px;
  min-width: 0;
}

.persona-strip div:nth-child(2) { border-top-color: #a7c943; }
.persona-strip div:nth-child(3) { border-top-color: #ef4444; }
.persona-strip div:nth-child(4) { border-top-color: #ff8a2a; }
.persona-strip div:nth-child(5) { border-top-color: #1c7dff; }

.persona-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.persona-strip strong {
  display: block;
  color: #4f5b61;
  font-size: 24px;
  line-height: 1.15;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.demo-toast {
  position: sticky;
  top: 12px;
  z-index: 20;
  margin: 0 0 18px auto;
  max-width: 760px;
  padding: 12px 16px;
  border: 1px solid #b9d2ff;
  border-radius: 10px;
  background: #eef6ff;
  color: #061640;
  box-shadow: 0 18px 34px rgba(7, 87, 255, .14);
  font-size: 13px;
  font-weight: 850;
}

.demo-control-panel {
  background:
    linear-gradient(135deg, rgba(7, 87, 255, .08), rgba(127, 193, 223, .08)),
    #fff;
}

.configurator-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
  gap: 14px;
  align-items: end;
}

.configurator-strip label {
  display: grid;
  gap: 6px;
  color: #30415f;
  font-size: 12px;
  font-weight: 850;
  min-width: 0;
}

.configurator-strip select {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid #d6e2f2;
  border-radius: 8px;
  color: #061640;
  background: #fff;
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
}

.bulk-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .42fr);
  gap: 18px;
  align-items: stretch;
  padding: 18px;
  border: 1px solid #d7e7ff;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(7, 87, 255, .08), rgba(28, 125, 255, .03)),
    #fbfdff;
}

.bulk-hero span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.bulk-hero strong {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: 22px;
  line-height: 1.15;
}

.bulk-hero p {
  max-width: 920px;
  margin: 10px 0 0;
  color: #465875;
  font-size: 14px;
}

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

.bulk-metrics div {
  min-height: 86px;
  padding: 14px;
  border: 1px solid #d8e6f8;
  border-radius: 10px;
  background: #fff;
}

.bulk-metrics b,
.bulk-metrics small {
  display: block;
}

.bulk-metrics b {
  color: var(--blue);
  font-size: 22px;
  line-height: 1;
}

.bulk-metrics small {
  margin-top: 8px;
  color: #60718e;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.bulk-builder {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.bulk-builder .primary-action {
  grid-column: 1 / -1;
  justify-self: start;
  min-width: 190px;
}

.guardrail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.guardrail {
  min-height: 84px;
  padding: 14px;
  border: 1px solid #d8e6f8;
  border-radius: 10px;
  background: #fbfdff;
}

.guardrail strong {
  display: block;
  color: var(--navy);
  font-size: 14px;
}

.guardrail span {
  display: block;
  margin-top: 7px;
  color: #60718e;
  font-size: 12px;
  font-weight: 760;
}

.guardrail.healthy {
  border-color: #cfeadd;
  background: #f5fcf8;
}

.guardrail.warning {
  border-color: #f8dfaa;
  background: #fffaf0;
}

.bulk-code {
  min-height: 270px;
}

.line-chart {
  width: 100%;
  height: 220px;
  display: block;
}

.line-chart polyline,
.spark polyline {
  fill: none;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.line-chart .grid {
  stroke: #edf0f2;
  stroke-width: .5;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  background: #fff;
}

.data-table {
  min-width: 100%;
  table-layout: fixed;
}

.stream-table,
.report-table {
  min-width: 100%;
  table-layout: auto;
}

.wide-table {
  table-layout: auto;
}

.wide-table th,
.wide-table td,
.ops-table th,
.ops-table td {
  overflow-wrap: normal;
  word-break: normal;
  white-space: normal;
}

.ops-table {
  min-width: 0;
  table-layout: auto;
}

.ops-table td:nth-child(3),
.ops-table th:nth-child(3) {
  min-width: 220px;
  text-align: left;
  white-space: normal;
}

.recipient-domain-table {
  min-width: 0;
  table-layout: fixed;
}

.recipient-domain-table th,
.recipient-domain-table td {
  padding: 11px 10px;
  font-size: 13px;
  white-space: normal;
  overflow-wrap: normal;
}

.wide-table td:first-child,
.wide-table td:nth-child(2),
.wide-table th:first-child,
.wide-table th:nth-child(2) {
  min-width: 110px;
}

th {
  color: #061640;
  text-align: right;
  padding: 9px 8px;
  border-bottom: 1px solid #e3ecf8;
  font-weight: 850;
  overflow-wrap: normal;
  white-space: normal;
}

th:first-child,
td:first-child,
td:nth-child(2),
th:nth-child(2) {
  text-align: left;
}

td {
  color: #60718e;
  text-align: right;
  padding: 9px 8px;
  border-bottom: 1px solid #edf3fb;
  white-space: normal;
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
}

td:last-child,
th:last-child,
.stream-table td:last-child,
.stream-table th:last-child,
.report-table td:last-child,
.report-table th:last-child {
  white-space: normal;
  min-width: 180px;
}

td small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
}

.domain-monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.domain-monitor-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(82px, .7fr) minmax(82px, .7fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #d8e7fb;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fbff, #fff);
}

.domain-monitor-card strong,
.domain-monitor-card b {
  display: block;
  color: #061640;
  font-size: 15px;
  line-height: 1.15;
}

.domain-monitor-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
}

.attempt-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.attempt-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #d8e7fb;
  border-radius: 10px;
  background: #fff;
}

.attempt-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.attempt-card-head strong {
  color: #061640;
  font-size: 15px;
}

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

.attempt-meta span {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.attempt-meta b,
.attempt-card p b {
  color: #061640;
}

.attempt-card p {
  margin: 0;
  color: #425471;
  font-size: 13px;
  line-height: 1.4;
}

.example-list {
  display: grid;
  gap: 6px;
}

.example-list span {
  display: block;
}

.example-drilldown {
  width: 100%;
}

.runtime-table td:first-child {
  color: #30415f;
  font-weight: 800;
}

.chip,
.ok {
  display: inline-grid;
  place-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf5f1;
  color: #3c8b68;
  font-weight: 800;
}

.chip.healthy {
  background: #edf5f1;
  color: #28714f;
}

.chip.warning {
  background: #fff5dc;
  color: #a85f00;
}

.chip.danger {
  background: #fff1f0;
  color: #b42318;
}

.chip.neutral {
  background: #eef4ff;
  color: #3b6fb2;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  text-align: left;
  font-weight: 850;
  cursor: pointer;
}

.link-button:hover {
  color: var(--blue);
  text-decoration: underline;
}

.link-button small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.stream-table th:last-child,
.stream-table td:last-child {
  text-align: left;
  white-space: normal;
  min-width: 180px;
}

.module-grid,
.key-value-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.module-grid div,
.key-value-grid div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dce8f8;
  border-radius: 9px;
  background: #f8fbff;
}

.module-grid strong,
.key-value-grid span {
  color: #061640;
  font-weight: 900;
}

.module-grid span,
.key-value-grid strong {
  color: #60718e;
  font-size: 13px;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.module-grid em {
  justify-self: start;
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf5f1;
  color: #3c8b68;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.config-editor-panel {
  border-color: #bcd7ff;
  background:
    linear-gradient(135deg, rgba(7, 87, 255, .07), rgba(127, 193, 223, .05)),
    #fff;
}

.time-control-panel {
  border-color: #d3e3fb;
  background: #f8fbff;
}

.compact-controls {
  margin-bottom: 14px;
}

.rule-builder {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr repeat(3, minmax(92px, .7fr)) 1fr auto;
  gap: 12px;
  align-items: end;
}

.retry-builder {
  grid-template-columns: 1.35fr 1.1fr 1.6fr .7fr auto;
}

.bounce-builder {
  grid-template-columns: 1.1fr 1.5fr 1.15fr 1.1fr 1.15fr auto;
}

.warmup-builder {
  grid-template-columns: 1.2fr 1.2fr .95fr repeat(3, minmax(92px, .65fr)) 1fr 1fr auto;
}

.proxy-builder {
  grid-template-columns: 1fr 1fr 1.1fr 1.2fr .75fr 1.1fr auto;
}

.ip-builder,
.auth-domain-builder {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
}

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

.rule-builder label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #30415f;
  font-size: 12px;
  font-weight: 900;
}

.rule-builder input,
.rule-builder select {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid #d6e2f2;
  border-radius: 8px;
  background: #fff;
  color: #061640;
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
}

.user-table select {
  min-width: 150px;
  max-width: 180px;
}

.cause {
  display: inline-grid;
  place-items: center;
  min-height: 21px;
  margin-right: 6px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.cause.remote {
  background: #fff4e8;
  color: #d66a17;
}

.cause.reputation {
  background: #ffeded;
  color: #d83d42;
}

.cause.policy {
  background: #eef4ff;
  color: #3b6fb2;
}

.cause.healthy {
  background: #edf5f1;
  color: #39885e;
}

.insight-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  color: #667178;
  font-size: 13px;
  font-weight: 750;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.panel-title-row h2 {
  margin-bottom: 0;
}

.drilldown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.drilldown-grid h3,
.panel > h3 {
  margin: 0 0 10px;
  color: var(--navy);
  font-size: 15px;
  line-height: 1.2;
}

.detail-head {
  display: grid;
  gap: 2px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf3fb;
  margin-bottom: 10px;
}

.detail-head strong {
  font-size: 21px;
  line-height: 1.15;
  color: #27343a;
}

.detail-head span {
  color: #6a777e;
  font-weight: 750;
}

.detail-list {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px 14px;
  margin: 16px 0 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  color: #4f5c63;
  font-weight: 700;
}

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

.pipeline div,
.access-grid div {
  min-height: 108px;
  border: 1px solid #d9e4f4;
  border-top: 5px solid var(--blue);
  border-radius: 10px;
  padding: 12px;
  background: #f8fbff;
}

.access-grid .selected-card {
  border-color: var(--blue);
  background: #eef6ff;
  box-shadow: 0 12px 26px rgba(7, 87, 255, 0.14);
}

.pipeline strong,
.access-grid strong {
  display: block;
  color: var(--blue);
  font-size: 15px;
  line-height: 1.1;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.pipeline span,
.access-grid span {
  color: #465875;
  font-size: 12px;
  font-weight: 750;
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.code-block {
  min-height: 330px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  border-radius: 10px;
  background: #061640;
  color: #e8f1ff;
  font: 13px/1.65 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.code-block.compact {
  min-height: 430px;
}

.primary-action {
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #0757ff, #0047dc);
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}

.primary-action:hover {
  background: linear-gradient(135deg, #1c7dff, #0757ff);
}

.mini-action {
  min-height: 28px;
  border: 0;
  border-radius: 8px;
  padding: 0 9px;
  background: #edf5f1;
  color: #3c8b68;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.mini-action:hover {
  background: #dbeee5;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-panel {
  width: min(520px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-brand {
  margin-bottom: 16px;
}

.auth-panel h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.1;
}

.auth-panel p {
  color: #69757c;
  margin: 0 0 18px;
}

.auth-error,
.auth-demo {
  border-radius: 10px;
  padding: 10px 12px;
}

.auth-error {
  background: #fff2f1;
  color: #c23b36;
  border: 1px solid #f0b6b2;
}

.auth-demo {
  background: #eef5ff;
  color: var(--blue);
  border: 1px solid #c8d9f8;
}

.admin-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-shell {
  padding: 58px 36px 44px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 28px;
}

.admin-header h1 {
  margin: 0;
  color: #243138;
  font-size: 34px;
  line-height: 1.05;
}

.admin-header p {
  margin: 8px 0 0;
  color: #6a777e;
  font-weight: 750;
}

.license-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

code {
  color: #29383f;
  font: 12px/1.4 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-weight: 850;
}

.download-link {
  display: grid;
  gap: 4px;
  min-width: 260px;
}

.download-link span {
  color: #69757c;
  font-size: 12px;
  font-weight: 750;
}

.bars {
  height: 246px;
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  align-items: end;
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid #edf3fb;
}

.bar-wrap {
  height: 100%;
  display: grid;
  grid-template-rows: 22px 1fr 20px;
  align-items: end;
  text-align: center;
  color: #9aa2a8;
  font-size: 11px;
}

.bar {
  width: 22px;
  justify-self: center;
  background: var(--orange);
  border-radius: 2px 2px 0 0;
}

.spark {
  width: 100%;
  height: 132px;
}

.mini-bars {
  height: 132px;
  display: flex;
  align-items: end;
  gap: 8px;
  padding-top: 20px;
}

.mini-bars i {
  width: 9px;
  background: #1c7dff;
  display: block;
}

.mini-bars i:nth-child(5n) {
  background: #e96b5f;
}

.events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 11px;
}

.events li {
  display: grid;
  grid-template-columns: 66px 1fr 38px;
  gap: 10px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf3fb;
}

.events span {
  color: var(--blue);
  font-weight: 850;
  font-size: 12px;
  text-transform: uppercase;
}

.events p {
  margin: 0;
  color: #30415f;
}

.events time {
  color: #9aa2a8;
  text-align: right;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.toggle {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  font-weight: 750;
}

.toggle input {
  width: 18px;
  height: 18px;
  box-shadow: none;
}

.note {
  color: #6b767c;
  margin: 18px 0 0;
}

.ai-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ai-card {
  border: 1px solid #d9e4f4;
  border-top: 5px solid #7fc1df;
  border-radius: 10px;
  background: #f8fbff;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.ai-card.high {
  border-top-color: #ef4444;
}

.ai-card.medium {
  border-top-color: #ff8a2a;
}

.ai-card.low {
  border-top-color: #a7c943;
}

.ai-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.ai-card h3 {
  margin: 0;
  color: var(--navy);
  font-size: 18px;
  line-height: 1.2;
}

.ai-card p {
  margin: 0;
  color: #465875;
  font-weight: 750;
}

.ai-evidence {
  margin: 0;
  padding-left: 18px;
  color: #30415f;
  display: grid;
  gap: 5px;
}

.ai-recommendation {
  border-left: 4px solid var(--blue);
  padding-left: 10px;
}

.report-score-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.report-score {
  border-top: 5px solid var(--blue);
  background: #f8fbff;
  padding: 12px;
  min-width: 0;
  border-radius: 10px;
}

.report-score.healthy { border-top-color: #a7c943; }
.report-score.remote { border-top-color: #ff8a2a; }
.report-score.reputation { border-top-color: #ef4444; }
.report-score.policy { border-top-color: #1c7dff; }

.report-score span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.report-score strong {
  display: block;
  color: var(--navy);
  font-size: 24px;
  line-height: 1.15;
  margin-top: 4px;
}

.report-score-pill {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 26px;
  border-radius: 999px;
  color: #fff;
  font-weight: 900;
}

.report-score-pill.healthy { background: #7aa625; }
.report-score-pill.remote { background: #d66a17; }
.report-score-pill.reputation { background: #c9343a; }

.report-insights {
  display: grid;
  gap: 12px;
}

.report-insight {
  border: 1px solid #d9e4f4;
  border-left: 5px solid var(--blue);
  border-radius: 10px;
  background: #f8fbff;
  padding: 12px;
}

.report-insight.high { border-left-color: #ef4444; }
.report-insight.medium { border-left-color: #ff8a2a; }
.report-insight.low { border-left-color: #a7c943; }

.report-insight span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.report-insight strong {
  display: block;
  margin-top: 3px;
  color: var(--navy);
  font-size: 15px;
}

.report-insight p {
  margin: 6px 0;
  color: #30415f;
  font-weight: 750;
}

.report-insight small {
  display: block;
  color: var(--blue);
  font-weight: 850;
}

.report-table td:last-child {
  white-space: normal;
}

.trend-bars {
  height: 254px;
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  padding-top: 8px;
}

.trend-bar {
  height: 100%;
  display: grid;
  grid-template-rows: 24px 1fr 20px;
  gap: 4px;
  align-items: end;
  text-align: center;
}

.trend-bar strong {
  color: #67737a;
  font-size: 10px;
  line-height: 1;
  transform: rotate(-20deg);
  transform-origin: center;
  white-space: nowrap;
}

.trend-bar i {
  display: block;
  width: 100%;
  min-height: 10px;
  border-radius: 3px 3px 0 0;
  background: #7fc1df;
}

.trend-bar:nth-child(3n) i { background: #a7c943; }
.trend-bar:nth-child(4n) i { background: #ff8a2a; }

.trend-bar span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 1100px) {
  #app { grid-template-columns: 190px 1fr; }
  .workspace { padding: 18px 14px 30px; }
  .filter-rail { grid-template-columns: 1fr 1fr; margin: -18px -14px 16px; }
  .filter-rail > * { min-width: 0; }
  .workflow-lead {
    align-items: stretch;
    flex-direction: column;
  }
  .section-tabs {
    justify-content: flex-start;
    min-width: 0;
  }
  .health-grid,
  .ops-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-primary-panel .metric-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .condition-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-grid,
  .key-value-grid { grid-template-columns: 1fr; }
  .rule-builder,
  .retry-builder,
  .bounce-builder,
  .warmup-builder,
  .proxy-builder,
  .bulk-builder,
  .ip-builder,
  .auth-domain-builder,
  .report-builder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rule-builder .primary-action { grid-column: span 2; }
  .persona-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drilldown-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-score-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .configurator-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .configurator-strip .primary-action { grid-column: span 2; }
  .bulk-hero { grid-template-columns: 1fr; }
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
}

@media (max-width: 720px) {
  #app { display: block; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    justify-content: space-between;
    padding: 10px 14px;
    overflow-x: auto;
  }
  .top-links { display: none; }
  nav {
    display: flex;
    gap: 6px;
    max-height: none;
    max-width: calc(100vw - 68px);
    overflow-x: auto;
    overflow-y: hidden;
    padding-right: 0;
  }
  nav::-webkit-scrollbar { height: 4px; }
  .brand { width: 34px; height: 34px; font-size: 22px; line-height: 22px; flex: 0 0 34px; }
  .nav-item { width: 36px; height: 36px; flex: 0 0 36px; justify-content: center; padding: 0; }
  .nav-item svg { width: 23px; height: 23px; }
  .nav-item span { display: none; }
  .filter-rail { grid-template-columns: 1fr; gap: 12px; padding: 16px; margin: 0 0 20px; }
  .status-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) repeat(3, 34px);
  }
  .status-control span,
  .gear {
    min-width: 0;
    width: 34px;
    padding: 0 4px;
  }
  .run { padding: 0 10px; }
  .page-grid { gap: 18px; }
  .panel { padding: 14px; overflow-x: auto; }
  .panel h2 { font-size: 19px; }
  .dashboard-primary-panel,
  .dashboard-secondary-panel { padding: 18px; }
  .dashboard-primary-panel .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-primary-panel .metric strong { font-size: 22px; }
  .dashboard-primary-panel .line-chart { height: 240px; }
  .dashboard-primary-panel .bars { min-height: 230px; }
  .dashboard-primary-panel .bar-wrap { min-height: 210px; }
  .dashboard-primary-panel .runtime-table { table-layout: auto; font-size: 13px; }
  .health-grid,
  .ops-flow { grid-template-columns: 1fr; }
  .condition-grid { grid-template-columns: 1fr; }
  .condition-card { min-height: 110px; }
  .rule-builder,
  .retry-builder,
  .bounce-builder,
  .warmup-builder,
  .proxy-builder,
  .bulk-builder,
  .ip-builder,
  .auth-domain-builder,
  .report-builder { grid-template-columns: 1fr; }
  .rule-builder .primary-action { grid-column: auto; }
  .domain-monitor-card { grid-template-columns: 1fr 1fr; }
  .attempt-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .configurator-strip { grid-template-columns: 1fr; }
  .configurator-strip .primary-action { grid-column: auto; }
  .bulk-metrics,
  .guardrail-grid { grid-template-columns: 1fr; }
  .help-tip::after { right: auto; left: -220px; }
  .line-chart { height: 170px; }
  .bars { gap: 7px; }
  .bar { width: 14px; }
  .detail-list { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: 1fr; }
  .access-grid { grid-template-columns: 1fr; }
  .ai-grid { grid-template-columns: 1fr; }
  .drilldown-grid { grid-template-columns: 1fr; }
  .persona-strip { grid-template-columns: 1fr; }
  .report-score-strip { grid-template-columns: 1fr; }
  .trend-bars { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .trend-bar:nth-child(even) strong { visibility: hidden; }
  .admin-shell { padding: 62px 14px 28px; }
  .admin-header { display: grid; }
  .license-form { grid-template-columns: 1fr; }
}
