:root {
  color-scheme: dark;
  --bg: #050506;
  --surface: #0d0d10;
  --surface-2: #141418;
  --surface-3: #1b1b20;
  --line: #24242b;
  --line-soft: rgba(255, 255, 255, 0.07);
  --text: #f4f3f1;
  --muted: #9a98a4;
  --faint: #6d6a75;
  --green: #45d483;
  --cyan: #48c8ff;
  --amber: #f2b94b;
  --violet: #a78bfa;
  --rose: #ff6f91;
  --red: #ff5d5d;
  --blue: #5aa6ff;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 220px),
    radial-gradient(circle at 50% -20%, rgba(72, 200, 255, 0.1), transparent 36rem),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  width: 248px;
  height: 100vh;
  flex: 0 0 248px;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid var(--line-soft);
  background: rgba(10, 10, 12, 0.86);
  padding: 16px 12px;
  backdrop-filter: blur(18px);
}

.brand-block {
  padding: 0 2px 8px;
}

.workspace-switch {
  display: grid;
  width: 100%;
  grid-template-columns: 36px 1fr 16px;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 8px;
  text-align: left;
}

.workspace-switch:hover {
  border-color: var(--line);
  background: var(--surface-2);
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(72, 200, 255, 0.35), transparent 58%),
    linear-gradient(315deg, rgba(69, 212, 131, 0.42), transparent 54%),
    #16161c;
  color: #ffffff;
  font-weight: 760;
}

.workspace-switch strong,
.workspace-switch small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-switch strong {
  font-size: 14px;
  font-weight: 680;
}

.workspace-switch small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.chevron {
  color: var(--muted);
}

.nav-section {
  display: grid;
  gap: 4px;
}

.nav-item {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  color: #d2d0d7;
  padding: 7px 10px;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.nav-item.active {
  background: #24242a;
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.nav-item svg,
.icon-text-button svg,
.primary-button svg,
.ghost-button svg,
.ghost-icon svg,
.search-field svg,
.select-field svg,
.metric-header svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.9;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.quota-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.quota-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.quota-card strong {
  display: block;
  margin-top: 7px;
  font-size: 14px;
}

.progress-track {
  height: 6px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #26262e;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--amber));
}

.icon-text-button,
.ghost-button,
.primary-button,
.ghost-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.icon-text-button {
  min-height: 36px;
  border: 1px solid transparent;
  background: transparent;
  color: #d7d5dc;
  padding: 8px 10px;
}

.icon-text-button:hover,
.ghost-button:hover,
.ghost-icon:hover {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.main-surface {
  width: 100%;
  min-width: 0;
  padding: 18px 22px 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.page-title {
  min-width: 0;
}

.eyebrow,
.panel-kicker {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.page-title h1 {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 680;
  line-height: 1.16;
}

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

.segmented {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a0a0c;
  padding: 3px;
}

.segmented button {
  min-width: 46px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 6px 9px;
  font-size: 13px;
}

.segmented button:hover {
  color: #fff;
}

.segmented button.active {
  background: var(--surface-3);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

.ghost-button,
.primary-button {
  min-height: 36px;
  border: 1px solid var(--line);
  padding: 8px 12px;
}

.ghost-button {
  background: #0b0b0e;
  color: #dfdde4;
}

.primary-button {
  border-color: rgba(72, 200, 255, 0.25);
  background: linear-gradient(180deg, #ffffff, #d9e7ff);
  color: #08080a;
  font-weight: 680;
  box-shadow: 0 12px 36px rgba(72, 200, 255, 0.13);
}

.primary-button:hover {
  transform: translateY(-1px);
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(160px, 210px));
  gap: 8px;
  margin-top: 16px;
}

.search-field,
.select-field {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 13, 16, 0.92);
  color: var(--muted);
  padding: 0 10px;
}

.search-field:focus-within,
.select-field:focus-within {
  border-color: rgba(72, 200, 255, 0.58);
  box-shadow: 0 0 0 3px rgba(72, 200, 255, 0.08);
}

.search-field input,
.select-field select {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.select-field select {
  appearance: none;
  cursor: pointer;
}

.search-field input::placeholder {
  color: var(--faint);
}

.view-tabs {
  display: flex;
  gap: 4px;
  margin-top: 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.view-tabs button {
  display: inline-flex;
  min-height: 42px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  font-weight: 620;
}

.view-tabs button:hover {
  color: #ffffff;
}

.view-tabs button.active {
  border-bottom-color: var(--cyan);
  color: var(--text);
}

.view-tabs svg {
  width: 16px;
  height: 16px;
}

.tab-panel[hidden] {
  display: none;
}

.insight-brief {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(72, 200, 255, 0.09), rgba(69, 212, 131, 0.045), transparent),
    var(--surface);
  box-shadow: var(--shadow);
  padding: 13px 14px;
}

.brief-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(72, 200, 255, 0.22);
  border-radius: 8px;
  background: rgba(72, 200, 255, 0.1);
  color: var(--cyan);
}

.brief-icon svg {
  width: 18px;
  height: 18px;
}

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

.brief-copy span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.brief-copy strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #ffffff;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brief-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.brief-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.brief-stat {
  min-width: 84px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 8px 10px;
  text-align: right;
}

.brief-stat strong {
  display: block;
  color: #ffffff;
  font-size: 14px;
}

.brief-stat span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.metric-card {
  position: relative;
  min-height: 162px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.048), rgba(255, 255, 255, 0.012)),
    var(--surface);
  padding: 15px;
  box-shadow: var(--shadow);
}

.metric-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  content: "";
  opacity: 0.95;
}

.accent-green::before {
  background: var(--green);
}

.accent-cyan::before {
  background: var(--cyan);
}

.accent-amber::before {
  background: var(--amber);
}

.accent-violet::before {
  background: var(--violet);
}

.metric-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cbc8d1;
  font-size: 13px;
}

