@property --score {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

:root {
  --topbar-height: 74px;
  --rail-width: 308px;
  --stage-gutter: clamp(16px, 2.2vw, 42px);
  --content-max: 1880px;
  --touch-size: 44px;
  --paper: #f1eee4;
  --paper-deep: #e6e0d2;
  --panel: #fbfaf5;
  --panel-cool: #f4f5f0;
  --ink: #19211d;
  --ink-soft: #34413a;
  --muted: #4d5851;
  --faint: #59635c;
  --line: rgba(25, 33, 29, 0.14);
  --line-strong: rgba(25, 33, 29, 0.28);
  --teal: #0d6b59;
  --teal-bright: #149477;
  --teal-soft: #d9ebe4;
  --amber: #d77a1b;
  --amber-ink: #9c4f0b;
  --amber-soft: #f6e1c9;
  --coral: #cd4c3a;
  --coral-ink: #ad3d2d;
  --coral-soft: #f4d9d4;
  --blue: #2d668a;
  --blue-soft: #dbe8ef;
  --stored: #2d668a;
  --diesel: #5d625e;
  --diesel-soft: #e2e2dc;
  --violet: #66583b;
  --red: #a52d35;
  --white: #fffefa;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow: 0 18px 50px rgba(25, 33, 29, 0.08);
  --hard-shadow: 5px 5px 0 rgba(25, 33, 29, 0.09);
  --display: "Iowan Old Style", "Songti SC", "STSong", "Noto Serif CJK SC",
    Georgia, serif;
  --body: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC",
    sans-serif;
  --number: "DIN Alternate", "Avenir Next Condensed", "Helvetica Neue",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 3%, rgba(215, 122, 27, 0.13), transparent 25rem),
    radial-gradient(circle at 95% 10%, rgba(13, 107, 89, 0.11), transparent 30rem),
    linear-gradient(118deg, transparent 0 76%, rgba(45, 102, 138, 0.035) 76% 100%),
    var(--paper);
  font-family: var(--body);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
.topbar,
.control-rail,
.view-nav,
.overview-hero,
.view-intro,
.panel-heading,
.mode-switch,
.startup-console,
.action-dialog {
  -webkit-user-select: none;
  user-select: none;
}

input,
textarea,
select,
pre,
code,
.data-table,
.quality-check-list,
.quality-normalization,
.quality-provenance,
.method-grid,
.limitation-grid {
  -webkit-user-select: text;
  user-select: text;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3 {
  margin-top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(25, 33, 29, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 33, 29, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}

.page-noise::before {
  position: absolute;
  inset: -20%;
  content: "";
  background:
    radial-gradient(circle at 22% 24%, rgba(215, 122, 27, 0.12), transparent 24rem),
    radial-gradient(circle at 78% 12%, rgba(20, 148, 119, 0.12), transparent 28rem),
    radial-gradient(circle at 64% 74%, rgba(45, 102, 138, 0.08), transparent 22rem);
  filter: blur(22px);
  animation: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 74px;
  padding: 10px clamp(14px, 2vw, 30px);
  gap: clamp(10px, 1.4vw, 18px);
  border-bottom: 1px solid var(--line);
  background: rgba(241, 238, 228, 0.92);
  backdrop-filter: blur(22px) saturate(1.15);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--paper);
  background: var(--ink);
  border-radius: 4px 4px 13px 4px;
  font-family: var(--number);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-copy strong {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--number);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.title-stack {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.scenario-title {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: var(--touch-size);
  min-width: 0;
  padding: 7px 8px;
  margin: -7px -8px;
  overflow: hidden;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 7px;
  outline: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--display);
  font-size: clamp(16px, 1.4vw, 22px);
  font-weight: 700;
  letter-spacing: -0.03em;
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.scenario-title:hover {
  background: rgba(255, 254, 250, 0.48);
}

.scenario-title:focus {
  background: rgba(255, 254, 250, 0.88);
  box-shadow:
    inset 0 0 0 1px rgba(215, 122, 27, 0.48),
    0 4px 16px rgba(25, 33, 29, 0.08);
}

.scenario-meta {
  display: flex;
  align-items: center;
  min-width: 0;
  flex-wrap: nowrap;
  gap: 7px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.scenario-meta > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 4px;
  color: var(--muted);
  font-size: 10px;
}

.save-state::before {
  width: 6px;
  height: 6px;
  content: "";
  border-radius: 50%;
  background: var(--teal-bright);
  box-shadow: 0 0 0 4px rgba(20, 148, 119, 0.1);
  animation: none;
}

.save-state.is-dirty::before {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(215, 122, 27, 0.12);
}

.save-state.is-error {
  color: var(--coral-ink);
}

.save-state.is-error::before {
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(205, 76, 58, 0.11);
}

.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: rgba(25, 33, 29, 0.06);
  border: 1px solid rgba(25, 33, 29, 0.1);
  border-radius: 999px;
}

.mode-button {
  min-height: 34px;
  padding: 6px 12px;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  transition:
    color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.mode-button:hover {
  color: var(--ink);
}

.mode-button.is-active {
  color: var(--white);
  background: var(--teal);
  box-shadow: 0 2px 8px rgba(13, 107, 89, 0.22);
}

.mode-pro .mode-switch {
  background: rgba(45, 102, 138, 0.08);
  border-color: rgba(45, 102, 138, 0.2);
}

.mode-pro .mode-button[data-display-mode="pro"].is-active {
  background: var(--blue);
  box-shadow: 0 2px 8px rgba(45, 102, 138, 0.28);
}

.view-tab[hidden] {
  display: none !important;
}

.button,
.text-button,
.icon-button {
  cursor: pointer;
}

.button {
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

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

.button:focus-visible,
.icon-button:focus-visible,
.view-tab:focus-visible,
.text-button:focus-visible,
.action-card:focus-visible {
  outline: 3px solid rgba(215, 122, 27, 0.35);
  outline-offset: 2px;
}

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

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

.button-quiet {
  background: rgba(255, 254, 250, 0.5);
}

.button-quiet:hover {
  color: var(--teal);
  border-color: var(--teal);
  background: var(--teal-soft);
}

.button-small {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 10px;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  font-size: 22px;
}

.icon-button:hover {
  background: rgba(25, 33, 29, 0.06);
}

.menu-button,
.rail-close {
  display: none;
}

.menu-button {
  width: 40px;
  height: 40px;
  gap: 4px;
}

.menu-button span {
  display: block;
  width: 17px;
  height: 1.5px;
  background: var(--ink);
}

.workspace {
  display: grid;
  grid-template-columns: calc(var(--rail-width) + 28px) minmax(0, 1fr);
  min-height: calc(100dvh - var(--topbar-height));
}

.control-rail {
  position: sticky;
  top: calc(var(--topbar-height) + 14px);
  align-self: start;
  height: calc(100dvh - var(--topbar-height) - 28px);
  margin: 14px 0 14px 14px;
  padding: 20px 16px 34px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.64), transparent 18rem),
    rgba(247, 245, 237, 0.88);
  box-shadow: 0 16px 44px rgba(25, 33, 29, 0.06);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.rail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.rail-head h2 {
  margin: 3px 0 0;
  font-family: var(--display);
  font-size: 25px;
  letter-spacing: -0.035em;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-family: var(--number);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.scenario-editor {
  margin-bottom: 13px;
  overflow: hidden;
  background: rgba(255, 254, 250, 0.5);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.scenario-editor > summary {
  display: flex;
  min-height: 56px;
  padding: 10px 12px;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.scenario-editor > summary::-webkit-details-marker {
  display: none;
}

.scenario-editor > summary::after {
  flex: 0 0 auto;
  margin-left: 2px;
  content: "+";
  color: var(--muted);
  font-family: var(--number);
  font-size: 15px;
}

.scenario-editor[open] > summary::after {
  content: "−";
}

.scenario-editor-label {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 3px;
}

.scenario-editor-label strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.scenario-editor-label small {
  overflow: hidden;
  color: var(--faint);
  font-family: var(--number);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scenario-editor-body {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.section-count {
  color: var(--faint);
  font-family: var(--number);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.field {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11.5px;
}

.field input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--ink);
  background: rgba(255, 254, 250, 0.7);
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  font-size: 12px;
}

.field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 107, 89, 0.1);
}

.mode-rail-note {
  margin: 3px 0 0;
  padding: 9px 10px;
  color: var(--muted);
  background: rgba(13, 107, 89, 0.05);
  border-left: 2px solid rgba(13, 107, 89, 0.36);
  font-size: 10.5px;
  line-height: 1.6;
}

.mode-rail-note.is-warning {
  margin: 0 0 8px;
  color: var(--amber-ink);
  background: rgba(215, 122, 27, 0.08);
  border-left-color: rgba(215, 122, 27, 0.55);
}

.control-group[hidden] {
  display: none;
}

.mode-simple .control-rail {
  background:
    linear-gradient(180deg, rgba(13, 107, 89, 0.035), transparent 24rem),
    rgba(247, 245, 237, 0.9);
}

.mode-pro .control-rail {
  background:
    linear-gradient(180deg, rgba(45, 102, 138, 0.04), transparent 24rem),
    rgba(247, 245, 237, 0.9);
}

.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 20px;
}

.preset-button {
  position: relative;
  min-height: 66px;
  padding: 10px 11px;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  background: rgba(255, 254, 250, 0.56);
  border: 1px solid var(--line);
  border-radius: 9px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.preset-button::after {
  position: absolute;
  right: -16px;
  bottom: -24px;
  width: 56px;
  height: 56px;
  content: "";
  border: 1px solid var(--line);
  border-radius: 50%;
}

.preset-button:hover {
  transform: translateY(-1px);
  border-color: var(--teal);
  background: var(--teal-soft);
}

.preset-button strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.preset-button small {
  display: block;
  color: var(--muted);
  font-family: var(--number);
  font-size: 9.5px;
}

.control-group {
  margin-bottom: 9px;
  overflow: hidden;
  background: rgba(255, 254, 250, 0.48);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.control-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 700;
  user-select: none;
}

.control-group > summary::-webkit-details-marker {
  display: none;
}

.control-group > summary::after {
  content: "+";
  color: var(--muted);
  font-family: var(--number);
  font-size: 14px;
  font-weight: 500;
}

.control-group[open] > summary::after {
  content: "−";
}

.control-group > summary em {
  margin-left: auto;
  margin-right: 10px;
  color: var(--faint);
  font-family: var(--number);
  font-size: 7.5px;
  font-style: normal;
  letter-spacing: 0.12em;
}

.control-body {
  padding: 0 12px 11px;
}

.control-item {
  padding: 10px 0 9px;
  border-top: 1px solid var(--line);
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.control-label {
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.35;
}

.control-value {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.control-value input {
  width: 68px;
  min-height: 34px;
  padding: 5px;
  color: var(--teal);
  text-align: right;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  outline: 0;
  font-family: var(--number);
  font-size: 12px;
  font-weight: 800;
}

.control-value input:focus {
  border-color: var(--teal);
}

.control-value span {
  min-width: 34px;
  color: var(--faint);
  font-family: var(--number);
  font-size: 9.5px;
}

input[type="range"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 42px;
  margin: 0;
  appearance: none;
  cursor: ew-resize;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  background: transparent;
  border-radius: 999px;
}

input[type="range"]::-webkit-slider-thumb {
  width: 26px;
  height: 26px;
  margin-top: -9px;
  appearance: none;
  background:
    radial-gradient(circle at 50% 50%, var(--teal) 0 3px, transparent 3.5px),
    linear-gradient(145deg, #fffefa, #eef3ed);
  border: 1px solid rgba(13, 107, 89, 0.52);
  border-radius: 50%;
  box-shadow:
    0 0 0 3px var(--panel),
    0 0 0 4px rgba(13, 107, 89, 0.16),
    0 7px 16px rgba(25, 33, 29, 0.18);
  transition:
    transform 180ms cubic-bezier(0.2, 0.9, 0.2, 1),
    box-shadow 180ms ease;
}

input[type="range"]::-moz-range-track {
  height: 8px;
  background: transparent;
  border-radius: 999px;
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background:
    radial-gradient(circle at 50% 50%, var(--teal) 0 3px, transparent 3.5px),
    linear-gradient(145deg, #fffefa, #eef3ed);
  border: 1px solid rgba(13, 107, 89, 0.52);
  border-radius: 50%;
  box-shadow:
    0 0 0 3px var(--panel),
    0 0 0 4px rgba(13, 107, 89, 0.16),
    0 7px 16px rgba(25, 33, 29, 0.18);
}

input[type="range"]:hover::-webkit-slider-thumb {
  transform: scale(1.08);
  box-shadow:
    0 0 0 3px var(--panel),
    0 0 0 5px rgba(13, 107, 89, 0.19),
    0 9px 20px rgba(25, 33, 29, 0.22);
}

input[type="range"]:focus-visible {
  outline: 0;
}

input[type="range"]:focus-visible::-webkit-slider-thumb,
.range-shell.is-dragging input[type="range"]::-webkit-slider-thumb {
  transform: scale(1.12);
  box-shadow:
    0 0 0 3px var(--panel),
    0 0 0 6px rgba(13, 107, 89, 0.2),
    0 10px 24px rgba(25, 33, 29, 0.24);
}

.range-shell {
  --range-progress: 0%;
  --range-ratio: 0;
  position: relative;
  height: 42px;
  margin: 1px 0 2px;
  isolation: isolate;
}

.range-visual {
  position: absolute;
  top: 17px;
  right: 1px;
  left: 1px;
  height: 8px;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), transparent 52%),
    rgba(25, 33, 29, 0.1);
  border: 1px solid rgba(25, 33, 29, 0.1);
  border-radius: 999px;
  box-shadow:
    inset 0 1px 2px rgba(25, 33, 29, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.65);
}

.range-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--range-progress);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent 52%),
    linear-gradient(90deg, #0d6b59, #149477 68%, #5abd9e);
  border-radius: inherit;
  box-shadow: 0 0 12px rgba(20, 148, 119, 0.22);
  transition:
    width 120ms linear,
    filter 180ms ease;
}

.range-fill::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(
    100deg,
    transparent 0 36%,
    rgba(255, 255, 255, 0.34) 48%,
    transparent 60% 100%
  );
  transform: translateX(-120%);
}

.range-shell.is-dragging .range-fill {
  filter: saturate(1.1) brightness(1.04);
}

.range-shell.is-dragging .range-fill::after {
  animation: range-fill-sheen 1.2s ease-out 2;
}

.range-ticks {
  position: absolute;
  inset: 0 -1px;
  opacity: 0.38;
  background-image: linear-gradient(
    90deg,
    rgba(251, 250, 245, 0.78) 0 1px,
    transparent 1px
  );
  background-size: calc(100% / 10) 100%;
  mix-blend-mode: overlay;
}

.range-bubble {
  position: absolute;
  top: -18px;
  left: var(
    --range-bubble-left,
    calc(17px + (100% - 34px) * var(--range-ratio))
  );
  z-index: 4;
  min-width: 34px;
  padding: 3px 7px 4px;
  pointer-events: none;
  color: var(--paper);
  background: rgba(25, 33, 29, 0.94);
  border: 1px solid rgba(241, 238, 228, 0.15);
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(25, 33, 29, 0.2);
  font-family: var(--number);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.25;
  opacity: 0;
  transform: translate(-50%, 4px) scale(0.92);
  transition:
    opacity 150ms ease,
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.range-bubble::after {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 6px;
  height: 6px;
  content: "";
  background: inherit;
  border-right: 1px solid rgba(241, 238, 228, 0.15);
  border-bottom: 1px solid rgba(241, 238, 228, 0.15);
  transform: translate(-50%, -3px) rotate(45deg);
}

.range-shell:is(:hover, :focus-within, .is-dragging) .range-bubble {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.range-shell:focus-within .range-visual {
  border-color: rgba(13, 107, 89, 0.34);
  box-shadow:
    inset 0 1px 2px rgba(25, 33, 29, 0.08),
    0 0 0 3px rgba(13, 107, 89, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.65);
}

@keyframes range-fill-sheen {
  to {
    transform: translateX(240%);
  }
}

.control-hint {
  margin: 2px 0 0;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.5;
}

.rail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.mode-mobile {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -6px 0 18px;
  padding: 12px;
  color: var(--muted);
  background: rgba(255, 254, 250, 0.52);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
}

.simple-mode-guide {
  position: relative;
  margin: 14px 0 4px;
  padding: 15px 14px 14px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(215, 122, 27, 0.1), transparent 64%),
    rgba(255, 254, 250, 0.62);
  border: 1px solid rgba(215, 122, 27, 0.28);
  border-radius: 12px;
}

.simple-mode-guide::after {
  position: absolute;
  right: -28px;
  top: -32px;
  width: 92px;
  height: 92px;
  content: "";
  border: 1px solid rgba(215, 122, 27, 0.22);
  border-radius: 50%;
}

.simple-mode-guide[hidden] {
  display: none;
}

.simple-mode-guide-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--amber-ink);
  font-family: var(--number);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.simple-mode-guide strong {
  display: block;
  margin-bottom: 7px;
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.35;
}

.simple-mode-guide p {
  margin: 0 0 11px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.simple-mode-guide-button {
  display: inline-flex;
  min-height: 36px;
  padding: 7px 11px;
  align-items: center;
  gap: 7px;
  color: var(--white);
  cursor: pointer;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.simple-mode-guide-button:hover {
  background: var(--teal);
  border-color: var(--teal);
}

.mode-simple .control-hint {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.text-button {
  display: inline-flex;
  min-height: 36px;
  padding: 4px 0;
  align-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 10.5px;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}

.text-button:hover {
  color: var(--teal);
  text-decoration-color: currentColor;
}

.panel-backdrop {
  display: none;
}

.main-stage {
  min-width: 0;
  padding: 0 var(--stage-gutter) 72px;
}

.app-booting .control-rail,
.app-booting .view-nav,
.app-booting .view {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.startup-console {
  display: grid;
  min-height: calc(100dvh - var(--topbar-height) - 28px);
  padding: clamp(20px, 4vw, 54px) 0;
  place-items: center;
}

.startup-console[hidden] {
  display: none;
}

.startup-console.is-leaving {
  animation: startup-console-out 360ms ease forwards;
}

.startup-card {
  width: min(920px, 100%);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), transparent 42%),
    rgba(251, 250, 245, 0.9);
  border: 1px solid var(--line);
  border-radius: 28px 8px 28px 8px;
  box-shadow: 0 30px 90px rgba(25, 33, 29, 0.12);
}

.startup-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  color: var(--paper);
  background:
    radial-gradient(circle at 88% 0, rgba(215, 122, 27, 0.22), transparent 16rem),
    var(--ink);
}

.startup-identity > div {
  display: grid;
  gap: 4px;
}

.startup-identity .eyebrow {
  color: rgba(241, 238, 228, 0.5);
}

.startup-identity span:not(.startup-mark) {
  color: rgba(241, 238, 228, 0.72);
  font-family: var(--number);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.startup-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--ink);
  background: #efb265;
  border-radius: 5px 5px 15px 5px;
  font-family: var(--number);
  font-size: 13px;
  font-weight: 900;
}

.startup-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 52px);
  padding: clamp(28px, 5vw, 58px);
  align-items: center;
}

.startup-loader {
  position: relative;
  display: grid;
  width: 176px;
  height: 176px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(20, 148, 119, 0.1), transparent 63%),
    rgba(25, 33, 29, 0.035);
  border: 1px solid rgba(25, 33, 29, 0.1);
}

.startup-loader::before,
.startup-loader::after {
  position: absolute;
  content: "";
  border-radius: 50%;
}

.startup-loader::before {
  inset: 14px;
  border: 1px dashed rgba(13, 107, 89, 0.24);
  animation: startup-ring 16s linear infinite;
}

.startup-loader::after {
  inset: 36px;
  border: 2px solid rgba(20, 148, 119, 0.12);
  border-top-color: var(--teal-bright);
  border-right-color: #efb265;
  animation: startup-ring-reverse 2.8s linear infinite;
}

.startup-loader i {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #efb265;
  box-shadow: 0 0 0 5px rgba(239, 178, 101, 0.1);
}

.startup-loader i:nth-child(1) {
  top: 14px;
  right: 36px;
}

.startup-loader i:nth-child(2) {
  bottom: 25px;
  left: 27px;
  background: var(--teal-bright);
  box-shadow: 0 0 0 5px rgba(20, 148, 119, 0.1);
}

.startup-loader span {
  color: var(--ink);
  font-family: var(--number);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.startup-copy h1 {
  margin: 8px 0 10px;
  font-family: var(--display);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
}

.startup-copy > p:not(.eyebrow) {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.startup-steps {
  display: grid;
  gap: 1px;
  margin: 24px 0 18px;
  padding: 1px;
  overflow: hidden;
  list-style: none;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.startup-steps li {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 43px;
  padding: 9px 12px;
  color: var(--faint);
  background: rgba(251, 250, 245, 0.92);
  font-size: 10.5px;
  transition:
    color 180ms ease,
    background-color 180ms ease;
}

.startup-steps li i {
  width: 8px;
  height: 8px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.startup-steps li em {
  font-family: var(--number);
  font-size: 8.5px;
  font-style: normal;
  letter-spacing: 0.04em;
}

.startup-steps li.is-active {
  color: var(--ink);
  background: var(--panel);
}

.startup-steps li.is-active i {
  color: var(--teal);
  border-color: var(--teal);
  background: var(--teal-bright);
  box-shadow: 0 0 0 4px rgba(20, 148, 119, 0.1);
}

.startup-steps li.is-done {
  color: var(--teal);
}

.startup-steps li.is-done i {
  border-color: var(--teal);
  background: var(--teal);
}

.startup-steps li.is-error {
  color: var(--coral-ink);
  background: var(--coral-soft);
}

.startup-steps li.is-error i {
  border-color: var(--coral);
  background: var(--coral);
}

.startup-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--faint);
  font-size: 9.5px;
}

.startup-foot strong {
  color: var(--ink);
  font-family: var(--number);
}

.startup-retry {
  margin-top: 16px;
}

.startup-console.is-error .startup-loader::after {
  border-top-color: var(--coral);
  border-right-color: var(--coral);
  animation: none;
}

.calculation-dock {
  position: fixed;
  right: clamp(16px, 3vw, 42px);
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 65;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: min(560px, calc(100vw - 32px));
  padding: 12px 14px;
  color: var(--paper);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.04), transparent 48%),
    rgba(25, 33, 29, 0.96);
  border: 1px solid rgba(241, 238, 228, 0.16);
  border-radius: 14px;
  box-shadow: 0 20px 55px rgba(25, 33, 29, 0.25);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 180ms ease;
  backdrop-filter: blur(18px) saturate(1.1);
}

.calculation-dock[hidden] {
  display: none;
}

.calculation-dock.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.calculation-dock.is-error {
  border-color: rgba(239, 123, 105, 0.48);
}

.calculation-dock.is-success {
  border-color: rgba(112, 221, 189, 0.34);
}

.calculation-signal {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(241, 238, 228, 0.16);
  border-radius: 50%;
}

.calculation-signal::before,
.calculation-signal::after {
  position: absolute;
  content: "";
  border-radius: 50%;
}

.calculation-signal::before {
  inset: 5px;
  border: 1px dashed rgba(112, 221, 189, 0.38);
  animation: startup-ring 5.4s linear infinite;
}

.calculation-signal::after {
  width: 7px;
  height: 7px;
  background: #70ddbd;
  box-shadow: 0 0 0 4px rgba(112, 221, 189, 0.1);
}

.calculation-signal i {
  position: absolute;
  top: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #efb265;
}

.calculation-dock.is-success .calculation-signal::before {
  animation: none;
  border-color: rgba(112, 221, 189, 0.58);
}

.calculation-dock.is-success .calculation-signal::after {
  border-radius: 2px;
  transform: rotate(45deg);
}

.calculation-dock.is-error .calculation-signal::before {
  animation: none;
  border-color: rgba(239, 123, 105, 0.55);
}

.calculation-dock.is-error .calculation-signal::after {
  background: #ef7b69;
  box-shadow: 0 0 0 4px rgba(239, 123, 105, 0.11);
}

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

.calculation-kicker {
  display: block;
  margin-bottom: 3px;
  color: rgba(241, 238, 228, 0.45);
  font-family: var(--number);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.calculation-copy strong {
  display: block;
  overflow: hidden;
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculation-copy p {
  margin: 3px 0 0;
  overflow: hidden;
  color: rgba(241, 238, 228, 0.58);
  font-size: 9px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculation-track {
  height: 2px;
  margin-top: 8px;
  overflow: hidden;
  background: rgba(241, 238, 228, 0.1);
  border-radius: 99px;
}

.calculation-track i {
  display: block;
  width: 34%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #70ddbd, #efb265, transparent);
  animation: calculation-scan 1.35s ease-in-out infinite;
}

.calculation-dock.is-success .calculation-track i {
  width: 100%;
  background: #70ddbd;
  animation: none;
}

.calculation-dock.is-error .calculation-track i {
  width: 100%;
  background: #ef7b69;
  animation: none;
}

.calculation-meta {
  display: grid;
  min-width: 74px;
  gap: 3px;
  justify-items: end;
  color: rgba(241, 238, 228, 0.76);
  font-family: var(--number);
  font-size: 9.5px;
}

.calculation-meta small {
  color: rgba(241, 238, 228, 0.38);
  font-size: 7.5px;
  white-space: nowrap;
}

.calculation-retry {
  grid-column: 2 / -1;
  justify-self: end;
  margin-top: 2px;
  color: var(--ink);
  background: #efb265;
  border-color: #efb265;
}

.calculation-retry[hidden] {
  display: none;
}

@keyframes startup-ring {
  to {
    transform: rotate(360deg);
  }
}

@keyframes startup-ring-reverse {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes startup-console-out {
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes calculation-scan {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(390%);
  }
}

.view-nav {
  --indicator-x: 5px;
  --indicator-width: 0px;
  position: sticky;
  top: calc(var(--topbar-height) + 12px);
  z-index: 40;
  display: flex;
  width: max-content;
  max-width: 100%;
  gap: 3px;
  margin: 16px auto 28px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 250, 245, 0.84);
  box-shadow: 0 12px 34px rgba(25, 33, 29, 0.08);
  backdrop-filter: blur(18px) saturate(1.2);
  isolation: isolate;
  scrollbar-width: none;
}

.view-nav::-webkit-scrollbar {
  display: none;
}

.view-tab {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 14px;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.view-tab:hover {
  color: var(--ink);
  background: rgba(25, 33, 29, 0.055);
}

.view-tab.is-active {
  color: var(--paper);
  background: transparent;
  box-shadow: none;
  animation: none;
}

.view-tab.is-active:hover {
  color: var(--paper);
  background: transparent;
}

.view-tab.is-active::after {
  position: absolute;
  right: 34%;
  bottom: 4px;
  left: 34%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, #efb265, transparent);
  opacity: 0.72;
  animation: none;
}

.view-tab-indicator {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  z-index: 0;
  width: var(--indicator-width);
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 44%),
    linear-gradient(112deg, #19211d 0%, #294237 46%, #19211d 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  box-shadow:
    0 8px 18px rgba(25, 33, 29, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transform: translate3d(var(--indicator-x), 0, 0);
  transition:
    transform 560ms cubic-bezier(0.22, 1.24, 0.36, 1),
    width 460ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 160ms ease;
  will-change: transform, width;
}

.view-tab-indicator.is-ready {
  opacity: 1;
}

.view-tab-indicator.is-immediate {
  transition: none;
}

.view {
  display: none;
  max-width: var(--content-max);
  margin: 0 auto;
}

.view.is-active {
  display: block;
  transform-origin: 50% 0;
  animation: view-in 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.view.is-active > .view-intro,
.view.is-active > .panel,
.view.is-active > .dashboard-grid,
.view.is-active > .quality-main-grid,
.view.is-active > .method-grid,
.view.is-active > .comparison-layout {
  animation: view-child-in 640ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.view.is-active > *:nth-child(2) {
  animation-delay: 55ms;
}

.view.is-active > *:nth-child(3) {
  animation-delay: 110ms;
}

.view.is-active > *:nth-child(4) {
  animation-delay: 165ms;
}

.view.is-active > *:nth-child(5) {
  animation-delay: 220ms;
}

@keyframes view-in {
  0% {
    opacity: 0;
    filter: blur(9px);
    transform: translateY(26px) scale(0.985);
  }
  58% {
    filter: blur(0);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes view-child-in {
  0% {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(22px) scale(0.994);
  }
  62% {
    filter: blur(0);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes ambient-aurora-drift {
  from {
    transform: translate3d(-1.8%, -1.2%, 0) scale(1);
  }
  to {
    transform: translate3d(2.2%, 1.6%, 0) scale(1.06);
  }
}

@keyframes live-status-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(20, 148, 119, 0.08);
    opacity: 0.72;
  }
  50% {
    box-shadow: 0 0 0 5px rgba(20, 148, 119, 0.03);
    opacity: 1;
  }
}

@keyframes nav-active-sheen {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes nav-active-underline {
  0%,
  100% {
    opacity: 0.36;
    transform: scaleX(0.72);
  }
  50% {
    opacity: 0.9;
    transform: scaleX(1);
  }
}

.overview-hero {
  --hero-grid: rgba(13, 107, 89, 0.055);
  --hero-warm: #b96210;
  --hero-cool: #0d6b59;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 220px;
  gap: 24px clamp(24px, 3vw, 42px);
  min-height: 310px;
  padding: clamp(28px, 2.6vw, 38px);
  overflow: hidden;
  color: var(--ink);
  background-color: var(--panel);
  background-image:
    radial-gradient(circle at 91% 6%, rgba(215, 122, 27, 0.13), transparent 18rem),
    radial-gradient(circle at 9% 108%, rgba(13, 107, 89, 0.12), transparent 25rem),
    linear-gradient(118deg, rgba(255, 254, 250, 0.98), rgba(248, 246, 238, 0.94) 61%, rgba(239, 232, 218, 0.88));
  border: 1px solid rgba(25, 33, 29, 0.12);
  border-radius: 34px 7px 34px 7px;
  box-shadow:
    0 22px 62px rgba(25, 33, 29, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.overview-hero::before,
.overview-hero::after {
  position: absolute;
  z-index: 0;
  content: "";
  pointer-events: none;
  border: 1px solid rgba(13, 107, 89, 0.1);
  border-radius: 50%;
}

.overview-hero::before {
  top: -85px;
  right: -80px;
  width: 330px;
  height: 330px;
  animation: none;
}

.overview-hero::after {
  right: 48px;
  bottom: -145px;
  width: 410px;
  height: 410px;
  animation: none;
}

.hero-atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: inherit;
}

.hero-atmosphere::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(
      90deg,
      rgba(251, 250, 245, 0.96) 0 37%,
      rgba(251, 250, 245, 0.72) 56%,
      rgba(251, 250, 245, 0.18) 78%,
      transparent 100%
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 31px,
      var(--hero-grid) 31px 32px
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0 31px,
      var(--hero-grid) 31px 32px
    ),
    radial-gradient(circle at 79% 35%, rgba(215, 122, 27, 0.1), transparent 18rem),
    linear-gradient(180deg, transparent 54%, rgba(13, 107, 89, 0.045));
  mask-image: linear-gradient(90deg, transparent 0 29%, #000 64%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0 29%, #000 64%);
}

.hero-aurora {
  position: absolute;
  width: 320px;
  height: 320px;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(44px);
  mix-blend-mode: multiply;
  opacity: 0.52;
}

.hero-aurora-a {
  top: -170px;
  right: 15%;
  background: rgba(215, 122, 27, 0.2);
  animation: none;
}

.hero-aurora-b {
  bottom: -200px;
  left: 20%;
  background: rgba(20, 148, 119, 0.17);
  animation: none;
}

.hero-contour-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  opacity: 0.58;
  mask-image: linear-gradient(
    104deg,
    transparent 0 30%,
    rgba(0, 0, 0, 0.18) 48%,
    #000 72%
  );
  -webkit-mask-image: linear-gradient(
    104deg,
    transparent 0 30%,
    rgba(0, 0, 0, 0.18) 48%,
    #000 72%
  );
}

.hero-topography path {
  fill: none;
  stroke: rgba(13, 107, 89, 0.13);
  stroke-width: 0.9;
  stroke-dasharray: 1.2 8;
  animation: none;
}

.hero-topography path:nth-child(2) {
  opacity: 0.58;
}

.hero-topography path:nth-child(3) {
  opacity: 0.46;
}

.hero-topography path:nth-child(4) {
  opacity: 0.36;
}

.hero-energy-routes {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-route-base {
  stroke-width: 1.45;
}

.hero-route {
  stroke-width: 2.35;
  filter: drop-shadow(0 1px 2px rgba(156, 79, 11, 0.18));
}

.hero-route-cool {
  filter: drop-shadow(0 1px 2px rgba(13, 107, 89, 0.18));
}

.hero-data-path {
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
}

.hero-data-path.is-drawing {
  animation: hero-data-draw 1.25s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

#heroPvPath.is-drawing {
  animation-delay: 90ms;
}

#heroRenewablePath.is-drawing {
  animation-delay: 170ms;
}

.hero-route-pulse {
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 0.035 1;
  stroke-dashoffset: 1;
  opacity: 0;
  vector-effect: non-scaling-stroke;
}

.hero-route-pulse-load {
  stroke: rgba(52, 65, 58, 0.9);
  stroke-width: 3;
  filter: drop-shadow(0 0 4px rgba(52, 65, 58, 0.25));
}

.hero-route-pulse-warm {
  stroke: #f0a84d;
  stroke-width: 3.8;
  filter: drop-shadow(0 0 6px rgba(215, 122, 27, 0.42));
}

.hero-route-pulse-cool {
  stroke: #8edcc6;
  stroke-width: 3.6;
  filter: drop-shadow(0 0 6px rgba(20, 148, 119, 0.4));
}

.hero-route-pulse.is-flowing {
  animation: hero-route-pulse 3.15s cubic-bezier(0.42, 0, 0.22, 1) 3 both;
}

#heroPvPulse.is-flowing {
  animation-delay: 820ms;
}

#heroRenewablePulse.is-flowing {
  animation-delay: 1480ms;
}

.hero-node {
  fill: #c56d16;
  filter: drop-shadow(0 0 5px rgba(215, 122, 27, 0.35));
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: hero-node-in 360ms var(--hero-node-delay, 0ms) ease forwards;
}

.hero-node.is-renewable {
  fill: #0d7e67;
  filter: drop-shadow(0 0 5px rgba(20, 148, 119, 0.32));
}

.hero-node-ripple {
  fill: none;
  stroke: rgba(13, 107, 89, 0.34);
  stroke-width: 1;
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: hero-node-ripple 2.4s var(--hero-node-delay, 0ms) ease-out 2
    both;
}

.hero-copy {
  position: relative;
  z-index: 1;
  align-self: center;
}

.hero-copy::before {
  position: absolute;
  inset: -26px -34px -22px -24px;
  z-index: -1;
  content: "";
  pointer-events: none;
  background: radial-gradient(
    ellipse at 24% 52%,
    rgba(251, 250, 245, 0.92) 0%,
    rgba(251, 250, 245, 0.72) 44%,
    rgba(251, 250, 245, 0.26) 66%,
    transparent 82%
  );
}

.hero-copy .eyebrow {
  color: var(--teal);
  animation: hero-copy-rise 520ms 40ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-copy h1 {
  display: grid;
  justify-items: start;
  max-width: 700px;
  margin: 14px 0 18px;
  font-family: var(--display);
  font-size: clamp(41px, 3.75vw, 61px);
  font-weight: 500;
  line-height: 0.99;
  letter-spacing: -0.055em;
}

.hero-title-plain,
.hero-title-accent {
  display: block;
  animation: hero-title-rise 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-title-plain {
  color: var(--ink);
  font-family: var(--body);
  font-size: 0.64em;
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.hero-title-plain:first-child {
  animation-delay: 110ms;
}

.hero-title-accent {
  animation-delay: 220ms;
}

.hero-title-plain:last-child {
  color: var(--ink-soft);
  animation-delay: 330ms;
}

.hero-title-accent {
  padding-block: 0.015em 0.045em;
  color: var(--hero-warm);
  background: linear-gradient(
    100deg,
    #8d4307 0%,
    #b96210 25%,
    #d77a1b 49%,
    #a6530c 73%,
    #8d4307 100%
  );
  background-size: 220% 100%;
  background-clip: text;
  font-size: 0.98em;
  font-style: normal;
  line-height: 1.02;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: hero-title-rise 720ms 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-lede {
  max-width: 680px;
  margin-bottom: 19px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.74;
  animation: hero-copy-rise 620ms 430ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.health-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 10px;
  color: var(--ink-soft);
  background: rgba(255, 254, 250, 0.68);
  border: 1px solid rgba(25, 33, 29, 0.13);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(25, 33, 29, 0.025);
  font-size: 10.5px;
  opacity: 0;
  animation: health-tag-in 440ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.health-tag:nth-child(1) {
  animation-delay: 560ms;
}

.health-tag:nth-child(2) {
  animation-delay: 620ms;
}

.health-tag:nth-child(3) {
  animation-delay: 680ms;
}

.health-tag:nth-child(4) {
  animation-delay: 740ms;
}

.health-tag:nth-child(5) {
  animation-delay: 800ms;
}

.health-tag::before {
  width: 5px;
  height: 5px;
  content: "";
  border-radius: 50%;
  background: var(--teal-bright);
}

.health-tag.is-warning::before {
  background: var(--amber);
}

.health-tag.is-critical::before {
  background: var(--coral);
}

.hero-score {
  position: relative;
  z-index: 1;
  display: flex;
  align-self: center;
  flex-direction: column;
  align-items: center;
  animation: hero-score-in 900ms 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.score-ring {
  --score: 0deg;
  position: relative;
  display: grid;
  width: 176px;
  height: 176px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(
    var(--amber) 0deg var(--score),
    rgba(25, 33, 29, 0.1) var(--score) 360deg
  );
  transition: box-shadow 240ms ease;
  box-shadow:
    inset 0 0 22px rgba(215, 122, 27, 0.06),
    0 16px 36px rgba(25, 33, 29, 0.08);
  isolation: isolate;
}

.score-ring.is-refreshing {
  animation: score-ring-confirm 760ms cubic-bezier(0.16, 1, 0.3, 1);
}

.score-aura,
.score-tick-ring {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
}

.score-aura {
  inset: -25px;
  z-index: -2;
  background: radial-gradient(
    circle,
    rgba(215, 122, 27, 0.14) 0%,
    rgba(215, 122, 27, 0.055) 38%,
    transparent 70%
  );
  filter: blur(7px);
  animation: score-aura-in 780ms 160ms ease-out both;
}

.score-tick-ring {
  inset: -15px;
  z-index: -1;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(25, 33, 29, 0.28) 0 0.8deg,
    transparent 0.8deg 8deg
  );
  opacity: 0.34;
  mask: radial-gradient(circle, transparent 66%, #000 67% 69%, transparent 70%);
  -webkit-mask: radial-gradient(
    circle,
    transparent 66%,
    #000 67% 69%,
    transparent 70%
  );
  animation: none;
}

.score-ring::after {
  position: absolute;
  inset: 8px;
  content: "";
  border: 1px solid rgba(25, 33, 29, 0.12);
  border-radius: 50%;
}

.score-ring::before {
  position: absolute;
  inset: -7px;
  content: "";
  border: 1px solid rgba(215, 122, 27, 0.2);
  border-top-color: rgba(215, 122, 27, 0.88);
  border-radius: 50%;
  filter: drop-shadow(0 0 6px rgba(215, 122, 27, 0.22));
  opacity: 0.78;
  transform: rotate(-18deg);
  animation: none;
}

.score-ring.is-refreshing::before {
  animation: score-ring-sweep 760ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.score-ring.is-refreshing .score-aura {
  animation:
    score-aura-in 780ms 160ms ease-out both,
    score-aura-confirm 760ms ease-out;
}

@keyframes score-ring-confirm {
  0% {
    box-shadow:
      inset 0 0 22px rgba(215, 122, 27, 0.06),
      0 0 0 0 rgba(215, 122, 27, 0);
  }
  42% {
    box-shadow:
      inset 0 0 26px rgba(215, 122, 27, 0.12),
      0 0 0 9px rgba(215, 122, 27, 0.065),
      0 0 45px rgba(215, 122, 27, 0.1);
  }
  100% {
    box-shadow:
      inset 0 0 22px rgba(215, 122, 27, 0.06),
      0 0 0 0 rgba(215, 122, 27, 0);
  }
}

@keyframes score-ring-sweep {
  from {
    opacity: 0.28;
    transform: rotate(-18deg);
  }
  55% {
    opacity: 1;
  }
  to {
    opacity: 0.78;
    transform: rotate(342deg);
  }
}

@keyframes score-aura-confirm {
  0% {
    opacity: 0;
    transform: scale(0.88);
  }
  38% {
    opacity: 0.9;
    transform: scale(1.08);
  }
  100% {
    opacity: 0.72;
    transform: scale(1);
  }
}

.score-ring-inner {
  position: relative;
  z-index: 1;
  display: flex;
  width: 138px;
  height: 138px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 34% 25%, rgba(255, 255, 255, 0.96), transparent 48%),
    var(--panel);
  border: 1px solid rgba(25, 33, 29, 0.1);
  border-radius: 50%;
  box-shadow: inset 0 -10px 28px rgba(25, 33, 29, 0.035);
}

.score-value {
  font-family: var(--number);
  font-size: 36px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: score-number-in 720ms 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.score-value.is-refreshing {
  animation: score-value-confirm 520ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes score-value-confirm {
  0% {
    opacity: 0.56;
    filter: blur(1.5px);
    transform: translateY(3px) scale(0.96);
  }
  58% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.score-label {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.score-delta {
  min-height: 18px;
  margin-top: 12px;
  color: var(--muted);
  font-family: var(--number);
  font-size: 10.5px;
  letter-spacing: 0.03em;
}

.score-delta.is-positive {
  color: var(--teal);
}

.score-delta.is-negative {
  color: var(--coral-ink);
}

.hero-signal {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 174px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 132px;
  padding: 15px 17px 11px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.74), transparent 35%),
    repeating-linear-gradient(
      90deg,
      transparent 0 39px,
      rgba(13, 107, 89, 0.035) 39px 40px
    ),
    rgba(255, 254, 250, 0.58);
  border: 1px solid rgba(25, 33, 29, 0.11);
  border-radius: 17px 5px 17px 5px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 7px 20px rgba(25, 33, 29, 0.035);
  animation: hero-copy-rise 680ms 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-signal::before {
  position: absolute;
  top: 17px;
  bottom: 17px;
  left: 0;
  width: 2px;
  content: "";
  background: linear-gradient(
    180deg,
    transparent,
    rgba(215, 122, 27, 0.66) 22%,
    rgba(13, 107, 89, 0.64) 78%,
    transparent
  );
}

.hero-signal-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.hero-signal-copy h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.hero-signal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

.hero-signal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.hero-signal-legend i {
  display: block;
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 5px currentColor;
}

.hero-signal-legend .is-load {
  color: var(--muted);
}

.hero-signal-legend .is-pv {
  color: var(--amber-ink);
}

.hero-signal-legend .is-renewable {
  color: var(--teal);
}

.hero-signal-note {
  color: var(--faint);
  font-family: var(--number);
  font-size: 7.5px;
  letter-spacing: 0.04em;
}

.hero-signal-chart {
  position: relative;
  min-width: 0;
  padding-top: 2px;
}

.hero-energy-map {
  display: block;
  width: 100%;
  height: 94px;
  overflow: visible;
}

.hero-chart-grid line {
  stroke: rgba(25, 33, 29, 0.09);
  stroke-dasharray: 2 8;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.hero-signal-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 1px;
  color: var(--faint);
  font-family: var(--number);
  font-size: 7.5px;
  letter-spacing: 0.04em;
}

.hero-mix {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: center;
  gap: 14px 20px;
  padding-top: 19px;
  border-top: 1px solid rgba(25, 33, 29, 0.12);
}

.mix-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
}

.mix-head span:last-child {
  color: var(--ink);
  font-family: var(--number);
  font-size: 12px;
  font-weight: 700;
}

.mix-bar {
  position: relative;
  display: flex;
  height: 13px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(25, 33, 29, 0.09);
  border: 1px solid rgba(25, 33, 29, 0.06);
  isolation: isolate;
}

.mix-bar::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -28%;
  z-index: 2;
  width: 24%;
  content: "";
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.12) 20%,
    rgba(255, 255, 255, 0.72) 52%,
    rgba(255, 255, 255, 0.12) 82%,
    transparent
  );
  filter: blur(1px);
  transform: skewX(-18deg);
  animation: mix-light-sweep 1.7s 500ms ease-out 1 both;
}

.mix-segment {
  min-width: 0;
  height: 100%;
  transition: width 450ms cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-origin: left center;
  animation: mix-segment-in 680ms var(--mix-delay, 420ms)
    cubic-bezier(0.16, 1, 0.3, 1) both;
}

.mix-segment.direct {
  background: var(--teal-bright);
}

.mix-segment.storage {
  background: var(--amber);
}

.mix-segment.inventory {
  background: var(--stored);
}

.mix-segment.diesel {
  background: #8b918c;
}

.mix-segment.unserved {
  background: #ef7b69;
}

.mix-legend {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 10px;
  animation: hero-copy-rise 520ms 800ms ease both;
}

@keyframes hero-orbit-a {
  0%,
  100% {
    opacity: 0.54;
    transform: scale(1) translate3d(0, 0, 0);
  }
  50% {
    opacity: 0.88;
    transform: scale(1.07) translate3d(-8px, 5px, 0);
  }
}

@keyframes hero-orbit-b {
  0%,
  100% {
    opacity: 0.42;
    transform: scale(1.03) translate3d(0, 0, 0);
  }
  50% {
    opacity: 0.74;
    transform: scale(0.96) translate3d(10px, -8px, 0);
  }
}

@keyframes hero-aurora-a {
  from {
    opacity: 0.22;
    transform: translate3d(-16px, 8px, 0) scale(0.94);
  }
  to {
    opacity: 0.46;
    transform: translate3d(22px, -12px, 0) scale(1.12);
  }
}

@keyframes hero-aurora-b {
  from {
    opacity: 0.18;
    transform: translate3d(14px, 10px, 0) scale(1.04);
  }
  to {
    opacity: 0.4;
    transform: translate3d(-24px, -16px, 0) scale(0.92);
  }
}

@keyframes hero-contour-drift {
  to {
    stroke-dashoffset: -90;
  }
}

@keyframes hero-route-flow {
  0% {
    opacity: 0;
    stroke-dashoffset: 100;
  }
  12%,
  86% {
    opacity: 0.82;
  }
  100% {
    opacity: 0;
    stroke-dashoffset: 0;
  }
}

@keyframes hero-data-draw {
  from {
    stroke-dashoffset: 1;
    opacity: 0;
  }
  24% {
    opacity: 1;
  }
  to {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

@keyframes hero-route-pulse {
  0% {
    stroke-dashoffset: 1;
    opacity: 0;
  }
  9% {
    opacity: 1;
  }
  82% {
    opacity: 0.92;
  }
  100% {
    stroke-dashoffset: -0.08;
    opacity: 0;
  }
}

@keyframes hero-node-in {
  from {
    opacity: 0;
    transform: scale(0.35);
  }
  to {
    opacity: 0.9;
    transform: scale(1);
  }
}

@keyframes hero-node-breathe {
  0%,
  100% {
    opacity: 0.48;
    transform: scale(0.72);
  }
  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

@keyframes hero-node-ripple {
  0% {
    opacity: 0;
    transform: scale(0.55);
  }
  22% {
    opacity: 0.55;
  }
  80%,
  100% {
    opacity: 0;
    transform: scale(2.2);
  }
}

@keyframes hero-mote-a {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.7);
  }
  12% {
    opacity: 0.75;
  }
  76% {
    opacity: 0.46;
  }
  100% {
    opacity: 0;
    transform: translate3d(58vw, -190px, 0) scale(1.15);
  }
}

@keyframes hero-mote-b {
  0% {
    opacity: 0;
    transform: translate3d(2vw, 12px, 0) scale(0.8);
  }
  15% {
    opacity: 0.68;
  }
  82% {
    opacity: 0.34;
  }
  100% {
    opacity: 0;
    transform: translate3d(48vw, -255px, 0) scale(1.25);
  }
}

@keyframes hero-mote-c {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.65);
  }
  18% {
    opacity: 0.58;
  }
  72% {
    opacity: 0.4;
  }
  100% {
    opacity: 0;
    transform: translate3d(38vw, -130px, 0) scale(1.1);
  }
}

@keyframes hero-title-glow {
  0%,
  100% {
    background-position: 0% 50%;
    filter: drop-shadow(0 0 0 rgba(239, 178, 101, 0));
  }
  50% {
    background-position: 100% 50%;
    filter: drop-shadow(0 0 9px rgba(239, 178, 101, 0.16));
  }
}

@keyframes hero-copy-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-title-rise {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes health-tag-in {
  from {
    opacity: 0;
    transform: translateY(5px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hero-score-in {
  from {
    opacity: 0;
    transform: scale(0.82) rotate(-5deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes score-orbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes score-aura-breathe {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes score-aura-in {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 0.86;
    transform: scale(1);
  }
}

@keyframes score-tick-orbit {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes score-number-in {
  from {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(7px) scale(0.9);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes mix-segment-in {
  from {
    opacity: 0;
    transform: scaleX(0);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes mix-light-sweep {
  0%,
  55% {
    opacity: 0;
    transform: translateX(0) skewX(-18deg);
  }
  64% {
    opacity: 0.62;
  }
  82% {
    opacity: 0;
    transform: translateX(570%) skewX(-18deg);
  }
  100% {
    opacity: 0;
    transform: translateX(570%) skewX(-18deg);
  }
}

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

.mix-legend i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 20px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.insight-card {
  position: relative;
  min-height: 104px;
  padding: 18px 19px 17px 22px;
  background: rgba(251, 250, 245, 0.82);
  opacity: 0;
  animation: insight-card-in 560ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.insight-card:nth-child(1) {
  animation-delay: 360ms;
}

.insight-card:nth-child(2) {
  animation-delay: 450ms;
}

.insight-card:nth-child(3) {
  animation-delay: 540ms;
}

@keyframes insight-card-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.insight-card::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  width: 3px;
  content: "";
  background: var(--teal);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 18px rgba(20, 148, 119, 0.14);
  animation: none;
}

.insight-card.is-warning::before {
  background: var(--amber);
}

.insight-card.is-critical::before {
  background: var(--coral);
}

@keyframes insight-accent-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.insight-card span {
  display: block;
  margin-bottom: 7px;
  color: var(--faint);
  font-family: var(--number);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.insight-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.metric-section-head {
  display: flex;
  margin-top: 20px;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.metric-section-head h2 {
  display: block;
  margin-top: 4px;
  margin-bottom: 0;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.metric-scope-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: var(--number);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.metric-scope-toggle {
  min-height: 32px;
  padding: 6px 11px;
  color: var(--teal);
  cursor: pointer;
  background: rgba(255, 254, 250, 0.55);
  border: 1px solid rgba(13, 107, 89, 0.22);
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.metric-scope-toggle[data-display-mode="simple"] {
  color: var(--ink);
  background: rgba(255, 254, 250, 0.9);
  border-color: rgba(25, 33, 29, 0.24);
  box-shadow: 0 4px 14px rgba(25, 33, 29, 0.06);
}

.metric-scope-toggle[data-display-mode="simple"]:hover {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
}

.metric-scope-toggle:hover {
  color: var(--white);
  background: var(--teal);
  border-color: var(--teal);
  transform: translateY(-1px);
}

.metric-scope-toggle:focus-visible {
  outline: 3px solid rgba(215, 122, 27, 0.35);
  outline-offset: 2px;
}

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

.metric-grid.is-scope-switching .metric-card:not([hidden]) {
  animation: metric-scope-in 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.metric-card {
  position: relative;
  min-height: 132px;
  padding: 18px 17px 15px;
  overflow: hidden;
  background: rgba(251, 250, 245, 0.83);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition:
    transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 260ms ease,
    box-shadow 260ms ease,
    background-color 260ms ease;
  animation: metric-in 420ms backwards;
}

.metric-card[hidden] {
  display: none !important;
}

.metric-card:nth-child(2) {
  animation-delay: 40ms;
}

.metric-card:nth-child(3) {
  animation-delay: 80ms;
}

.metric-card:nth-child(4) {
  animation-delay: 120ms;
}

.metric-card:nth-child(5) {
  animation-delay: 160ms;
}

.metric-card:nth-child(6) {
  animation-delay: 200ms;
}

.metric-card:nth-child(7) {
  animation-delay: 240ms;
}

.metric-card:nth-child(8) {
  animation-delay: 280ms;
  --metric-breathe-delay: -8.5s;
}

.metric-card:nth-child(1) {
  --metric-breathe-delay: -0.8s;
}

.metric-card:nth-child(2) {
  --metric-breathe-delay: -1.9s;
}

.metric-card:nth-child(3) {
  --metric-breathe-delay: -3s;
}

.metric-card:nth-child(4) {
  --metric-breathe-delay: -4.1s;
}

.metric-card:nth-child(5) {
  --metric-breathe-delay: -5.2s;
}

.metric-card:nth-child(6) {
  --metric-breathe-delay: -6.3s;
}

.metric-card:nth-child(7) {
  --metric-breathe-delay: -7.4s;
}

@keyframes metric-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes metric-scope-in {
  from {
    opacity: 0.2;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.metric-card::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 72px;
  height: 72px;
  content: "";
  background: radial-gradient(circle at 100% 0, var(--metric-color, var(--teal)) 0, transparent 68%);
  opacity: 0.11;
  transform-origin: 100% 0;
  animation: none;
}

.metric-card:first-child {
  color: var(--paper);
  background:
    radial-gradient(circle at 100% 0, rgba(20, 148, 119, 0.24), transparent 55%),
    linear-gradient(145deg, #1e2c25, var(--ink));
  border-color: rgba(25, 33, 29, 0.3);
}

.metric-card:first-child .metric-label,
.metric-card:first-child .metric-note,
.metric-card:first-child .metric-value small {
  color: rgba(241, 238, 228, 0.62);
}

.metric-card:first-child .metric-value {
  color: #efb265;
}

.metric-card:first-child::after {
  background: radial-gradient(circle at 100% 0, var(--teal-bright) 0, transparent 68%);
  opacity: 0.18;
}

@keyframes metric-corner-breathe {
  0%,
  100% {
    opacity: 0.07;
    transform: scale(0.86) translate3d(4px, -4px, 0);
  }
  50% {
    opacity: 0.2;
    transform: scale(1.14) translate3d(-5px, 5px, 0);
  }
}

.metric-card .metric-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10.5px;
}

.metric-card .metric-label i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--metric-color, var(--teal));
  box-shadow: 0 0 0 3px rgba(20, 148, 119, 0.08);
  animation: none;
}

.metric-card.is-updated {
  border-color: rgba(20, 148, 119, 0.46);
  animation:
    metric-in 420ms backwards,
    metric-updated 900ms 120ms ease-out 1;
}

.metric-card.is-updated::before {
  position: absolute;
  top: 11px;
  right: 12px;
  z-index: 2;
  padding: 3px 6px;
  content: "已更新";
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 999px;
  font-family: var(--number);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

@keyframes metric-dot-pulse {
  0%,
  100% {
    opacity: 0.7;
    box-shadow: 0 0 0 2px rgba(20, 148, 119, 0.06);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 0 5px rgba(20, 148, 119, 0.015);
  }
}

@keyframes metric-updated {
  0% {
    box-shadow: 0 0 0 0 rgba(20, 148, 119, 0);
  }
  30% {
    box-shadow: 0 0 0 5px rgba(20, 148, 119, 0.13);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(20, 148, 119, 0);
  }
}

.metric-card .metric-value {
  margin: 14px 0 7px;
  font-family: var(--number);
  font-size: clamp(25px, 2.25vw, 38px);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1;
}

.metric-card .metric-value small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
}

.metric-card .metric-note {
  color: var(--faint);
  max-width: calc(100% - 46px);
  font-size: 10px;
  line-height: 1.4;
}

.metric-delta {
  position: absolute;
  right: 14px;
  bottom: 13px;
  padding: 3px 6px;
  border-radius: 999px;
  font-family: var(--number);
  font-size: 9px;
  font-weight: 700;
}

.metric-delta.is-positive {
  color: var(--teal);
  background: var(--teal-soft);
}

.metric-delta.is-negative {
  color: var(--coral-ink);
  background: var(--coral-soft);
}

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

.dashboard-grid-wide {
  grid-template-columns: minmax(0, 1.72fr) minmax(260px, 0.78fr);
}

.panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: rgba(251, 250, 245, 0.84);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 32px rgba(25, 33, 29, 0.035);
  transition:
    transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 280ms ease,
    box-shadow 280ms ease;
}

.panel::after {
  position: absolute;
  top: 0;
  left: -38%;
  z-index: 4;
  width: 38%;
  height: 1px;
  content: "";
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(20, 148, 119, 0.62),
    rgba(239, 178, 101, 0.52),
    transparent
  );
  opacity: 0.54;
  animation: panel-light-rail 1.8s 220ms ease-out 1 both;
}

.panel:nth-child(2n)::after {
  animation-delay: 300ms;
}

.panel:nth-child(3n)::after {
  animation-delay: 380ms;
}

@keyframes panel-light-rail {
  0% {
    opacity: 0;
    transform: translateX(0);
  }
  8% {
    opacity: 0.58;
  }
  72% {
    opacity: 0.42;
  }
  100% {
    opacity: 0;
    transform: translateX(365%);
  }
}

@media (hover: hover) and (pointer: fine) {
  .metric-card:hover {
    border-color: rgba(20, 148, 119, 0.28);
    box-shadow: 0 16px 38px rgba(25, 33, 29, 0.08);
    transform: translateY(-3px);
  }

  .metric-card:first-child:hover {
    border-color: rgba(239, 178, 101, 0.3);
    box-shadow: 0 18px 44px rgba(25, 33, 29, 0.14);
  }

  .panel:hover {
    border-color: rgba(20, 148, 119, 0.2);
    box-shadow: 0 18px 42px rgba(25, 33, 29, 0.07);
    transform: translateY(-2px);
  }
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 19px 15px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: 21px;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.unit-chip,
.status-pill,
.version-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 23px;
  padding: 4px 8px;
  color: var(--muted);
  background: rgba(25, 33, 29, 0.045);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--number);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.status-pill {
  color: var(--teal);
  background: var(--teal-soft);
  border-color: transparent;
}

.status-pill.status-warning {
  color: var(--amber-ink);
  background: var(--amber-soft);
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.table-scroll:focus-visible,
.sensitivity-wrap:focus-visible,
.hourly-body:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--number);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.data-table th,
.data-table td {
  padding: 9px 10px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--panel-cool);
  font-family: var(--body);
  font-size: 10px;
  font-weight: 700;
}

.data-table th:first-child,
.data-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  text-align: left;
  background: var(--panel);
}

.data-table th:first-child {
  z-index: 3;
  background: var(--panel-cool);
}

.data-table tbody tr:hover td {
  background: rgba(13, 107, 89, 0.04);
}

.data-table tr.total-row td {
  color: var(--ink);
  background: rgba(25, 33, 29, 0.05);
  border-top: 1px solid var(--line-strong);
  font-weight: 800;
}

.rate-cell {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.rate-track {
  width: 40px;
  height: 4px;
  overflow: hidden;
  background: rgba(25, 33, 29, 0.09);
  border-radius: 99px;
}

.rate-track i {
  display: block;
  height: 100%;
  background: var(--teal);
  border-radius: 99px;
}

.economics-stack {
  display: grid;
  gap: 0;
}

.economics-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

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

.economics-note {
  padding: 10px 18px;
  color: #8f3d30;
  background: #fff0ec;
  border-bottom: 1px solid #f1d5cf;
  font-size: 9px;
  line-height: 1.55;
}

.economics-row span {
  color: var(--muted);
  font-size: 10.5px;
}

.economics-row strong {
  font-family: var(--number);
  font-size: 16px;
  letter-spacing: -0.03em;
}

.economics-hero {
  padding: 20px 18px 17px;
  background:
    linear-gradient(135deg, rgba(13, 107, 89, 0.95), rgba(25, 33, 29, 0.96));
  color: var(--paper);
}

.economics-hero span {
  display: block;
  color: var(--paper);
  font-size: 9px;
  font-weight: 700;
}

.economics-hero strong {
  display: block;
  margin-top: 8px;
  font-family: var(--number);
  font-size: 34px;
  letter-spacing: -0.055em;
}

.economics-hero strong small {
  margin-left: 4px;
  font-size: 9px;
  letter-spacing: 0;
}

.chart-frame {
  min-width: 0;
  padding: 14px 12px 8px;
  overflow: hidden;
}

.chart-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: var(--faint);
  border: 1px dashed var(--line);
  border-radius: 9px;
  font-size: 10px;
}

.chart-frame svg,
[id$="Chart"] svg {
  max-width: 100%;
}

.chart-frame svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-frame text {
  font-family: var(--number);
}

.grid-line {
  stroke: rgba(25, 33, 29, 0.09);
  stroke-width: 1;
}

.chart-grid-line {
  opacity: 0;
  animation: chart-grid-in 520ms ease forwards;
  animation-delay: var(--grid-delay, 0ms);
}

.axis-line {
  stroke: rgba(25, 33, 29, 0.2);
  stroke-width: 1;
}

.chart-axis-line {
  opacity: 0;
  animation: chart-axis-in 520ms 250ms ease forwards;
}

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

.bar-segment,
.line-path,
.area-path,
.soc-path {
  transition: opacity 160ms ease;
}

.bar-visual {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: bar-grow 720ms var(--bar-delay, 160ms)
    cubic-bezier(0.16, 1, 0.3, 1) both;
}

.bar-potential-outline {
  opacity: 0.62;
  animation: none;
}

.bar-total-cap {
  opacity: 0.72;
  animation: none;
}

.trend-fill {
  opacity: 0;
  animation: trend-area-in 720ms 80ms ease forwards;
}

.trend-scan {
  opacity: 0;
  animation: trend-scan 1.55s 180ms cubic-bezier(0.45, 0, 0.2, 1) 1 both;
}

.trend-aura {
  opacity: 0.44;
  animation: trend-line-in 480ms 120ms ease both;
}

.trend-line-renewable {
  clip-path: inset(-6px 100% -6px -6px);
  animation: trend-line-draw 960ms 120ms cubic-bezier(0.2, 0.8, 0.2, 1)
    forwards;
}

.trend-line-glow {
  opacity: 0;
  filter: blur(2px);
  animation: trend-line-in 680ms 280ms ease 1 both;
}

.trend-line-curtailment {
  opacity: 0;
  animation: trend-line-in 520ms 520ms ease forwards;
}

.trend-flow {
  opacity: 0;
  stroke-dashoffset: 100;
  filter: drop-shadow(0 0 7px rgba(20, 148, 119, 0.7));
  animation: trend-flow 1.8s calc(420ms + var(--flow-delay, 0ms)) linear 1 both;
}

.trend-flow-halo {
  --flow-peak: 0.26;
  stroke-width: 12;
  stroke-dasharray: 3.2 96.8;
  filter: drop-shadow(0 0 10px rgba(64, 214, 175, 0.68));
}

.trend-flow-core {
  --flow-peak: 0.94;
  stroke-width: 4.8;
  stroke-dasharray: 1.8 98.2;
}

.trend-flow-core.is-secondary {
  --flow-peak: 0.63;
  stroke-width: 3.6;
  filter: drop-shadow(0 0 5px rgba(20, 148, 119, 0.54));
}

.trend-flow-core.is-tertiary {
  --flow-peak: 0.58;
  stroke-width: 3.2;
  filter: drop-shadow(0 0 4px rgba(168, 240, 217, 0.46));
}

.trend-flow-halo.is-soft {
  --flow-peak: 0.24;
  stroke-width: 14;
  filter: blur(2px) drop-shadow(0 0 12px rgba(216, 255, 243, 0.32));
}

.trend-point {
  opacity: 0;
  animation: trend-point-in 320ms ease forwards;
  animation-delay: var(--trend-delay, 420ms);
}

.trend-point-halo {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: trend-point-pulse 900ms
    calc(300ms + var(--point-delay, 0ms)) ease-out 1 both;
}

.daily-area {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: daily-area-rise 760ms calc(120ms + var(--area-delay, 0ms))
    cubic-bezier(0.16, 1, 0.3, 1) both;
}

.daily-area-direct,
.daily-area-discharge {
  --area-opacity: 0.75;
}

.daily-area-discharge {
  --area-delay: 90ms;
}

.daily-area-diesel,
.daily-area-unserved {
  --area-opacity: 0.62;
}

.daily-area-diesel {
  --area-delay: 180ms;
}

.daily-area-unserved {
  --area-delay: 270ms;
}

.daily-pv-line {
  opacity: 0;
  animation: daily-line-in 620ms 420ms ease forwards;
}

.daily-total-line {
  clip-path: inset(-4px 100% -4px -4px);
  animation: trend-line-draw 980ms 220ms cubic-bezier(0.2, 0.8, 0.2, 1)
    forwards;
}

.daily-soc-line {
  opacity: 0;
  animation: daily-line-in 620ms 650ms ease forwards;
}

.daily-scan {
  opacity: 0;
  animation: trend-scan 1.55s 240ms cubic-bezier(0.45, 0, 0.2, 1) 1 both;
}

.daily-load-glow {
  opacity: 0.55;
  animation: trend-line-in 600ms 200ms ease 1 both;
}

.daily-soc-dot {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: daily-dot-in 380ms var(--daily-dot-delay, 540ms) ease forwards;
}

@keyframes trend-line-draw {
  to {
    stroke-dashoffset: 0;
    clip-path: inset(-8px);
  }
}

@keyframes trend-line-in {
  to {
    opacity: 1;
  }
}

@keyframes trend-area-in {
  to {
    opacity: 1;
  }
}

@keyframes chart-grid-in {
  from {
    opacity: 0;
    stroke-dasharray: 0 1000;
  }
  to {
    opacity: 1;
    stroke-dasharray: 1000 0;
  }
}

@keyframes chart-axis-in {
  to {
    opacity: 1;
  }
}

@keyframes bar-grow {
  from {
    opacity: 0;
    transform: scaleY(0.02);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes bar-cap-breathe {
  0%,
  100% {
    opacity: 0.22;
  }
  50% {
    opacity: 0.74;
  }
}

@keyframes potential-dash {
  to {
    stroke-dashoffset: -24;
  }
}

@keyframes potential-breathe {
  0%,
  100% {
    opacity: 0.48;
  }
  50% {
    opacity: 0.82;
  }
}

@keyframes trend-line-glow-breathe {
  0%,
  100% {
    opacity: 0.22;
  }
  50% {
    opacity: 0.66;
  }
}

@keyframes trend-aura-breathe {
  0%,
  100% {
    opacity: 0.22;
  }
  50% {
    opacity: 0.68;
  }
}

@keyframes trend-scan {
  0% {
    opacity: 0;
    transform: translateX(0);
  }
  9% {
    opacity: 0.78;
  }
  84% {
    opacity: 0.62;
  }
  100% {
    opacity: 0;
    transform: translateX(var(--scan-distance, 0));
  }
}

@keyframes trend-flow {
  0% {
    opacity: 0;
    stroke-dashoffset: 100;
  }
  10%,
  88% {
    opacity: var(--flow-peak, 0.88);
  }
  100% {
    opacity: 0;
    stroke-dashoffset: 0;
  }
}

@keyframes trend-curtailment-dash {
  to {
    stroke-dashoffset: -72;
  }
}

@keyframes trend-point-pulse {
  0% {
    opacity: 0;
    transform: scale(0.65);
  }
  18% {
    opacity: 0.42;
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(2.5);
  }
}

@keyframes daily-area-rise {
  from {
    opacity: 0;
    transform: scaleY(0.03);
  }
  to {
    opacity: var(--area-opacity, 0.75);
    transform: scaleY(1);
  }
}

@keyframes daily-line-in {
  to {
    opacity: 1;
  }
}

@keyframes daily-load-glow-breathe {
  0%,
  100% {
    opacity: 0.22;
  }
  50% {
    opacity: 0.64;
  }
}

@keyframes daily-dot-in {
  from {
    opacity: 0;
    transform: scale(0.45);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes trend-point-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bar-group:hover .bar-segment {
  opacity: 0.74;
}

.chart-note {
  padding: 0 18px 15px;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.5;
}

.chart-legend-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 18px 15px;
  color: var(--muted);
  font-size: 9.5px;
}

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

.chart-legend-inline i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.view-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin: 4px 0 22px;
  padding: 11px 2px 0;
}

.view-intro h1 {
  margin: 8px 0 8px;
  font-family: var(--display);
  font-size: clamp(34px, 4.2vw, 58px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.view-intro p:not(.eyebrow) {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.balance-checks,
.hourly-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  color: var(--muted);
  background: rgba(251, 250, 245, 0.62);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 9.5px;
}

.check-chip::before {
  width: 5px;
  height: 5px;
  content: "";
  background: var(--teal);
  border-radius: 50%;
}

.calendar-panel {
  margin-top: 14px;
}

.calendar-summary {
  display: flex;
  gap: 13px;
  color: var(--muted);
  font-size: 8.5px;
}

.calendar-summary strong {
  color: var(--ink);
  font-family: var(--number);
  font-size: 11px;
}

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

.month-calendar {
  padding: 10px;
  background: var(--panel-cool);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.month-calendar h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 13px;
}

.month-calendar h3 span {
  color: var(--muted);
  font-family: var(--number);
  font-size: 8px;
  font-weight: 500;
}

.weekday-row,
.day-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.day-row .calendar-day:nth-child(7n),
.day-row .calendar-day:nth-child(7n - 1) {
  color: #9b3d2f;
}

.weekday-row {
  margin-bottom: 3px;
  color: var(--faint);
  text-align: center;
  font-family: var(--number);
  font-size: 7px;
}

.calendar-day {
  position: relative;
  display: grid;
  min-height: 28px;
  place-items: center;
  color: var(--ink-soft);
  background: rgba(255, 254, 250, 0.48);
  border-radius: 4px;
  font-family: var(--number);
  font-size: 9px;
}

.calendar-day.is-empty {
  background: transparent;
}

.calendar-day.is-monthly {
  color: #98550e;
  background: var(--amber-soft);
}

.calendar-day.is-annual {
  color: #922b34;
  background: var(--coral-soft);
}

.calendar-day.is-monthly,
.calendar-day.is-annual {
  font-weight: 700;
}

.calendar-day.is-weekend {
  font-weight: 800;
}

.hourly-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 11px;
  margin-bottom: 14px;
  padding: 13px 14px;
  background: rgba(251, 250, 245, 0.77);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.hourly-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
}

.hourly-toolbar select,
.hourly-toolbar input {
  min-width: 104px;
  height: 40px;
  padding: 7px 10px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: 0;
  font-family: var(--number);
  font-size: 11px;
}

.hourly-toolbar select:focus,
.hourly-toolbar input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 107, 89, 0.09);
}

.toolbar-spacer {
  flex: 1;
}

.row-count {
  color: var(--muted);
  font-family: var(--number);
  font-size: 10px;
}

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

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

.swatch {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.swatch-load {
  background: var(--ink);
}

.swatch-pv {
  background: var(--amber);
}

.swatch-storage {
  background: var(--teal-bright);
}

.swatch-diesel {
  background: #858b86;
}

.swatch-soc {
  background: var(--blue);
}

.chart-panel-tall .chart-frame {
  min-height: 330px;
}

.chart-frame-day {
  min-height: 350px;
}

.chart-data-point {
  cursor: pointer;
  outline: none;
}

.chart-data-point:focus {
  outline: none;
}

.chart-data-point:focus-visible rect,
.chart-data-point:focus-visible circle {
  stroke: var(--amber);
  stroke-width: 3px;
}

.hourly-table-panel {
  margin-top: 14px;
}

.hourly-table-shell {
  max-width: 100%;
  overflow: hidden;
  background: var(--panel);
}

.hourly-head,
.hourly-row {
  display: grid;
  min-width: 1120px;
  grid-template-columns:
    138px 42px 42px 98px 98px 98px 98px 92px 98px 98px 98px
    112px;
}

.hourly-head {
  --hourly-scroll: 0px;
  position: sticky;
  top: 0;
  z-index: 3;
  height: 44px;
  align-items: center;
  color: var(--muted);
  background: var(--panel-cool);
  border-bottom: 1px solid var(--line);
  font-size: 9.5px;
  font-weight: 700;
  will-change: transform;
}

.hourly-head div {
  padding: 0 8px;
  text-align: right;
  white-space: nowrap;
}

.hourly-head div:first-child {
  position: relative;
  z-index: 2;
  background: var(--panel-cool);
  transform: translateX(var(--hourly-scroll));
}

.hourly-body:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
}

.hourly-head div:first-child,
.hourly-head div:nth-child(2),
.hourly-head div:nth-child(3) {
  text-align: left;
}

.hourly-body {
  position: relative;
  height: 520px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.hourly-spacer {
  position: relative;
}

.hourly-row {
  position: absolute;
  top: 0;
  left: 0;
  height: 44px;
  align-items: center;
  color: var(--ink-soft);
  border-bottom: 1px solid rgba(25, 33, 29, 0.06);
  font-family: var(--number);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.hourly-row:hover {
  background: rgba(13, 107, 89, 0.05);
}

.hourly-row div {
  padding: 0 8px;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hourly-row div:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  align-self: stretch;
  display: flex;
  align-items: center;
  color: var(--muted);
  background: var(--panel);
  text-align: left;
}

.hourly-row:hover div:first-child {
  background: #eff6f1;
}

.hourly-day-button {
  max-width: 100%;
  min-height: 44px;
  padding: 0;
  overflow: hidden;
  color: inherit;
  cursor: pointer;
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hourly-day-button:hover,
.hourly-day-button:focus-visible {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.soc-inline {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.soc-inline i {
  width: 28px;
  height: 4px;
  overflow: hidden;
  background: rgba(25, 33, 29, 0.08);
  border-radius: 99px;
}

.soc-inline b {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: 99px;
}

.sensitivity-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 8px;
}

.sensitivity-legend i {
  width: 60px;
  height: 6px;
  background: linear-gradient(
    90deg,
    rgba(13, 107, 89, 0.12),
    rgba(13, 107, 89, 0.9)
  );
  border-radius: 99px;
}

.sensitivity-legend em {
  margin-left: 7px;
  font-style: normal;
}

.sensitivity-wrap {
  padding: 15px;
  overflow-x: auto;
}

.sensitivity-placeholder {
  display: grid;
  grid-template-columns: minmax(190px, 0.78fr) minmax(0, 1.4fr);
  align-items: stretch;
  min-height: 260px;
  padding: 18px;
  gap: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(13, 107, 89, 0.1), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(240, 246, 242, 0.76));
  border: 1px solid rgba(13, 107, 89, 0.16);
  border-radius: 12px;
}

.sensitivity-placeholder-visual {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(13, 107, 89, 0.04), rgba(13, 107, 89, 0.12)),
    #edf3ee;
  border: 1px solid rgba(13, 107, 89, 0.14);
  border-radius: 9px;
}

.sensitivity-map-grid {
  position: absolute;
  inset: 34px 22px 28px 30px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  transform: skewY(-4deg);
}

.sensitivity-map-grid i {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(
      135deg,
      rgba(13, 107, 89, 0.08),
      rgba(13, 107, 89, 0.42)
    );
  border: 1px solid rgba(255, 254, 250, 0.5);
  border-radius: 4px;
}

.sensitivity-map-grid i:nth-child(2) {
  background: linear-gradient(
    135deg,
    rgba(13, 107, 89, 0.12),
    rgba(13, 107, 89, 0.54)
  );
}

.sensitivity-map-grid i:nth-child(3) {
  background: linear-gradient(
    135deg,
    rgba(185, 117, 28, 0.14),
    rgba(13, 107, 89, 0.48)
  );
}

.sensitivity-map-grid i:nth-child(4) {
  background: linear-gradient(
    135deg,
    rgba(185, 117, 28, 0.3),
    rgba(13, 107, 89, 0.32)
  );
}

.sensitivity-map-grid i:nth-child(5) {
  background: linear-gradient(
    135deg,
    rgba(185, 117, 28, 0.42),
    rgba(185, 117, 28, 0.16)
  );
}

.sensitivity-axis {
  position: absolute;
  z-index: 1;
  color: rgba(25, 33, 29, 0.58);
  font-family: var(--number);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sensitivity-axis.is-pv {
  top: 13px;
  right: 22px;
}

.sensitivity-axis.is-storage {
  bottom: 9px;
  left: 18px;
}

.sensitivity-scan-line {
  position: absolute;
  top: 18%;
  right: 18px;
  left: 26px;
  z-index: 2;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 254, 250, 0.95) 18%,
    rgba(185, 117, 28, 0.9) 52%,
    transparent
  );
  filter: drop-shadow(0 0 7px rgba(185, 117, 28, 0.55));
  opacity: 0.42;
}

.sensitivity-placeholder.is-busy .sensitivity-scan-line {
  animation: sensitivity-scan 1.65s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.sensitivity-placeholder-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 10px 6px;
}

.sensitivity-placeholder-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  margin-bottom: 15px;
  padding: 5px 9px;
  color: var(--teal-ink);
  background: rgba(13, 107, 89, 0.08);
  border: 1px solid rgba(13, 107, 89, 0.13);
  border-radius: 99px;
  font-family: var(--number);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.sensitivity-placeholder-status i {
  width: 6px;
  height: 6px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(13, 107, 89, 0.08);
}

.sensitivity-placeholder.is-busy .sensitivity-placeholder-status i {
  animation: sensitivity-pulse 1.1s ease-in-out infinite;
}

.sensitivity-placeholder.is-error .sensitivity-placeholder-status {
  color: var(--coral-ink);
  background: var(--coral-soft);
  border-color: rgba(166, 73, 53, 0.16);
}

.sensitivity-placeholder.is-error .sensitivity-placeholder-status i {
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(166, 73, 53, 0.08);
}

.sensitivity-placeholder-copy > strong {
  max-width: 560px;
  font-family: var(--display);
  font-size: clamp(20px, 2.4vw, 31px);
  font-weight: 500;
  line-height: 1.13;
  letter-spacing: -0.025em;
}

.sensitivity-placeholder-copy > p {
  max-width: 590px;
  margin: 12px 0 17px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.75;
}

.sensitivity-dimensions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sensitivity-dimensions span {
  padding: 5px 8px;
  color: var(--ink-soft);
  background: rgba(255, 254, 250, 0.72);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: var(--number);
  font-size: 8px;
  font-weight: 700;
}

@keyframes sensitivity-scan {
  0% {
    top: 14%;
    opacity: 0;
  }
  14% {
    opacity: 0.72;
  }
  86% {
    opacity: 0.72;
  }
  100% {
    top: 84%;
    opacity: 0;
  }
}

@keyframes sensitivity-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(13, 107, 89, 0.08);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(13, 107, 89, 0.02);
  }
}

.sensitivity-table {
  width: 100%;
  min-width: 760px;
  border-spacing: 5px;
  border-collapse: separate;
}

.sensitivity-table th {
  padding: 4px;
  color: var(--muted);
  font-family: var(--number);
  font-size: 8px;
  font-weight: 700;
  text-align: center;
}

.sensitivity-table th:first-child {
  text-align: left;
}

.sensitivity-cell {
  width: 14%;
  padding: 3px;
  border: 1px solid rgba(13, 107, 89, 0.09);
  border-radius: 6px;
  font-family: var(--number);
  text-align: center;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease;
}

.sensitivity-cell[data-tooltip] {
  position: relative;
}

.sensitivity-cell:has(.sensitivity-button:hover),
.sensitivity-cell:has(.sensitivity-button:focus-visible) {
  z-index: 2;
  transform: scale(1.035);
  box-shadow: 0 5px 15px rgba(25, 33, 29, 0.12);
}

.sensitivity-button {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 8px 6px;
  color: inherit;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 4px;
  font: inherit;
}

.sensitivity-button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.sensitivity-cell strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.sensitivity-cell small {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.35;
}

.sensitivity-cell.is-current {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  color: var(--faint);
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  font-size: 10px;
}

.comparison-table {
  padding: 7px 18px 13px;
}

.comparison-visual {
  padding: 15px 18px 5px;
  border-bottom: 1px solid var(--line);
}

.comparison-chart {
  display: grid;
  gap: 14px;
}

.comparison-chart-key {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--muted);
  font-family: var(--number);
  font-size: 8px;
}

.comparison-chart-key span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.comparison-chart-key i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.comparison-chart-key i.is-current {
  background: var(--teal);
}

.comparison-chart-key i.is-baseline {
  background: var(--amber);
}

.comparison-chart-row {
  display: grid;
  gap: 7px;
}

.comparison-chart-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.comparison-chart-label strong {
  color: var(--ink-soft);
  font-size: 10px;
}

.comparison-chart-label em {
  padding: 2px 6px;
  color: var(--muted);
  background: var(--panel-cool);
  border-radius: 999px;
  font-family: var(--number);
  font-size: 8px;
  font-style: normal;
}

.comparison-chart-label em.is-positive {
  color: var(--teal);
  background: var(--teal-soft);
}

.comparison-chart-label em.is-negative {
  color: var(--coral-ink);
  background: var(--coral-soft);
}

.comparison-bars {
  display: grid;
  gap: 5px;
}

.comparison-bar {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 7px;
  color: var(--faint);
  font-family: var(--number);
  font-size: 8px;
}

.comparison-bar > i {
  height: 7px;
  overflow: hidden;
  background: rgba(25, 33, 29, 0.07);
  border-radius: 99px;
}

.comparison-bar > i > b {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
}

.comparison-bar.is-current > i > b {
  background: var(--teal);
}

.comparison-bar.is-baseline > i > b {
  background: var(--amber);
}

.comparison-bar > strong {
  color: var(--ink-soft);
  text-align: right;
  font-size: 8.5px;
}

.comparison-visual-empty {
  display: grid;
  min-height: 102px;
  padding: 14px;
  place-content: center;
  gap: 6px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(13, 107, 89, 0.06), transparent 62%),
    var(--panel-cool);
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
}

.comparison-visual-empty span {
  color: var(--faint);
  font-family: var(--number);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.comparison-visual-empty strong {
  font-family: var(--display);
  font-size: 15px;
}

.comparison-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 90px;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
}

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

.comparison-row span {
  color: var(--muted);
}

.comparison-row strong {
  text-align: right;
  font-family: var(--number);
  font-size: 11px;
}

.comparison-row em {
  justify-self: end;
  padding: 3px 6px;
  border-radius: 99px;
  font-family: var(--number);
  font-size: 8px;
  font-style: normal;
}

.comparison-row em.is-positive {
  color: var(--teal);
  background: var(--teal-soft);
}

.comparison-row em.is-negative {
  color: var(--coral-ink);
  background: var(--coral-soft);
}

.comparison-row em.is-unavailable {
  color: var(--muted);
  background: var(--panel-cool);
}

.reading-note {
  padding: 14px 18px 18px;
}

.reading-note p {
  margin: 0;
  padding: 11px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.65;
}

.reading-note p:last-child {
  border-bottom: 0;
}

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

.method-card {
  position: relative;
  min-width: 0;
  min-height: 245px;
  padding: 20px;
  overflow: hidden;
  background: rgba(251, 250, 245, 0.8);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.method-index {
  display: block;
  margin-bottom: 34px;
  color: var(--amber-ink);
  font-family: var(--number);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.method-card::after {
  position: absolute;
  top: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  content: "";
  border: 1px solid var(--line);
  border-radius: 50%;
}

.method-card h2 {
  margin-bottom: 9px;
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.method-card p {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.method-card code {
  display: block;
  max-width: 100%;
  padding: 10px;
  overflow-x: auto;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 6px;
  font-size: 10px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.provenance-list {
  padding: 4px 18px 15px;
}

.provenance-list > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.provenance-list > div:last-child {
  border-bottom: 0;
}

.provenance-list span {
  grid-row: 1 / 3;
  color: var(--muted);
  font-size: 10px;
}

.provenance-list strong {
  font-size: 11px;
}

.provenance-list em {
  color: var(--faint);
  font-size: 9.5px;
  font-style: normal;
}

.api-list {
  padding: 5px 18px 8px;
}

.api-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.api-list code {
  color: var(--teal);
  font-family: var(--number);
  font-size: 9.5px;
}

.api-list span {
  color: var(--muted);
  font-size: 9.5px;
}

.api-note {
  margin: 0;
  padding: 9px 18px 17px;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.5;
}

.limitation-panel {
  margin-top: 14px;
}

.limitation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.limitation-grid p {
  min-height: 100px;
  margin: 0;
  padding: 16px 18px;
  background: var(--panel);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.software-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 13px 18px;
  color: var(--muted);
  background: rgba(251, 250, 245, 0.64);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 9px;
}

.software-identity strong {
  color: var(--ink);
  font-family: var(--number);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.software-identity span,
.software-identity em {
  font-style: normal;
}

.software-identity em {
  justify-self: end;
  color: var(--faint);
}

.quality-intro {
  align-items: center;
}

.quality-verdict {
  --quality-accent: var(--amber);
  position: relative;
  display: flex;
  width: min(430px, 42vw);
  min-width: 330px;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px 22px;
  overflow: hidden;
  color: var(--paper);
  background:
    radial-gradient(circle at 100% 0, var(--quality-accent), transparent 42%),
    var(--ink);
  border: 1px solid rgba(255, 254, 250, 0.12);
  border-radius: 5px 24px 5px 24px;
  box-shadow: var(--shadow);
}

.quality-verdict::after {
  position: absolute;
  right: -34px;
  bottom: -58px;
  width: 170px;
  height: 170px;
  content: "";
  border: 1px solid rgba(255, 254, 250, 0.13);
  border-radius: 50%;
}

.quality-verdict.is-pass {
  --quality-accent: var(--teal-bright);
  --quality-status-bg: var(--teal);
  --quality-status-ink: var(--white);
}

.quality-verdict.is-warning {
  --quality-accent: var(--amber);
  --quality-status-bg: var(--amber);
  --quality-status-ink: var(--ink);
}

.quality-verdict.is-fail {
  --quality-accent: var(--coral);
  --quality-status-bg: var(--coral-ink);
  --quality-status-ink: var(--white);
}

.quality-status {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 4px 8px;
  color: var(--quality-status-ink);
  background: var(--quality-status-bg);
  border-radius: 999px;
  font-family: var(--number);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.quality-verdict strong {
  position: relative;
  z-index: 1;
  max-width: 330px;
  margin: 15px 0 9px;
  font-family: var(--display);
  font-size: clamp(20px, 1.8vw, 28px);
  font-weight: 600;
  line-height: 1.13;
  letter-spacing: -0.035em;
}

.quality-verdict small {
  position: relative;
  z-index: 1;
  color: rgba(241, 238, 228, 0.62);
  font-family: var(--number);
  font-size: 8.5px;
}

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

.quality-summary-card {
  --summary-tone: var(--teal);
  position: relative;
  min-width: 0;
  min-height: 126px;
  padding: 16px 17px 14px;
  overflow: hidden;
  background: rgba(251, 250, 245, 0.84);
  border: 1px solid var(--line);
  border-top: 3px solid var(--summary-tone);
  border-radius: 4px 13px 13px 13px;
}

.quality-summary-card::after {
  position: absolute;
  right: -35px;
  bottom: -45px;
  width: 100px;
  height: 100px;
  content: "";
  border: 1px solid color-mix(in srgb, var(--summary-tone) 32%, transparent);
  border-radius: 50%;
}

.quality-summary-card.is-warning {
  --summary-tone: var(--amber);
}

.quality-summary-card.is-fail {
  --summary-tone: var(--coral);
}

.quality-summary-card > span {
  color: var(--faint);
  font-family: var(--number);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.quality-summary-card > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 12px 0 7px;
}

.quality-summary-card strong {
  font-family: var(--number);
  font-size: clamp(24px, 2.1vw, 34px);
  letter-spacing: -0.05em;
  line-height: 1;
}

.quality-summary-card small {
  color: var(--muted);
  font-size: 9px;
}

.quality-summary-card p {
  position: relative;
  z-index: 1;
  max-width: calc(100% - 24px);
  margin: 0;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.55;
}

.quality-main-grid {
  grid-template-columns: minmax(0, 1.32fr) minmax(300px, 0.68fr);
  align-items: start;
}

.quality-side-stack {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.quality-check-list {
  padding: 8px 16px 16px;
}

.quality-check-group + .quality-check-group {
  margin-top: 14px;
}

.quality-check-group > h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 7px;
  color: var(--ink-soft);
  font-size: 10px;
}

.quality-check-group > h3 span {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  color: var(--muted);
  background: var(--panel-cool);
  border-radius: 99px;
  font-family: var(--number);
  font-size: 8px;
}

.quality-check-row {
  --check-tone: var(--teal);
  --check-ink: var(--teal);
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) minmax(105px, auto) 46px;
  align-items: center;
  gap: 9px;
  padding: 10px 9px;
  border-top: 1px solid var(--line);
}

.quality-check-row.is-warning {
  --check-tone: var(--amber);
  --check-ink: var(--amber-ink);
}

.quality-check-row.is-fail {
  --check-tone: var(--coral);
  --check-ink: var(--coral-ink);
}

.quality-check-row > i,
.provenance-audit-row > i {
  width: 7px;
  height: 7px;
  background: var(--check-tone);
  border-radius: 50%;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--check-tone) 13%, transparent);
}

.quality-check-row strong {
  display: block;
  font-size: 10.5px;
}

.quality-check-row p {
  margin: 3px 0 0;
  color: var(--faint);
  font-size: 8.7px;
  line-height: 1.5;
}

.quality-check-row > span {
  justify-self: end;
  color: var(--ink-soft);
  font-family: var(--number);
  font-size: 9px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.quality-check-row > em,
.provenance-audit-row > em {
  justify-self: end;
  padding: 3px 6px;
  color: var(--check-ink);
  background: color-mix(in srgb, var(--check-tone) 10%, var(--panel));
  border-radius: 99px;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.quality-repro {
  padding: 14px 16px 17px;
}

.fingerprint-card {
  position: relative;
  padding: 16px;
  overflow: hidden;
  color: var(--paper);
  background:
    linear-gradient(138deg, rgba(20, 148, 119, 0.16), transparent 48%),
    var(--ink);
  border-radius: 4px 15px 4px 15px;
}

.fingerprint-card::after {
  position: absolute;
  right: -25px;
  top: -34px;
  width: 100px;
  height: 100px;
  content: "";
  border: 1px solid rgba(255, 254, 250, 0.12);
  border-radius: 50%;
}

.fingerprint-card > span {
  display: block;
  color: rgba(241, 238, 228, 0.58);
  font-family: var(--number);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.fingerprint-card code {
  display: block;
  margin: 12px 0 8px;
  color: #9ee0c8;
  font-family: var(--number);
  font-size: 10px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.fingerprint-card small {
  display: block;
  max-width: 92%;
  color: rgba(241, 238, 228, 0.54);
  font-size: 8.5px;
  line-height: 1.55;
}

.repro-grid {
  display: grid;
  gap: 0;
  margin-top: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.repro-grid > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.repro-grid > div:last-child {
  border-bottom: 0;
}

.repro-grid span {
  color: var(--muted);
  font-size: 8.5px;
}

.repro-grid code,
.repro-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-family: var(--number);
  font-size: 8.5px;
  font-weight: 600;
  line-height: 1.45;
}

.repro-note {
  margin: 11px 1px 0;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.6;
}

.provenance-audit {
  padding: 4px 16px 13px;
}

.provenance-audit-row {
  --check-tone: var(--teal);
  --check-ink: var(--teal);
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 9px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.provenance-audit-row:last-child {
  border-bottom: 0;
}

.provenance-audit-row.is-warning {
  --check-tone: var(--amber);
  --check-ink: var(--amber-ink);
}

.provenance-audit-row.is-fail {
  --check-tone: var(--coral);
  --check-ink: var(--coral-ink);
}

.provenance-audit-row span {
  display: block;
  color: var(--faint);
  font-size: 8px;
}

.provenance-audit-row strong {
  display: block;
  margin: 2px 0;
  font-size: 10px;
}

.provenance-audit-row p {
  margin: 0;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.5;
}

.quality-normalization-panel,
.quality-warning-panel {
  margin-top: 14px;
}

.quality-normalization {
  padding: 16px 18px 18px;
}

.normalization-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.normalization-summary span {
  padding: 12px;
  color: var(--muted);
  background: var(--panel-cool);
  font-size: 8.5px;
  line-height: 1.45;
}

.normalization-summary strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-family: var(--number);
  font-size: 15px;
}

.normalization-list {
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.normalization-list li {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(160px, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.normalization-list li:last-child {
  border-bottom: 0;
}

.normalization-list strong {
  display: block;
  font-size: 10px;
}

.normalization-list code {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-family: var(--number);
  font-size: 8px;
}

.normalization-list span {
  color: var(--ink-soft);
  font-family: var(--number);
  font-size: 9px;
  overflow-wrap: anywhere;
}

.normalization-list em {
  color: var(--amber-ink);
  font-size: 8px;
  font-style: normal;
}

.normalization-list li.is-clean em {
  color: var(--teal);
}

.normalization-extra {
  margin-top: 11px;
  padding: 10px 12px;
  color: var(--muted);
  background: var(--amber-soft);
  border-left: 3px solid var(--amber);
  font-size: 9px;
  line-height: 1.55;
}

.normalization-extra.is-error {
  background: var(--coral-soft);
  border-color: var(--coral);
}

.normalization-extra strong {
  color: var(--ink-soft);
}

.normalization-extra p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.quality-warning-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding: 0;
  margin: 0;
  list-style: none;
  background: var(--line);
}

.quality-warning-list li {
  min-width: 0;
  padding: 14px 17px;
  background: var(--panel);
}

.quality-warning-list span {
  display: inline-flex;
  margin-bottom: 7px;
  padding: 3px 6px;
  color: var(--muted);
  background: var(--panel-cool);
  border-radius: 99px;
  font-family: var(--number);
  font-size: 7.5px;
}

.quality-warning-list li.is-warning span {
  color: var(--amber-ink);
  background: var(--amber-soft);
}

.quality-warning-list li.is-critical span {
  color: var(--coral-ink);
  background: var(--coral-soft);
}

.quality-warning-list p {
  margin: 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.65;
}

.quality-tone {
  display: inline-flex;
  padding: 3px 7px;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 99px;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.quality-tone.is-warning {
  color: var(--amber-ink);
  background: var(--amber-soft);
}

.quality-tone.is-fail {
  color: var(--coral-ink);
  background: var(--coral-soft);
}

.action-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow-y: auto;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 30px 100px rgba(25, 33, 29, 0.25);
}

.action-dialog::backdrop {
  background: rgba(25, 33, 29, 0.45);
  backdrop-filter: blur(4px);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  margin: 5px 0 0;
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: -0.04em;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 18px 22px;
}

.action-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 86px;
  padding: 13px;
  text-align: left;
  cursor: pointer;
  background: var(--panel-cool);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.action-card:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.action-card-wide {
  grid-column: 1 / -1;
}

.action-icon {
  display: grid;
  min-width: 38px;
  height: 38px;
  place-items: center;
  color: var(--teal);
  background: rgba(13, 107, 89, 0.09);
  border-radius: 7px;
  font-family: var(--number);
  font-size: 8px;
  font-weight: 800;
}

.action-card strong,
.action-card small {
  display: block;
}

.action-card strong {
  margin: 2px 0 5px;
  font-size: 11.5px;
}

.action-card small {
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.5;
}

.dialog-note {
  margin: 0;
  padding: 0 22px 20px;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.5;
}

.dialog-confirm {
  width: min(430px, calc(100vw - 32px));
}

.confirm-message {
  margin: 0;
  padding: 22px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 22px 22px;
}

.import-dialog {
  width: min(920px, calc(100vw - 28px));
  max-height: calc(100dvh - 24px);
}

.import-filebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 22px;
  color: var(--muted);
  background: var(--panel-cool);
  border-bottom: 1px solid var(--line);
  font-size: 9px;
}

.import-filebar > span {
  display: inline-grid;
  min-width: 36px;
  height: 26px;
  place-items: center;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 5px;
  font-family: var(--number);
  font-size: 8px;
  font-weight: 800;
}

.import-filebar strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-filebar em {
  margin-left: auto;
  color: var(--faint);
  font-size: 8.5px;
  font-style: normal;
  white-space: nowrap;
}

.import-preview-body {
  padding: 18px 22px 8px;
}

.import-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.import-overview > div {
  min-width: 0;
  padding: 13px 14px;
  background: var(--panel-cool);
}

.import-overview span {
  display: block;
  color: var(--faint);
  font-size: 8px;
}

.import-overview strong {
  display: block;
  margin: 4px 0;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-overview small {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.5;
}

.import-hash {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 11px;
  padding: 10px 12px;
  background: var(--ink);
  border-radius: 8px;
}

.import-hash > span {
  color: rgba(241, 238, 228, 0.58);
  font-size: 8.5px;
}

.import-hash code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #9ee0c8;
  font-family: var(--number);
  font-size: 8.5px;
  line-height: 1.5;
}

.import-section {
  margin-top: 17px;
}

.import-section h3 {
  margin: 0 0 7px;
  color: var(--ink-soft);
  font-size: 10.5px;
}

.import-warning-stack {
  display: grid;
  gap: 6px;
}

.import-warning-stack p {
  margin: 0;
  padding: 8px 10px;
  color: #80500f;
  background: var(--amber-soft);
  border-left: 3px solid var(--amber);
  font-size: 9px;
  line-height: 1.55;
}

.import-warning-stack p.is-info {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: var(--blue);
}

.import-empty {
  margin: 0;
  padding: 9px 10px;
  color: var(--faint);
  background: var(--panel-cool);
  border-radius: 6px;
  font-size: 8.8px;
}

.import-change-scroll {
  max-height: 190px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  scrollbar-gutter: stable;
}

.import-change-scroll:focus-visible,
.insight-strip:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.import-change-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.import-change-list li {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(150px, 1fr);
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.import-change-list li:last-child {
  border-bottom: 0;
}

.import-change-list strong {
  display: block;
  font-size: 9.5px;
}

.import-change-list code {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-family: var(--number);
  font-size: 7.5px;
}

.import-change-list span {
  align-self: center;
  color: var(--ink-soft);
  font-family: var(--number);
  font-size: 8.5px;
  overflow-wrap: anywhere;
}

.import-preflight {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 10px;
  padding: 10px 12px;
  background: var(--panel-cool);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.import-preflight > span:not(.quality-tone) {
  color: var(--muted);
  font-family: var(--number);
  font-size: 8.5px;
}

.import-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  background: rgba(251, 250, 245, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.import-actions .button {
  min-height: 40px;
}

.chart-tooltip {
  position: fixed;
  z-index: 100;
  max-width: 230px;
  padding: 8px 10px;
  color: var(--paper);
  pointer-events: none;
  background: rgba(25, 33, 29, 0.94);
  border-radius: 6px;
  box-shadow: 0 8px 30px rgba(25, 33, 29, 0.2);
  font-size: 9px;
  line-height: 1.5;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 120;
  display: flex;
  width: min(360px, calc(100vw - 40px));
  flex-direction: column;
  gap: 0;
  pointer-events: none;
  transition: bottom 180ms ease;
}

body.has-calculation-dock .toast-stack {
  bottom: var(--calculation-dock-offset, 116px);
}

.toast {
  position: relative;
  display: flex;
  width: 100%;
  overflow: hidden;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px 13px;
  color: var(--paper);
  pointer-events: none;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 10.5px;
  line-height: 1.5;
  animation: toast-in 220ms ease both;
}

.toast::before {
  width: 6px;
  height: 6px;
  margin-top: 4px;
  content: "";
  flex: 0 0 auto;
  border-radius: 50%;
  background: #72d0b2;
}

.toast.is-error::before {
  background: #f07f6c;
}

.toast::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  content: "";
  background: #72d0b2;
  transform-origin: left center;
  animation: toast-progress var(--toast-duration, 4600ms) linear both;
}

.toast.is-error::after {
  background: #f07f6c;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

@media (max-width: 1250px) {
  .workspace {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .main-stage {
    padding-right: 22px;
    padding-left: 22px;
  }

  .view-nav {
    margin-right: -22px;
    margin-left: -22px;
    padding-right: 22px;
    padding-left: 22px;
  }

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

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

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

@media (max-width: 980px) {
  .topbar {
    padding-right: 16px;
    padding-left: 16px;
  }

  .save-state,
  #baselineButton,
  .top-mode-switch {
    display: none;
  }

  .workspace {
    display: block;
  }

  .menu-button,
  .rail-close {
    display: inline-grid;
  }

  .mode-mobile {
    display: flex;
  }

  .mode-mobile .mode-switch {
    display: inline-flex;
  }

  .control-rail {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    width: min(360px, calc(100vw - 36px));
    height: 100vh;
    padding-top: 20px;
    transform: translateX(-105%);
    background: #f8f5ec;
    box-shadow: 24px 0 70px rgba(25, 33, 29, 0.2);
    transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  body.controls-open .control-rail {
    transform: translateX(0);
  }

  .panel-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    visibility: hidden;
    cursor: pointer;
    opacity: 0;
    background: rgba(25, 33, 29, 0.42);
    border: 0;
    transition:
      opacity 220ms ease,
      visibility 220ms ease;
  }

  body.controls-open .panel-backdrop {
    visibility: visible;
    opacity: 1;
  }

  .main-stage {
    padding-right: 18px;
    padding-left: 18px;
  }

  .view-nav {
    top: 74px;
    margin-right: -18px;
    margin-left: -18px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .overview-hero {
    grid-template-columns: minmax(0, 1fr) 190px;
    padding: 28px;
  }

  .dashboard-grid,
  .dashboard-grid-wide {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .topbar {
    min-height: 66px;
    gap: 9px;
    padding: 8px 12px;
  }

  .brand-copy {
    display: none;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .title-stack {
    min-width: 0;
    padding-left: 10px;
  }

  .scenario-title {
    font-size: 16px;
  }

  .scenario-meta {
    gap: 4px;
    font-size: 7.5px;
  }

  .top-actions .button {
    padding-right: 10px;
    padding-left: 10px;
    font-size: 9px;
  }

  .workspace {
    min-height: calc(100vh - 66px);
  }

  .view-nav {
    top: 66px;
    margin-right: -12px;
    margin-left: -12px;
    padding: 8px 12px;
  }

  .main-stage {
    padding: 0 12px 50px;
  }

  .view-tab {
    padding: 8px 10px;
    font-size: 9.5px;
  }

  .overview-hero {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px 20px 22px;
    border-radius: 4px 4px 22px 4px;
  }

  .hero-copy h1 {
    font-size: clamp(36px, 12vw, 52px);
  }

  .hero-score {
    align-items: flex-start;
  }

  .score-ring {
    width: 150px;
    height: 150px;
  }

  .score-ring-inner {
    width: 118px;
    height: 118px;
  }

  .score-value {
    font-size: 31px;
  }

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

  .mix-legend {
    grid-column: 1;
  }

  .insight-strip,
  .metric-grid,
  .calendar-grid,
  .method-grid,
  .limitation-grid {
    grid-template-columns: 1fr;
  }

  .metric-section-head {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px 14px;
  }

  .metric-section-head h2 {
    font-size: 18px;
  }

  .metric-scope-actions {
    width: 100%;
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 7px;
  }

  .metric-grid {
    gap: 8px;
  }

  .metric-card {
    min-height: 112px;
  }

  .view-intro {
    display: block;
    margin-bottom: 16px;
  }

  .view-intro h1 {
    font-size: 38px;
  }

  .balance-checks,
  .hourly-status {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .panel-heading {
    padding: 15px 14px 12px;
  }

  .panel-heading h2 {
    font-size: 18px;
  }

  .chart-frame {
    min-height: 230px;
    padding-right: 5px;
    padding-left: 5px;
  }

  .chart-frame svg {
    min-width: 0;
  }

  .hourly-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .hourly-toolbar label {
    flex: 1 1 120px;
  }

  .hourly-toolbar select,
  .hourly-toolbar input {
    width: 100%;
  }

  .toolbar-spacer {
    display: none;
  }

  .row-count {
    width: 100%;
  }

  .chart-key {
    display: none;
  }

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

  .calendar-summary {
    display: none;
  }
}

@media (max-width: 420px) {
  .top-actions #baselineButton,
  .scenario-meta .meta-divider:first-of-type {
    display: none;
  }

  .top-actions .button-primary {
    max-width: 86px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .metric-card .metric-value {
    font-size: 29px;
  }

  .metric-scope-toggle {
    min-height: 40px;
    padding-right: 13px;
    padding-left: 13px;
  }

  .comparison-row {
    grid-template-columns: 1fr 78px 66px;
  }
}

@media (min-width: 1420px) {
  .metric-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: minmax(132px, auto);
  }

  .metric-card:nth-child(1) {
    grid-column: span 4;
  }

  .metric-card:nth-child(2) {
    grid-column: span 3;
  }

  .metric-card:nth-child(3) {
    grid-column: span 2;
  }

  .metric-card:nth-child(4) {
    grid-column: span 3;
  }

  .metric-card:nth-child(5) {
    grid-column: span 3;
  }

  .metric-card:nth-child(6) {
    grid-column: span 3;
  }

  .metric-card:nth-child(7) {
    grid-column: span 2;
  }

  .metric-card:nth-child(8) {
    grid-column: span 4;
  }
}

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

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

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

@media (max-width: 1180px) {
  .topbar {
    padding-right: 16px;
    padding-left: 16px;
  }

  .save-state,
  #baselineButton {
    display: none;
  }

  .workspace {
    display: block;
    min-height: calc(100dvh - var(--topbar-height));
  }

  .menu-button,
  .rail-close {
    display: inline-grid;
  }

  .control-rail,
  .mode-simple .control-rail,
  .mode-pro .control-rail {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 90;
    width: min(380px, calc(100vw - 24px));
    height: 100dvh;
    margin: 0;
    padding: max(16px, env(safe-area-inset-top)) 16px
      max(28px, env(safe-area-inset-bottom));
    overflow-y: auto;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(calc(-100% - 24px));
    border: 0;
    border-right: 1px solid var(--line-strong);
    border-radius: 0 24px 24px 0;
    background:
      linear-gradient(180deg, rgba(13, 107, 89, 0.045), transparent 22rem),
      #f8f5ec;
    box-shadow: 28px 0 80px rgba(25, 33, 29, 0.24);
    transition:
      transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
      visibility 0s linear 260ms;
  }

  .mode-pro .control-rail {
    background:
      linear-gradient(180deg, rgba(45, 102, 138, 0.065), transparent 22rem),
      #f8f5ec;
  }

  body.controls-open {
    overflow: hidden;
  }

  body.controls-open .control-rail {
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition-delay: 0s;
  }

  .panel-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: block;
    visibility: hidden;
    cursor: pointer;
    opacity: 0;
    background: rgba(25, 33, 29, 0.46);
    border: 0;
    transition:
      opacity 220ms ease,
      visibility 0s linear 220ms;
  }

  body.controls-open .panel-backdrop {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
  }

  .rail-head {
    position: sticky;
    top: -1px;
    z-index: 2;
    padding: 3px 0 12px;
    background: linear-gradient(#f8f5ec 72%, transparent);
  }

  .mode-mobile {
    display: flex;
  }

  .mode-mobile .mode-switch {
    display: inline-flex;
  }

  .main-stage {
    padding: 0 18px 64px;
  }

  .view-nav {
    top: calc(var(--topbar-height) + 12px);
  }

  .overview-hero {
    grid-template-columns: minmax(0, 1fr) 190px;
    padding: 28px;
  }

  .button,
  .mode-button,
  .view-tab,
  .icon-button,
  .text-button,
  .preset-button,
  .action-card,
  .control-group > summary,
  .field input,
  .hourly-toolbar select,
  .hourly-toolbar input {
    min-height: 44px;
  }

  .menu-button,
  .rail-close {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 900px) {
  .top-mode-switch {
    display: none;
  }

  .dashboard-grid,
  .dashboard-grid-wide {
    grid-template-columns: 1fr;
  }

  .overview-hero {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero-signal {
    grid-template-columns: 154px minmax(0, 1fr);
  }

  .hero-score {
    align-items: flex-start;
  }

  .view-intro {
    display: block;
    margin-bottom: 18px;
  }

  .balance-checks,
  .hourly-status {
    justify-content: flex-start;
    margin-top: 14px;
  }

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

@media (max-width: 760px) {
  .topbar {
    min-height: 64px;
    gap: 8px;
    padding: 7px 11px;
  }

  .brand-copy {
    display: none;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .title-stack {
    min-width: 0;
    padding-left: 10px;
  }

  .scenario-title {
    font-size: 15.5px;
  }

  .scenario-meta {
    gap: 5px;
    font-size: 9.5px;
  }

  .top-actions .button {
    min-height: 44px;
    padding-right: 11px;
    padding-left: 11px;
    font-size: 10.5px;
  }

  .main-stage {
    padding: 0 12px 52px;
  }

  .view-nav {
    top: calc(var(--topbar-height) + 8px);
    width: 100%;
    margin: 10px auto 20px;
    padding: 4px;
    border-radius: 20px;
  }

  .view-tab {
    min-height: 40px;
    padding: 8px 11px;
    font-size: 11px;
  }

  .overview-hero {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 20px 18px 17px;
    border-radius: 26px 6px 26px 6px;
  }

  .hero-copy::before {
    inset: -18px -14px -16px -14px;
    background: radial-gradient(
      ellipse at 32% 48%,
      rgba(251, 250, 245, 0.94) 0%,
      rgba(251, 250, 245, 0.72) 48%,
      transparent 82%
    );
  }

  .hero-copy h1 {
    margin: 9px 0 11px;
    font-size: clamp(32px, 9.6vw, 44px);
    line-height: 1.03;
  }

  .hero-title-plain,
  .hero-title-accent {
    display: block;
  }

  .hero-title-plain {
    font-size: 0.68em;
  }

  .hero-title-accent {
    font-size: 0.98em;
  }

  .hero-lede {
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.58;
  }

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

  .health-tag {
    justify-content: center;
    text-align: center;
  }

  .hero-score {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
  }

  .score-ring {
    width: 112px;
    height: 112px;
  }

  .score-ring-inner {
    width: 86px;
    height: 86px;
  }

  .score-value {
    font-size: 27px;
  }

  .hero-signal {
    grid-template-columns: 1fr;
    gap: 9px;
    min-height: 0;
    padding: 13px 13px 9px;
    border-radius: 14px 4px 14px 4px;
  }

  .hero-signal-copy {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    gap: 3px 10px;
  }

  .hero-signal-copy .eyebrow {
    grid-column: 1 / -1;
  }

  .hero-signal-copy h2 {
    font-size: 18px;
  }

  .hero-signal-legend {
    justify-self: end;
    gap: 4px 8px;
    font-size: 8px;
  }

  .hero-signal-note {
    display: none;
  }

  .hero-energy-map {
    height: 78px;
  }

  .hero-mix {
    grid-template-columns: 1fr;
    gap: 9px;
    padding-top: 13px;
  }

  .mix-head {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }

  .mix-legend {
    grid-column: 1;
    gap: 7px 10px;
  }

  .insight-strip {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-bottom: 4px;
    overflow-x: auto;
    background: transparent;
    border: 0;
    border-radius: 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .insight-strip::-webkit-scrollbar {
    display: none;
  }

  .insight-card {
    min-width: 0;
    min-height: 118px;
    flex: 0 0 min(82vw, 330px);
    border: 1px solid var(--line);
    border-radius: 13px;
    scroll-snap-align: start;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0;
  }

  .metric-card {
    min-height: 122px;
    padding: 15px 13px 13px;
  }

  .metric-card .metric-value {
    margin-top: 12px;
  }

  .metric-card .metric-note {
    max-width: 100%;
    padding-right: 26px;
  }

  .metric-delta {
    right: 9px;
    bottom: 9px;
  }

  .view-intro h1 {
    font-size: clamp(34px, 10.3vw, 48px);
  }

  .panel-heading {
    flex-wrap: wrap;
    padding: 15px 14px 12px;
  }

  .panel-heading > * {
    min-width: 0;
  }

  .panel-heading h2 {
    font-size: 18px;
  }

  .chart-frame {
    padding: 8px 8px 5px;
  }

  .data-table {
    font-size: 10px;
  }

  .data-table th {
    font-size: 9.5px;
  }

  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .month-calendar {
    padding: 8px;
  }

  .calendar-summary {
    display: none;
  }

  .method-grid,
  .limitation-grid {
    grid-template-columns: 1fr;
  }

  .hourly-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
    padding: 11px;
  }

  .hourly-toolbar label {
    flex: 1 1 120px;
  }

  .hourly-toolbar select,
  .hourly-toolbar input {
    width: 100%;
    height: 42px;
  }

  .toolbar-spacer {
    display: none;
  }

  .row-count {
    width: 100%;
  }

  .chart-key {
    display: none;
  }

  .hourly-body {
    height: 440px;
  }

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

  .action-dialog {
    width: min(720px, calc(100vw - 24px));
    max-height: calc(100dvh - 20px);
  }

  .comparison-row {
    grid-template-columns: minmax(0, 1fr) 92px 72px;
  }

  .control-rail,
  .mode-simple .control-rail,
  .mode-pro .control-rail {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: min(88dvh, 760px);
    max-height: calc(100dvh - 18px);
    padding: 18px 14px max(28px, env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid var(--line-strong);
    border-radius: 24px 24px 0 0;
    transform: translateY(105%);
    box-shadow: 0 -24px 80px rgba(25, 33, 29, 0.24);
  }

  body.controls-open .control-rail {
    transform: translateY(0);
  }

  .rail-head {
    top: -1px;
    padding-top: 17px;
  }

  .rail-head::before {
    position: absolute;
    top: 5px;
    left: 50%;
    width: 42px;
    height: 4px;
    content: "";
    border-radius: 999px;
    background: rgba(25, 33, 29, 0.2);
    transform: translateX(-50%);
  }
}

@media (max-width: 420px) {
  .top-actions #baselineButton,
  .scenario-meta .meta-divider:first-of-type {
    display: none;
  }

  .top-actions .button-primary {
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero-copy h1 {
    font-size: clamp(29px, 8.8vw, 35px);
  }

  .hero-copy .eyebrow {
    letter-spacing: 0.13em;
  }

  .hero-lede {
    font-size: 11.5px;
  }

  .health-tag {
    min-height: 32px;
    padding: 4px 7px;
    font-size: 9px;
  }

  .score-ring {
    width: 104px;
    height: 104px;
  }

  .score-ring-inner {
    width: 80px;
    height: 80px;
  }

  .score-value {
    font-size: 25px;
  }

  .hero-signal {
    padding: 11px 11px 7px;
  }

  .hero-signal-copy {
    grid-template-columns: 1fr;
  }

  .hero-signal-copy h2 {
    font-size: 17px;
  }

  .hero-signal-legend {
    justify-self: start;
    grid-column: 1;
  }

  .hero-energy-map {
    height: 70px;
  }

  .metric-card {
    min-height: 118px;
  }

  .metric-card .metric-label {
    font-size: 9.5px;
  }

  .metric-card .metric-value {
    font-size: clamp(23px, 7.4vw, 29px);
  }

  .metric-card .metric-note {
    font-size: 9px;
  }

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

  .heading-actions,
  .sensitivity-legend {
    width: 100%;
    flex-wrap: wrap;
  }

  .action-card {
    min-height: 112px;
    flex-direction: column;
  }

  .action-icon {
    min-width: 34px;
    height: 34px;
  }

  .comparison-row {
    grid-template-columns: minmax(0, 1fr) 78px 64px;
  }
}

@media (max-width: 360px) {
  .topbar {
    gap: 7px;
    padding-right: 9px;
    padding-left: 9px;
  }

  .brand {
    display: none;
  }

  .title-stack {
    padding-left: 0;
    border-left: 0;
  }

  .scenario-title {
    font-size: 15px;
  }

  .view-nav {
    gap: 1px;
    padding: 3px;
  }

  .view-tab {
    min-width: 44px;
    padding-right: 6px;
    padding-left: 6px;
    font-size: 10px;
  }

  .overview-hero {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 20px 16px 18px;
  }

  .hero-copy {
    grid-column: 1 / -1;
  }

  .hero-copy h1 {
    margin: 9px 0 11px;
    font-size: 27px;
  }

  .hero-lede {
    margin-bottom: 11px;
  }

  .hero-score {
    grid-column: 1 / -1;
    width: 100%;
    grid-template-columns: 104px minmax(0, 1fr);
    align-self: start;
  }

  .score-ring {
    width: 104px;
    height: 104px;
  }

  .score-ring-inner {
    width: 78px;
    height: 78px;
  }

  .score-value {
    font-size: 25px;
  }

  .score-delta {
    display: none;
  }

  .hero-mix {
    grid-column: 1 / -1;
    align-self: stretch;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(25, 33, 29, 0.12);
  }

  .mix-legend {
    gap: 6px 10px;
    font-size: 9px;
  }
}

@media (max-height: 600px) and (min-width: 520px) {
  .control-rail,
  .mode-simple .control-rail,
  .mode-pro .control-rail {
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .topbar {
    min-height: 56px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .brand-copy small,
  .scenario-meta {
    display: none;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .title-stack {
    padding-left: 10px;
  }

  .scenario-title {
    font-size: 15px;
  }

  .view-nav {
    top: calc(var(--topbar-height) + 6px);
    margin-top: 7px;
    margin-bottom: 12px;
  }

  .overview-hero {
    grid-template-columns: minmax(0, 1fr) 132px;
    gap: 12px 18px;
    min-height: 0;
    padding: 18px 22px 16px;
  }

  .hero-copy h1 {
    margin: 8px 0 10px;
    font-size: clamp(30px, 4.2vw, 40px);
    line-height: 1;
  }

  .hero-lede {
    margin-bottom: 10px;
    font-size: 11px;
    line-height: 1.45;
  }

  .hero-tags {
    gap: 5px;
  }

  .hero-signal {
    grid-template-columns: 145px minmax(0, 1fr);
    min-height: 92px;
    padding: 9px 12px 7px;
  }

  .hero-signal-copy {
    gap: 4px;
  }

  .hero-signal-copy h2 {
    font-size: 17px;
  }

  .hero-signal-copy .eyebrow,
  .hero-signal-note {
    display: none;
  }

  .hero-energy-map {
    height: 62px;
  }

  .health-tag {
    min-height: 25px;
    padding: 3px 7px;
    font-size: 9px;
  }

  .score-ring {
    width: 108px;
    height: 108px;
  }

  .score-ring-inner {
    width: 84px;
    height: 84px;
  }

  .score-value {
    font-size: 25px;
  }

  .score-label,
  .score-delta {
    font-size: 8px;
  }

  .hero-mix {
    grid-column: 1 / -1;
    padding-top: 10px;
  }

  .insight-strip {
    margin-top: 12px;
  }

  .dialog-head {
    padding: 16px 18px 12px;
  }

  .dialog-head h2 {
    font-size: 23px;
  }

  .dialog-actions {
    grid-template-columns: 1fr 1fr;
    padding: 12px 18px;
  }

  .action-card {
    min-height: 66px;
    flex-direction: row;
    padding: 10px;
  }

  .action-icon {
    min-width: 32px;
    height: 32px;
  }

  .dialog-note {
    padding: 0 18px 14px;
  }
}

@media (pointer: coarse) {
  .button,
  .mode-button,
  .view-tab,
  .icon-button,
  .text-button,
  .preset-button,
  .action-card,
  .control-group > summary,
  .field input,
  .hourly-toolbar select,
  .hourly-toolbar input {
    min-height: 44px;
  }

  .control-value input {
    min-height: 44px;
  }

  input[type="range"] {
    height: 44px;
  }

  .range-shell {
    height: 44px;
  }

  .range-visual {
    top: 18px;
  }

  .rail-footer {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-atmosphere,
  .overview-hero::before,
  .overview-hero::after,
  .score-ring::before,
  .score-ring.is-refreshing,
  .score-ring.is-refreshing::before,
  .score-aura,
  .score-ring.is-refreshing .score-aura,
  .score-tick-ring,
  .mix-bar::after,
  .hero-route-pulse,
  .hero-node-ripple,
  .panel::after,
  .trend-scan,
  .trend-flow,
  .trend-point-halo,
  .daily-scan {
    display: none;
    animation: none;
  }

  .bar-potential-outline,
  .trend-aura {
    opacity: 0.55;
    animation: none;
  }

  .metric-card::after {
    opacity: 0.12;
    animation: none;
  }

  .toast::after {
    opacity: 0.65;
    animation: none;
    transform: scaleX(1);
  }

  .bar-total-cap,
  .daily-soc-dot {
    opacity: 1;
    animation: none;
  }

  .trend-line-glow,
  .daily-load-glow {
    opacity: 0.5;
    animation: none;
  }

  .trend-fill,
  .trend-line-curtailment,
  .trend-aura,
  .trend-point {
    opacity: 1;
    animation: none;
  }

  .trend-line-renewable {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    clip-path: none;
    animation: none;
  }

  .daily-total-line {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    clip-path: none;
    animation: none;
  }

  .hero-title-accent {
    background-position: 50% 50%;
    animation: none;
  }

  .view-tab.is-active {
    background-position: 50% 50%;
    animation: none;
  }

  .view-tab-indicator,
  .view,
  .view > * {
    filter: none;
    transform: none;
    transition: none !important;
  }

  .save-state::before,
  .insight-card::before,
  .metric-card .metric-label i {
    animation: none;
  }

  .startup-loader::before,
  .startup-loader::after,
  .calculation-signal::before,
  .calculation-track i,
  .metric-card.is-updated {
    animation: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 760px) {
  .startup-console {
    min-height: calc(100dvh - var(--topbar-height) - 12px);
    padding: 14px 0 26px;
  }

  .startup-card {
    border-radius: 20px 6px 20px 6px;
  }

  .startup-body {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 20px 26px;
  }

  .startup-loader {
    width: 128px;
    height: 128px;
    justify-self: center;
  }

  .startup-loader::before {
    inset: 10px;
  }

  .startup-loader::after {
    inset: 27px;
  }

  .startup-loader span {
    font-size: 23px;
  }

  .startup-copy h1 {
    font-size: 31px;
  }

  .startup-steps {
    margin-top: 18px;
  }

  .startup-steps li {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 9.5px;
  }

  .calculation-dock {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    width: auto;
    padding: 11px 12px;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .calculation-signal {
    width: 30px;
    height: 30px;
  }

  .calculation-copy p {
    max-width: 48vw;
  }

  .calculation-meta {
    min-width: 58px;
  }
}

@media (max-width: 460px) {
  .startup-identity {
    padding: 14px 16px;
  }

  .startup-body {
    padding: 20px 16px 22px;
  }

  .startup-loader {
    width: 112px;
    height: 112px;
  }

  .startup-copy h1 {
    font-size: 27px;
  }

  .startup-copy > p:not(.eyebrow) {
    font-size: 10.5px;
  }

  .startup-steps li {
    grid-template-columns: 12px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .startup-foot {
    display: grid;
    gap: 4px;
  }

  .calculation-dock {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .calculation-copy p {
    display: none;
  }

  .calculation-meta {
    grid-column: 2;
    grid-template-columns: auto auto;
    min-width: 0;
    justify-content: start;
    justify-items: start;
  }

  .calculation-meta small {
    align-self: center;
  }

  .calculation-retry {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-height: 620px) and (max-width: 760px) {
  .startup-body {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
  }

  .startup-loader {
    width: 88px;
    height: 88px;
    justify-self: start;
  }

  .startup-copy h1 {
    font-size: 24px;
  }
}

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

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

@media (max-width: 900px) {
  .quality-verdict {
    width: 100%;
    min-width: 0;
    margin-top: 16px;
  }

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

@media (max-width: 760px) {
  .hero-flow-mote {
    display: none;
  }

  .hero-contour-map {
    opacity: 0.3;
  }

  .hero-energy-map {
    opacity: 1;
  }

  .hero-aurora {
    opacity: 0.2;
  }

  .score-tick-ring {
    inset: -10px;
  }

  .sensitivity-placeholder {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 12px;
  }

  .sensitivity-placeholder-visual {
    min-height: 150px;
  }

  .sensitivity-map-grid {
    inset: 28px 18px 25px 22px;
  }

  .sensitivity-placeholder-copy {
    padding: 2px 4px 9px;
  }

  .sensitivity-placeholder-copy > strong {
    font-size: 24px;
  }

  .software-identity {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .software-identity em {
    justify-self: start;
  }

  .quality-side-stack {
    grid-template-columns: 1fr;
  }

  .quality-summary-card {
    min-height: 116px;
    padding: 14px;
  }

  .quality-summary-card strong {
    font-size: 27px;
  }

  .quality-check-list {
    padding: 6px 10px 12px;
  }

  .quality-check-row {
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
  }

  .quality-check-row > span {
    grid-column: 2;
    justify-self: start;
    text-align: left;
  }

  .quality-check-row > em {
    grid-column: 3;
    grid-row: 1;
  }

  .quality-normalization {
    padding: 12px;
  }

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

  .normalization-list li {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .normalization-list li > div {
    grid-column: 1 / -1;
  }

  .quality-warning-list {
    grid-template-columns: 1fr;
  }

  .import-dialog {
    width: calc(100vw - 20px);
  }

  .import-filebar {
    flex-wrap: wrap;
    padding: 10px 15px;
  }

  .import-filebar em {
    width: 100%;
    margin-left: 46px;
  }

  .import-preview-body {
    padding: 14px 15px 6px;
  }

  .import-overview {
    grid-template-columns: 1fr;
  }

  .import-hash {
    grid-template-columns: 1fr auto;
  }

  .import-hash > span {
    grid-column: 1 / -1;
  }

  .import-actions {
    padding: 12px 15px;
  }
}

@media (max-width: 460px) {
  .quality-summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .quality-summary-card {
    min-height: 126px;
  }

  .quality-summary-card > div {
    display: block;
  }

  .quality-summary-card small {
    display: block;
    margin-top: 4px;
  }

  .repro-grid > div {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .normalization-list li {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .normalization-list li > div {
    grid-column: auto;
  }

  .import-change-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .import-actions {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
  }

  .import-actions .button {
    min-width: 0;
    padding-right: 8px;
    padding-left: 8px;
    font-size: 9.5px;
  }
}

@media print {
  :root {
    --paper: #fff;
    --panel: #fff;
    --panel-cool: #f5f5f5;
  }

  body {
    background: #fff;
  }

  .page-noise,
  .topbar,
  .view-nav,
  .control-rail,
  .panel-backdrop,
  .top-actions,
  .button,
  .toast-stack {
    display: none !important;
  }

  .workspace {
    display: block;
  }

  .main-stage {
    padding: 0;
  }

  .view {
    display: block !important;
    max-width: none;
    break-after: page;
  }

  .view:last-child {
    break-after: auto;
  }

  .overview-hero {
    color: #111;
    background: #f3f3f3;
    box-shadow: none;
  }

  .hero-copy h1 span,
  .score-value,
  .score-delta {
    color: #111;
  }

  .score-ring-inner {
    background: #fff;
  }

  .panel,
  .metric-card,
  .insight-card {
    break-inside: avoid;
  }
}
