﻿:root {
  --bg: #f4efe7;
  --panel: rgba(255, 252, 247, 0.88);
  --panel-strong: #fffaf2;
  --ink: #1f2a28;
  --muted: #61706a;
  --line: rgba(31, 42, 40, 0.09);
  --accent: #c7b263;
  --accent-soft: rgba(199, 178, 99, 0.28);
  --accent-warm: #cc7a00;
  --danger: #b64b44;
  --shadow: 0 20px 40px rgba(31, 42, 40, 0.08);
  --radius: 24px;
  --gold: #fff2cc;
  --matt-gold: #ece5cc;
  --gold-dark: #c7b263;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--accent-soft);
  font-family: "Palatino Linotype", Palatino, "Book Antiqua", serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1280px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.hero,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  padding: 28px;
  display: grid;
  gap: 20px;
  position: sticky;
  top: 10px;
  z-index: 40;
}

.hero-top,
.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.eyebrow {
  margin: 0;
  color: var(--accent-warm);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.02;
  max-width: 12ch;
}

.hero p,
.muted {
  color: var(--muted);
}

.mobile-rotate-note {
  display: none;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(198, 40, 40, 0.22);
  background: rgba(198, 40, 40, 0.12);
  color: #c62828;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hero-metrics,
.admin-grid,
.dual-grid,
.allocation-grid {
  display: grid;
  gap: 16px;
}

.hero-metrics {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.summary-grid {
  align-items: stretch;
  margin-bottom: 18px;
}

.portfolio-stack > .summary-grid {
  margin-bottom: 0;
}

.metric,
.mini-card {
  padding: 14px;
  border-radius: 16px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.metric-label,
label span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.metric-value {
  font-size: 1.45rem;
}

.portfolio-label {
  font-size: 0.88rem;
  font-weight: 600;
}

.topbar,
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.hero-controls {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.hero-topbar {
  justify-content: flex-end;
}

.portfolio-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: min(100%, 760px);
  padding-bottom: 2px;
}

.portfolio-scroll .pill {
  flex: 0 0 auto;
}

.pill {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  background: #ece4d5;
  color: var(--ink);
}

.pill.is-active {
  background: var(--accent);
  color: #ffffff;
}

.action {
  background: var(--accent);
  color: #1f2a28;
}

.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.warning {
  color: var(--danger);
}

.layout {
  margin-top: 18px;
  display: grid;
  gap: 18px;
}

.panel {
  padding: 22px;
}

.panel-header {
  margin-bottom: 16px;
}

.summary-grid .panel {
  height: 100%;
}

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

.simulation-header {
  align-items: stretch;
}

.simulation-header-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 10px;
  align-items: start;
}

.simulation-header-card {
  padding: 10px 12px;
  border-radius: 14px;
  min-height: 0;
}

.simulation-header-card .metric-label {
  margin-bottom: 4px;
  font-size: 0.72rem;
}

.simulation-header-card .metric-value {
  font-size: 1.02rem;
}

.simulation-chart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 12px;
  align-items: end;
}

.simulation-placeholder,
.simulation-chart-placeholder {
  min-height: 148px;
  padding: 10px 12px 6px;
  border: 1px solid rgba(31, 42, 40, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
}

.simulation-placeholder {
  display: grid;
  place-items: center;
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.simulation-chart {
  min-height: 148px;
  overflow: visible;
}

.simulation-axis-line {
  stroke: rgba(31, 42, 40, 0.22);
  stroke-width: 1;
}

.simulation-grid-line {
  stroke: rgba(31, 42, 40, 0.09);
  stroke-width: 1;
  stroke-dasharray: 4 6;
}

.simulation-band {
  stroke: none;
}

.simulation-band-outer {
  fill: rgba(143, 124, 58, 0.14);
}

.simulation-band-inner {
  fill: rgba(199, 178, 99, 0.26);
}

.simulation-axis-label {
  fill: #61706a;
  font-size: 14px;
}

.simulation-year-label {
  font-size: 15px;
  letter-spacing: 0.01em;
}

.simulation-point-hit {
  fill: transparent;
  cursor: pointer;
}

.simulation-point {
  fill: #8f7c3a;
  stroke: #fffaf2;
  stroke-width: 2;
  transition: r 120ms ease, fill 120ms ease;
}

.simulation-point-group:hover .simulation-point {
  fill: #c7b263;
}

.simulation-side-legend {
  justify-self: end;
  align-self: end;
}

.simulation-legend-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
}

.simulation-legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.simulation-legend-label {
  font-size: 0.96rem;
  color: #2d3936;
}

.simulation-legend-line {
  width: 28px;
  height: 0;
  border-top: 3px solid #8f7c3a;
  border-radius: 999px;
  flex: 0 0 auto;
}

.simulation-legend-swatch {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(31, 42, 40, 0.12);
  flex: 0 0 auto;
}

.simulation-legend-swatch-inner {
  background: rgba(199, 178, 99, 0.26);
}

.simulation-legend-swatch-outer {
  background: rgba(143, 124, 58, 0.14);
}

.allocation-grid {
  grid-template-columns: 1fr;
  align-items: start;
}

.allocation-grid.is-drilldown {
  grid-template-columns: 1fr;
}

.allocation-chart-wrap {
  min-height: 320px;
}

.legend {
  display: grid;
  gap: 10px;
}

.legend-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.legend-button {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  padding: 10px 12px;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.legend-button.is-selected {
  border-color: rgba(31, 122, 109, 0.7);
  background: rgba(31, 122, 109, 0.1);
}

.legend-boxed .legend-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  padding: 10px 12px;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(31, 42, 40, 0.12);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}


.table th,
.table td {
  padding: 10px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(31, 42, 40, 0.08);
  vertical-align: middle;
}


.table a {
  color: #1f2a28;
  text-decoration: underline;
}

.table a:visited {
  color: #1f2a28;
}
.table-sort {
  border: 0;
  background: transparent;
  padding: 0;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.table-sort:hover {
  color: #ffffff;
  opacity: 0.92;
}
.table th {
  color: #ffffff;
  font-weight: 600;
  background: var(--gold-dark);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(480px, 100%);
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.login-card form,
.admin-form {
  display: grid;
  gap: 10px;
}

.admin-form label {
  display: grid;
  gap: 4px;
}

.admin-form label span {
  font-size: 0.82rem;
  color: var(--muted);
}

.admin-form input,
.admin-form select {
  min-height: 38px;
  padding: 8px 10px;
}

.admin-form select[multiple] {
  min-height: 116px;
  padding: 8px;
}


label {
  display: grid;
  gap: 8px;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--accent-soft);
  color: #1f2a28;
  font-size: 0.84rem;
}

.history-toggle {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.history-toggle-inline {
  margin-bottom: -0.65rem;
  justify-content: flex-end;
  align-items: center;
}

.history-toggle .pill {
  padding: 7px 12px;
  min-height: 34px;
  font-size: 0.9rem;
  line-height: 1;
}

.history-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 10px;
  align-items: end;
}

.history-bars-value {
  grid-template-columns: minmax(180px, 0.95fr) repeat(auto-fit, minmax(74px, 1fr));
  align-items: end;
}

.history-value-legend {
  align-self: end;
  display: grid;
  gap: 10px;
  padding-bottom: 0.15rem;
  margin-bottom: -0.65rem;
}

.history-value-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.94rem;
  color: #2d3936;
}

.history-value-legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1px solid rgba(31, 42, 40, 0.12);
}

.history-value-legend-swatch.is-value {
  background: var(--gold-dark);
}

.history-value-legend-swatch.is-cashflow {
  background: linear-gradient(135deg, rgba(198, 115, 103, 0.95) 0%, rgba(198, 115, 103, 0.95) 46%, rgba(157, 193, 139, 0.92) 54%, rgba(157, 193, 139, 0.92) 100%);
  border-color: rgba(120, 101, 49, 0.38);
}

.history-panel-body {
  min-height: 360px;
}

.history-col {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.history-plot {
  position: relative;
  width: 100%;
  height: 292px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.history-zero {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 42%;
  border-top: 1px solid rgba(31, 42, 40, 0.2);
}

.history-bar {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(34px, 70%);
  border-radius: 10px;
  border: 1px solid transparent;
  transition: filter 120ms ease, box-shadow 120ms ease;
  cursor: default;
}

.history-bar.is-positive {
  background: #2e7d32;
}

.history-bar.is-negative {
  background: #c62828;
}

.history-bar.is-up {
  bottom: 58%;
  border-radius: 10px 10px 4px 4px;
}

.history-bar.is-down {
  top: 42%;
  border-radius: 4px 4px 10px 10px;
}

.history-bar-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.92rem;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.history-bar-label.is-up {
  bottom: calc(58% + var(--history-bar-height, 0%) + 10px);
}

.history-bar-label.is-down {
  top: calc(42% + var(--history-bar-height, 0%) + 10px);
}

.history-bar-label.is-positive {
  color: #2e7d32;
}

.history-bar-label.is-negative {
  color: #c62828;
}

.history-bars-value .history-plot-value {
  height: 244px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: visible;
}

.history-bar.is-value {
  bottom: 0;
  background: var(--gold-dark);
  border-color: rgba(31, 42, 40, 0.08);
}

.history-cashflow-segment {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(34px, 70%);
  background: rgba(234, 223, 174, 0.92);
  border: 1px solid rgba(137, 118, 48, 0.42);
  border-radius: 7px;
  z-index: 2;
  box-shadow: inset 0 1px 0 rgba(255, 250, 232, 0.65);
}

.history-cashflow-segment.is-positive {
  background: rgba(157, 193, 139, 0.92);
  border-color: rgba(90, 136, 72, 0.56);
}

.history-cashflow-segment.is-negative {
  background: rgba(198, 115, 103, 0.9);
  border-color: rgba(143, 71, 61, 0.54);
}


.history-year {
  font-weight: 600;
  color: #2d3936;
}

.history-sub {
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 0.1rem;
  line-height: 1.05;
}

.history-cashflow-label {
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 0.08rem;
  line-height: 1.05;
}

.history-cashflow-label.is-positive {
  color: #2e7d32;
}

.history-cashflow-label.is-negative {
  color: #c62828;
}

.history-cashflow-label.is-empty {
  visibility: hidden;
}

.chart {
  width: 100%;
  min-height: 280px;
}

.donut-chart {
  width: min(360px, 100%);
  min-height: 320px;
  display: block;
  margin: 0 auto;
}

.small {
  font-size: 0.84rem;
}

.allocation-slice {
  transition: opacity 120ms ease, filter 120ms ease, stroke-width 120ms ease;
}

.allocation-slice:hover {
  opacity: 0.5;
  filter: brightness(0.72) saturate(1.35) drop-shadow(0 0 6px rgba(31, 42, 40, 0.35));
  stroke-width: 32px;
}

.clickable-slice {
  cursor: pointer;
}

@media (max-width: 980px) {
  .dual-grid {
    grid-template-columns: 1fr;
  }

  .simulation-header-metrics {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .allocation-grid {
    grid-template-columns: 1fr;
  }

  .allocation-grid.is-drilldown {
  grid-template-columns: 1fr;
}

.allocation-chart-wrap {
    min-height: 0;
  }
}


















.value-positive {
  color: #2e7d32;
}

.value-negative {
  color: #c62828;
}








.hero.is-compact {
  padding: 12px 16px;
  gap: 8px;
  top: 6px;
}

.hero.is-compact .hero-top {
  gap: 10px;
}

.hero.is-compact h1 {
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
  line-height: 1.1;
  max-width: none;
}

.hero.is-compact .hero-metrics {
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px;
}

.hero.is-compact .metric {
  padding: 10px 12px;
  border-radius: 12px;
}

.hero.is-compact .metric-label {
  font-size: 0.72rem;
  margin-bottom: 4px;
}

.hero.is-compact .metric-value {
  font-size: 1.02rem;
}

.hero.is-compact .row {
  gap: 8px;
}






.portfolio-pill {
  padding: 10px 16px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}


/* Compact hero controls to keep both rows tidy */
.hero-controls .row,
.hero-topbar {
  gap: 8px;
}

.hero-controls .row {
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: 100%;
}

.hero-controls .pill,
.hero-topbar .pill,
.portfolio-pill {
  padding: 7px 12px;
  min-height: 34px;
  font-size: 0.9rem;
  line-height: 1;
}

#logout-btn {
  background: #111111;
  color: #ffffff;
  border: 1px solid #111111;
}


.admin-title {
  color: #ffffff;
}



/* Force admin color overrides */
.admin-form .action {
  color: #ffffff !important;
}

.admin-title {
  color: #1f2a28 !important;
}

/* Final admin typography/button color fixes */
.panel .admin-title {
  color: #1f2a28 !important;
}

.admin-form button.pill.action,
.admin-form button.pill.action:hover,
.admin-form button.pill.action:focus,
.admin-form button.pill.action:active {
  color: #ffffff !important;
}


/* Portfolio pills: cleaner top layout without clipped horizontal scroll */
.hero-controls {
  width: min(100%, 920px);
}

.portfolio-scroll {
  flex-wrap: wrap !important;
  overflow-x: visible !important;
  max-width: min(100%, 920px) !important;
  padding-bottom: 0 !important;
  row-gap: 8px;
}

.portfolio-scroll .pill {
  white-space: nowrap;
}

.hero-controls .row {
  flex-wrap: wrap !important;
  overflow-x: visible !important;
  justify-content: flex-end;
}




















.portfolio-stack {
  display: grid;
  gap: 18px;
}

@media (max-width: 800px) and (orientation: portrait) {
  body {
    overflow-x: hidden;
  }

  .shell {
    width: min(calc(100% - 20px), 480px);
    margin-top: 12px;
    margin-bottom: 24px;
  }

  .layout,
  .portfolio-stack,
  .panel,
  .history-panel-body,
  .simulation-chart-layout,
  .simulation-chart-placeholder,
  .simulation-side-legend {
    min-width: 0;
    max-width: 100%;
  }

  .hero {
    position: static;
    padding: 18px;
    gap: 14px;
    border-radius: 20px;
  }

  .hero-top {
    flex-direction: column;
    gap: 14px;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(1.8rem, 8vw, 2.4rem);
    line-height: 1.06;
  }

  .hero p {
    margin: 0;
    line-height: 1.45;
  }



  .mobile-rotate-note {
    display: block;
  }

  .hero-controls {
    width: 100%;
    justify-items: stretch;
  }

  .hero-controls > .row {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .hero-controls .tag,
  .hero-controls .pill {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .hero-topbar {
    justify-content: flex-start;
  }

  .portfolio-scroll {
    max-width: 100%;
    padding-bottom: 6px;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .hero .metric {
    padding: 12px 14px;
  }

  .hero .metric-value {
    font-size: 1.15rem;
  }

   .simulation-chart-layout {
    grid-template-columns: minmax(0, 1fr) 124px;
    gap: 8px;
    align-items: end;
  }

  .simulation-side-legend {
    justify-self: end;
    align-self: end;
  }

  .simulation-legend-card {
    width: 124px;
    padding: 8px 10px;
  }

  .simulation-legend-label {
    font-size: 0.78rem;
  }

  .simulation-chart-placeholder {
    min-height: 138px;
    padding: 6px 6px 4px;
  }

  .history-panel-body {
    overflow-y: visible;
    min-height: 348px;
  }

  .history-panel-body,
  .simulation-chart-placeholder,
  .table {
    overflow-x: auto;
  }

  .history-bars {
    grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
    gap: 8px;
  }

  .history-bars-value {
    grid-template-columns: 1fr;
  }

  .history-bar-label,
  .history-sub,
  .history-cashflow-label {
    font-size: 0.8rem;
  }
}

@media (max-width: 980px) and (orientation: landscape) {
  body {
    overflow-x: hidden;
  }

  .shell {
    width: min(calc(100% - 16px), 1280px);
    margin: 8px auto 18px;
  }

  .layout,
  .portfolio-stack,
  .panel,
  .history-panel-body,
  .simulation-chart-layout,
  .simulation-chart-placeholder,
  .simulation-side-legend {
    min-width: 0;
    max-width: 100%;
  }

  .hero {
    position: static;
    padding: 16px 18px;
    gap: 14px;
    border-radius: 20px;
  }

  .hero-top {
    gap: 14px;
    align-items: flex-start;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(1.55rem, 3.6vw, 2.1rem);
    line-height: 1.05;
  }

  .hero p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.35;
  }

  .hero-controls {
    width: 100%;
    justify-items: stretch;
  }

  .hero-controls .row {
    justify-content: flex-start;
    flex-wrap: wrap !important;
    overflow: visible !important;
    max-width: 100%;
  }

  .hero-controls .pill,
  .hero-topbar .pill,
  .portfolio-pill {
    padding: 6px 10px;
    min-height: 30px;
    font-size: 0.82rem;
  }

  .hero-topbar {
    justify-content: flex-start;
  }

  .portfolio-scroll {
    max-width: 100% !important;
    row-gap: 6px;
  }

  .hero-metrics {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 10px;
  }

  .metric,
  .mini-card {
    padding: 12px;
  }

  .metric-label,
  label span {
    font-size: 0.76rem;
    margin-bottom: 6px;
  }

  .metric-value {
    font-size: 1.15rem;
  }

  .panel {
    padding: 16px;
  }

  .panel-header {
    gap: 10px;
    margin-bottom: 12px;
  }

  .summary-grid {
    gap: 12px;
    margin-bottom: 12px;
  }

  .simulation-header-metrics {
    grid-template-columns: repeat(2, minmax(108px, 1fr));
    gap: 8px;
  }

  .simulation-header-card {
    padding: 6px 8px;
  }

  .simulation-header-card .metric-label {
    font-size: 0.62rem;
  }

  .simulation-header-card .metric-value {
    font-size: 0.84rem;
  }

  .simulation-chart-layout {
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 8px;
    align-items: end;
  }

  .simulation-chart-placeholder {
    min-height: 154px;
    padding: 8px 8px 6px;
    overflow: hidden;
  }

  .simulation-side-legend {
    justify-self: end;
    align-self: end;
  }

  .simulation-legend-card {
    padding: 8px 10px;
    min-width: 132px;
  }

  .simulation-legend-label {
    font-size: 0.8rem;
  }

  .simulation-axis-label {
    font-size: 12px;
  }

  .simulation-year-label {
    font-size: 12px;
  }

  .history-panel-body,
  .table {
    overflow-x: auto;
  }

  .history-panel-body {
    overflow-y: visible;
    min-height: 360px;
  }

  .history-bars {
    grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
    gap: 6px;
  }

  .history-bars-value {
    grid-template-columns: 1fr;
  }

  .history-bar-label,
  .history-sub,
  .history-cashflow-label {
    font-size: 0.72rem;
  }
}





























@media (max-width: 1180px) and (orientation: landscape) {
  .simulation-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
  }

  .simulation-header > div:first-child {
    min-width: 0;
  }

  .simulation-header > div:first-child h2 {
    white-space: nowrap;
    font-size: clamp(1.25rem, 2.8vw, 1.9rem);
  }

  .simulation-header > div:first-child .muted {
    max-width: 28ch;
  }

  .simulation-header-metrics {
    width: max-content;
    grid-template-columns: minmax(90px, 98px) minmax(138px, 154px);
    gap: 6px;
  }

  .simulation-header-card {
    padding: 5px 7px;
  }

  .simulation-header-card .metric-label {
    font-size: 0.58rem;
  }

  .simulation-header-card .metric-value {
    font-size: 0.8rem;
  }
}





.admin-subpanel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
}

.admin-subpanel .panel-header {
  margin-bottom: 12px;
}

.title-admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.title-admin-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.title-admin-field {
  margin: 0;
}

.title-admin-actions {
  justify-content: flex-end;
  align-items: end;
}

.title-admin-actions .action {
  border-radius: 999px;
}

@media (max-width: 980px) {
  .title-admin-form {
    grid-template-columns: 1fr;
  }

  .title-admin-inline {
    grid-template-columns: 1fr;
  }

  .title-admin-actions {
    justify-content: flex-start;
  }
}