.metric-value {
  margin-top: 18px;
  font-size: 34px;
  font-weight: 720;
  line-height: 0.95;
}

.metric-foot {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.metric-foot.up {
  color: var(--green);
}

.metric-foot.neutral {
  color: var(--amber);
}

.sparkline {
  position: absolute;
  right: 12px;
  bottom: 8px;
  left: 12px;
  width: calc(100% - 24px);
  height: 46px;
  overflow: visible;
}

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

.panel {
  min-width: 0;
  min-height: 356px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.038), rgba(255, 255, 255, 0.01)),
    var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.panel-wide {
  grid-column: span 8;
}

.panel-large {
  grid-column: span 8;
}

.panel-tall {
  grid-column: span 4;
  grid-row: span 2;
}

.panel-medium {
  grid-column: span 6;
}

.dashboard-grid > .panel:not(.panel-wide):not(.panel-large):not(.panel-tall):not(.panel-medium) {
  grid-column: span 4;
}

.panel-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-heading h2 {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 660;
  line-height: 1.25;
}

.ghost-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.legend-blue {
  background: var(--cyan);
}

.legend-orange {
  background: var(--amber);
}

.legend-pink {
  background: var(--rose);
}

.legend-green {
  background: var(--green);
}

.legend-red {
  background: var(--red);
}

.funnel {
  display: grid;
  gap: 11px;
}

.funnel-row {
  display: grid;
  grid-template-columns: 142px minmax(120px, 1fr) 86px;
  align-items: center;
  gap: 12px;
}

.funnel-label {
  min-width: 0;
  color: #d8d5dd;
  font-size: 13px;
}

.funnel-label strong,
.funnel-label small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.funnel-label small {
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.25;
}

.funnel-track {
  position: relative;
  height: 34px;
  overflow: hidden;
  border-radius: 7px;
  background:
    repeating-linear-gradient(90deg, transparent, transparent 42px, rgba(255, 255, 255, 0.035) 43px),
    #15151a;
}

.funnel-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(72, 200, 255, 0.92), rgba(69, 212, 131, 0.92));
  box-shadow: 0 0 26px rgba(72, 200, 255, 0.18);
}

.funnel-row:nth-child(3n + 2) .funnel-bar {
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.9), rgba(72, 200, 255, 0.9));
}

