:root {
  --ink: #071a15;
  --ink-2: #09241c;
  --card: #102c22;
  --card-2: #14372a;
  --card-3: #193f30;
  --line: rgba(174, 225, 200, 0.13);
  --line-strong: rgba(174, 225, 200, 0.25);
  --text: #eef9ed;
  --muted: #9db4aa;
  --dim: #6f8b7f;
  --lime: #c1ff2e;
  --teal: #22b9d4;
  --pink: #ee6ba5;
  --green: #83c99b;
  --yellow: #eddf70;
  --serif: "DM Serif Display", Georgia, serif;
  --sans: "DM Sans", sans-serif;
  --mono: "JetBrains Mono", monospace;
}
* {
  box-sizing: border-box;
}
html {
  background: var(--ink);
}
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 75% -20%, #164d37 0, transparent 34rem),
    var(--ink);
  font: 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button,
select,
input {
  font: inherit;
}
button,
select {
  color: inherit;
}
button {
  cursor: pointer;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
[hidden] {
  display: none !important;
}

/* Auth keeps the same server-side /auth contract as the other dashboard pages. */
.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 15%, #184a35, transparent 44rem), var(--ink);
}
.auth-card {
  width: min(380px, calc(100% - 32px));
  padding: 44px 38px 38px;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: rgba(16, 44, 34, 0.92);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}
.brand-mark {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.06em;
  color: var(--text);
  white-space: nowrap;
}
.brand-mark > span {
  color: var(--lime);
  font-weight: 700;
  margin-right: 2px;
}
.auth-card .brand-mark {
  font-size: 33px;
  margin-bottom: 12px;
}
.auth-subtitle {
  color: var(--muted);
  margin: 0 0 26px;
}
.auth-input {
  width: 100%;
  color: var(--text);
  background: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 12px 14px;
  outline: 0;
  text-align: center;
}
.auth-input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(193, 255, 46, 0.12);
}
.auth-btn,
.lime-btn {
  border: 0;
  background: var(--lime);
  color: #102416;
  font-weight: 700;
  border-radius: 8px;
  padding: 11px 16px;
  transition:
    transform 0.15s,
    filter 0.15s;
}
.auth-btn {
  width: 100%;
  margin-top: 12px;
}
.auth-btn:hover,
.lime-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.auth-error {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--pink);
  font-size: 12px;
}

.app-shell {
  min-height: 100vh;
}
.topbar {
  min-height: 53px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 44px);
  background: rgba(4, 19, 14, 0.74);
}
.topbar-brand,
.topbar-meta,
.head-actions,
.toolbar,
.control-group,
.section-tabs,
.subtabs {
  display: flex;
  align-items: center;
}
.topbar-brand {
  gap: 14px;
}
.eyebrow,
.topbar-meta,
.kicker,
.control-group label,
.toolbar-note,
.status-pill {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 10px;
  color: var(--muted);
}
.topbar-meta {
  gap: 9px;
  font-size: 10px;
}
.dot {
  color: var(--lime);
}
.status-pill {
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: 4px 8px;
  color: var(--lime);
}
.status-pill.error {
  color: var(--pink);
}
.product-nav {
  min-height: 40px;
  padding: 0 clamp(16px, 3vw, 44px);
  display: flex;
  gap: 3px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  background: rgba(6, 28, 21, 0.72);
}
.product-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 11px 13px 9px;
  font-size: 12px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.product-nav a:hover,
.product-nav a.active {
  color: var(--text);
  border-color: var(--lime);
}

.workspace {
  width: min(1480px, 100%);
  padding: 28px clamp(16px, 3vw, 44px) 64px;
  margin: 0 auto;
}
.workspace-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 21px;
}
.kicker {
  color: var(--lime);
  margin: 0 0 7px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  margin-bottom: 4px;
  font: 30px/1.1 var(--serif);
  letter-spacing: -0.02em;
}
h2 {
  margin-bottom: 5px;
  font: 23px/1.1 var(--serif);
}
h3 {
  margin-bottom: 4px;
  font: 18px/1.2 var(--serif);
}
.workspace-subtitle {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.head-actions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
}
.ghost-btn {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  border-radius: 7px;
  padding: 9px 11px;
  font-size: 11px;
}
.ghost-btn:hover {
  color: var(--text);
  border-color: var(--lime);
}

