:root {
  color-scheme: dark;
  --bg: #0f1319;
  --bg-deep: #0b0f14;
  --sidebar: #111720;
  --panel: #151c26;
  --panel-raised: #19222e;
  --panel-soft: #121922;
  --panel-hover: #1c2734;
  --text: #f2f5f7;
  --text-soft: #c6cdd5;
  --muted: #8f9aa8;
  --faint: #788493;
  --line: #2a3441;
  --line-soft: #222b36;
  --blue: #5b9def;
  --blue-strong: #3987e5;
  --blue-soft: rgba(91, 157, 239, 0.13);
  --teal: #2cc493;
  --teal-soft: rgba(44, 196, 147, 0.13);
  --yellow: #e1ad47;
  --yellow-soft: rgba(225, 173, 71, 0.13);
  --red: #ef6a68;
  --red-soft: rgba(239, 106, 104, 0.13);
  --violet: #9c83e8;
  --cyan: #53bfd2;
  --orange: #dc8b4a;
  --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.065), 0 1px 2px rgba(0, 0, 0, 0.22), 0 12px 28px rgba(0, 0, 0, 0.10);
  --shadow-card-hover: 0 0 0 1px rgba(255, 255, 255, 0.105), 0 2px 5px rgba(0, 0, 0, 0.28), 0 18px 36px rgba(0, 0, 0, 0.15);
  --shadow-float: 0 0 0 1px rgba(255, 255, 255, 0.085), 0 18px 55px rgba(0, 0, 0, 0.46);
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 11px;
  --radius-sm: 8px;
  --header-height: 66px;
  --scenario-width: 354px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
html { background: var(--bg); }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 78% -10%, rgba(52, 111, 179, 0.12), transparent 31rem),
    var(--bg);
  overflow: hidden;
}

button, input, select { font: inherit; }
button { color: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { font-family: Outfit, Inter, sans-serif; text-wrap: balance; }
p, li, small { text-wrap: pretty; }
a { color: var(--blue); text-underline-offset: 3px; }
code { color: #d8e9ff; font-size: .92em; }
svg { display: block; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 9999;
  padding: 11px 15px;
  border-radius: 9px;
  color: var(--bg);
  background: var(--text);
  transform: translateY(-150%);
  transition-property: transform;
  transition-duration: 160ms;
  transition-timing-function: ease-out;
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  position: relative;
  z-index: 100;
  height: var(--header-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 0 18px;
  background: rgba(14, 19, 26, 0.94);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.07), 0 9px 24px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  justify-self: start;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #07140f;
  background: linear-gradient(145deg, #42d7a7, #1fab7f);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28), 0 7px 18px rgba(29, 175, 128, 0.18);
}
.brand-mark svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand-copy { min-width: 0; display: grid; gap: 1px; }
.brand-owner { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; line-height: 1.25; text-transform: uppercase; }
.brand-title { overflow: hidden; font-family: Outfit, Inter, sans-serif; font-size: 18px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }

.topbar-center {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border-radius: 999px;
  color: #b9c3cc;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  font-size: 11px;
  white-space: nowrap;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(44, 196, 147, 0.11); }
.topbar-actions { display: flex; justify-self: end; align-items: center; gap: 8px; }

.import-dropdown-container { position: relative; display: inline-flex; }
.dropdown-chevron { width: 13px; height: 13px; flex: 0 0 13px; fill: none; stroke: currentColor; stroke-width: 2.2; margin-left: -2px; transition: transform 160ms ease-out; }
.import-dropdown-container[data-open="true"] .dropdown-chevron { transform: rotate(180deg); }
.import-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 120;
  width: 300px;
  padding: 6px;
  border-radius: 12px;
  background: #111822;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 18px 45px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(18px);
  display: grid;
  gap: 6px;
  animation: enter 140ms ease-out;
}
.import-popover-group { display: grid; gap: 3px; }
.import-popover-group + .import-popover-group { padding-top: 6px; box-shadow: 0 -1px var(--line-soft); }
.import-popover-label { padding: 4px 10px 2px; color: var(--faint); font-size: 8px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.import-popover-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--text-soft);
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background-color 130ms, color 130ms;
}
.import-popover-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.075); }
.import-popover-item svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: var(--blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.popover-item-copy { min-width: 0; display: grid; gap: 1px; }
.popover-item-copy strong { color: var(--text); font-size: 11.5px; font-weight: 650; line-height: 1.2; }
.popover-item-copy small { color: var(--muted); font-size: 9px; line-height: 1.25; }

.topbar-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}
.topbar-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2cc493, #e1ad47);
  transition: width 180ms ease-out;
}

.ghost-button, .icon-button, .icon-text-button, .text-button, .secondary-button, .primary-button, .danger-button, .run-button, .preset-button, .preset-info, .segmented-control button, .info-button, .resource-edit {
  border: 0;
  cursor: pointer;
  transition-property: transform, background-color, color, box-shadow, opacity;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}
.ghost-button:active:not(:disabled), .icon-button:active:not(:disabled), .icon-text-button:active:not(:disabled), .text-button:active:not(:disabled), .secondary-button:active:not(:disabled), .primary-button:active:not(:disabled), .danger-button:active:not(:disabled), .run-button:active:not(:disabled), .preset-button:active:not(:disabled), .preset-info:active:not(:disabled), .segmented-control button:active:not(:disabled), .info-button:active:not(:disabled), .resource-edit:active:not(:disabled) { scale: .96; }
.ghost-button:focus-visible, .icon-button:focus-visible, .icon-text-button:focus-visible, .text-button:focus-visible, .secondary-button:focus-visible, .primary-button:focus-visible, .danger-button:focus-visible, .run-button:focus-visible, .preset-button:focus-visible, .preset-info:focus-visible, .segmented-control button:focus-visible, .info-button:focus-visible, .resource-edit:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid rgba(91, 157, 239, 0.38);
  outline-offset: 2px;
}
.ghost-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10);
  font-size: 12px;
  font-weight: 650;
}
.ghost-button:hover:not(:disabled) { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.ghost-button:disabled { opacity: .38; }
.ghost-button svg, .secondary-button svg, .icon-text-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell {
  height: calc(100vh - var(--header-height));
  display: grid;
  grid-template-columns: var(--scenario-width) minmax(0, 1fr);
  overflow: hidden;
}

.scenario-panel {
  position: relative;
  z-index: 10;
  min-width: 0;
  padding: 24px 20px 24px;
  background: rgba(17, 23, 32, 0.96);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.065), 12px 0 34px rgba(0, 0, 0, 0.17);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #334050 transparent;
}
.scenario-panel::-webkit-scrollbar, .results-panel::-webkit-scrollbar, .modal-content::-webkit-scrollbar { width: 9px; }
.scenario-panel::-webkit-scrollbar-thumb, .results-panel::-webkit-scrollbar-thumb, .modal-content::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: #354150; background-clip: padding-box; }