.funnel-row:nth-child(3n + 3) .funnel-bar {
  background: linear-gradient(90deg, rgba(242, 185, 75, 0.92), rgba(69, 212, 131, 0.88));
}

.funnel-value {
  color: #ffffff;
  font-size: 13px;
  font-weight: 680;
  text-align: right;
}

.funnel-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 17px;
  color: var(--muted);
  font-size: 12px;
}

.funnel-notes span {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 11px;
  overflow-wrap: anywhere;
}

.funnel-notes strong {
  color: var(--text);
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: 12px;
}

.live-dot::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 18px currentColor;
  content: "";
}

.event-feed {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-item {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  padding: 0 0 18px;
}

.event-item:not(:last-child)::before {
  position: absolute;
  top: 34px;
  bottom: 0;
  left: 16px;
  width: 1px;
  background: var(--line);
  content: "";
}

.event-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--cyan);
}

.event-icon svg {
  width: 16px;
  height: 16px;
}

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

.event-copy strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #eae8ef;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.38;
}

.event-copy time {
  color: var(--faint);
  font-size: 11px;
}

.chart,
.scatter {
  width: 100%;
  height: auto;
}

.axis,
.grid-line {
  stroke: rgba(255, 255, 255, 0.09);
  stroke-width: 1;
}

.axis-label {
  fill: var(--faint);
  font-size: 11px;
}

.chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.chart-area {
  opacity: 0.16;
}

.model-stack {
  display: grid;
  gap: 13px;
}

.model-row {
  display: grid;
  gap: 8px;
}

.model-meta,
.harness-meta,
.friction-meta,
.team-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.model-name,
.harness-name,
.team-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: #e9e6ee;
  font-size: 13px;
  font-weight: 620;
}

.model-name span,
.harness-name span,
.team-avatar {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 7px;
  background: #202028;
  color: #fff;
  font-size: 11px;
}

.model-metric,
.harness-score,
.friction-score,
.team-impact {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.stack-track,
.harness-track,
.friction-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #1a1a20;
}

.stack-fill,
.harness-fill,
.friction-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.harness-list,
.friction-list,
.team-table {
  display: grid;
  gap: 13px;
}

.harness-row,
.friction-row {
  display: grid;
  gap: 8px;
}

.harness-sub,
.friction-sub {
  color: var(--muted);
  font-size: 12px;
}

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

.skill-tile {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121216;
  padding: 10px;
}

.skill-tile strong {
  display: block;
  overflow: hidden;
  color: #ebe9ef;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-tile span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.heat-track {
  height: 5px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #24242b;
}

.heat-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--cyan), var(--green));
}

.mini-stat {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #111116;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
}

.mini-stat strong {
  color: #fff;
}

.team-table {
  margin-top: 2px;
}

.team-row {
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 12px;
}

.team-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.team-name span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-impact {
  display: grid;
  min-width: 106px;
  gap: 3px;
  text-align: right;
}

.team-impact strong {
  color: #ffffff;
  font-size: 13px;
}

.route-simulator,
.thinking-mix,
.benchmark-table,
.opportunity-list,
.diff-stack,
.gate-list,
.sandbox-matrix,
.risk-list,
.audit-list {
  display: grid;
  gap: 12px;
}

.scenario-controls,
.policy-levers {
  display: grid;
  gap: 10px;
  margin-bottom: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 12px;
}

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

.scenario-controls label {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 12px;
}

.scenario-controls label span,
.policy-levers span {
  color: #dedbe4;
  font-size: 13px;
  font-weight: 620;
}

.scenario-controls label strong {
  color: var(--green);
  font-size: 12px;
}

.scenario-controls input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--cyan);
}

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

.policy-levers label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.policy-levers input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  accent-color: var(--green);
}

.route-row {
  display: grid;
  grid-template-columns: minmax(118px, 168px) minmax(180px, 1fr) minmax(90px, 120px);
  align-items: center;
  gap: 12px;
}

.route-label strong,
.route-label span,
.route-save strong,
.route-save span {
  display: block;
}