.toolbar {
  gap: 17px;
  flex-wrap: wrap;
  padding: 13px 15px;
  margin-bottom: 17px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(16, 44, 34, 0.72);
}
.control-group {
  gap: 7px;
}
.control-group label {
  white-space: nowrap;
}
select {
  min-width: 102px;
  padding: 7px 28px 7px 9px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--ink-2);
  color: var(--text);
  font-size: 12px;
}
.compare-control {
  margin-left: auto;
}
.switch {
  position: relative;
  display: inline-flex;
  width: 32px;
  height: 18px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch span {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: #416154;
  transition: 0.2s;
}
.switch span:before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #d4e2d6;
  transition: 0.2s;
}
.switch input:checked + span {
  background: var(--lime);
}
.switch input:checked + span:before {
  transform: translateX(14px);
  background: var(--ink);
}
.toolbar-note {
  color: var(--yellow);
  text-transform: none;
  letter-spacing: 0;
}
.section-tabs {
  gap: 4px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.section-tab,
.subtab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 11px 13px;
  font-size: 12px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.section-tab.active,
.section-tab:hover,
.subtab.active,
.subtab:hover {
  color: var(--text);
  border-color: var(--lime);
}
.subtabs {
  gap: 8px;
  min-height: 49px;
  border-bottom: 1px solid var(--line);
}
.subtab {
  padding: 9px 5px;
  font-size: 11px;
}
.content-stack {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-top: 18px;
}
.loading-card,
.empty-state,
.coverage-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(
    140deg,
    rgba(20, 55, 42, 0.96),
    rgba(12, 39, 29, 0.96)
  );
}
.loading-card,
.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 14px;
}
.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.two-col {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}
.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.four-col {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.panel {
  min-width: 0;
  padding: 17px 18px;
}
.panel.accent-lime {
  border-top: 2px solid var(--lime);
}
.panel.accent-teal {
  border-top: 2px solid var(--teal);
}
.panel.accent-pink {
  border-top: 2px solid var(--pink);
}
.panel.accent-green {
  border-top: 2px solid var(--green);
}
.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}
.panel-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.panel-note {
  color: var(--muted);
  font-size: 11px;
  margin: 2px 0 0;
}
.kpi-label {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 5px;
}
.kpi-value {
  font: 31px/1 var(--mono);
  color: var(--text);
  letter-spacing: -0.07em;
}
.kpi-unit {
  color: var(--muted);
  font: 12px var(--sans);
  letter-spacing: 0;
  margin-left: 4px;
}
.kpi-compare {
  color: var(--green);
  font: 11px var(--mono);
  margin-top: 9px;
}
.kpi-compare.down {
  color: var(--pink);
}
.chart-wrap {
  position: relative;
  height: 250px;
}
.chart-wrap.tall {
  height: 300px;
}
.chart-wrap.short {
  height: 185px;
}
.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
.insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.insight {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  background: rgba(7, 26, 21, 0.45);
  min-height: 76px;
}
.insight-num {
  color: var(--lime);
  font: 11px var(--mono);
}
.insight p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.insight strong {
  color: var(--text);
  font-weight: 600;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
th {
  color: var(--muted);
  text-align: left;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(7, 26, 21, 0.55);
}
th,
td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  color: var(--text);
}
td.muted,
.muted {
  color: var(--muted);
}
.right {
  text-align: right;
}
.bar-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) 2fr auto;
  gap: 10px;
  align-items: center;
  font-size: 11px;
}
.bar-track {
  height: 7px;
  border-radius: 99px;
  background: #1c4938;
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--lime);
}
.bar-fill.teal {
  background: var(--teal);
}
.bar-fill.pink {
  background: var(--pink);
}
.bar-fill.green {
  background: var(--green);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--muted);
  font-size: 10px;
}
.legend i {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 2px;
  margin-right: 4px;
}
.metric-list {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 16px;
  font-size: 11px;
}
.metric-list dt {
  color: var(--muted);
}
.metric-list dd {
  margin: 0;
  font: 11px var(--mono);
  color: var(--text);
}
.pill {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 10px;
}
.pill.lime {
  color: var(--lime);
  border-color: rgba(193, 255, 46, 0.4);
}
.pill.teal {
  color: var(--teal);
  border-color: rgba(34, 185, 212, 0.4);
}
.suppressed {
  color: var(--yellow) !important;
  font-style: italic;
}
.unavailable {
  color: var(--dim) !important;
  font-style: italic;
}
.coverage-card {
  padding: 15px 17px;
}
.coverage-card pre {
  white-space: pre-wrap;
  margin: 10px 0 0;
  color: var(--muted);
  font: 11px/1.6 var(--mono);
}
.coverage-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
}
.coverage-list li {
  margin: 9px 0;
  font-size: 12px;
}
.coverage-list strong {
  color: var(--text);
  font-weight: 500;
  margin-left: 4px;
}

