:root {
    --ink: #15241f;
    --ink-soft: #52605a;
    --forest: #173c30;
    --forest-light: #28644f;
    --sage: #dce6dd;
    --sage-bright: #e8eee7;
    --cream: #f4f1e8;
    --paper: #fbfaf5;
    --white: #ffffff;
    --line: #dcded5;
    --line-dark: #c8cec4;
    --gold: #d09a3d;
    --coral: #b9624b;
    --blue: #3d5a80;
    --shadow: 0 20px 60px rgba(21, 36, 31, 0.08);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 86% 7%, rgba(208, 154, 61, 0.09), transparent 23rem),
        var(--cream);
    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    color: inherit;
    font: inherit;
}

button,
select {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
}

a {
    color: inherit;
}

p,
h1,
h2,
h3,
dl,
dd {
    margin: 0;
}

h1:focus {
    outline: none;
}

.site-shell {
    width: min(1480px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: 0 32px;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 84px;
    border-bottom: 1px solid rgba(21, 36, 31, 0.14);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--forest);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.04em;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    color: var(--paper);
    background: var(--forest);
}

.brand-mark svg {
    width: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand-mark .brand-spark {
    stroke: var(--gold);
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4c9f75;
    box-shadow: 0 0 0 4px rgba(76, 159, 117, 0.12);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.6fr);
    gap: 80px;
    align-items: end;
    padding: 70px 4px 58px;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    color: var(--forest-light);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.eyebrow span {
    width: 26px;
    height: 1px;
    background: var(--gold);
}

.hero h1 {
    max-width: 820px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(48px, 6vw, 78px);
    font-weight: 500;
    letter-spacing: -0.055em;
    line-height: 0.97;
}

.hero h1 em {
    color: var(--forest-light);
    font-weight: 400;
}

.hero-copy {
    padding-bottom: 5px;
}

.hero-copy > p {
    max-width: 520px;
    color: var(--ink-soft);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    line-height: 1.55;
}

.hero-proof {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 24px;
    color: #637069;
    font-size: 12px;
    font-weight: 650;
}

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

.hero-proof .icon {
    width: 15px;
}

.workspace {
    display: grid;
    grid-template-columns: 430px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    padding-bottom: 64px;
}

.control-panel,
.results-panel {
    border: 1px solid rgba(21, 36, 31, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.control-panel {
    padding: 26px;
    background: var(--paper);
}

.results-panel {
    min-height: 920px;
    padding: 34px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
}

.panel-heading,
.results-heading,
.card-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.section-number,
.card-kicker {
    margin-bottom: 6px;
    color: var(--forest-light);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.panel-heading h2,
.results-heading h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 27px;
    font-weight: 600;
    letter-spacing: -0.035em;
}

.data-window,
.chart-unit {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink-soft);
    background: var(--white);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 24px;
    padding: 5px;
    border-radius: 14px;
    background: #e9e8df;
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 62px;
    padding: 10px 12px;
    border: 0;
    border-radius: 11px;
    text-align: left;
    background: transparent;
    transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

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

.mode-option.active {
    color: var(--forest);
    background: var(--white);
    box-shadow: 0 3px 12px rgba(21, 36, 31, 0.08);
}

.mode-option .icon {
    width: 21px;
    flex: 0 0 auto;
    color: var(--forest-light);
}

.mode-option span {
    display: grid;
    gap: 2px;
}

.mode-option strong {
    font-size: 13px;
}

.mode-option small {
    color: var(--ink-soft);
    font-size: 10px;
}

.control-section {
    margin-top: 26px;
}

.control-section + .control-section {
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.control-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--ink-soft);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.section-rule {
    height: 1px;
    flex: 1;
    background: var(--line);
}

.control-section-title strong {
    font-size: 11px;
    letter-spacing: 0;
}

.allocation-ok {
    color: var(--forest-light);
}

.allocation-bad {
    color: var(--coral);
}

.field-label {
    display: block;
    margin: 14px 0 7px;
    color: #4c5853;
    font-size: 11px;
    font-weight: 700;
}

.input-shell,
.select-shell {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line-dark);
    border-radius: var(--radius-sm);
    background: var(--white);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.input-shell:focus-within,
.select-shell:focus-within {
    border-color: var(--forest-light);
    box-shadow: 0 0 0 3px rgba(40, 100, 79, 0.12);
}

.input-shell input,
.select-shell select {
    width: 100%;
    min-width: 0;
    height: 42px;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font-size: 14px;
    font-weight: 650;
}

.money-input > span {
    padding-left: 14px;
    color: var(--ink-soft);
    font-size: 14px;
}

.money-input input {
    padding: 0 14px 0 7px;
}

.suffix-input input {
    padding-left: 14px;
}

.suffix-input span {
    padding: 0 14px 0 7px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 700;
}

.select-shell {
    position: relative;
}

.select-shell select {
    z-index: 1;
    appearance: none;
    padding: 0 38px 0 13px;
}

.select-shell .icon {
    position: absolute;
    right: 12px;
    width: 15px;
    pointer-events: none;
}

.field-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.75fr;
    gap: 10px;
}

.field-help {
    margin-top: 7px;
    color: #77817c;
    font-size: 10px;
    line-height: 1.5;
}

.strategy-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 11px;
    border-radius: 9px;
    color: #5d6a64;
    background: var(--sage-bright);
    font-size: 10px;
    line-height: 1.45;
}

.strategy-note .icon {
    width: 14px;
    flex: 0 0 auto;
    margin-top: 1px;
}

.range-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
}