.route-label strong,
.mix-row strong,
.benchmark-name strong,
.opportunity-title,
.risk-title,
.audit-title {
  color: #ebe9ef;
  font-size: 13px;
  font-weight: 680;
}

.route-label span,
.route-save span,
.mix-row span,
.benchmark-name span,
.opportunity-meta,
.risk-meta,
.audit-meta,
.gate-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.route-bars {
  display: grid;
  gap: 6px;
}

.route-track {
  display: flex;
  height: 18px;
  overflow: hidden;
  border-radius: 6px;
  background: #1a1a20;
}

.route-track span {
  height: 100%;
}

.route-track .premium {
  background: var(--violet);
}

.route-track .balanced {
  background: var(--cyan);
}

.route-track .cheap {
  background: var(--green);
}

.route-track .local {
  background: var(--amber);
}

.route-caption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--faint);
  font-size: 11px;
}

.route-save {
  text-align: right;
}

.route-save strong {
  color: var(--green);
  font-size: 14px;
}

.mix-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 72px;
  align-items: center;
  gap: 12px;
}

.mix-meter {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.mix-cell {
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    #111116;
  padding: 10px;
}

.mix-cell strong {
  display: block;
  color: #fff;
  font-size: 16px;
}

.mix-cell span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.benchmark-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(4, minmax(72px, 96px));
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line-soft);
  padding: 0 0 11px;
}

.benchmark-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.benchmark-head {
  color: var(--faint);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.benchmark-head div:not(:first-child) {
  text-align: right;
}

.benchmark-score {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.benchmark-score strong {
  color: #ffffff;
  font-size: 13px;
}

.benchmark-score.winner strong {
  color: var(--green);
}

.opportunity-card,
.gate-row,
.risk-card,
.audit-row,
.diff-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121216;
  padding: 12px;
}

.opportunity-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.opportunity-value {
  color: var(--green);
  font-size: 13px;
  font-weight: 720;
  text-align: right;
}

.diff-card {
  padding: 0;
  overflow: hidden;
}

.diff-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

.diff-header strong {
  min-width: 0;
  overflow: hidden;
  color: #ffffff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diff-header span {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 12px;
  font-weight: 680;
}

.diff-lines {
  display: grid;
  gap: 1px;
  padding: 8px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.diff-lines div {
  padding: 0 12px;
  white-space: nowrap;
}

.diff-lines .remove {
  color: #ff9aa8;
  background: rgba(255, 93, 93, 0.08);
}

.diff-lines .add {
  color: #8df1b5;
  background: rgba(69, 212, 131, 0.08);
}

.diff-lines .context {
  color: var(--muted);
}

.gate-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
}

.gate-state {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: rgba(69, 212, 131, 0.12);
  color: var(--green);
}

.gate-state.warn {
  background: rgba(242, 185, 75, 0.13);
  color: var(--amber);
}

.gate-copy strong {
  display: block;
  color: #ffffff;
  font-size: 13px;
}

.gate-value {
  color: #ffffff;
  font-size: 13px;
  font-weight: 720;
}

.sandbox-row {
  display: grid;
  grid-template-columns: minmax(110px, 150px) minmax(180px, 1fr) 80px;
  align-items: center;
  gap: 12px;
}

.sandbox-name {
  color: #ebe9ef;
  font-size: 13px;
  font-weight: 680;
}

.sandbox-track {
  display: flex;
  height: 30px;
  overflow: hidden;
  border-radius: 7px;
  background: #1a1a20;
}

.sandbox-track span {
  display: block;
  height: 100%;
}

.sandbox-track .safe {
  background: var(--green);
}

.sandbox-track .escalated {
  background: var(--amber);
}

.sandbox-track .open {
  background: var(--red);
}

.sandbox-score {
  color: #ffffff;
  font-size: 13px;
  font-weight: 720;
  text-align: right;
}

.justification-ring {
  min-height: 260px;
  place-items: center;
  text-align: center;
}

.ring-wrap {
  position: relative;
  display: grid;
  width: 178px;
  height: 178px;
  place-items: center;
}

.ring-wrap svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-copy strong {
  display: block;
  color: #ffffff;
  font-size: 34px;
  line-height: 1;
}

.ring-copy span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.justification-breakdown {
  display: grid;
  width: 100%;
  gap: 8px;
  margin-top: 18px;
}

.justification-breakdown div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.justification-breakdown strong {
  color: #ffffff;
}

.risk-card {
  display: grid;
  gap: 9px;
}

.risk-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.risk-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 720;
}

