:root {
  --panel: rgba(255, 252, 247, 0.82);
  --panel-dark: linear-gradient(145deg, rgba(22, 60, 86, 0.95), rgba(15, 127, 120, 0.86));
  --ink: #19323a;
  --muted: #596e75;
  --line: rgba(25, 50, 58, 0.12);
  --teal: #0f7f78;
  --teal-soft: #d9f0ed;
  --amber: #c9781b;
  --amber-soft: #fde5c9;
  --coral: #d26452;
  --coral-soft: #fde0d8;
  --night-soft: #d7e7f0;
  --shadow: 0 22px 60px rgba(38, 42, 43, 0.11);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font-display: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: "SF Pro Text", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(15, 127, 120, 0.09), transparent 28%),
    radial-gradient(circle at bottom right, rgba(201, 120, 27, 0.1), transparent 24%),
    linear-gradient(180deg, #f7f2ea 0%, #efe7db 100%);
  color: var(--ink);
  font-family: var(--font-body);
}

body {
  padding: 18px 16px 40px;
}

body.is-locked {
  overflow: hidden;
}

.page-shell {
  max-width: 1760px;
  margin: 0 auto;
  position: relative;
}

.app-shell {
  display: grid;
  grid-template-columns: 312px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  transition: grid-template-columns 220ms ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 92px minmax(0, 1fr);
}

.ambient {
  position: absolute;
  border-radius: 999px;
  filter: blur(32px);
  opacity: 0.7;
  pointer-events: none;
}

.ambient-one {
  width: 240px;
  height: 240px;
  top: 72px;
  right: 48px;
  background: rgba(15, 127, 120, 0.18);
}

.ambient-two {
  width: 180px;
  height: 180px;
  left: 18px;
  top: 560px;
  background: rgba(201, 120, 27, 0.18);
}

.sidebar,
.panel,
.workspace-header {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 18px;
  padding: 20px;
  border-radius: var(--radius-xl);
  display: grid;
  gap: 18px;
  transition: padding 220ms ease;
}

.app-shell.sidebar-collapsed .sidebar {
  padding: 18px 10px;
}

.sidebar-topbar {
  display: flex;
  justify-content: flex-end;
}