.range-heading .field-label {
    margin: 0;
}

.range-heading output {
    color: var(--forest-light);
    font-size: 11px;
    font-weight: 800;
}

.range-input {
    width: 100%;
    height: 4px;
    margin: 15px 0 5px;
    border-radius: 999px;
    appearance: none;
    background: linear-gradient(90deg, var(--forest-light), var(--sage));
}

.range-input::-webkit-slider-thumb {
    width: 17px;
    height: 17px;
    border: 3px solid var(--white);
    border-radius: 50%;
    appearance: none;
    background: var(--forest);
    box-shadow: 0 1px 6px rgba(21, 36, 31, 0.28);
}

.range-input::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border: 3px solid var(--white);
    border-radius: 50%;
    background: var(--forest);
    box-shadow: 0 1px 6px rgba(21, 36, 31, 0.28);
}

.range-limits {
    display: flex;
    justify-content: space-between;
    color: #8b938f;
    font-size: 9px;
}

.preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 13px;
}

.preset-row button {
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #5e6863;
    background: var(--white);
    font-size: 9px;
    font-weight: 700;
}

.preset-row button:hover {
    color: var(--forest);
    border-color: #aab7ae;
}

.allocation-track {
    display: flex;
    width: 100%;
    height: 7px;
    margin-bottom: 13px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e3db;
}

.allocation-track span {
    min-width: 0;
    transition: width 200ms ease;
}

.holding-row {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) 70px 28px;
    gap: 9px;
    align-items: center;
    min-height: 51px;
    border-bottom: 1px solid #e6e6df;
}

.asset-dot,
.outcome-marker {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.holding-asset {
    display: grid;
    min-width: 0;
}

.holding-asset select {
    width: 100%;
    border: 0;
    outline: 0;
    appearance: none;
    overflow: hidden;
    text-overflow: ellipsis;
    background: transparent;
    font-size: 12px;
    font-weight: 750;
}

.holding-asset small {
    margin-top: 2px;
    overflow: hidden;
    color: #828a86;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weight-input {
    display: flex;
    align-items: center;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.weight-input input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    padding-left: 8px;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
}

.weight-input span {
    padding-right: 7px;
    color: #7d8581;
    font-size: 9px;
}

.icon-button {
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: #69736e;
    background: var(--white);
    transition: color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.icon-button:hover:not(:disabled) {
    color: var(--forest);
    border-color: #aab7ae;
    transform: translateY(-1px);
}

.icon-button:disabled {
    opacity: 0.35;
}

.icon-button .icon {
    width: 15px;
}

.remove-holding {
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
}

.remove-holding:hover:not(:disabled) {
    color: var(--coral);
    transform: none;
}

.asset-adder {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 13px;
}

.asset-adder .field-label {
    grid-column: 1 / -1;
    margin: 0;
}

.asset-adder .select-shell {
    min-height: 40px;
}

.asset-adder .select-shell select {
    height: 38px;
    font-size: 11px;
}

.add-holding {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 74px;
    padding: 0 13px;
    border: 1px solid #afbbb3;
    border-radius: var(--radius-sm);
    color: var(--forest-light);
    background: var(--white);
    font-size: 10px;
    font-weight: 800;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.add-holding:hover {
    transform: translateY(-1px);
    border-color: var(--forest-light);
    background: #f4f7f3;
}

.add-holding .icon {
    width: 14px;
}

.allocation-warning {
    margin-top: 9px;
    color: var(--coral);
    font-size: 10px;
    line-height: 1.45;
}

.uk-investor-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
    padding: 11px;
    border: 1px solid #d9e2da;
    border-radius: 10px;
    color: #5d6a64;
    background: #f0f4ef;
}

.uk-investor-tip .icon {
    width: 14px;
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--forest-light);
}

.uk-investor-tip p {
    font-size: 9.5px;
    line-height: 1.5;
}

.uk-investor-tip strong {
    color: var(--forest);
}

.advanced-settings,
.methodology-card {
    margin-top: 22px;
    border-top: 1px solid var(--line);
}

.advanced-settings summary,
.methodology-card summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 17px 0 4px;
    list-style: none;
    color: #59655f;
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
}

.advanced-settings summary::-webkit-details-marker,
.methodology-card summary::-webkit-details-marker {
    display: none;
}

.advanced-settings summary span,
.methodology-card summary span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.advanced-settings summary .icon,
.methodology-card summary .icon {
    width: 15px;
}

.advanced-settings summary > .icon,
.methodology-card summary > .icon {
    transition: transform 180ms ease;
}

.advanced-settings[open] summary > .icon,
.methodology-card[open] summary > .icon {
    transform: rotate(180deg);
}

.advanced-body {
    padding-bottom: 5px;
}

.compact-input {
    min-height: 40px;
}

.compact-input input {
    height: 38px;
}

.form-error {
    margin-top: 14px;
    padding: 11px 12px;
    border: 1px solid rgba(185, 98, 75, 0.25);
    border-radius: 9px;
    color: #8a4938;
    background: rgba(185, 98, 75, 0.08);
    font-size: 10px;
    line-height: 1.5;
}