dialog {
  max-width: min(720px, calc(100% - 32px));
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  padding: 25px;
  box-shadow: 0 20px 80px #000b;
}
dialog::backdrop {
  background: #0009;
}
.dialog-close {
  position: absolute;
  right: 13px;
  top: 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
}
.dialog-body h2 {
  margin-right: 20px;
}
.dialog-body p,
.dialog-body li {
  color: var(--muted);
  font-size: 12px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: var(--lime);
  color: var(--ink);
  padding: 10px 15px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 12px;
  transition: 0.2s;
  z-index: 20;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1000px) {
  .topbar {
    align-items: start;
    flex-direction: column;
    gap: 5px;
    padding-top: 11px;
    padding-bottom: 11px;
  }
  .workspace-head {
    align-items: start;
    flex-direction: column;
  }
  .head-actions {
    justify-content: start;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .two-col {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .workspace {
    padding-inline: 12px;
  }
  .kpi-grid,
  .three-col,
  .four-col,
  .insights {
    grid-template-columns: 1fr;
  }
  .toolbar {
    align-items: start;
    flex-direction: column;
  }
  .compare-control {
    margin-left: 0;
  }
  .topbar-meta {
    flex-wrap: wrap;
  }
  h1 {
    font-size: 27px;
  }
  .chart-wrap,
  .chart-wrap.tall {
    height: 230px;
  }
  .bar-row {
    grid-template-columns: 90px 1fr auto;
  }
}

.scenario-input {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text);
  font-size: 13px;
}
.scenario-input input {
  width: 140px;
  padding: 10px;
  border-radius: 7px;
  border: 1px solid #315548;
  background: #0b241b;
  color: #e7f3e9;
  font: inherit;
}

/* Comparison details follow the supplied Passetto home. */
.kpi-value {
  font-size: clamp(25px, 2.4vw, 34px);
  letter-spacing: -0.055em;
}
.kpi-value:has(.observed) {
  overflow-wrap: anywhere;
}
.panel h3 {
  font-size: 19px;
}
.detail-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  text-align: left;
  font: inherit;
  text-decoration: none;
}
.detail-link span {
  color: var(--dim);
  font-size: 10px;
  margin-left: 2px;
}
.detail-link:hover,
.detail-link:focus-visible {
  color: var(--lime);
}
.detail-link:focus-visible {
  outline: 1px solid var(--lime);
  outline-offset: 4px;
  border-radius: 2px;
}
.qualification-bars {
  display: grid;
  gap: 13px;
}
.bar-caption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 10px;
}
.bar-caption > span {
  font: 10px var(--mono);
  white-space: nowrap;
}
.prior-value {
  color: var(--dim);
}
.pair-arrow {
  color: var(--muted);
  padding-inline: 3px;
}
.prior-track {
  position: relative;
  height: 7px;
  background: #1c4938;
  border-radius: 9px;
}
.prior-tick {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 13px;
  background: #dcebdd;
  border-radius: 1px;
  opacity: 0.8;
}
.response-head {
  color: var(--lime);
  font: 31px/1.2 var(--mono);
  margin: 0 0 15px;
  letter-spacing: -0.06em;
}
.response-head small {
  color: var(--dim);
  font: 10px var(--sans);
  margin-left: 8px;
  letter-spacing: 0;
}
.response-pairs {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  margin: 0;
  font-size: 10px;
}
.response-pairs dt {
  color: var(--muted);
}
.response-pairs dd {
  margin: 0;
  font: 10px var(--mono);
  white-space: nowrap;
}
.mix-layout {
  display: grid;
  grid-template-columns: minmax(100px, 0.9fr) minmax(0, 1.1fr);
  gap: 15px;
  align-items: center;
}
.mix-layout .chart-wrap {
  height: 170px;
}
.mix-legend {
  display: grid;
  gap: 11px;
}
.mix-legend > div {
  display: grid;
  grid-template-columns: 7px 1fr auto;
  column-gap: 5px;
  align-items: center;
  font-size: 10px;
}
.mix-legend i {
  width: 7px;
  height: 7px;
  border-radius: 1px;
}
.mix-legend strong {
  font: 10px var(--mono);
}
.mix-legend > div > span {
  grid-column: 2 / 4;
  color: var(--dim);
  font: 9px var(--mono);
}
.compare-control.disabled {
  opacity: 0.5;
}
.switch input:disabled + span {
  cursor: not-allowed;
}
.rank-num {
  color: var(--lime);
  font: 10px var(--mono);
  margin-right: 9px;
}
.sample-caution {
  color: var(--yellow);
}
.drill-context {
  margin: 14px 0 0;
}
.drill-context a {
  color: var(--lime);
  text-decoration: none;
}
.drill-context a:hover {
  text-decoration: underline;
}
#dialog-body h2 {
  margin-right: 25px;
}
#dialog-body p {
  color: var(--muted);
  font-size: 12px;
}
#dialog-body .query-answer {
  color: var(--text);
  border-left: 2px solid var(--lime);
  padding: 14px 15px;
  background: #09241c;
  font-size: 14px;
  line-height: 1.6;
  margin: 18px 0;
}
.question-label {
  display: block;
  color: var(--muted);
  margin: 16px 0 7px;
  font-size: 11px;
}
#data-question {
  max-width: 100%;
  width: 100%;
}
@media (min-width: 1001px) {
  .two-col {
    grid-template-columns: minmax(0, 1.9fr) minmax(320px, 1fr);
  }
}
@media (max-width: 700px) {
  .mix-layout {
    grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr);
  }
  .mix-layout .chart-wrap {
    height: 170px;
  }
  .head-actions {
    gap: 6px;
  }
  .head-actions button {
    padding: 9px 10px;
  }
  .response-head {
    font-size: 30px;
  }
}

.head-actions a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.chart-empty-note {
  position: absolute;
  inset: 48px 18px 18px;
  margin: 0;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  pointer-events: none;
}