.sidebar-toggle {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
  color: var(--ink);
  border-radius: 16px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.sidebar-toggle:hover {
  background: var(--teal-soft);
  border-color: rgba(15, 127, 120, 0.42);
  transform: translateY(-1px);
}

.sidebar-toggle-icon {
  font-size: 16px;
}

.sidebar-brand h1 {
  margin: 0;
  font: 800 clamp(28px, 3vw, 38px) / 1.02 var(--font-display);
  letter-spacing: -0.04em;
}

.eyebrow,
.panel-kicker,
.workspace-kicker,
.spotlight-label {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
}

.sidebar-copy,
.workspace-text,
.graph-hint,
.callout-box p,
.snapshot-copy,
.group-card p,
.project-note,
.project-feedback,
.project-meta,
.view-button-copy,
.tooltip-summary,
.tooltip-bullet {
  color: var(--muted);
}

.sidebar-copy,
.workspace-text,
.graph-hint,
.callout-box p,
.project-note,
.project-feedback {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
}

.view-nav {
  display: grid;
  gap: 14px;
}

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

.view-nav-heading {
  margin: 0;
  padding-left: 4px;
  font: 700 12px/1.2 var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.view-nav-stack {
  display: grid;
  gap: 10px;
}

.view-button {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  border-radius: 20px;
  padding: 13px 14px;
  text-align: left;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.view-button:hover,
.view-button.is-active {
  transform: translateY(-1px);
  border-color: rgba(15, 127, 120, 0.42);
  background: var(--teal-soft);
}

.view-button-short {
  min-width: 34px;
  height: 28px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(15, 127, 120, 0.12);
  display: grid;
  place-items: center;
  font: 800 12px/1 var(--font-display);
}

.view-button-body {
  display: grid;
  gap: 6px;
}

.view-button-title {
  font: 700 16px/1.2 var(--font-display);
}

.view-button-copy {
  font-size: 13px;
  line-height: 1.5;
}

.sidebar-status {
  display: grid;
  gap: 12px;
}

.status-card,
.status-mini,
.project-panel {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.status-card {
  padding: 16px;
  display: grid;
  gap: 6px;
}

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

.status-mini {
  padding: 14px;
  display: grid;
  gap: 6px;
}

.status-label,
.status-mini span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.status-title {
  font: 700 18px/1.2 var(--font-display);
}

.status-mini strong {
  font: 800 22px/1.02 var(--font-display);
  letter-spacing: -0.04em;
}

.project-panel {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.project-section {
  display: grid;
  gap: 10px;
}

.project-section-title {
  margin: 0;
  font: 700 13px/1.2 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.preset-library {
  display: grid;
  gap: 10px;
}

.panel-head-compact {
  margin-bottom: 0;
}

.project-name-field {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.project-name-field span {
  font-size: 13px;
}

.project-name-field input {
  width: 100%;
  border: 1px solid rgba(25, 50, 58, 0.16);
  background: rgba(255, 255, 255, 0.9);
  padding: 12px 14px;
  border-radius: 14px;
  font: 600 14px/1 var(--font-body);
  color: var(--ink);
  outline: none;
}

.project-name-field input:focus {
  border-color: rgba(15, 127, 120, 0.5);
  box-shadow: 0 0 0 3px rgba(15, 127, 120, 0.12);
}

.project-actions {
  display: flex;
  gap: 10px;
}

.primary-button,
.ghost-button,
.project-delete {
  border-radius: 14px;
  padding: 10px 12px;
  font: 700 13px/1 var(--font-body);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.primary-button {
  border: 1px solid rgba(15, 127, 120, 0.4);
  background: rgba(15, 127, 120, 0.94);
  color: #f7fbfc;
}

.ghost-button,
.project-delete {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
}

.primary-button:hover,
.ghost-button:hover,
.project-delete:hover {
  transform: translateY(-1px);
}

.project-list {
  display: grid;
  gap: 10px;
}

.project-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(25, 50, 58, 0.08);
  background: rgba(255, 255, 255, 0.55);
}

.project-item.is-active {
  border-color: rgba(15, 127, 120, 0.4);
  background: rgba(217, 240, 237, 0.82);
}

.project-load {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
  display: grid;
  gap: 4px;
  cursor: pointer;
  color: inherit;
}

.project-load strong {
  font: 700 14px/1.3 var(--font-display);
}

.project-meta {
  font-size: 12px;
}

.project-empty {
  padding: 14px;
  border-radius: 16px;
  border: 1px dashed rgba(25, 50, 58, 0.16);
  background: rgba(255, 255, 255, 0.4);
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.workspace {
  display: grid;
  gap: 18px;
}

.mobile-shellbar,
.mobile-backdrop {
  display: none;
}

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

.mobile-shellbar {
  gap: 10px;
  align-items: center;
}

.mobile-nav-toggle {
  border: 1px solid rgba(15, 127, 120, 0.22);
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  border-radius: 18px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 700 14px/1 var(--font-body);
  cursor: pointer;
}

.mobile-nav-icon {
  font-size: 16px;
}

.mobile-pill-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  flex: 1;
}

.mobile-pill {
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  display: grid;
  gap: 4px;
}

.mobile-pill span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mobile-pill strong {
  font: 800 18px/1.05 var(--font-display);
  letter-spacing: -0.03em;
}

.workspace-header {
  border-radius: var(--radius-xl);
  padding: 26px 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.84fr);
  gap: 18px;
}

.workspace-copy h2 {
  margin: 0;
  font: 800 clamp(28px, 3vw, 44px) / 1.04 var(--font-display);
  letter-spacing: -0.04em;
}

.workspace-text {
  margin-top: 12px;
  max-width: 60ch;
}

.workspace-spotlight {
  border-radius: 24px;
  padding: 24px;
  background: var(--panel-dark);
  color: #f7fbfc;
}

.spotlight-label {
  color: rgba(247, 251, 252, 0.75);
}

.spotlight-value {
  margin: 0 0 10px;
  font: 700 28px/1.1 var(--font-display);
}

.spotlight-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: rgba(247, 251, 252, 0.9);
}

.workspace-body {
  display: grid;
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: grid;
  gap: 18px;
}

.panel {
  border-radius: var(--radius-xl);
  padding: 24px;
}

.panel-logic {
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-head h2 {
  margin: 3px 0 0;
  font: 700 24px/1.15 var(--font-display);
}

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

.summary-grid {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, 1fr);
  gap: 14px;
}

.metric-card {
  min-height: 138px;
  border-radius: var(--radius-lg);
  padding: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.metric-card.is-hero {
  background: var(--panel-dark);
  color: #f7fbfc;
}

.metric-label {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.74;
}

.metric-value {
  margin: 0;
  font: 800 34px/1.02 var(--font-display);
  letter-spacing: -0.04em;
}

.metric-sub {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.56;
  opacity: 0.84;
}

.callout-box {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: rgba(25, 50, 58, 0.05);
  border: 1px dashed rgba(25, 50, 58, 0.18);
  display: grid;
  gap: 10px;
}

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

.snapshot-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
}

.snapshot-label {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.snapshot-value {
  margin: 0 0 8px;
  font: 700 24px/1.1 var(--font-display);
}

.preset-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.preset-chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 18px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
  font-weight: 600;
  display: grid;
  gap: 3px;
  text-align: left;
}

.preset-chip small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.preset-chip:hover,
.preset-chip.is-active {
  transform: translateY(-1px);
  border-color: rgba(15, 127, 120, 0.4);
  background: var(--teal-soft);
}

.input-form {
  display: grid;
  gap: 18px;
}

.group-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.group-card h3 {
  margin: 0 0 8px;
  font: 700 18px/1.2 var(--font-display);
}

.group-card p {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.6;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  font-weight: 600;
}

.field-unit {
  color: var(--muted);
  font-size: 12px;
}

.field input {
  width: 100%;
  border: 1px solid rgba(25, 50, 58, 0.16);
  background: rgba(255, 255, 255, 0.88);
  padding: 12px 14px;
  border-radius: 14px;
  font: 600 15px/1 var(--font-body);
  color: var(--ink);
  outline: none;
}

.field select {
  width: 100%;
  border: 1px solid rgba(25, 50, 58, 0.16);
  background: rgba(255, 255, 255, 0.88);
  padding: 12px 14px;
  border-radius: 14px;
  font: 600 15px/1 var(--font-body);
  color: var(--ink);
  outline: none;
}

.field input:focus {
  border-color: rgba(15, 127, 120, 0.5);
  box-shadow: 0 0 0 3px rgba(15, 127, 120, 0.12);
}

.field select:focus {
  border-color: rgba(15, 127, 120, 0.5);
  box-shadow: 0 0 0 3px rgba(15, 127, 120, 0.12);
}

.derived-card {
  background: linear-gradient(180deg, rgba(247, 251, 252, 0.92), rgba(255, 255, 255, 0.82));
}

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

.derived-item {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(25, 50, 58, 0.08);
  background: rgba(255, 255, 255, 0.84);
}

.derived-item span {
  color: var(--muted);
  font-size: 13px;
}

.derived-item strong {
  font: 700 20px/1.15 var(--font-display);
  color: var(--ink);
}

.derived-item small {
  color: var(--muted);
  line-height: 1.6;
}

.derived-note {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(217, 240, 237, 0.52);
  border: 1px solid rgba(15, 127, 120, 0.16);
  display: grid;
  gap: 6px;
}

.year-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 280px;
}

.year-picker label,
.year-picker span {
  font-weight: 600;
}

.year-picker input {
  flex: 1;
  min-width: 180px;
}

.graph-hint {
  margin-bottom: 16px;
}

.graph-stage {
  border-radius: 28px;
  background:
    radial-gradient(circle at 20% 20%, rgba(15, 127, 120, 0.08), transparent 28%),
    radial-gradient(circle at 80% 80%, rgba(201, 120, 27, 0.08), transparent 24%),
    rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  overflow: hidden;
}

.graph-svg {
  width: 100%;
  height: auto;
  display: block;
}

.graph-stage-box {
  fill: rgba(255, 255, 255, 0.25);
  stroke: rgba(25, 50, 58, 0.08);
  stroke-width: 1.4;
  stroke-dasharray: 8 8;
}

.graph-stage-label,
.graph-lane-label {
  fill: rgba(25, 50, 58, 0.55);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-body);
  letter-spacing: 0.04em;
}

.graph-lane-label {
  font-size: 13px;
}

.graph-edge {
  fill: none;
  stroke: rgba(25, 50, 58, 0.18);
  stroke-width: 2.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.95;
}

.graph-edge.highlight {
  stroke: rgba(15, 127, 120, 0.52);
  stroke-width: 3.8;
}

.graph-node {
  cursor: pointer;
  transition: transform 180ms ease;
}

.graph-node:hover {
  transform: translateY(-2px);
}

.graph-node.is-active .node-shell {
  stroke: rgba(15, 127, 120, 0.76);
  stroke-width: 3;
  filter: drop-shadow(0 14px 26px rgba(15, 127, 120, 0.14));
}

.graph-node.is-connected .node-shell {
  stroke: rgba(25, 50, 58, 0.18);
}

.node-shell {
  stroke: rgba(25, 50, 58, 0.12);
  stroke-width: 1.5;
}

.node-shell.input {
  fill: rgba(255, 255, 255, 0.9);
}

.node-shell.derived {
  fill: rgba(217, 240, 237, 0.92);
}

.node-shell.tax {
  fill: rgba(253, 224, 216, 0.92);
}

.node-shell.cost {
  fill: rgba(253, 229, 201, 0.92);
}

.node-shell.result {
  fill: rgba(215, 231, 240, 0.96);
}

.node-title {
  fill: var(--ink);
  font: 700 13px/1.2 var(--font-display);
}

.node-subtitle {
  fill: rgba(25, 50, 58, 0.62);
  font-size: 11px;
  font-family: var(--font-body);
}

.node-value {
  fill: var(--ink);
  font: 800 16px/1.1 var(--font-display);
}

.floating-tooltip {
  position: fixed;
  z-index: 30;
  width: min(340px, calc(100vw - 32px));
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 253, 249, 0.97);
  border: 1px solid rgba(25, 50, 58, 0.12);
  box-shadow: 0 24px 48px rgba(21, 37, 43, 0.16);
  pointer-events: none;
}

.floating-tooltip h3 {
  margin: 0 0 8px;
  font: 700 22px/1.1 var(--font-display);
}

.tooltip-value {
  margin: 0 0 12px;
  font: 800 32px/1.02 var(--font-display);
  letter-spacing: -0.04em;
}

.tooltip-summary {
  margin: 0 0 12px;
  line-height: 1.65;
}

.tooltip-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tooltip-tag {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(25, 50, 58, 0.06);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.tooltip-bullets {
  display: grid;
  gap: 8px;
}

.tooltip-bullet {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(25, 50, 58, 0.04);
  font-size: 13px;
  line-height: 1.6;
}

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

.axis-label,
.chart-tick {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--font-body);
}

.chart-legend {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-body);
}

.chart-hover-line {
  stroke: rgba(15, 127, 120, 0.45);
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
}

.chart-hover-dot {
  fill: #163c56;
  stroke: #ffffff;
  stroke-width: 3;
}

.chart-hover-bar {
  stroke: rgba(22, 60, 86, 0.5);
  stroke-width: 3;
}

.chart-hover-tooltip {
  position: fixed;
  z-index: 60;
  min-width: 180px;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 42px rgba(16, 30, 34, 0.18);
  pointer-events: none;
}

.chart-hover-tooltip strong {
  display: block;
  margin-bottom: 4px;
  font: 700 13px/1.3 var(--font-display);
}

.chart-hover-tooltip p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

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

.cashflow-chart-panel,
.cashflow-detail-panel {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.chart-frame {
  padding: 8px 6px 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(25, 50, 58, 0.08);
}

.cashflow-summary-grid {
  margin-top: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cashflow-detail-grid {
  display: grid;
  grid-template-columns: 1.18fr 1fr 1fr;
  gap: 18px;
}

.cashflow-mini-table {
  min-width: 0;
}

.cashflow-mini-table th,
.cashflow-mini-table td,
.benchmark-compare-table th,
.benchmark-compare-table td {
  white-space: normal;
  vertical-align: top;
}

.cashflow-mini-table td:last-child {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.benchmark-compare-grid {
  display: block;
}

.benchmark-compare-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.benchmark-compare-table th:first-child,
.benchmark-compare-table td:first-child {
  width: 100px;
}

.sensitivity-layout {
  display: grid;
  grid-template-columns: 332px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sensitivity-sidepanel {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
}

.sensitivity-toolbar {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
}

.sensitivity-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.sensitivity-actions {
  display: grid;
  gap: 8px;
}

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

.sensitivity-metric {
  min-height: 118px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
}

.sensitivity-metric .metric-value {
  font-size: clamp(24px, 2.1vw, 30px);
}

.sensitivity-metric .metric-sub {
  margin-top: 8px;
  font-size: 13px;
}

.sensitivity-workbench {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  align-items: start;
}

.sensitivity-control-card {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.sensitivity-control-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.sensitivity-control-head h3 {
  margin: 0 0 6px;
  font: 700 17px/1.2 var(--font-display);
}

.sensitivity-control-copy {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
}

.sensitivity-control-meta {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(25, 50, 58, 0.05);
  display: grid;
  gap: 6px;
}

.sensitivity-control-meta span {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.sensitivity-control-meta strong {
  font: 800 22px/1.05 var(--font-display);
  letter-spacing: -0.04em;
}

.sensitivity-delta {
  font-size: 13px;
  font-weight: 700;
}

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

.sensitivity-delta.negative {
  color: var(--coral);
}

.sensitivity-control-inputs {
  display: grid;
  gap: 12px;
  align-items: start;
}

.sensitivity-input-group {
  display: grid;
  gap: 8px;
}

.sensitivity-input-group span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.sensitivity-number,
.sensitivity-slider {
  width: 100%;
}

.sensitivity-number {
  border: 1px solid rgba(25, 50, 58, 0.16);
  background: rgba(255, 255, 255, 0.88);
  padding: 12px 14px;
  border-radius: 14px;
  font: 600 15px/1 var(--font-body);
  color: var(--ink);
  outline: none;
}

.sensitivity-number:focus {
  border-color: rgba(15, 127, 120, 0.5);
  box-shadow: 0 0 0 3px rgba(15, 127, 120, 0.12);
}

.sensitivity-slider-group {
  align-self: stretch;
}

.sensitivity-slider {
  appearance: none;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(15, 127, 120, 0.14), rgba(22, 60, 86, 0.2));
  outline: none;
}

.sensitivity-slider::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #0f7f78;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(15, 127, 120, 0.28);
  cursor: pointer;
}

.sensitivity-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #0f7f78;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(15, 127, 120, 0.28);
  cursor: pointer;
}

.sensitivity-range-note {
  font-size: 13px;
  color: var(--muted);
}

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

.table-wrap {
  overflow-x: auto;
}

.compact-table {
  min-width: 760px;
}

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

.benchmark-hero-grid {
  margin-top: 18px;
}

.benchmark-detail-row.level-1 td:first-child {
  font-weight: 700;
}

.benchmark-row-active {
  background: rgba(217, 240, 237, 0.42);
}

.panel-planner {
  overflow: hidden;
  padding: 8px;
}

.planner-layout {
  display: block;
}

.planner-toolbar-card {
  background:
    linear-gradient(180deg, rgba(247, 251, 252, 0.84), rgba(255, 255, 255, 0.74)),
    rgba(255, 255, 255, 0.52);
}

.planner-tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.95fr);
  gap: 10px;
}

.planner-tool-group {
  display: grid;
  gap: 8px;
}

.planner-tool-label {
  margin: 0;
  font: 700 11px/1.2 var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.planner-toolbar-bottom {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.planner-card {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid var(--line);
}

.planner-glass-card {
  background:
    linear-gradient(180deg, rgba(253, 255, 255, 0.54), rgba(255, 255, 255, 0.36)),
    rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 24px rgba(16, 30, 34, 0.12);
}

.planner-glass-card .panel-head {
  margin-bottom: 10px;
}

.planner-glass-card .panel-head h2 {
  font-size: 17px;
}

.planner-glass-card .panel-kicker {
  margin-bottom: 6px;
  font-size: 10px;
}

.planner-point-stack {
  display: grid;
  gap: 8px;
}

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

.planner-file-field {
  display: grid;
  gap: 8px;
}

.planner-file-field input[type="file"] {
  width: 100%;
  border: 1px dashed rgba(25, 50, 58, 0.18);
  background: rgba(255, 255, 255, 0.68);
  padding: 9px 10px;
  border-radius: 12px;
  font: 600 13px/1.35 var(--font-body);
  color: var(--ink);
}

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

.planner-brush {
  border: 1px solid rgba(25, 50, 58, 0.12);
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  border-radius: 14px;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font: 700 12px/1.2 var(--font-body);
  cursor: pointer;
}

.planner-brush.is-active {
  border-color: color-mix(in srgb, var(--planner-color) 56%, white);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--planner-color) 20%, transparent);
  transform: translateY(-1px);
}

.planner-brush-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--planner-color);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.92);
}