.risk-pill.high {
  background: rgba(255, 93, 93, 0.14);
  color: #ff8b8b;
}

.risk-pill.medium {
  background: rgba(242, 185, 75, 0.14);
  color: var(--amber);
}

.risk-pill.low {
  background: rgba(69, 212, 131, 0.13);
  color: var(--green);
}

.risk-control {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.audit-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
}

.audit-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: rgba(72, 200, 255, 0.1);
  color: var(--cyan);
}

.audit-icon svg {
  width: 16px;
  height: 16px;
}

.audit-count {
  color: #ffffff;
  font-size: 13px;
  font-weight: 720;
  text-align: right;
}

.tooltip {
  position: fixed;
  z-index: 20;
  max-width: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 18, 22, 0.96);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.45);
  color: #eeecf2;
  padding: 9px 10px;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 0.14s ease,
    transform 0.14s ease;
}

.tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 18, 22, 0.96);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  color: #ffffff;
  padding: 10px 12px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.58);
  padding: 18px;
  backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
  display: none;
}

.report-modal {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015)),
    var(--surface);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.62);
  padding: 16px;
}

.modal-heading,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-heading h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.modal-heading .ghost-icon svg {
  transform: rotate(45deg);
}

.report-body {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.report-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111116;
  padding: 12px;
}

.report-section strong {
  display: block;
  color: #ffffff;
  font-size: 14px;
}

.report-section p,
.report-section li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.report-section ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.modal-actions {
  margin-top: 16px;
}

@media (max-width: 1120px) {
  .sidebar {
    width: 224px;
    flex-basis: 224px;
  }

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

  .benchmark-row {
    grid-template-columns: minmax(180px, 1fr) repeat(4, minmax(62px, 82px));
  }

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

  .panel-wide,
  .panel-large,
  .panel-tall,
  .panel-medium,
  .dashboard-grid > .panel:not(.panel-wide):not(.panel-large):not(.panel-tall):not(.panel-medium) {
    grid-column: span 6;
  }

  .panel-tall {
    grid-row: auto;
  }
}

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

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex-basis: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

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

  .nav-item {
    justify-content: center;
  }

  .nav-item:not(.active) {
    color: var(--muted);
  }

  .sidebar-footer {
    display: none;
  }

  .topbar,
  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
  }

  .segmented,
  .ghost-button,
  .primary-button {
    width: 100%;
  }

  .filter-bar {
    grid-template-columns: 1fr 1fr;
  }

  .insight-brief {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .brief-stats {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .scenario-controls,
  .policy-levers {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .main-surface {
    padding: 14px 12px 24px;
  }

  .nav-section,
  .filter-bar,
  .insight-strip,
  .skill-grid,
  .funnel-notes {
    grid-template-columns: 1fr;
  }

  .view-tabs button {
    width: max-content;
  }

  .nav-item {
    justify-content: flex-start;
  }

  .panel-wide,
  .panel-large,
  .panel-tall,
  .panel-medium,
  .dashboard-grid > .panel:not(.panel-wide):not(.panel-large):not(.panel-tall):not(.panel-medium) {
    grid-column: span 6;
  }

  .funnel-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .funnel-value {
    text-align: left;
  }

  .route-row,
  .sandbox-row,
  .audit-row {
    grid-template-columns: 1fr;
  }

  .route-save,
  .sandbox-score,
  .audit-count {
    text-align: left;
  }

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

  .benchmark-head {
    display: none;
  }

  .mix-meter {
    grid-template-columns: 1fr;
  }

  .opportunity-card,
  .gate-row {
    grid-template-columns: 1fr;
  }

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

  .brief-copy strong {
    white-space: normal;
  }

  .chart-legend {
    justify-content: flex-start;
  }
}
