.simulator-shell {
  --result-surface: #f0c830;
  padding-bottom: calc(70px + env(safe-area-inset-bottom));
}

.simulator-hero {
  padding-bottom: 30px;
}

.simulator-hero h1 {
  max-width: 9em;
}

.scope-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.scope-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #d5d0c3;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.privacy-note::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(240, 200, 48, 0.12);
}

.calculator-grid {
  display: grid;
  gap: 14px;
}

.input-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(255,255,255,0.012));
}

.input-card.primary {
  border-color: rgba(240, 200, 48, 0.55);
}

.field-label,
.field-legend {
  display: block;
  margin: 0 0 10px;
  color: var(--ivory);
  font-size: 13px;
  font-weight: 800;
}

.field-help {
  display: block;
  margin: -5px 0 13px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.amount-input-wrap {
  position: relative;
  display: flex;
  align-items: baseline;
  border-bottom: 1px solid var(--line-strong);
}

.amount-input {
  width: 100%;
  min-width: 0;
  padding: 5px 62px 10px 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: clamp(34px, 11vw, 50px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.amount-input.small {
  font-family: var(--sans);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.amount-input:focus + .amount-unit,
.amount-input-wrap:focus-within {
  border-color: var(--yellow);
}

.amount-unit {
  position: absolute;
  right: 0;
  bottom: 13px;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 800;
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 14px;
}

.preset-button {
  min-height: 38px;
  padding: 7px 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  color: #c9c5b8;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.preset-button:active {
  border-color: var(--yellow);
  color: var(--yellow);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0c0c0b;
}

.segmented label {
  position: relative;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segmented span {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 8px;
  border-radius: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.segmented input:checked + span {
  background: var(--yellow);
  color: #16140d;
}

.segmented input:focus-visible + span {
  outline: 2px solid var(--ivory);
  outline-offset: 2px;
}

.inline-field {
  margin-top: 16px;
}

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

.inline-note strong {
  color: var(--ivory);
}

.validation-message {
  min-height: 22px;
  margin: 0;
  color: #f1d476;
  font-size: 11px;
}

.result-panel {
  scroll-margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--yellow);
  border-radius: 5px;
  background: var(--surface);
}

.result-panel.is-empty .result-content {
  opacity: 0.35;
}

.result-hero {
  padding: 26px 20px 24px;
  background: var(--result-surface);
  color: #15130d;
}

.result-eyebrow {
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.result-value {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 13vw, 66px);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.055em;
}

.result-subline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 13px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(21, 19, 13, 0.28);
  font-size: 11px;
  font-weight: 800;
}

.result-content {
  padding: 20px;
  transition: opacity 160ms ease;
}

.breakdown-chart {
  display: flex;
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #282720;
}

.breakdown-chart span {
  display: block;
  min-width: 0;
  transition: width 240ms ease;
}

.chart-net { background: var(--yellow); }
.chart-fee { background: #ded7bf; }
.chart-tax { background: #847f70; }
.chart-expenses { background: #514f48; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 10px 0 20px;
  color: var(--muted);
  font-size: 9px;
}

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

.chart-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.result-list {
  margin: 0;
}

.result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

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

.result-row dt {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.result-row dd {
  margin: 0;
  color: var(--ivory);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: right;
}

.result-row.emphasis dt,
.result-row.emphasis dd {
  color: var(--yellow);
}

.result-footnote {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.reset-button {
  width: 100%;
  min-height: 46px;
  margin-top: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.fee-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  line-height: 1.5;
}

.fee-table th,
.fee-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.fee-table th {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.fee-table td:last-child {
  color: var(--ivory);
  font-weight: 700;
}

.source-list {
  margin: 0;
  padding-left: 1.4em;
  color: var(--muted);
  font-size: 10px;
}

.source-list li + li { margin-top: 7px; }
.source-list a { text-underline-offset: 3px; }

.consultation-block {
  padding: 22px;
  border: 1px solid rgba(240, 200, 48, 0.5);
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(240,200,48,0.11), rgba(255,255,255,0.015));
}

.consultation-block h2 { margin-bottom: 8px; }
.consultation-block p { color: var(--muted); font-size: 12px; }

[hidden] { display: none !important; }

@media (min-width: 680px) {
  .calculator-grid {
    grid-template-columns: 1fr 1fr;
  }
  .input-card.primary { grid-column: 1 / -1; }
  .preset-button:hover { border-color: var(--yellow); color: var(--yellow); }
}

@media (prefers-reduced-motion: reduce) {
  .breakdown-chart span,
  .result-content { transition: none; }
}