.step-label, .eyebrow {
  display: block;
  color: var(--teal);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .12em;
  line-height: 1.35;
  text-transform: uppercase;
}
.scenario-intro .step-label { margin-bottom: 8px; }
.scenario-intro h1 { margin-bottom: 10px; font-size: 27px; line-height: 1.08; letter-spacing: -.035em; }
.scenario-intro p { margin-bottom: 23px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }

.panel-section, .resource-section { margin-bottom: 19px; }
.preset-section { position: relative; z-index: 60; }
.section-heading { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-heading h2 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .01em; }
.section-heading p { margin: 3px 0 0; color: var(--faint); font-size: 10px; }
.text-button { min-height: 40px; padding: 0 7px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 650; }
.text-button:hover { color: var(--text); }

.preset-grid { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.preset-option { position: relative; min-width: 0; }
.preset-button {
  width: 100%;
  min-width: 0;
  min-height: 70px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px 27px 10px 8px;
  border-radius: 10px;
  color: var(--muted);
  background: var(--panel-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.065);
  text-align: left;
}
.preset-button span { color: var(--text-soft); font-size: 10.5px; font-weight: 700; line-height: 1.18; }
.preset-button small { color: var(--faint); font-size: 8.5px; line-height: 1.2; }
.preset-button:hover { background: var(--panel-hover); }
.preset-button.active { color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px rgba(91, 157, 239, 0.38); }
.preset-button.active span { color: #dcecff; }
.preset-button.active small { color: #8fbbea; }
.preset-info {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: var(--faint);
  background: transparent;
}
.preset-info:hover { color: var(--text); background: rgba(255, 255, 255, 0.055); }
.preset-info[aria-pressed="true"] { color: #b8d9fb; background: rgba(91, 157, 239, 0.13); }
.preset-button.active + .preset-info { color: #8fbbea; }
.preset-info svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.preset-popover {
  position: absolute;
  top: calc(100% + 8px);
  z-index: 70;
  width: min(292px, calc(100vw - 28px));
  padding: 12px 13px;
  visibility: hidden;
  border-radius: 11px;
  color: var(--muted);
  background: #0a1017;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.13), 0 16px 34px rgba(0, 0, 0, 0.48);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 130ms ease-out, transform 130ms ease-out;
}
.preset-option:nth-child(odd) .preset-popover { left: 0; }
.preset-option:nth-child(even) .preset-popover { right: 0; }
.preset-popover strong { display: block; margin-bottom: 5px; color: var(--text); font-size: 11px; }
.preset-popover p { margin: 0 0 7px; font-size: 9.5px; line-height: 1.5; }
.preset-popover small { display: block; color: var(--faint); font-size: 8.75px; line-height: 1.45; }
.preset-option:not([data-suppressed="true"]) .preset-button:focus-visible ~ .preset-popover,
.preset-option[data-open="true"] .preset-popover { visibility: visible; opacity: 1; transform: translateY(0); }
.preset-option[data-suppressed="true"] .preset-popover {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
@media (hover: hover) {
  .preset-option:not([data-suppressed="true"]):hover .preset-popover { visibility: visible; opacity: 1; transform: translateY(0); }
}

#scenarioForm { display: grid; }
.control-card {
  min-width: 0;
  margin: 0 0 19px;
  padding: 15px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-card);
}
.control-card legend { float: left; width: 100%; margin-bottom: 8px; padding: 0; font-size: 12px; font-weight: 700; }
.control-card legend + * { clear: both; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) 136px; align-items: center; gap: 12px; padding: 10px 0; box-shadow: 0 1px 0 var(--line-soft); }
.field-row:last-of-type { box-shadow: none; }
.field-row label, .two-field-grid label, .three-field-grid label, .dialog-field-grid label, .details-field label { display: block; margin-bottom: 4px; color: var(--text-soft); font-size: 10.5px; font-weight: 650; }
.field-row small { display: block; color: var(--faint); font-size: 9px; line-height: 1.3; }
.stress-summary {
  margin: 8px 0 1px;
  padding: 9px 10px;
  border-radius: 9px;
  color: #aebac6;
  background: rgba(91, 157, 239, 0.065);
  box-shadow: inset 0 0 0 1px rgba(91, 157, 239, 0.13);
  font-size: 9px;
  line-height: 1.45;
}
input, select {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid #344150;
  border-radius: var(--radius-sm);
  color: var(--text);
  background: #0f151d;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.22);
  font-size: 12px;
  transition-property: border-color, box-shadow, background-color;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}
input:hover, select:hover { border-color: #4b596a; }
input:focus, select:focus { border-color: var(--blue); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18), 0 0 0 3px rgba(91, 157, 239, 0.10); }
input:disabled, select:disabled { cursor: not-allowed; opacity: .52; }
select { cursor: pointer; }
.unit-input { position: relative; display: block; }
.unit-input input { padding-right: 39px; text-align: right; }
.unit-input > span { position: absolute; top: 50%; right: 10px; color: var(--faint); font-size: 9.5px; font-weight: 650; pointer-events: none; transform: translateY(-50%); }
.two-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding-top: 12px; }
.three-field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 12px; }
.aligned-input-field { min-width: 0; display: grid; grid-template-rows: 28px 40px minmax(31px, auto); align-content: start; }
.aligned-input-field > label { align-self: start; }
.control-help { display: block; margin-top: 5px; color: var(--faint); font-size: 8.5px; line-height: 1.35; text-wrap: pretty; }
.field-explainer {
  margin: 8px 0 0;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  font-size: 8.75px;
  line-height: 1.45;
}
.field-explainer strong { color: var(--text-soft); }

.icon-text-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  color: var(--blue);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}
.resource-list { display: grid; gap: 7px; }
.resource-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 78px 40px;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow-card);
  transition-property: background-color, box-shadow;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}
