:root {
  color-scheme: dark;
  --bg: #0e1520;
  --surface: #182332;
  --surface-light: #1d2b3d;
  --surface-deep: #101b2a;
  --border: #334358;
  --text: #edf3fb;
  --muted: #a4b4c7;
  --subtle: #8296ab;
  --teal: #4bd2bd;
  --blue: #8ca7ff;
  --warning: #f8c675;
  --danger: #ff9c9c;
  --radius: 20px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(ellipse at 18% -10%, #1b3346 0, transparent 48%), var(--bg);
  color: var(--text);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
input, select {
  min-width: 0;
  background: var(--surface-deep);
  color: var(--text);
  border: 1px solid #45566f;
  border-radius: 11px;
  padding: 10px 12px;
}
input[type="range"] {
  border: 0;
  padding: 0;
  height: 31px;
  width: 100%;
  accent-color: var(--teal);
  cursor: grab;
  touch-action: pan-y;
}
input[type="range"]:active { cursor: grabbing; }
input:disabled { opacity: .6; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}
a { color: #afcfff; }
a:hover { text-decoration: none; }
.sr-only {
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  width: 1px;
  height: 1px;
}
.shell { width: min(100%, 1260px); padding: 0 30px; margin: 0 auto; }
.site-header, .footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.site-header { padding: 22px 0; border-bottom: 1px solid #2c3a4d; }
.home-link { display: inline-flex; gap: 12px; align-items: center; color: var(--text); font-weight: 750; text-decoration: none; }
.home-mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; background: var(--teal); color: #0c2927; font-size: 13px; }
.privacy-indicator { color: var(--muted); font-size: 13px; }
.privacy-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; background: var(--teal); border-radius: 50%; }

.intro { display: flex; justify-content: space-between; align-items: center; gap: 36px; padding: 44px 0 34px; }
.eyebrow, .section-kicker { font-weight: 800; font-size: 11px; letter-spacing: .145em; color: var(--teal); margin: 0 0 8px; }
h1, h2, h3, p { overflow-wrap: break-word; }
h1 { font-size: clamp(33px, 5vw, 57px); line-height: 1.07; letter-spacing: -.055em; margin: 0 0 16px; }
h1 span { color: var(--teal); }
.intro-description { color: var(--muted); font-size: 16px; margin: 0; max-width: 640px; }
.intro-settings { flex: none; display: flex; align-items: center; gap: 10px; }
.intro-settings svg { width: 20px; height: 20px; }
h2 { font-size: 21px; line-height: 1.25; letter-spacing: -.025em; margin: 0; }
h3 { font-size: 17px; margin: 0; }
.panel { min-width: 0; padding: 25px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.section-heading { display: flex; gap: 14px; align-items: end; justify-content: space-between; margin-bottom: 17px; }
.section-heading.compact-heading { align-items: start; margin-bottom: 18px; }
.field-label { display: block; font-size: 13px; color: var(--muted); font-weight: 700; margin: 0 0 7px; }
.button { border: 1px solid #4e617a; color: var(--text); background: #28384a; border-radius: 10px; padding: 10px 16px; font-size: 13px; font-weight: 750; transition: background .15s, filter .15s; }
.button:hover:not(:disabled) { filter: brightness(1.12); }
.button-primary { background: var(--teal); color: #062626; border-color: var(--teal); }
.button-outline { background: transparent; }

.mode-panel { display: grid; grid-template-columns: minmax(190px, .8fr) minmax(0, 2fr); align-items: center; gap: 22px; margin-bottom: 19px; }
.mode-panel h2 { font-size: 19px; }
.mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 0; padding: 0; margin: 0; gap: 11px; }
.mode-option { position: relative; min-width: 0; }
.mode-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode-option span { display: block; border: 1px solid #46576b; background: #141f2e; border-radius: 13px; padding: 12px 14px; min-height: 77px; cursor: pointer; transition: border-color .16s, background .16s; }
.mode-option input:checked + span { border: 2px solid var(--teal); padding: 11px 13px; background: #193734; }
.mode-option input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 4px; }
.mode-option strong { font-size: 14px; display: block; }
.mode-option small { font-size: 12px; display: block; color: var(--muted); margin-top: 2px; }

.visual-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 19px; margin-bottom: 19px; }
.mix-content { display: flex; align-items: center; gap: clamp(18px, 3vw, 38px); }
.donut {
  --donut-fill: #3a4758;
  position: relative;
  width: min(50%, 270px);
  aspect-ratio: 1;
  flex: 0 0 auto;
  background: #3a4758;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px #314154, 0 13px 30px #0c152036;
}
.donut-inner {
  width: 71%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 5%;
  text-align: center;
}
.donut-inner span { font-size: 12px; color: var(--muted); }
.donut-inner strong { font-size: clamp(33px, 4.3vw, 58px); letter-spacing: -.065em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.donut-inner small { color: var(--muted); font-size: 11px; }
.mix-legend { display: flex; flex-direction: column; gap: 13px; min-width: 0; flex: 1; }
.mix-legend-item { display: grid; grid-template-columns: 11px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; min-width: 0; }
.mix-legend-item .legend-name { color: var(--muted); overflow-wrap: anywhere; }
.mix-legend-item strong { font-variant-numeric: tabular-nums; font-size: 15px; }
.legend-dot { width: 10px; height: 10px; border-radius: 4px; background: var(--role-color, var(--teal)); }

.impact-panel { display: flex; flex-direction: column; }
.move-story { font-size: clamp(17px, 2vw, 21px); line-height: 1.35; font-weight: 650; margin: 17px 0 5px; max-width: 520px; min-height: 48px; }
.move-note { color: var(--muted); font-size: 12px; margin: 0 0 16px; min-height: 19px; }
.baseline-bars { display: flex; flex-direction: column; gap: 11px; margin-top: auto; max-height: 270px; overflow: auto; }
.baseline-row { display: grid; grid-template-columns: minmax(100px, 1fr) 1.5fr 34px; align-items: center; gap: 10px; }
.baseline-row .role-name { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.baseline-row .role-value { font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.baseline-track { background: #111c2c; height: 15px; border-radius: 6px; position: relative; overflow: hidden; }
.baseline-track .today-bar { height: 100%; position: absolute; left: 0; top: 0; background: #596b80; opacity: .75; border-radius: 5px; }
.baseline-track .now-bar { height: 7px; position: absolute; left: 0; top: 4px; background: var(--role-color, var(--teal)); border-radius: 4px; }
.baseline-key { margin: 14px 0 0; font-size: 11px; color: var(--muted); }
.baseline-key span { display: inline-block; width: 15px; height: 7px; border-radius: 2px; vertical-align: middle; margin: 0 4px 1px 12px; }
.baseline-key span:first-child { margin-left: 0; }
.baseline-current { background: var(--teal); }
.baseline-original { background: #596b80; }

.budget-panel { margin-bottom: 29px; }
.budget-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 18px; }
.budget-totals { display: flex; gap: clamp(18px, 4vw, 45px); flex-wrap: wrap; }
.budget-totals span { text-align: right; }
.budget-totals small { display: block; color: var(--muted); font-size: 11px; font-weight: 650; }
.budget-totals strong { display: block; font-size: 23px; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.budget-meter { width: 100%; display: flex; overflow: hidden; border-radius: 9px; height: 30px; background: #3b4758; }
.budget-meter span { min-width: 0; height: 100%; transition: width .15s ease-out; }
.budget-legend { display: flex; gap: 9px 20px; flex-wrap: wrap; margin-top: 13px; }
.budget-legend .legend-item { color: var(--muted); font-size: 12px; }
.budget-legend .legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.budget-warning { margin: 14px 0 0; font-size: 13px; color: var(--warning); }
.budget-warning:empty { display: none; }

.allocation-section { margin-bottom: 22px; }
.allocation-section > .section-heading { margin: 0 0 17px; }
.hint-lock { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.hint-lock svg { width: 16px; height: 16px; }
/* Compact allocation cards: four visible side by side on wide screens. */
.role-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.allocation-card {
  --role-color: var(--teal);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--role-color);
  border-radius: 14px;
  padding: 13px 13px 12px;
  min-width: 0;
}
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.card-heading { display: flex; align-items: flex-start; gap: 9px; min-width: 0; flex: 1; }
.card-swatch { flex: none; width: 9px; height: 9px; border-radius: 3px; background: var(--role-color); margin-top: 7px; }
.card-text { flex: 1; min-width: 0; }
.card-name-button {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  border: 0; border-radius: 4px; padding: 0; background: transparent;
  color: var(--text); text-align: left; font-size: 15px; font-weight: 780;
  line-height: 1.35; cursor: text;
}
.card-name-button:hover .card-name-label { text-decoration: underline; text-decoration-color: var(--role-color); text-underline-offset: 3px; }
.card-name-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name-edit-mark { font-size: 13px; line-height: 1; opacity: .55; flex: none; }
.card-name-button:hover .name-edit-mark { opacity: 1; }
.card-name-input { width: 100%; padding: 3px 7px; font-size: 14px; line-height: 1.2; }
.card-name-input[hidden], .card-name-button[hidden] { display: none !important; }
.card-subtitle { font-size: 11px; color: var(--muted); margin: 1px 0 0; }
.lock-button {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px;
  background: #223146; border: 1px solid #43536b; border-radius: 9px; color: #b0c0d3;
}
.lock-button svg { width: 17px; height: 17px; }
.lock-button.is-locked { background: #213b37; color: var(--teal); border-color: var(--teal); }
.lock-button:hover { border-color: var(--teal); }
.card-main { display: flex; align-items: baseline; gap: 6px; margin: 8px 0 7px; }
.card-main .count-input {
  width: 4.5ch; max-width: 64%; padding: 0; border: 0; border-bottom: 1px solid transparent;
  border-radius: 0; background: transparent; color: var(--role-color);
  font-size: clamp(31px, 3vw, 39px); font-weight: 800; letter-spacing: -.045em;
  line-height: 1.1; font-variant-numeric: tabular-nums; appearance: textfield;
  -moz-appearance: textfield;
}
.card-main .count-input::-webkit-outer-spin-button,
.card-main .count-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.card-main .count-input:focus { border-color: var(--teal); }
.card-main .count-label { font-size: 11px; color: var(--muted); }
.role-slider { display: flex; align-items: center; gap: 7px; }
.role-slider input[type="range"] { min-width: 0; height: 25px; }
.role-step {
  flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center;
  font-size: 20px; line-height: 1; border: 1px solid #43556b; border-radius: 50%;
  background: #141f2e; color: var(--text); padding: 0;
}
.role-step:hover:not(:disabled) { border-color: var(--teal); }
.role-footer { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.role-footer .delta { color: var(--text); font-weight: 700; }
.role-footer span:last-child { white-space: nowrap; }
.role-warning { font-size: 11px; color: var(--warning); margin: 6px 0 0; }
.role-warning:empty { display: none; }

.assistant-panel, .scenario-panel, .settings-panel { margin-top: 19px; }
.assistant-panel { background: #172a33; border-color: #365e60; }
.assistant-panel > summary, .settings-panel > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.assistant-panel > summary::-webkit-details-marker, .settings-panel > summary::-webkit-details-marker { display: none; }
.details-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 11px; }
.details-title strong { font-size: 17px; }
.details-title small { font-size: 12px; color: var(--muted); }
.details-icon { font-size: 22px; color: var(--teal); line-height: 1; }
.details-action { color: var(--teal); white-space: nowrap; font-size: 13px; font-weight: 750; }
details[open] > summary .details-action span:last-child { display: inline-block; transform: rotate(180deg); }
.assistant-body, .settings-body { border-top: 1px solid #405365; margin-top: 20px; padding-top: 21px; }
.assistant-body > select { display: block; max-width: 440px; }
.assistant-body > .button { margin: 5px 9px 9px 0; }
.helper-text { font-size: 13px; color: var(--muted); margin: 10px 0 16px; max-width: 950px; }
.method-note { border-top: 1px solid #405365; padding-top: 12px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.method-note summary { cursor: pointer; font-weight: 700; color: #bdd7f5; }
.method-note p { margin: 10px 0 0; }

.scenario-save { display: flex; gap: 9px; max-width: 530px; }
.scenario-save input { flex: 1; }
.empty-message { font-size: 13px; color: var(--muted); margin: 22px 0 0; }
.scenario-gallery { margin-top: 19px; display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 13px; }
.scenario-tile { padding: 16px; border-radius: 13px; border: 1px solid #44546b; background: var(--surface-light); }
.scenario-name { font-size: 15px; font-weight: 750; margin-bottom: 9px; overflow-wrap: anywhere; }
.scenario-amounts { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.scenario-amounts span { display: flex; flex-direction: column; color: var(--muted); font-size: 11px; }
.scenario-amounts strong { color: var(--text); font-size: 17px; font-variant-numeric: tabular-nums; }
.scenario-visual { display: flex; width: 100%; height: 12px; background: #3b495b; overflow: hidden; border-radius: 6px; margin: 12px 0; }
.scenario-visual span { height: 100%; }
.scenario-note { font-size: 12px; color: var(--muted); min-height: 18px; }
.scenario-changes { font-size: 12px; color: var(--text); background: #142233; border-radius: 8px; padding: 9px 10px; margin-top: 9px; line-height: 1.45; }
.scenario-actions { display: flex; gap: 8px; margin-top: 9px; }
.scenario-actions button { padding: 5px 11px; border: 1px solid #586b80; border-radius: 7px; color: var(--text); background: transparent; font-size: 12px; }
.scenario-actions button:hover { border-color: var(--teal); }
.scenario-actions .delete-button { color: #ffb5b5; }
.comparison-details { margin-top: 18px; padding-top: 15px; border-top: 1px solid #384b60; }
.comparison-details summary { color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 700; }
.comparison-details .button { margin-top: 15px; }
.table-scroll { overflow: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
th, td { padding: 10px 12px; border-bottom: 1px solid #38485b; text-align: right; }
th:first-child, td:first-child { text-align: left; }
thead th { font-size: 12px; color: var(--muted); }
.current-column { color: var(--teal); }

.settings-details-icon { font-size: 22px; color: var(--teal); }
.budget-input-group { display: grid; max-width: 290px; gap: 7px; }
.budget-input-group label { font-size: 13px; color: var(--muted); font-weight: 750; }
.settings-role-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; flex-wrap: wrap; margin: 26px 0 15px; }
.heading-count { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.settings-role-list { display: grid; gap: 12px; }
.settings-role-card { border: 1px solid #41546c; background: #1d2b3d; border-radius: 13px; padding: 17px; }
.settings-role-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.settings-role-name { font-weight: 750; color: var(--text); }
.settings-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.settings-fields label { font-size: 12px; color: var(--muted); font-weight: 650; }
.settings-fields input, .settings-fields select { display: block; width: 100%; margin-top: 5px; }
.remove-type { background: transparent; border: 0; color: #ffb3b3; font-size: 12px; }
.data-actions { display: flex; gap: 11px; flex-wrap: wrap; align-items: center; margin-top: 23px; border-top: 1px solid #44566b; padding-top: 21px; }
.storage-warning { font-size: 12px; color: var(--warning); }

.footnotes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding: 26px 3px 33px; }
.footnotes p { margin: 0; font-size: 12px; color: var(--subtle); }
.footnotes strong { color: var(--muted); }
.footer { border-top: 1px solid #2b394c; padding: 25px 0 35px; color: var(--muted); font-size: 12px; }

@media (max-width: 980px) {
  .mode-panel { grid-template-columns: 1fr; gap: 14px; }
  .visual-grid { grid-template-columns: 1fr; }
  .donut { width: min(42%, 260px); }
}
@media (max-width: 680px) {
  .shell { padding: 0 16px; }
  .site-header { padding: 16px 0; }
  .intro { flex-direction: column; align-items: flex-start; gap: 19px; padding: 30px 0 24px; }
  h1 { font-size: 37px; }
  .panel { padding: 18px; }
  .mode-switch { grid-template-columns: 1fr; }
  .mode-option span { min-height: 0; }
  .mix-content { gap: 20px; }
  .donut { width: min(48%, 210px); }
  .donut-inner span { font-size: 11px; }
  .donut-inner strong { font-size: 38px; }
  .donut-inner small { font-size: 10px; }
  .mix-legend { gap: 9px; }
  .mix-legend-item { font-size: 12px; gap: 6px; }
  .budget-heading { align-items: flex-start; flex-direction: column; }
  .budget-totals { width: 100%; justify-content: space-between; }
  .budget-totals span { text-align: left; }
  .allocation-section > .section-heading { flex-direction: column; align-items: flex-start; }
  .role-cards { grid-template-columns: 1fr; }
  .settings-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scenario-save { flex-direction: column; }
  .footnotes { grid-template-columns: 1fr; gap: 12px; }
  .footer { align-items: flex-start; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}


/* Keep the charts, budget ribbon and four controls visible together. */
.site-header { padding: 12px 0; }
.intro { gap: 15px; padding: 20px 0 17px; }
h1 { font-size: clamp(29px, 3.8vw, 43px); margin: 0 0 7px; }
.intro-description { font-size: 14px; }
.panel { padding: 17px 19px; border-radius: 15px; }
h2 { font-size: 18px; }
.eyebrow, .section-kicker { margin-bottom: 5px; }
.mode-panel { gap: 15px; margin-bottom: 12px; }
.mode-panel h2 { font-size: 16px; }
.mode-switch { gap: 8px; }
.mode-option span { padding: 8px 11px; min-height: 0; }
.mode-option input:checked + span { padding: 7px 10px; }
.mode-option strong { font-size: 13px; }
.mode-option small { font-size: 11px; }
.visual-grid { gap: 12px; margin-bottom: 12px; }
.section-heading.compact-heading { margin-bottom: 10px; }
.mix-content { gap: 16px; }
.donut { width: min(37%, 160px); }
.donut-inner strong { font-size: clamp(27px, 3vw, 40px); }
.donut-inner span { font-size: 11px; }
.donut-inner small { font-size: 10px; }
.mix-legend { gap: 7px; }
.mix-legend-item { font-size: 12px; gap: 7px; }
.mix-legend-item strong { font-size: 13px; }
.move-story { font-size: 15px; min-height: 0; margin: 9px 0 5px; }
.move-note { margin-bottom: 9px; min-height: 0; }
.baseline-bars { gap: 6px; max-height: 175px; }
.baseline-row { gap: 7px; grid-template-columns: minmax(65px, 1fr) minmax(50px, 1.4fr) 31px; }
.baseline-track { height: 12px; }
.baseline-track .now-bar { height: 6px; top: 3px; }
.baseline-key { margin-top: 9px; }
.budget-panel { margin-bottom: 16px; }
.budget-heading { margin-bottom: 9px; }
.budget-totals strong { font-size: 19px; }
.budget-meter { height: 18px; }
.budget-legend { gap: 6px 14px; margin-top: 7px; }
.allocation-section { margin-bottom: 16px; }
.allocation-section > .section-heading { margin-bottom: 10px; }
.allocation-hint { font-size: 12px; color: var(--muted); margin: 3px 0 0; }
.hint-lock { font-size: 11px; }
.assistant-panel, .scenario-panel, .settings-panel { margin-top: 13px; }
.reset-area { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid #43556a; padding-top: 20px; margin-top: 22px; }
.reset-description strong { font-size: 14px; }
.reset-description p { margin: 4px 0; color: var(--muted); font-size: 12px; }
.button-danger { background: #432830; border: 1px solid #a05a68; color: #ffd5dd; flex: none; }
.button-danger:hover:not(:disabled) { background: #5a303b; }
.reset-feedback { color: var(--teal); font-size: 13px; margin: 9px 0 0; }
.reset-feedback:empty { display: none; }

@media (min-width: 1080px) {
  .role-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 550px) and (max-width: 1079px) {
  .role-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 550px) {
  .visual-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shell { padding: 0 14px; }
  .panel { padding: 14px; }
  .mode-panel { gap: 10px; }
  .intro { padding: 18px 0 16px; }
  .intro-description { font-size: 13px; }
  .mix-content { gap: 10px; }
  .mix-legend-item { gap: 5px; }
  .donut { width: min(41%, 145px); }
  .donut-inner strong { font-size: 30px; }
  .baseline-row { grid-template-columns: minmax(54px, 1fr) 1fr 27px; gap: 4px; }
  .baseline-row .role-name, .baseline-row .role-value { font-size: 11px; }
}
@media (max-width: 549px) {
  .visual-grid, .role-cards { grid-template-columns: 1fr; }
  .mode-switch { grid-template-columns: 1fr; }
  .intro { gap: 12px; }
  .intro-settings { font-size: 12px; }
  .budget-heading { flex-direction: column; }
  .budget-totals { justify-content: space-between; }
  .reset-area { flex-direction: column; align-items: flex-start; }
  .settings-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .donut { width: min(37%, 160px); }
}

.intro-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.button-reset-link { border: 1px solid #566173; background: transparent; color: var(--muted); padding: 10px 13px; }
.button-reset-link:hover:not(:disabled) { border-color: #bb7784; color: #ffd5dd; }
.reset-notice { margin: -5px 0 12px; color: var(--teal); font-size: 13px; }
.reset-notice[hidden] { display: none; }
@media (min-width: 550px) {
  .mode-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .budget-heading { flex-direction: row; align-items: end; }
}
@media (max-width: 760px) {
  .intro-actions { flex-wrap: wrap; }
  .intro-settings { font-size: 12px; }
}

/* Dashboard-first density: on a typical laptop the chart and four default
   categories should share the first viewport, without tiny controls. */
.site-header { padding: 10px 0; }
.intro { padding: 12px 0; }
h1 { font-size: clamp(28px, 3.3vw, 38px); margin-bottom: 4px; }
.eyebrow, .section-kicker { margin-bottom: 3px; }
.mode-panel { padding-top: 12px; padding-bottom: 12px; }
.mode-option span { padding-top: 6px; padding-bottom: 6px; }
.mode-option input:checked + span { padding-top: 5px; padding-bottom: 5px; }
.visual-grid .panel { padding-top: 13px; padding-bottom: 13px; }
.section-heading.compact-heading { margin-bottom: 6px; }
.budget-panel { padding-top: 12px; padding-bottom: 12px; margin-bottom: 12px; }
.budget-heading { margin-bottom: 6px; }
.budget-legend { margin-top: 5px; }
.allocation-section > .section-heading { margin-bottom: 7px; }
.allocation-card { padding: 11px 12px; }
.card-main { margin: 6px 0; }
.card-main .count-input { font-size: clamp(30px, 2.8vw, 36px); }
.role-footer { margin-top: 6px; }
@media (min-width: 1080px) {
  .donut { width: min(32%, 130px); }
  .donut-inner strong { font-size: 34px; }
}
@media (max-width: 1079px) and (min-width: 550px) {
  .donut { width: min(40%, 135px); }
}