.planner-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.planner-helper {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

.planner-price-grid {
  display: grid;
  gap: 8px;
}

.planner-price-field {
  display: grid;
  gap: 6px;
}

.planner-price-label {
  font-weight: 700;
}

.planner-price-unit {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.planner-price-field input {
  width: 100%;
  border: 1px solid rgba(25, 50, 58, 0.16);
  background: rgba(255, 255, 255, 0.68);
  padding: 9px 10px;
  border-radius: 12px;
  font: 600 13px/1 var(--font-body);
  color: var(--ink);
  outline: none;
}

.planner-price-field input:focus {
  border-color: rgba(15, 127, 120, 0.5);
  box-shadow: 0 0 0 3px rgba(15, 127, 120, 0.12);
}

.planner-price-field small {
  color: var(--muted);
  line-height: 1.6;
}

.planner-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.planner-map-shell {
  position: relative;
  min-width: 0;
  min-height: clamp(620px, 76vh, 840px);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(25, 50, 58, 0.12);
  background: rgba(247, 251, 252, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.planner-map-shell.is-fullscreen {
  border-radius: 0;
}

.planner-layer-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.planner-layer-switch .ghost-button.is-active {
  border-color: rgba(15, 127, 120, 0.4);
  background: var(--teal-soft);
}

.planner-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink);
}

.planner-map-status {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 24;
  width: min(520px, calc(100% - 40px));
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(253, 229, 201, 0.72);
  border: 1px solid rgba(201, 120, 27, 0.18);
  color: var(--ink);
  font-size: 12px;
}

.planner-map {
  width: 100%;
  height: clamp(620px, 76vh, 840px);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(215, 231, 240, 0.72), rgba(253, 248, 238, 0.72)),
    rgba(255, 255, 255, 0.7);
}

.planner-map-shell.is-fullscreen .planner-map {
  height: 100dvh;
}

.planner-float {
  position: absolute;
  z-index: 18;
  pointer-events: none;
}

.planner-float > * {
  pointer-events: auto;
}

.planner-float-left {
  top: 8px;
  left: 8px;
  width: min(660px, calc(100% - 320px));
}

.planner-float-right {
  top: 8px;
  right: 8px;
  width: min(286px, calc(100% - 16px));
  max-height: calc(100% - 16px);
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.planner-float-right::-webkit-scrollbar {
  width: 8px;
}

.planner-float-right::-webkit-scrollbar-thumb {
  background: rgba(25, 50, 58, 0.16);
  border-radius: 999px;
}

.planner-summary-grid .sensitivity-metric {
  min-height: 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(10px);
}

.planner-summary-grid .metric-value {
  font-size: 22px;
}

.planner-summary-grid .metric-sub {
  margin-top: 5px;
  font-size: 10px;
  line-height: 1.35;
}

.planner-point-pin {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(16, 30, 34, 0.18);
}

.planner-point-pin span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
}

.planner-point-pin.is-substation {
  width: 22px;
  height: 22px;
  background: #163c56;
}

.planner-point-pin.is-turbine {
  background: #0f7f78;
}

.planner-point-pin.is-selected {
  transform: scale(1.18);
  box-shadow: 0 0 0 4px rgba(236, 118, 27, 0.18), 0 12px 28px rgba(16, 30, 34, 0.24);
}

.planner-breakdown-card {
  padding-top: 10px;
}

.planner-breakdown-card .compact-table {
  min-width: 0;
}

.planner-breakdown-card th,
.planner-breakdown-card td {
  padding: 8px 8px;
  font-size: 11px;
}

.planner-breakdown-card .table-wrap,
.planner-line-list {
  max-height: 240px;
  overflow: auto;
}

.planner-line-list {
  display: grid;
  gap: 8px;
}

.planner-line-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(25, 50, 58, 0.08);
  background: rgba(255, 255, 255, 0.36);
}