.resource-row:hover { background: var(--panel-raised); box-shadow: var(--shadow-card-hover); }
.resource-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--resource-color);
  background: color-mix(in srgb, var(--resource-color) 13%, transparent);
}
.resource-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.resource-copy { min-width: 0; }
.resource-copy strong { display: block; overflow: hidden; margin-bottom: 2px; font-size: 11px; font-weight: 650; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.resource-copy small { display: block; overflow: hidden; color: var(--faint); font-size: 8.5px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.resource-capacity .unit-input input { height: 34px; padding: 0 25px 0 7px; font-size: 11px; }
.resource-capacity .unit-input > span { right: 7px; font-size: 8px; }
.resource-edit {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
}
.resource-edit:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.resource-edit svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.data-details {
  margin-bottom: 18px;
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.data-details summary {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  list-style: none;
}
.data-details summary::-webkit-details-marker { display: none; }
.data-details summary span { min-width: 0; display: grid; gap: 3px; }
.data-details summary strong { font-size: 11px; }
.data-details summary small { overflow: hidden; color: var(--faint); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.data-details summary svg { width: 17px; flex: 0 0 17px; fill: none; stroke: var(--muted); stroke-width: 1.8; transition-property: transform; transition-duration: 160ms; transition-timing-function: ease-out; }
.data-details[open] summary svg { transform: rotate(180deg); }
.details-body { padding: 0 14px 14px; }
.details-body p { margin: 0 0 12px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.details-field { display: grid; gap: 4px; margin-bottom: 12px; }
.details-field label { margin: 0; }
.details-field small { color: var(--faint); font-size: 8.75px; line-height: 1.4; }
.study-basis-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 2px 0 8px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(91, 157, 239, 0.055);
  box-shadow: inset 0 0 0 1px rgba(91, 157, 239, 0.14);
}
.study-basis-card div { min-width: 0; display: grid; gap: 3px; }
.study-basis-card span { color: var(--faint); font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.study-basis-card strong { color: var(--text-soft); font-size: 9.5px; line-height: 1.35; }
.study-basis-card svg { width: 18px; fill: none; stroke: var(--blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#profileCouplingExplanation { margin-bottom: 10px; padding-inline: 2px; }
.three-field-grid > div { min-width: 0; }
.three-field-grid small { display: block; margin-top: 5px; color: var(--faint); font-size: 8px; line-height: 1.35; }
.weather-basis {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px;
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  font-size: 8.75px;
  line-height: 1.3;
  text-align: center;
}
.weather-basis span { display: grid; gap: 2px; }
.weather-basis strong { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.weather-basis i { color: var(--faint); font-style: normal; }
.secondary-button, .primary-button, .danger-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
}
.secondary-button { color: var(--text-soft); background: rgba(255, 255, 255, 0.035); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.11); }
.secondary-button:hover:not(:disabled) { color: var(--text); background: rgba(255, 255, 255, 0.075); }
.secondary-button:disabled { opacity: .36; }
.secondary-button.compact { min-height: 40px; white-space: nowrap; }
.primary-button { color: #07121e; background: var(--blue); box-shadow: 0 8px 18px rgba(57, 135, 229, 0.18); }
.primary-button:hover { background: #72adf1; }
.danger-button { color: #ffaaa8; background: var(--red-soft); }
.danger-button:hover { background: rgba(239, 106, 104, 0.20); }
.compact-fields { margin-top: 12px; }

.details-summary-copy { min-width: 0; display: grid; gap: 4px; }
.details-summary-copy > small { overflow: hidden; color: var(--faint); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.details-summary-title { min-width: 0; display: flex; align-items: center; gap: 7px; }
.details-summary-title strong { min-width: 0; }
.fidelity-badge {
  width: fit-content;
  display: inline-flex !important;
  align-items: center;
  min-width: 0 !important;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  color: #aab6c3;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.085);
  font-family: Inter, sans-serif;
  font-size: 7.5px !important;
  font-weight: 750;
  letter-spacing: .055em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.fidelity-badge.local { color: #87dcbc; background: rgba(44, 196, 147, 0.10); box-shadow: inset 0 0 0 1px rgba(44, 196, 147, 0.19); }
.fidelity-badge.preview { color: #edd18f; background: rgba(225, 173, 71, 0.10); box-shadow: inset 0 0 0 1px rgba(225, 173, 71, 0.20); }
.fidelity-badge.external { color: #b4a6e8; background: rgba(156, 131, 232, 0.10); box-shadow: inset 0 0 0 1px rgba(156, 131, 232, 0.20); }
.research-details { background: linear-gradient(145deg, rgba(91, 157, 239, 0.075), rgba(18, 25, 34, 0.96) 62%); }
.research-details[open] { box-shadow: inset 0 0 0 1px rgba(91, 157, 239, 0.16), 0 10px 24px rgba(0, 0, 0, 0.09); }
.research-details-body { padding-top: 2px; }
.research-study-fields {
  min-width: 0;
  margin: 10px 0 0;
  padding: 11px;
  border: 0;
  border-radius: 11px;
  background: rgba(8, 13, 19, 0.27);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.052);
}
.research-study-fields legend { padding: 0 4px; color: var(--text-soft); font-size: 9px; font-weight: 700; }
.research-field-grid { padding-top: 3px; }
.research-study-fields .research-field-note { margin: 8px 0 0; color: var(--faint); font-size: 8.75px; line-height: 1.45; }
#adequacyStudyFields .research-field-note { margin: 0; }
.compact-detail-field { margin-bottom: 9px; }
.research-case-estimate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  font-size: 8.5px;
}
.research-case-estimate output { color: var(--text-soft); font-size: 9px; font-weight: 700; text-align: right; }

.scenario-status-bar {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.run-status { min-height: 16px; color: var(--faint); font-size: 9.5px; text-align: center; }

.run-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 13px 4px 8px;
  min-height: 40px;
  border-radius: 10px;
  color: #071610;
  background: linear-gradient(135deg, #3bd09f, #25b888);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24), 0 4px 14px rgba(32, 190, 141, 0.22);
  text-align: left;
  white-space: nowrap;
}
.run-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #50daae, #2bc492);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32), 0 6px 18px rgba(32, 190, 141, 0.30);
}
.run-button:disabled { opacity: .50; cursor: progress; }
.run-button.running { color: #f4e9d1; background: #5a4522; box-shadow: inset 0 0 0 1px rgba(225, 173, 71, 0.35); }
.run-icon { position: relative; width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 7px; background: rgba(4, 25, 17, 0.13); }
.run-icon svg { grid-area: 1 / 1; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition-property: opacity, scale, filter; transition-duration: 300ms; transition-timing-function: cubic-bezier(.2, 0, 0, 1); }
.run-icon .run-play { margin-left: 2px; fill: currentColor; stroke: none; opacity: 1; scale: 1; filter: blur(0); }
.run-icon .run-stop { opacity: 0; scale: .25; filter: blur(4px); }
.run-button.running .run-play { opacity: 0; scale: .25; filter: blur(4px); }
.run-button.running .run-stop { opacity: 1; scale: 1; filter: blur(0); }
.run-copy { min-width: 0; display: grid; gap: 1px; }
.run-copy strong { font-size: 11.5px; font-weight: 700; line-height: 1.15; }
.run-copy small { color: rgba(4, 30, 20, 0.70); font-size: 8.5px; line-height: 1.1; }
.run-button.running .run-copy small { color: #cbb98f; }
.progress-track { height: 3px; margin: 0; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--yellow); transition-property: width; transition-duration: 180ms; transition-timing-function: ease-out; }

.results-panel {
  min-width: 0;
  padding: 27px clamp(22px, 3vw, 46px) 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #334050 transparent;
}
.report-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin: 0 auto 22px; max-width: 1450px; }
.report-heading .step-label { margin-bottom: 7px; }
.report-heading h2 { margin-bottom: 6px; font-size: clamp(25px, 2.4vw, 34px); line-height: 1.08; letter-spacing: -.035em; }
.report-heading p { margin-bottom: 0; color: var(--muted); font-size: 11px; }
.stale-results {
  max-width: 1450px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -10px auto 14px;
  padding: 10px 13px;
  border-radius: 12px;
  color: #efd08b;
  background: var(--yellow-soft);
  box-shadow: inset 0 0 0 1px rgba(225, 173, 71, 0.25);
  font-size: 10.5px;
  line-height: 1.4;
}
.stale-results[hidden] { display: none; }
.stale-results svg { width: 19px; height: 19px; flex: 0 0 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stale-results strong { color: #ffe0a3; }
.verdict-pill {
  min-height: 40px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 5px;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.verdict-indicator { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04); }
.verdict-pill.good { color: #82e3bf; background: var(--teal-soft); box-shadow: inset 0 0 0 1px rgba(44, 196, 147, 0.22); }
.verdict-pill.good .verdict-indicator { background: var(--teal); box-shadow: 0 0 0 4px rgba(44, 196, 147, 0.11); }
.verdict-pill.watch { color: #efd08b; background: var(--yellow-soft); box-shadow: inset 0 0 0 1px rgba(225, 173, 71, 0.22); }
.verdict-pill.watch .verdict-indicator { background: var(--yellow); box-shadow: 0 0 0 4px rgba(225, 173, 71, 0.10); }
.verdict-pill.bad { color: #ffaaa8; background: var(--red-soft); box-shadow: inset 0 0 0 1px rgba(239, 106, 104, 0.22); }
.verdict-pill.bad .verdict-indicator { background: var(--red); box-shadow: 0 0 0 4px rgba(239, 106, 104, 0.10); }

.metric-grid { max-width: 1450px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin: 0 auto 12px; }
.metric-card {
  position: relative;
  min-width: 0;
  min-height: 142px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(27, 36, 48, 0.95), rgba(20, 27, 37, 0.98));
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.metric-card::after { content: ""; position: absolute; inset: auto -12px -34px auto; width: 95px; height: 95px; border-radius: 50%; background: radial-gradient(circle, rgba(91, 157, 239, 0.10), transparent 68%); pointer-events: none; }
.metric-primary { box-shadow: inset 3px 0 0 var(--blue), var(--shadow-card); }
.metric-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.info-button { width: 40px; height: 40px; display: grid; place-items: center; margin: -12px -10px -12px 0; border-radius: 9px; color: var(--faint); background: transparent; font-size: 11px; font-weight: 800; }
.info-button:hover { color: var(--blue); background: var(--blue-soft); }
.metric-value { min-width: 0; display: flex; align-items: baseline; gap: 7px; margin-bottom: 8px; }
.metric-value strong { overflow: hidden; font-family: Outfit, Inter, sans-serif; font-size: clamp(26px, 2.5vw, 38px); font-weight: 650; letter-spacing: -.045em; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.metric-value span { color: var(--faint); font-size: 9px; font-weight: 650; white-space: nowrap; }
.metric-card p { margin: 0; color: var(--muted); font-size: 9.5px; line-height: 1.35; }
.metric-delta { display: block; min-height: 14px; margin-top: 6px; color: var(--faint); font-size: 9px; font-weight: 650; }
.metric-delta.better { color: var(--teal); }
.metric-delta.worse { color: var(--red); }

.interpretation-card {
  max-width: 1450px;
  min-height: 94px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin: 0 auto 12px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(100deg, rgba(91, 157, 239, 0.105), rgba(21, 28, 38, 0.72) 64%);
  box-shadow: inset 0 0 0 1px rgba(91, 157, 239, 0.18), 0 10px 26px rgba(0, 0, 0, 0.08);
}
.interpretation-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; color: var(--blue); background: var(--blue-soft); }
.interpretation-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.interpretation-kicker { display: block; margin-bottom: 3px; color: var(--blue); font-size: 9px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.interpretation-card h3 { margin-bottom: 4px; font-size: 15px; letter-spacing: -.015em; }
.interpretation-card p { margin-bottom: 0; color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.interpretation-stat { min-width: 125px; display: grid; gap: 2px; padding-left: 18px; box-shadow: -1px 0 var(--line); text-align: right; }
.interpretation-stat span, .interpretation-stat small { color: var(--faint); font-size: 8.5px; }
.interpretation-stat strong { font-family: Outfit, Inter, sans-serif; font-size: 23px; font-weight: 650; }
.interpretation-card.good { background: linear-gradient(100deg, rgba(44, 196, 147, 0.11), rgba(21, 28, 38, 0.72) 64%); box-shadow: inset 0 0 0 1px rgba(44, 196, 147, 0.18), 0 10px 26px rgba(0, 0, 0, 0.08); }
.interpretation-card.good .interpretation-icon { color: var(--teal); background: var(--teal-soft); }
.interpretation-card.good .interpretation-kicker { color: var(--teal); }
.interpretation-card.bad { background: linear-gradient(100deg, rgba(239, 106, 104, 0.11), rgba(21, 28, 38, 0.72) 64%); box-shadow: inset 0 0 0 1px rgba(239, 106, 104, 0.18), 0 10px 26px rgba(0, 0, 0, 0.08); }
.interpretation-card.bad .interpretation-icon { color: var(--red); background: var(--red-soft); }
.interpretation-card.bad .interpretation-kicker { color: var(--red); }

.research-result-card {
  max-width: 1450px;
  margin: 0 auto 12px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(125deg, rgba(91, 157, 239, 0.095), rgba(21, 28, 38, 0.96) 48%, rgba(156, 131, 232, 0.065));
  box-shadow: inset 0 0 0 1px rgba(91, 157, 239, 0.18), 0 12px 28px rgba(0, 0, 0, 0.10);
}
.research-result-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 22px; }
.research-result-header .eyebrow { margin-bottom: 5px; color: #84b8ef; }
.research-result-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.research-result-title-row h3 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.research-result-header p { max-width: 760px; margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.research-result-header .research-result-warning { max-width: 800px; margin-top: 10px; padding: 9px 11px; border-radius: 9px; color: #e8ca86; background: rgba(225, 173, 71, .09); box-shadow: inset 0 0 0 1px rgba(225, 173, 71, .18); text-wrap: pretty; }
.research-result-hero { min-width: 150px; display: grid; justify-items: end; gap: 3px; text-align: right; }
.research-result-hero strong { font-family: Outfit, Inter, sans-serif; font-size: 32px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.04em; line-height: 1; }
.research-result-hero span { color: var(--faint); font-size: 9px; font-weight: 650; }
.research-progress { margin: 15px 0 2px; }
.research-progress > div { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: var(--muted); font-size: 9px; }
.research-progress > div strong { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.research-progress-track { height: 5px; display: block; overflow: hidden; border-radius: 999px; background: #0b1118; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.045); }
.research-progress-track i { width: 0; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--violet)); transform-origin: left; transition-property: width; transition-duration: 160ms; transition-timing-function: ease-out; }
.research-result-grid { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 12px; margin-top: 15px; }
.research-chart-shell, .research-result-table-wrap { min-width: 0; border-radius: 12px; background: rgba(8, 13, 19, 0.28); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055); }
.research-chart-shell { padding: 14px; overflow: hidden; }
.research-result-chart { min-width: 0; min-height: 0; }
.research-result-chart svg { width: 100%; height: auto; }
.research-result-table-wrap { max-height: 328px; overflow: auto; }
.research-result-table-wrap table { width: 100%; min-width: 600px; font-variant-numeric: tabular-nums; }
.research-result-table-wrap th { position: sticky; top: 0; z-index: 1; background: #111821; }
.research-result-table-wrap .empty-cell { height: 210px; }
.research-series-line { fill: none; stroke: rgba(91, 157, 239, .58); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.research-ci-line { stroke: rgba(143, 154, 168, .75); stroke-width: 1.5; }
.research-case-point { stroke: #0b1118; stroke-width: 3; paint-order: stroke fill; }
.research-axis-line { stroke: #536171; stroke-width: 1; }
.research-target-label { fill: #75d4b4; font-family: Inter, sans-serif; font-size: 10px; font-weight: 700; }
.research-axis-title { fill: #a8b2be; font-family: Inter, sans-serif; font-size: 11px; font-weight: 650; }
.research-chart-legend { fill: var(--muted); font-family: Inter, sans-serif; font-size: 9px; }

.analysis-grid { max-width: 1450px; display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(280px, .72fr); gap: 12px; margin: 0 auto 12px; }
.analysis-card {
  min-width: 0;
  border-radius: var(--radius-lg);
  background: rgba(21, 28, 38, 0.92);
  box-shadow: var(--shadow-card);
}
.risk-card { min-height: 485px; padding: 18px; }
.card-heading { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-heading.compact { align-items: center; margin-bottom: 14px; }
.card-heading .eyebrow { margin-bottom: 4px; color: var(--faint); font-size: 8.5px; }
.card-heading h3 { margin: 0; font-size: 16px; letter-spacing: -.015em; }
.card-heading p { margin: 4px 0 0; color: var(--muted); font-size: 9.5px; }
.card-heading > strong { color: var(--text-soft); font-family: Outfit, Inter, sans-serif; font-size: 15px; }
.segmented-control { flex: 0 0 auto; display: flex; gap: 2px; padding: 3px; border-radius: 11px; background: #0f151d; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.065); }
.segmented-control button { min-height: 40px; padding: 0 11px; border-radius: 8px; color: var(--muted); background: transparent; font-size: 9.5px; font-weight: 700; }
.segmented-control button:hover { color: var(--text-soft); }
.segmented-control button.active { color: #dbeaff; background: #25364a; box-shadow: 0 0 0 1px rgba(91, 157, 239, 0.24), 0 3px 8px rgba(0, 0, 0, 0.18); }
.chart-view { min-height: 394px; }
.heatmap-wrap { display: grid; align-content: center; min-height: 386px; }
.heatmap {
  display: grid;
  grid-template-columns: 38px repeat(24, minmax(6px, 1fr));
  grid-template-rows: 21px repeat(12, 22px);
  gap: 3px;
  align-items: center;
}
.heatmap-label { color: var(--faint); font-size: 9px; text-align: center; }
.heatmap-label.month { padding-right: 5px; text-align: right; }
.heatmap-cell {
  width: 100%;
  height: 22px;
  border-radius: 4px;
  background: #202a35;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  transition-property: transform, box-shadow, filter;
  transition-duration: 120ms;
  transition-timing-function: ease-out;
}
.heatmap-cell:hover, .heatmap-cell:focus-visible { position: relative; z-index: 2; transform: scale(1.16); box-shadow: 0 0 0 2px var(--text), 0 5px 12px rgba(0, 0, 0, 0.34); filter: brightness(1.15); outline: none; }
.heatmap-legend { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 13px; color: var(--faint); font-size: 9.5px; }
.legend-ramp { width: 106px; height: 7px; border-radius: 999px; background: linear-gradient(90deg, #202a35, #334d65, #4679a2, #d5a247, #ef6a68); }
.chart-meta { margin: 5px 0 12px; color: var(--muted); font-size: 9.5px; }
.svg-chart { width: 100%; min-height: 345px; overflow: hidden; }
.svg-chart.small { min-height: 82px; }
.svg-chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-axis { fill: var(--faint); font-family: Inter, sans-serif; font-size: 10px; }
.chart-gridline { stroke: #28333f; stroke-width: 1; }
.chart-load { fill: none; stroke: #f0f3f5; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart-supply { fill: none; stroke: var(--teal); stroke-width: 2.1; stroke-linejoin: round; stroke-linecap: round; }
.chart-area-shortfall { fill: rgba(239, 106, 104, 0.28); }
.chart-soc { fill: none; stroke: var(--violet); stroke-width: 1.4; stroke-dasharray: 4 4; }
.chart-dot { fill: var(--blue); }
.distribution-axis-title { fill: var(--muted); font-weight: 650; }
.weather-point { outline: none; }
.weather-dot {
  fill: #72b2f4;
  stroke: #d9edff;
  stroke-width: 1.4;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
  transition-property: fill, stroke, stroke-width;
  transition-duration: 140ms;
  transition-timing-function: ease-out;
}
.weather-dot.above { fill: #ef6a68; stroke: #ffd2d1; }
.weather-point:hover .weather-dot,
.weather-point:focus-visible .weather-dot {
  fill: #9bcbfb;
  stroke: #ffffff;
  stroke-width: 2.4;
}
.weather-point:hover .weather-dot.above,
.weather-point:focus-visible .weather-dot.above { fill: #ff8987; }
.distribution-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.distribution-summary div { padding: 10px; border-radius: 10px; background: var(--panel-soft); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055); }
.distribution-summary span { display: block; margin-bottom: 5px; color: var(--faint); font-size: 8px; text-transform: uppercase; }
.distribution-summary strong { font-family: Outfit, Inter, sans-serif; font-size: 15px; }
.hist-bar { fill: rgba(91, 157, 239, 0.68); }
.hist-bar.zero { fill: rgba(44, 196, 147, 0.55); }
.weather-diagnostic-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 2px 0 10px; }
.weather-diagnostic-summary div { min-width: 0; padding: 9px 10px; border-radius: 10px; background: var(--panel-soft); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055); }
.weather-diagnostic-summary span { display: block; overflow: hidden; margin-bottom: 4px; color: var(--faint); font-size: 8px; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.weather-diagnostic-summary strong { display: block; overflow: hidden; color: var(--text-soft); font-family: Outfit, Inter, sans-serif; font-size: 15px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.weather-years-chart { min-height: 205px; }
.chart-empty-state { min-height: 205px; display: grid; place-items: center; padding: 20px; color: var(--faint); font-size: 9.5px; line-height: 1.5; text-align: center; }
.weather-years-table { max-height: 138px; margin-top: 10px; overflow: auto; }
.weather-years-table table { min-width: 610px; }
.weather-years-table th { position: sticky; top: 0; z-index: 1; }
.weather-years-table th, .weather-years-table td { padding-block: 8px; }

.insight-stack { display: grid; grid-template-rows: auto auto minmax(145px, 1fr); gap: 12px; }
.driver-card, .portfolio-card, .convergence-card { padding: 16px; }
.driver-list { display: grid; gap: 10px; }
.driver-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.driver-label { min-width: 0; display: grid; gap: 4px; }
.driver-label span { overflow: hidden; color: var(--text-soft); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.driver-track { height: 5px; overflow: hidden; border-radius: 999px; background: #0e141c; }
.driver-track i { display: block; height: 100%; border-radius: inherit; background: var(--driver-color, var(--blue)); transform-origin: left; }
.driver-row strong { color: var(--muted); font-size: 9px; }
.empty-mini { padding: 16px 0; color: var(--faint); font-size: 9.5px; text-align: center; }
.capacity-bar { height: 11px; display: flex; overflow: hidden; border-radius: 999px; background: #0e141c; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.045); }
.capacity-segment { min-width: 2px; height: 100%; background: var(--segment-color); }
.capacity-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; margin-top: 12px; }
.capacity-legend div { min-width: 0; display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.capacity-legend i { width: 7px; height: 7px; border-radius: 2px; background: var(--segment-color); }
.capacity-legend span { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.capacity-legend strong { color: var(--text-soft); font-size: 8px; }
.convergence-card p { margin: 6px 0 0; color: var(--faint); font-size: 8.5px; line-height: 1.35; }
.convergence-band { fill: rgba(91, 157, 239, 0.11); }
.convergence-line { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.target-line { stroke: var(--teal); stroke-width: 1; stroke-dasharray: 3 3; }

.event-card { max-width: 1450px; margin: 0 auto 12px; padding: 18px; }
.table-wrap { overflow-x: auto; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055); }
table { width: 100%; border-collapse: collapse; font-size: 10px; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--line-soft); text-align: left; white-space: nowrap; }
th { color: var(--faint); background: #121922; font-size: 8px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
td { color: var(--text-soft); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.018); }
td:nth-last-child(-n + 3), th:nth-last-child(-n + 3) { text-align: right; }
.event-stress { display: inline-flex; align-items: center; gap: 6px; }
.event-stress::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); }
.empty-cell { height: 86px; color: var(--faint); text-align: center !important; }

.comparison-card {
  max-width: 1450px;
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(0, 1.4fr);
  align-items: center;
  gap: 24px;
  margin: 0 auto 12px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, rgba(156, 131, 232, 0.11), rgba(21, 28, 38, 0.92) 55%);
  box-shadow: inset 0 0 0 1px rgba(156, 131, 232, 0.16), 0 12px 28px rgba(0, 0, 0, 0.10);
}
.comparison-card .eyebrow { margin-bottom: 5px; color: var(--violet); }
.comparison-card h3 { margin-bottom: 5px; font-size: 16px; }
.comparison-card p { margin: 0; color: var(--muted); font-size: 9.5px; }
.comparison-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.comparison-metric { padding: 11px; border-radius: 10px; background: rgba(10, 14, 20, 0.34); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055); }
.comparison-metric span { display: block; margin-bottom: 5px; color: var(--faint); font-size: 8px; text-transform: uppercase; }
.comparison-metric strong { font-family: Outfit, Inter, sans-serif; font-size: 16px; }
.comparison-metric strong.better { color: var(--teal); }
.comparison-metric strong.worse { color: var(--red); }

.results-footer { max-width: 1450px; display: flex; justify-content: space-between; gap: 20px; margin: 22px auto 0; padding: 16px 2px 3px; box-shadow: 0 -1px var(--line-soft); }
.results-footer p { max-width: 900px; margin: 0; color: var(--faint); font-size: 9px; line-height: 1.5; }
.results-footer a { flex: 0 0 auto; color: var(--muted); font-size: 10px; font-weight: 650; text-decoration: none; }
.results-footer a:hover { color: var(--text); }

.modal {
  width: min(650px, calc(100vw - 28px));
  max-height: min(86vh, 820px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-xl);
  color: var(--text);
  background: transparent;
  box-shadow: var(--shadow-float);
  overflow: hidden;
}
.modal::backdrop { background: rgba(3, 6, 10, 0.70); backdrop-filter: blur(4px); }
.modal-shell { max-height: min(86vh, 820px); display: flex; flex-direction: column; border-radius: var(--radius-xl); background: #151c26; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 15px; background: #151c26; box-shadow: 0 1px var(--line-soft); }
.modal-header.sticky { position: sticky; top: 0; z-index: 2; }
.modal-header .step-label { margin-bottom: 4px; }
.modal-header h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.icon-button { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; margin: -6px -8px 0 0; border-radius: 10px; color: var(--muted); background: transparent; }
.icon-button:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.modal-content { padding: 20px 22px; overflow-y: auto; }
.modal-footer { display: flex; align-items: center; gap: 8px; padding: 14px 22px 18px; background: #151c26; box-shadow: 0 -1px var(--line-soft); }
.modal-spacer { flex: 1; }
.dialog-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dialog-note { margin: 17px 0 0; padding: 11px 12px; border-radius: 10px; color: var(--muted); background: #111820; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055); font-size: 10px; line-height: 1.45; }

.method-modal { width: min(960px, calc(100vw - 28px)); }
.method-shell { max-height: min(90vh, 900px); }
.method-content { padding: 0 26px 30px; }
.method-lede { padding: 24px 0 22px; }
.method-lede > p { max-width: 760px; margin-bottom: 18px; color: var(--text-soft); font-size: 13px; line-height: 1.65; }
.method-doc-link {
  min-height: 66px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 11px 13px 11px 11px;
  border-radius: 14px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(91, 157, 239, 0.16), rgba(44, 196, 147, 0.09));
  box-shadow: inset 0 0 0 1px rgba(91, 157, 239, 0.24), 0 8px 22px rgba(0, 0, 0, 0.14);
  text-decoration: none;
  transition-property: scale, background-color, box-shadow;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}
.method-doc-link:hover { background-color: rgba(91, 157, 239, 0.09); box-shadow: inset 0 0 0 1px rgba(91, 157, 239, 0.42), 0 11px 26px rgba(0, 0, 0, 0.2); }
.method-doc-link:active { scale: .96; }
.method-doc-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 9px; color: #b9d9ff; background: rgba(91, 157, 239, 0.18); }
.method-doc-icon svg, .method-doc-arrow { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.method-doc-link > span:nth-child(2) { min-width: 0; }
.method-doc-link strong { display: block; margin-bottom: 3px; font-size: 11px; }
.method-doc-link small { display: block; color: var(--muted); font-size: 9px; line-height: 1.4; }
.method-doc-arrow { color: var(--blue); }
.method-flow { display: flex; align-items: center; gap: 7px; overflow-x: auto; padding: 10px; border-radius: 13px; background: #111820; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055); }
.method-flow span { flex: 1 0 auto; padding: 8px 10px; border-radius: 8px; color: #cfe1f6; background: var(--blue-soft); font-size: 9px; font-weight: 700; text-align: center; }
.method-flow i { color: var(--faint); font-style: normal; }
.method-section { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 17px; padding: 24px 0; box-shadow: 0 -1px var(--line-soft); }
.method-number { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: var(--blue-soft); font-family: Outfit, Inter, sans-serif; font-size: 11px; font-weight: 700; }
.method-section h3 { margin-bottom: 10px; font-size: 17px; }
.method-section p, .method-section li { color: var(--muted); font-size: 11px; line-height: 1.62; }
.method-section p:last-child { margin-bottom: 0; }
.method-section ul { margin: 11px 0 0; padding-left: 18px; }
.method-section li + li { margin-top: 6px; }
.method-section li .fidelity-badge { margin-right: 6px; vertical-align: middle; }
.definition-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.definition-grid article { padding: 13px; border-radius: 11px; background: #111820; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055); }
.definition-grid strong { display: block; margin-bottom: 6px; color: var(--text-soft); font-size: 10px; }
.definition-grid p { margin: 0; color: var(--faint); font-size: 9px; line-height: 1.45; }
.definition-grid article.highlight { animation: definition-pulse 900ms ease-out; }
.method-callout { display: grid; gap: 5px; margin-top: 12px; padding: 13px; border-radius: 11px; color: #efd08b; background: var(--yellow-soft); box-shadow: inset 0 0 0 1px rgba(225, 173, 71, 0.18); }
.method-callout strong { font-size: 10px; }
.method-callout span { color: #c9b98f; font-size: 9.5px; line-height: 1.5; }
.limitations .method-number { color: var(--yellow); background: var(--yellow-soft); }
.method-sources { padding-top: 24px; box-shadow: 0 -1px var(--line-soft); }
.method-sources h3 { margin-bottom: 12px; font-size: 14px; }
.method-sources a { display: block; padding: 10px 0; box-shadow: 0 -1px var(--line-soft); color: var(--blue); font-size: 10px; text-decoration: none; }
.method-sources a:hover { color: #9bc7f7; }

.tooltip {
  position: fixed;
  z-index: 9000;
  max-width: 230px;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--text-soft);
  background: #080d12;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 10px 25px rgba(0, 0, 0, 0.42);
  font-size: 9px;
  line-height: 1.45;
  pointer-events: none;
}
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9100;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 11px;
  color: var(--text-soft);
  background: #17212c;
  box-shadow: var(--shadow-float);
  font-size: 10px;
  line-height: 1.4;
  animation: toast-in 220ms ease-out;
}

.entrance { opacity: 0; transform: translateY(10px); filter: blur(3px); animation: enter 420ms ease-out forwards; animation-delay: var(--delay, 0ms); }
@keyframes enter { to { opacity: 1; transform: translateY(0); filter: blur(0); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } }
@keyframes definition-pulse { 0%, 100% { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055); } 35% { box-shadow: inset 0 0 0 2px rgba(91, 157, 239, 0.70), 0 0 25px rgba(91, 157, 239, 0.12); } }

@media (max-width: 1180px) {
  :root { --scenario-width: 326px; }
  .topbar-center { display: none; }
  .topbar { grid-template-columns: 1fr auto; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-grid { grid-template-columns: 1fr; }
  .insight-stack { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: none; }
  .risk-card { min-height: 455px; }
}

@media (max-width: 860px) {
  body { overflow: auto; }
  .topbar { position: sticky; top: 0; height: 60px; padding: 0 12px; }
  .brand-owner { display: none; }
  .brand-mark { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; }
  .brand-title { font-size: 16px; }
  .topbar-actions { gap: 4px; }
  .import-popover { position: fixed; top: 66px; right: 8px; left: 8px; width: auto; max-height: calc(100vh - 74px); overflow-y: auto; }
  .ghost-button { width: 38px; min-height: 38px; padding: 0; justify-content: center; background: transparent; box-shadow: none; }
  .ghost-button span, .ghost-button .dropdown-chevron { display: none; }
  .run-button { min-height: 38px; padding: 4px 10px 4px 6px; }
  .run-button .run-copy small { display: none; }
  .app-shell { height: auto; display: block; overflow: visible; }
  .scenario-panel { max-height: none; padding: 23px 18px 20px; overflow: visible; box-shadow: 0 1px rgba(255, 255, 255, 0.065); }
  .results-panel { padding: 26px 18px 28px; overflow: visible; scroll-margin-top: 72px; }
  .analysis-grid { display: block; }
  .insight-stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
  .convergence-card { grid-column: 1 / -1; }
  .comparison-card { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .brand-title { max-width: 154px; }
  .scenario-panel, .results-panel { padding-inline: 14px; }
  .scenario-intro h1 { font-size: 25px; }
  .preset-grid { grid-template-columns: 1fr; }
  .three-field-grid { grid-template-columns: 1fr; }
  .preset-button { min-height: 58px; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding-right: 46px; }
  .preset-button small { text-align: right; }
  .preset-popover,
  .preset-option:nth-child(2) .preset-popover,
  .preset-option:last-child .preset-popover {
    position: static;
    width: auto;
    max-height: 0;
    margin: 0;
    padding-block: 0;
    overflow: hidden;
    transform: none;
  }
  .preset-option:not([data-suppressed="true"]) .preset-button:focus-visible ~ .preset-popover,
  .preset-option[data-open="true"] .preset-popover,
  .preset-option:nth-child(2):not([data-suppressed="true"]) .preset-button:focus-visible ~ .preset-popover,
  .preset-option:nth-child(2)[data-open="true"] .preset-popover {
    max-height: 230px;
    margin-top: 7px;
    padding-block: 12px;
    transform: none;
  }
  .report-heading { display: grid; gap: 10px; }
  .verdict-pill { justify-self: start; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric-card { min-height: 128px; padding: 13px; }
  .metric-value { display: grid; gap: 4px; }
  .metric-value strong { font-size: 28px; }
  .interpretation-card { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
  .interpretation-icon { width: 40px; height: 40px; border-radius: 11px; }
  .interpretation-stat { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; padding: 10px 0 0; box-shadow: 0 -1px var(--line); text-align: left; }
  .research-result-card { padding: 14px; }
  .research-result-header { grid-template-columns: 1fr; gap: 13px; }
  .research-result-hero { min-width: 0; justify-items: start; text-align: left; }
  .research-result-hero strong { font-size: 29px; }
  .research-result-chart { min-width: 0; min-height: 0; }
  .research-chart-shell { padding: 9px; }
  .risk-card { min-height: 0; padding: 14px; }
  .card-heading { display: grid; }
  .segmented-control { width: 100%; }
  .segmented-control button { flex: 1; min-width: 0; padding-inline: 5px; font-size: 8.75px; }
  .chart-view { min-height: 340px; overflow-x: auto; }
  .heatmap-wrap { min-width: 570px; min-height: 330px; }
  .svg-chart { min-width: 520px; min-height: 300px; }
  .svg-chart.research-result-chart { min-width: 0; min-height: 0; }
  .svg-chart.small { min-width: 0; min-height: 82px; }
  .weather-years-chart { min-width: 0; min-height: 205px; }
  .weather-years-table { max-height: 190px; }
  .insight-stack { grid-template-columns: 1fr; }
  .convergence-card { grid-column: auto; }
  .event-card { padding: 14px; }
  .comparison-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results-footer { display: grid; }
  .dialog-field-grid, .definition-grid { grid-template-columns: 1fr; }
  .method-content { padding-inline: 18px; }
  .method-section { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
  .method-number { width: 32px; height: 32px; }
  .modal-footer { flex-wrap: wrap; }
  input, select { min-height: 44px; font-size: 16px; }
  .resource-capacity .unit-input input { height: 44px; font-size: 16px; }
}

@media (max-width: 390px) {
  .brand-title { max-width: 124px; }
  .resource-row { grid-template-columns: 32px minmax(0, 1fr) 72px 40px; gap: 6px; }
  .resource-icon { width: 32px; height: 32px; }
  .field-row { grid-template-columns: minmax(0, 1fr) 124px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 116px; }
  .metric-value { display: flex; }
  .weather-basis { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .weather-basis i:nth-of-type(2), .weather-basis span:last-child { display: none; }
  .weather-diagnostic-summary { grid-template-columns: 1fr; }
  .weather-diagnostic-summary div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 12px; }
  .weather-diagnostic-summary span { margin-bottom: 0; }
  .research-field-grid { grid-template-columns: 1fr; }
}

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

@media print {
  :root { color-scheme: light; }
  body { color: #15202b; background: white; overflow: visible; }
  .topbar, .scenario-panel, .segmented-control, .secondary-button, .results-footer a { display: none !important; }
  .app-shell { display: block; height: auto; }
  .results-panel { padding: 0; overflow: visible; }
  .analysis-card, .metric-card, .interpretation-card, .research-result-card, .comparison-card { color: #15202b; background: white; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12); break-inside: avoid; }
  .chart-view[hidden] { display: block !important; }
  .results-footer { color: #344; }
}