.run-button,
.primary-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    margin-top: 20px;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    color: var(--white);
    background: var(--forest);
    box-shadow: 0 10px 24px rgba(23, 60, 48, 0.2);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.run-button:hover:not(:disabled),
.primary-button:hover {
    transform: translateY(-1px);
    background: #20513f;
    box-shadow: 0 13px 28px rgba(23, 60, 48, 0.24);
}

.run-button:disabled {
    opacity: 0.75;
}

.run-button .icon {
    width: 18px;
    color: var(--gold);
}

.run-button kbd {
    margin-left: auto;
    padding: 2px 6px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 5px;
    color: rgba(255, 255, 255, 0.7);
    font-family: inherit;
    font-size: 10px;
}

.button-spinner,
.large-spinner {
    border: 2px solid rgba(255, 255, 255, 0.28);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.button-spinner {
    width: 16px;
    height: 16px;
}

.results-heading {
    align-items: flex-end;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--line);
}

.results-heading > div:first-child > p:last-child {
    margin-top: 7px;
    color: var(--ink-soft);
    font-size: 12px;
}

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

.money-mode-tip {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid #d9e2da;
    border-radius: 12px;
    background: #f1f5f0;
}

.money-tip-icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 9px;
    color: var(--forest-light);
    background: var(--white);
}

.money-tip-icon .icon {
    width: 15px;
}

.money-mode-tip strong {
    display: block;
    color: var(--forest);
    font-size: 10px;
}

.money-mode-tip p {
    margin-top: 3px;
    color: #67736d;
    font-size: 9px;
    line-height: 1.45;
}

.money-mode-tip > span {
    padding: 6px 9px;
    border-radius: 999px;
    color: var(--forest-light);
    background: var(--white);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.value-toggle {
    display: flex;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f1f1eb;
}

.value-toggle button {
    padding: 7px 10px;
    border: 0;
    border-radius: 7px;
    color: #707a75;
    background: transparent;
    font-size: 9px;
    font-weight: 750;
}

.value-toggle button.active {
    color: var(--forest);
    background: var(--white);
    box-shadow: 0 2px 7px rgba(21, 36, 31, 0.08);
}

.rerun {
    flex: 0 0 auto;
}

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

.metric-card {
    position: relative;
    min-width: 0;
    min-height: 144px;
    padding: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--white);
}

.metric-card > p {
    margin: 16px 0 6px;
    overflow: hidden;
    color: #65706b;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.03em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.metric-card > strong,
.success-metric > strong {
    display: block;
    overflow: hidden;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(22px, 2.2vw, 30px);
    font-weight: 600;
    letter-spacing: -0.045em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-card > small {
    display: block;
    margin-top: 5px;
    color: #8a928e;
    font-size: 9px;
    line-height: 1.35;
}

.metric-icon {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border-radius: 8px;
    color: var(--forest-light);
    background: var(--sage-bright);
}

.metric-icon .icon {
    width: 15px;
}

.risk-icon {
    color: #8e6d31;
    background: #f4ead7;
}

.success-card {
    color: var(--white);
    border-color: var(--forest);
    background: var(--forest);
}

.success-card .metric-icon {
    color: var(--gold);
    background: rgba(255, 255, 255, 0.1);
}

.success-card > p,
.success-card > small {
    color: rgba(255, 255, 255, 0.66);
}

.success-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.success-ring {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--gold) var(--score), rgba(255, 255, 255, 0.14) 0);
}

.success-ring i {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--forest);
}

.chart-card {
    margin-top: 12px;
    padding: 22px 22px 16px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: var(--white);
}

.card-heading-row h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    letter-spacing: -0.025em;
}

.fan-chart-wrap {
    width: 100%;
    margin-top: 8px;
}

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

.chart-grid {
    stroke: #e5e7e0;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.chart-grid-vertical {
    stroke-dasharray: 3 6;
    opacity: 0.55;
}

.chart-axis,
.chart-tick {
    stroke: #aeb8b2;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.chart-axis-label {
    fill: #8a928e;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: 10px;
}

.chart-axis-title {
    fill: #5f6c66;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.04em;
}

.chart-band {
    stroke: none;
}

.chart-band-outer {
    fill: rgba(61, 90, 128, 0.09);
}

.chart-band-inner {
    fill: rgba(40, 100, 79, 0.16);
}

.chart-median {
    fill: none;
    stroke: var(--forest-light);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.chart-end-dot,
.chart-marker {
    fill: var(--paper);
    stroke: var(--forest-light);
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
}

.chart-marker {
    transition: r 140ms ease, fill 140ms ease;
}

.chart-marker:hover {
    r: 6px;
    fill: var(--gold);
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: -2px;
    color: #75807a;
    font-size: 9px;
    font-weight: 650;
}

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

.legend-line {
    width: 16px;
    height: 2px;
    background: var(--forest-light);
}

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

.legend-inner {
    background: rgba(40, 100, 79, 0.2);
}

.legend-outer {
    background: rgba(61, 90, 128, 0.12);
}

.outcomes-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--white);
}

.outcomes-grid article {
    position: relative;
    padding: 17px 18px;
}

.outcomes-grid article + article {
    border-left: 1px solid var(--line);
}

.outcomes-grid p {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #69736e;
    font-size: 9px;
    font-weight: 750;
    text-transform: uppercase;
}

.outcomes-grid strong {
    display: block;
    margin-top: 7px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 21px;
    letter-spacing: -0.035em;
}