.planner-line-item.is-active {
  border-color: rgba(15, 127, 120, 0.42);
  background: rgba(217, 240, 237, 0.34);
}

.planner-line-focus {
  border: 0;
  background: transparent;
  padding: 0;
  display: grid;
  gap: 4px;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.planner-line-focus strong {
  font: 700 12px/1.25 var(--font-display);
}

.planner-line-focus small {
  color: var(--muted);
  line-height: 1.4;
  font-size: 10px;
}

.planner-line-chip {
  display: inline-flex;
  align-items: center;
  align-self: start;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--planner-color) 18%, white);
  color: color-mix(in srgb, var(--planner-color) 72%, black);
  font-size: 10px;
  font-weight: 700;
}

.planner-glass-card .ghost-button,
.planner-glass-card .primary-button {
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
}

.planner-glass-card .field input,
.planner-glass-card .field select {
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.planner-glass-card .field-label {
  font-size: 12px;
}

.planner-empty-row {
  text-align: center !important;
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(25, 50, 58, 0.08);
  text-align: right;
  white-space: nowrap;
}

thead th {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

th:first-child,
td:first-child {
  text-align: left;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.56);
}

.app-shell.sidebar-collapsed .sidebar-brand,
.app-shell.sidebar-collapsed .sidebar-status,
.app-shell.sidebar-collapsed .project-panel,
.app-shell.sidebar-collapsed .view-nav-heading,
.app-shell.sidebar-collapsed .view-button-copy,
.app-shell.sidebar-collapsed .view-button-title,
.app-shell.sidebar-collapsed .sidebar-toggle-label {
  display: none;
}

.app-shell.sidebar-collapsed .view-button {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 12px 10px;
}

.app-shell.sidebar-collapsed .view-button-short {
  width: 34px;
  height: 34px;
}

.app-shell.sidebar-collapsed .view-nav {
  gap: 10px;
}

.app-shell.sidebar-collapsed .view-nav-stack {
  gap: 8px;
}

.app-shell.sidebar-collapsed .sidebar-topbar {
  justify-content: center;
}

.app-shell.sidebar-collapsed .sidebar-toggle {
  padding: 10px;
}

@media (max-width: 1380px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .app-shell.sidebar-collapsed .sidebar {
    padding: 16px;
  }

  .app-shell.sidebar-collapsed .sidebar-brand,
  .app-shell.sidebar-collapsed .sidebar-status,
  .app-shell.sidebar-collapsed .project-panel,
  .app-shell.sidebar-collapsed .view-button-copy,
  .app-shell.sidebar-collapsed .view-button-title,
  .app-shell.sidebar-collapsed .sidebar-toggle-label {
    display: revert;
  }

  .app-shell.sidebar-collapsed .view-button {
    grid-template-columns: 28px minmax(0, 1fr);
    justify-items: stretch;
  }

  .view-nav,
  .summary-grid,
  .split-grid,
  .overview-snapshot,
  .workspace-header,
  .sensitivity-layout,
  .sensitivity-summary,
  .cashflow-layout,
  .cashflow-detail-grid,
  .cashflow-summary-grid,
  .planner-tool-grid,
  .benchmark-filter-bar,
  .derived-grid {
    grid-template-columns: 1fr;
  }

  .sensitivity-sidepanel {
    position: static;
  }
}

@media (max-width: 1180px) {
  .planner-map-shell {
    display: grid;
    gap: 12px;
    min-height: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .planner-float {
    position: static;
    pointer-events: auto;
    width: auto;
    max-height: none;
  }

  .planner-float-left,
  .planner-float-right {
    width: auto;
    padding-right: 0;
    overflow: visible;
  }

  .planner-float-left {
    order: -3;
  }

  .planner-map-status {
    position: static;
    top: auto;
    left: auto;
    transform: none;
    width: auto;
    order: -2;
  }

  .planner-float-right {
    order: -1;
  }

  .planner-map {
    height: 620px;
    min-height: 620px;
    border-radius: 26px;
    border: 1px solid var(--line);
  }
}

@media (max-width: 980px) {
  body {
    padding: 12px 10px 28px;
  }

  .ambient {
    display: none;
  }

  .app-shell,
  .app-shell.sidebar-collapsed {
    display: block;
  }

  .mobile-shellbar {
    position: sticky;
    top: 12px;
    z-index: 24;
    display: flex;
    margin-bottom: 12px;
  }

  .mobile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: block;
    border: 0;
    background: rgba(16, 30, 34, 0.32);
    backdrop-filter: blur(2px);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(88vw, 360px);
    height: 100dvh;
    padding: 16px;
    overflow-y: auto;
    z-index: 40;
    border-radius: 0 26px 26px 0;
    transform: translateX(calc(-100% - 20px));
    transition: transform 220ms ease;
  }

  .app-shell.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  .app-shell.sidebar-collapsed .sidebar {
    padding: 16px;
  }

  .app-shell.sidebar-collapsed .sidebar-brand,
  .app-shell.sidebar-collapsed .sidebar-status,
  .app-shell.sidebar-collapsed .project-panel,
  .app-shell.sidebar-collapsed .view-button-copy,
  .app-shell.sidebar-collapsed .view-button-title,
  .app-shell.sidebar-collapsed .sidebar-toggle-label {
    display: revert;
  }

  .app-shell.sidebar-collapsed .view-button {
    grid-template-columns: 28px minmax(0, 1fr);
    justify-items: stretch;
  }

  .field-grid,
  .status-grid,
  .project-actions,
  .summary-grid,
  .split-grid,
  .overview-snapshot,
  .cashflow-layout,
  .cashflow-detail-grid,
  .cashflow-summary-grid,
  .sensitivity-summary,
  .sensitivity-workbench,
  .planner-action-grid,
  .planner-brush-grid,
  .planner-summary-grid,
  .planner-layer-switch,
  .benchmark-filter-bar,
  .planner-point-grid,
  .derived-grid {
    grid-template-columns: 1fr;
  }

  .panel,
  .workspace-header,
  .sidebar {
    padding: 18px;
  }

  .workspace {
    gap: 12px;
  }

  .panel-head {
    flex-direction: column;
  }

  .project-actions {
    display: grid;
  }

  .sensitivity-actions {
    grid-template-columns: 1fr;
  }

  .workspace-copy h2 {
    font-size: clamp(24px, 8vw, 34px);
  }

  .workspace-text {
    margin-top: 8px;
    font-size: 14px;
  }

  .workspace-spotlight {
    padding: 18px;
  }

  .spotlight-value {
    font-size: 24px;
  }

  .graph-stage {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .planner-card {
    padding: 16px;
  }

  .planner-map {
    height: 420px;
    min-height: 420px;
  }

  .planner-toolbar-bottom {
    align-items: stretch;
  }

  .graph-svg {
    width: 1180px;
    min-width: 1180px;
  }

  .chart-svg {
    min-height: 280px;
  }

  .table-wrap {
    -webkit-overflow-scrolling: touch;
  }
}