.outcomes-grid small {
    display: block;
    margin-top: 3px;
    color: #8c9490;
    font-size: 9px;
}

.outcome-marker {
    display: inline-block;
}

.cautious {
    background: var(--gold);
}

.typical {
    background: var(--forest-light);
}

.strong {
    background: var(--blue);
}

.typical-outcome {
    background: #fafbf8;
}

.history-strip {
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) minmax(420px, 1.4fr);
    gap: 24px;
    align-items: center;
    margin-top: 12px;
    padding: 17px 19px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f1f3ed;
}

.history-strip .return-sense-check {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: -10px;
    color: #77817c;
    font-size: 8.5px;
    line-height: 1.4;
}

.return-sense-check .icon {
    width: 13px;
    flex: 0 0 auto;
}

.history-strip > div > p {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    font-weight: 600;
}

.history-strip small {
    display: block;
    margin-top: 3px;
    color: #7e8782;
    font-size: 9px;
}

.history-strip dl {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.history-strip dl div {
    padding-left: 12px;
    border-left: 1px solid #d8dbd3;
}

.history-strip dt {
    color: #7e8782;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
}

.history-strip dd {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 800;
}

.history-strip .headline-stat {
    border-left-color: var(--gold);
}

.history-strip .headline-stat dd {
    color: var(--forest);
}

.history-strip .real-return-stat dd {
    color: var(--forest-light);
}

.history-strip .negative {
    color: var(--coral);
}

.methodology-card {
    margin-top: 14px;
    padding: 0 2px;
}

.methodology-card summary {
    padding: 14px 0;
}

.methodology-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding: 5px 0 6px;
}

.uk-access-note {
    grid-column: 1 / -1;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f5f6f1;
}

.uk-access-note .source-links {
    margin-top: 9px;
    padding-top: 0;
}

.methodology-content h3 {
    margin-bottom: 6px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 14px;
}

.methodology-content p {
    color: #68736d;
    font-size: 10px;
    line-height: 1.6;
}

.source-links {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 4px;
}

.source-links a {
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--forest-light);
    background: var(--white);
    font-size: 9px;
    font-weight: 700;
    text-decoration: none;
}

.source-links a:hover {
    border-color: #aab7ae;
}

.results-loading {
    display: grid;
    min-height: 740px;
    place-content: center;
    justify-items: center;
    text-align: center;
}

.large-spinner {
    width: 42px;
    height: 42px;
    margin-bottom: 18px;
    color: var(--forest-light);
    border-color: var(--sage);
    border-top-color: currentColor;
}

.results-loading h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 25px;
}

.results-loading p {
    margin-top: 8px;
    color: var(--ink-soft);
    font-size: 12px;
}

.site-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
    padding: 32px 2px 42px;
    border-top: 1px solid rgba(21, 36, 31, 0.14);
}

.footer-brand {
    font-size: 20px;
}

.site-footer > div p,
.footer-note {
    margin-top: 5px;
    color: #77817c;
    font-size: 10px;
}

.footer-note {
    max-width: 470px;
    text-align: right;
    line-height: 1.5;
}

.not-found {
    display: grid;
    min-height: 65vh;
    place-content: center;
    justify-items: center;
    text-align: center;
}

.not-found h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 48px;
}

.not-found > p:not(.eyebrow) {
    margin: 12px 0 20px;
    color: var(--ink-soft);
}

.not-found .primary-button {
    width: auto;
    padding: 0 22px;
}

.app-loader {
    display: grid;
    min-height: 100vh;
    place-content: center;
    justify-items: center;
    background: var(--cream);
}

.loader-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--forest);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    font-weight: 700;
}

.loader-brand svg {
    width: 38px;
    padding: 6px;
    border-radius: 10px;
    fill: none;
    stroke: var(--paper);
    stroke-width: 1.8;
    stroke-linecap: round;
    background: var(--forest);
}

.loader-brand svg path:last-child {
    stroke: var(--gold);
}

.loader-track {
    width: 180px;
    height: 3px;
    margin-top: 22px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--sage);
}

.loader-track span {
    display: block;
    width: 45%;
    height: 100%;
    border-radius: inherit;
    background: var(--forest-light);
    animation: load-slide 1.2s ease-in-out infinite alternate;
}

.app-loader p {
    margin-top: 10px;
    color: var(--ink-soft);
    font-size: 10px;
}

#blazor-error-ui {
    position: fixed;
    z-index: 1000;
    right: 18px;
    bottom: 18px;
    display: none;
    max-width: 480px;
    padding: 14px 16px;
    border: 1px solid #d8a493;
    border-radius: 10px;
    color: #743d2f;
    background: #fff1ec;
    box-shadow: var(--shadow);
    font-size: 12px;
}

#blazor-error-ui a {
    margin-left: 8px;
    font-weight: 800;
}

#blazor-error-ui .dismiss {
    margin-left: 8px;
    border: 0;
    color: inherit;
    background: transparent;
    font-size: 0;
}

#blazor-error-ui .dismiss::after {
    content: "×";
    font-size: 18px;
}

.icon {
    display: block;
    width: 20px;
    height: 20px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(208, 154, 61, 0.45);
    outline-offset: 2px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes load-slide {
    from { transform: translateX(-10%); }
    to { transform: translateX(130%); }
}

@media (max-width: 1180px) {
    .workspace {
        grid-template-columns: 390px minmax(0, 1fr);
    }

    .control-panel,
    .results-panel {
        padding: 24px;
    }

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

    .history-strip {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .history-strip dl {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .site-shell {
        padding: 0 20px;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 52px 2px 42px;
    }

    .hero-copy > p {
        max-width: 650px;
    }

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

    .results-panel {
        min-height: auto;
    }
}

@media (max-width: 620px) {
    .site-shell {
        padding: 0 12px;
    }

    .site-header {
        min-height: 70px;
    }

    .header-meta {
        font-size: 0;
    }

    .header-meta::after {
        content: "Private";
        font-size: 11px;
    }

    .hero {
        padding-top: 40px;
    }

    .hero h1 {
        font-size: clamp(43px, 14vw, 62px);
    }

    .hero-copy > p {
        font-size: 17px;
    }

    .control-panel,
    .results-panel {
        padding: 18px;
        border-radius: 18px;
    }

    .field-grid {
        grid-template-columns: 1fr 0.75fr;
    }

    .results-heading {
        display: grid;
    }

    .results-actions {
        width: 100%;
    }

    .money-mode-tip {
        grid-template-columns: 30px minmax(0, 1fr);
    }

    .money-mode-tip > span {
        grid-column: 2;
        justify-self: start;
    }

    .value-toggle {
        flex: 1;
    }

    .value-toggle button {
        flex: 1;
    }

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

    .metric-card {
        min-height: 138px;
        padding: 13px;
    }

    .metric-card > strong,
    .success-metric > strong {
        font-size: 22px;
    }

    .chart-card {
        padding: 18px 8px 14px;
    }

    .card-heading-row {
        padding: 0 10px;
    }

    .chart-unit {
        display: none;
    }

    .fan-chart {
        min-height: 270px;
    }

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

    .outcomes-grid article + article {
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .history-strip dl {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .methodology-content {
        grid-template-columns: 1fr;
    }

    .uk-access-note {
        grid-column: auto;
    }

    .source-links {
        grid-column: auto;
    }

    .site-footer {
        display: grid;
    }

    .footer-note {
        text-align: left;
    }
}

.portfolio-profile-button {
    width: 23px;
    height: 23px;
    flex: 0 0 auto;
    border-color: transparent;
    border-radius: 5px;
    color: var(--ink-soft);
    background: transparent;
}

.portfolio-profile-button .icon {
    width: 14px;
}

.portfolio-profile-button:hover:not(:disabled) {
    border-color: transparent;
    color: var(--forest-light);
    background: rgba(86, 213, 164, 0.08);
}

.profile-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    padding: 20px;
    place-items: center;
    background: rgba(3, 7, 12, 0.76);
    backdrop-filter: blur(4px);
}

.profile-modal {
    width: min(680px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border: 1px solid var(--line-dark);
    border-radius: 10px;
    color: var(--ink);
    background: var(--paper);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.profile-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 18px 15px;
    border-bottom: 1px solid var(--line);
}

.profile-modal-header h2 {
    font-size: 15px;
    font-weight: 750;
    letter-spacing: -0.015em;
}

.profile-modal-header p {
    margin-top: 4px;
    color: var(--ink-soft);
    font-size: 9px;
}

.profile-modal-close {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border-color: transparent;
    background: transparent;
}

.profile-modal-close .icon {
    width: 15px;
}

.profile-modal-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 16px 18px;
}

.profile-modal-metrics > div {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-muted);
}

.profile-modal-metrics dt {
    color: var(--ink-soft);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.profile-modal-metrics dd {
    margin-top: 5px;
    font-size: 18px;
    font-weight: 720;
    font-variant-numeric: tabular-nums;
}

.profile-modal-metrics .headline-stat dd,
.profile-modal-metrics .real-return-stat dd {
    color: var(--forest-light);
}

.profile-modal-metrics .negative-stat dd {
    color: var(--coral);
}

.profile-modal-note {
    margin: 0 18px 18px;
    padding-top: 13px;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 9px;
    line-height: 1.5;
}

@media (max-width: 620px) {
    .profile-modal-backdrop {
        padding: 10px;
    }

    .profile-modal {
        max-height: calc(100vh - 20px);
    }

    .profile-modal-header,
    .profile-modal-metrics {
        padding-right: 14px;
        padding-left: 14px;
    }

    .profile-modal-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .profile-modal-note {
        margin-right: 14px;
        margin-left: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Compact finance dashboard */

:root {
    --ink: #e6edf3;
    --ink-soft: #95a3b3;
    --forest: #38c793;
    --forest-light: #63d9ae;
    --sage: #263743;
    --sage-bright: #17252b;
    --cream: #0d1117;
    --paper: #131a23;
    --white: #1a2430;
    --line: #293544;
    --line-dark: #3a495b;
    --surface-muted: #101720;
    --surface-deep: #0a0f16;
    --surface-raised: #202b38;
    --gold: #dca95d;
    --coral: #ef826e;
    --blue: #78a7d7;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.42), 0 12px 30px rgba(0, 0, 0, 0.12);
    --radius-lg: 10px;
    --radius-md: 8px;
    --radius-sm: 6px;
    color-scheme: dark;
}

body {
    background:
        radial-gradient(circle at 86% -8%, rgba(91, 139, 190, 0.11), transparent 32rem),
        var(--cream);
}

.site-shell {
    width: min(1560px, 100%);
    padding: 0 24px;
}

.site-header {
    min-height: 58px;
    border-bottom-color: var(--line);
}

.brand {
    gap: 8px;
    color: var(--ink);
    font-family: inherit;
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -0.02em;
}

.brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--white);
    background: var(--forest);
}

.brand-mark svg {
    width: 21px;
}

.brand-context {
    margin-left: 4px;
    padding-left: 12px;
    border-left: 1px solid var(--line-dark);
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 550;
    letter-spacing: 0;
}

.header-meta {
    gap: 7px;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 600;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--forest-light);
    box-shadow: none;
}

.workspace {
    grid-template-columns: 388px minmax(0, 1fr);
    gap: 14px;
    margin-top: 14px;
    padding-bottom: 30px;
}

.control-panel,
.results-panel {
    border-color: var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.control-panel {
    padding: 18px;
    background: var(--paper);
}

.results-panel {
    min-height: 760px;
    padding: 20px;
    background: var(--paper);
    backdrop-filter: none;
}

.panel-heading,
.results-heading,
.card-heading-row {
    align-items: center;
}

.panel-heading h2,
.results-heading h2 {
    font-family: inherit;
    font-size: 16px;
    font-weight: 720;
    letter-spacing: -0.015em;
}

.data-window,
.chart-unit {
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--ink-soft);
    background: transparent;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0;
}

.mode-switch {
    gap: 3px;
    margin-top: 14px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-muted);
}

.mode-option {
    justify-content: center;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 5px;
    text-align: center;
}

.mode-option:hover {
    transform: none;
    background: rgba(86, 213, 164, 0.07);
}

.mode-option.active {
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.42);
}

.mode-option strong {
    font-size: 11px;
    font-weight: 700;
}

.return-model-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-deep);
}

.return-model-option {
    min-height: 31px;
    padding: 6px 7px;
    border: 0;
    border-radius: 4px;
    color: var(--ink-soft);
    background: transparent;
    font-size: 9px;
    font-weight: 650;
}

.return-model-option:hover {
    color: var(--ink);
    background: rgba(86, 213, 164, 0.07);
}

.return-model-option.active {
    color: var(--forest-light);
    background: var(--white);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.42);
}

.return-model-fields {
    margin-top: 0;
}

.portfolio-section .return-model-switch {
    margin-bottom: 1px;
}

.return-model-value {
    color: var(--forest-light);
    white-space: nowrap;
}

.historical-sampling {
    margin-top: 10px;
}

.historical-sampling .field-label {
    margin-top: 0;
}

.portfolio-section .preset-row {
    margin-top: 12px;
}

.control-section {
    margin-top: 18px;
}

.control-section + .control-section {
    padding-top: 18px;
}

.control-section-title {
    gap: 8px;
    margin-bottom: 10px;
    color: var(--ink-soft);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.09em;
}

.control-section-title strong {
    font-size: 10px;
}

.field-label {
    margin: 11px 0 5px;
    color: var(--ink-soft);
    font-size: 10px;
    font-weight: 650;
}

.input-shell,
.select-shell {
    min-height: 38px;
    border-radius: var(--radius-sm);
}

.input-shell input,
.select-shell select {
    height: 36px;
    font-size: 12px;
    font-weight: 600;
}

.money-input > span {
    padding-left: 11px;
    font-size: 12px;
}

.money-input input {
    padding: 0 11px 0 6px;
}

.suffix-input input {
    padding-left: 11px;
}

.suffix-input span {
    padding: 0 11px 0 5px;
    font-size: 10px;
}

.select-shell select {
    padding: 0 32px 0 11px;
}

.select-shell .icon {
    right: 10px;
    width: 13px;
}

.field-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.field-help {
    margin-top: 6px;
    color: var(--ink-soft);
    font-size: 9px;
    line-height: 1.45;
}

.strategy-note {
    gap: 6px;
    margin-top: 8px;
    padding: 0;
    border-radius: 0;
    color: var(--ink-soft);
    background: transparent;
    font-size: 9px;
    line-height: 1.45;
}

.strategy-note .icon {
    width: 12px;
}

.range-heading {
    margin-top: 13px;
}

.range-heading output {
    color: var(--forest-light);
    font-size: 10px;
}

.range-input {
    height: 3px;
    margin: 13px 0 4px;
    background: linear-gradient(90deg, var(--forest-light), var(--sage));
}

.range-input::-webkit-slider-thumb {
    width: 15px;
    height: 15px;
    border-width: 2px;
    background: var(--forest-light);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.range-input::-moz-range-thumb {
    width: 11px;
    height: 11px;
    border-width: 2px;
    background: var(--forest-light);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.range-limits {
    font-size: 8px;
}

.preset-row {
    gap: 5px;
    margin-bottom: 10px;
}

.preset-row button {
    padding: 5px 7px;
    border-radius: 5px;
    color: var(--ink-soft);
    font-size: 8px;
    font-weight: 650;
}

.allocation-track {
    height: 5px;
    margin-bottom: 8px;
    border-radius: 2px;
}

.holding-row {
    grid-template-columns: 7px minmax(0, 1fr) 62px 25px;
    gap: 7px;
    min-height: 43px;
}

.holding-asset select {
    font-size: 11px;
    font-weight: 650;
}

.holding-asset small {
    font-size: 8px;
}

.weight-input {
    height: 28px;
    border-radius: 5px;
}

.weight-input input {
    padding-left: 7px;
    font-size: 10px;
}

.weight-input span {
    padding-right: 6px;
    font-size: 8px;
}

.icon-button {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.icon-button:hover:not(:disabled) {
    transform: none;
}

.remove-holding {
    width: 25px;
    height: 25px;
}

.asset-adder {
    gap: 7px;
    margin-top: 10px;
}

.asset-adder .select-shell {
    min-height: 36px;
}

.asset-adder .select-shell select {
    height: 34px;
    font-size: 10px;
}

.add-holding {
    min-width: 62px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 9px;
}

.add-holding:hover {
    transform: none;
}

.advanced-settings,
.methodology-card {
    margin-top: 17px;
}

.advanced-settings summary,
.methodology-card summary {
    padding: 13px 0 2px;
    color: var(--ink-soft);
    font-size: 10px;
    font-weight: 700;
}

.advanced-settings summary .icon,
.methodology-card summary .icon {
    width: 13px;
}

.compact-input,
.asset-adder .select-shell {
    min-height: 36px;
}

.compact-input input {
    height: 34px;
}

.form-error {
    margin-top: 11px;
    padding: 9px 10px;
    border-radius: 6px;
    font-size: 9px;
}

.run-button,
.primary-button {
    min-height: 41px;
    margin-top: 15px;
    border-radius: 6px;
    box-shadow: none;
    font-size: 11px;
    font-weight: 700;
}

.run-button:hover:not(:disabled),
.primary-button:hover {
    transform: none;
    background: #48c992;
    box-shadow: none;
}

.results-heading {
    align-items: center;
    padding-bottom: 14px;
}

.results-heading > div:first-child > p:last-child {
    margin-top: 3px;
    color: var(--ink-soft);
    font-size: 10px;
}

.results-actions {
    gap: 6px;
}

.value-toggle {
    padding: 2px;
    border-radius: 6px;
    background: var(--surface-muted);
}

.value-option {
    position: relative;
    display: flex;
}

.value-toggle button {
    padding: 6px 9px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 650;
}

.value-toggle button.active {
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.42);
}

.value-tooltip {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    right: 0;
    width: 230px;
    padding: 8px 9px;
    border: 1px solid var(--line-dark);
    border-radius: 5px;
    color: var(--ink);
    background: var(--surface-raised);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
    font-size: 9px;
    font-weight: 500;
    line-height: 1.45;
    text-align: left;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity 120ms ease, transform 120ms ease;
}

.value-option:hover .value-tooltip,
.value-option:focus-within .value-tooltip {
    opacity: 1;
    transform: translateY(0);
}

.rerun {
    width: 31px;
    height: 31px;
}

.metric-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    margin-top: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.metric-card {
    min-height: 82px;
    padding: 13px 14px;
    border: 0;
    border-radius: 0;
    background: var(--white);
}

.metric-card + .metric-card {
    border-left: 1px solid var(--line);
}

.metric-card > p {
    margin: 0 0 9px;
    color: var(--ink-soft);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.metric-card > strong,
.success-metric > strong {
    color: var(--ink);
    font-family: inherit;
    font-size: clamp(18px, 1.8vw, 24px);
    font-weight: 700;
    letter-spacing: -0.035em;
    font-variant-numeric: tabular-nums;
}

.success-card {
    color: var(--ink);
    border-color: transparent;
    background: var(--sage-bright);
}

.success-card > p {
    color: var(--forest-light);
}

.success-card > strong {
    color: var(--forest);
}

.chart-card {
    margin-top: 12px;
    padding: 15px 16px 12px;
    border-radius: 8px;
}

.card-heading-row h3 {
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.fan-chart-wrap {
    margin-top: 2px;
}

.chart-grid {
    stroke: var(--line);
}

.chart-axis,
.chart-tick {
    stroke: #465950;
}

.chart-axis-label,
.chart-axis-title {
    fill: var(--ink-soft);
    font-family: inherit;
    font-size: 9px;
}

.chart-axis-title {
    font-weight: 650;
    letter-spacing: 0.02em;
}

.chart-band-outer {
    fill: rgba(120, 167, 215, 0.18);
}

.chart-band-inner {
    fill: rgba(86, 213, 164, 0.24);
}

.chart-median {
    stroke: var(--forest-light);
    stroke-width: 2;
}

.chart-end-dot,
.chart-marker {
    fill: var(--white);
    stroke-width: 2;
}

.chart-legend {
    gap: 14px;
    color: var(--ink-soft);
    font-size: 8px;
    font-weight: 600;
}

.history-strip {
    display: block;
    margin-top: 12px;
    padding: 14px 15px;
    border-radius: 8px;
    background: var(--surface-muted);
}

.history-strip > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 11px;
    border-bottom: 1px solid var(--line);
}

.history-strip > div > p {
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
}

.history-strip small {
    margin-top: 0;
    font-size: 8px;
}

.history-strip dl {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    padding-top: 12px;
}

.history-strip dl div {
    padding: 0 10px;
    border-left-color: var(--line);
}

.history-strip dl div:first-child {
    padding-left: 0;
    border-left: 0;
}

.history-strip dt {
    font-size: 7px;
    letter-spacing: 0.04em;
}

.history-strip dd {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.methodology-card {
    padding: 0;
}

.methodology-card summary {
    padding: 12px 0;
}

.methodology-content {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 3px 0 8px;
}

.methodology-content h3 {
    margin-bottom: 4px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
}

.methodology-content p {
    color: var(--ink-soft);
    font-size: 9px;
    line-height: 1.5;
}

.source-links {
    gap: 12px;
    padding-top: 2px;
}

.source-links a {
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--forest-light);
    background: transparent;
    font-size: 8px;
    font-weight: 650;
    text-decoration: underline;
    text-decoration-color: rgba(86, 213, 164, 0.45);
    text-underline-offset: 2px;
}

.results-loading {
    min-height: 600px;
}

.large-spinner {
    width: 26px;
    height: 26px;
    margin-bottom: 10px;
}

.results-loading p {
    margin-top: 0;
    font-size: 10px;
}

.site-footer {
    align-items: center;
    justify-content: flex-start;
    padding: 18px 2px 24px;
    border-top-color: var(--line);
    color: var(--ink-soft);
    font-size: 10px;
}

.footer-note {
    max-width: none;
    margin-top: 0;
    font-size: 9px;
    text-align: left;
}

.loader-brand {
    color: var(--ink);
    font-family: inherit;
    font-size: 20px;
}

.loader-brand svg {
    width: 30px;
    border-radius: 6px;
}

.loader-track {
    margin-top: 16px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline-color: rgba(86, 213, 164, 0.65);
}

/* Always-dark surface and state corrections */

::selection {
    color: #07110d;
    background: var(--forest-light);
}

input,
select,
button {
    color-scheme: dark;
}

select option {
    color: var(--ink);
    background: var(--white);
}

.range-limits,
.holding-asset small,
.weight-input span,
.icon-button,
.outcomes-grid p,
.outcomes-grid small,
.history-strip .return-sense-check,
.history-strip small,
.history-strip dt,
.metric-card > small,
.site-footer > div p,
.footer-note {
    color: var(--ink-soft);
}

.allocation-track {
    background: var(--surface-deep);
}

.holding-row {
    border-bottom-color: var(--line);
}

.preset-row button:hover,
.icon-button:hover:not(:disabled),
.source-links a:hover {
    border-color: var(--forest-light);
}

.add-holding {
    border-color: var(--line-dark);
}

.add-holding:hover {
    background: var(--sage-bright);
}

.uk-investor-tip,
.money-mode-tip,
.uk-access-note {
    border-color: var(--line);
    color: var(--ink-soft);
    background: var(--surface-muted);
}

.uk-investor-tip strong,
.money-mode-tip strong {
    color: var(--forest-light);
}

.money-mode-tip p {
    color: var(--ink-soft);
}

.risk-icon {
    color: var(--gold);
    background: rgba(226, 170, 82, 0.12);
}

.typical-outcome {
    background: var(--surface-muted);
}

.methodology-content p {
    color: var(--ink-soft);
}

.form-error,
#blazor-error-ui {
    border-color: rgba(239, 130, 110, 0.38);
    color: #ffad9e;
    background: #2a1816;
}

@media (max-width: 1250px) {
    .workspace {
        grid-template-columns: 360px minmax(0, 1fr);
    }
}

@media (max-width: 1050px) {
    .site-shell {
        padding: 0 16px;
    }

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

    .control-panel,
    .results-panel {
        padding: 18px;
    }

}

@media (max-width: 760px) {
    .history-strip dl {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: 12px;
    }

    .history-strip dl div:nth-child(4) {
        padding-left: 0;
        border-left: 0;
    }

    .methodology-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .site-shell {
        padding: 0 10px;
    }

    .site-header {
        min-height: 52px;
    }

    .brand-context {
        display: none;
    }

    .control-panel,
    .results-panel {
        padding: 14px;
        border-radius: 8px;
    }

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

    .results-heading {
        display: flex;
        align-items: flex-start;
    }

    .results-heading > div:first-child > p:last-child {
        max-width: 190px;
        line-height: 1.4;
    }

    .results-actions {
        width: auto;
    }

    .value-toggle {
        flex: none;
    }

    .value-toggle button {
        flex: none;
        padding: 6px 7px;
    }

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

    .metric-card:nth-child(3),
    .metric-card:nth-child(5) {
        border-left: 0;
    }

    .metric-card:nth-child(3) {
        border-top: 1px solid var(--line);
    }

    .metric-card:nth-child(4) {
        border-left: 1px solid var(--line);
        border-top: 1px solid var(--line);
    }

    .metric-card:nth-child(5) {
        border-top: 1px solid var(--line);
    }

    .metric-card {
        min-height: 75px;
        padding: 11px;
    }

    .metric-card > strong,
    .success-metric > strong {
        font-size: 20px;
    }

    .chart-card {
        padding: 13px 10px 10px;
    }

    .fan-chart-wrap {
        overflow-x: auto;
    }

    .fan-chart {
        min-width: 620px;
        min-height: 0;
    }

    .chart-unit {
        display: block;
    }

    .history-strip > div {
        display: block;
    }

    .history-strip small {
        margin-top: 3px;
    }

    .history-strip dl {
        grid-template-columns: 1fr 1fr;
    }

    .history-strip dl div:nth-child(3),
    .history-strip dl div:nth-child(5) {
        padding-left: 0;
        border-left: 0;
    }

    .history-strip dl div:nth-child(4) {
        padding-left: 10px;
        border-left: 1px solid var(--line);
    }

    .site-footer {
        display: block;
    }

    .footer-note {
        text-align: left;
    }
}
