/* ============================================================
   /calculators — platform design system.
   No more editorial cream-paper experiment: this file now uses
   the same brand tokens, fonts, radii and shadows as the rest
   of Финсабат (site-polish.css + home-redesign.css).
   The HTML structure (ed-* classes) is preserved so the blade
   doesn't need to change; only the visual language is unified.
   ============================================================ */

.calc-page {
    position: relative;
    background:
        radial-gradient(circle at 8% -6%, rgba(36, 187, 140, .12), transparent 40%),
        radial-gradient(circle at 92% 8%, rgba(74, 200, 174, .08), transparent 38%),
        var(--brand-tint, #f0faf7);
    color: var(--ink);
    padding-block: var(--section-space, clamp(3rem, 2rem + 4vw, 6rem));
    overflow-x: hidden;
}

html[data-theme="dark"] .calc-page {
    background: #0c1812;
}

.calc-page > .container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
}

/* ============================================================
   Masthead — clean centered header (matches home-redesign hero)
   ============================================================ */
.ed-masthead {
    max-width: 760px;
    margin: 0 auto var(--space-12, 3rem);
    text-align: center;
}

.ed-masthead-row {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3, .75rem);
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(36, 187, 140, .22);
    border-radius: var(--radius-pill, 999px);
    padding: .35rem .9rem;
    font-family: 'Manrope', sans-serif;
    font-size: var(--text-xs, .75rem);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--brand-strong);
    font-weight: 700;
    margin-bottom: var(--space-5, 1.25rem);
    backdrop-filter: blur(6px);
}

html[data-theme="dark"] .ed-masthead-row {
    background: rgba(15, 26, 21, .85);
}

.ed-masthead-row .col {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.ed-masthead-row .dot {
    width: 6px;
    height: 6px;
    background: var(--brand);
    border-radius: 50%;
    display: inline-block;
}

.ed-issue { color: var(--brand-deep); font-weight: 800; }

.ed-headline {
    font-family: 'Manrope', sans-serif;
    font-style: normal;
    font-weight: 800;
    font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem);
    line-height: 1.1;
    letter-spacing: -.02em;
    color: var(--ink);
    margin: 0 auto var(--space-4, 1rem);
    max-width: 720px;
    text-align: center;
    overflow-wrap: anywhere;
}

.ed-headline em {
    font-style: normal;
    color: var(--brand);
    border-bottom: 0;
}

.ed-lede {
    font-family: 'Manrope', sans-serif;
    font-size: var(--text-lg, 1.125rem);
    line-height: 1.6;
    color: var(--body);
    max-width: 620px;
    margin: 0 auto var(--space-5, 1.25rem);
    text-align: center;
}

.ed-lede::first-letter {
    /* no drop cap — match platform body text style */
    font-size: inherit;
    color: inherit;
    float: none;
    padding: 0;
    margin: 0;
}

.ed-byline {
    font-family: 'Manrope', sans-serif;
    font-size: var(--text-xs, .75rem);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.ed-byline strong { color: var(--ink); font-weight: 700; }

/* ============================================================
   Tab navigation — pill cards in a row, matches mini-calc grid
   ============================================================ */
.ed-nav {
    max-width: 1180px;
    margin: 0 auto var(--space-8, 2rem);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3, .75rem);
    border-top: 0;
    border-bottom: 0;
    background: transparent;
}

.ed-nav.ed-nav-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 1100px) {
    .ed-nav,
    .ed-nav.ed-nav-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 680px) {
    .ed-nav,
    .ed-nav.ed-nav-6 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
    .ed-nav,
    .ed-nav.ed-nav-6 { grid-template-columns: 1fr; }
}

.ed-nav-item {
    background: var(--surface, #fff);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-align: left;
    padding: var(--space-4, 1rem);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    color: var(--ink);
    font: inherit;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    box-shadow: var(--shadow);
}

html[data-theme="dark"] .ed-nav-item {
    background: #161e1b;
    border-color: #243430;
}

.ed-nav-item::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), var(--brand-bright));
    opacity: 0;
    transition: opacity .2s ease;
}

.ed-nav-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(36, 187, 140, .35);
}

.ed-nav-item.is-active {
    border-color: var(--brand);
    background: var(--brand-tint);
}

html[data-theme="dark"] .ed-nav-item.is-active {
    background: rgba(36, 187, 140, .08);
}

.ed-nav-item.is-active::before { opacity: 1; }

.ed-nav-num {
    font-family: 'Manrope', sans-serif;
    font-size: var(--text-xs, .75rem);
    font-weight: 800;
    letter-spacing: .12em;
    color: var(--brand);
    padding: .2rem .55rem;
    background: var(--brand-tint);
    border-radius: 6px;
    display: inline-block;
    margin-bottom: var(--space-3, .75rem);
}

html[data-theme="dark"] .ed-nav-num {
    background: #122119;
    color: var(--brand-bright);
}

.ed-nav-title {
    font-family: 'Manrope', sans-serif;
    font-style: normal;
    font-size: var(--text-lg, 1.125rem);
    font-weight: 800;
    color: var(--ink);
    line-height: 1.2;
    letter-spacing: -.01em;
    margin-bottom: .25rem;
    display: block;
}

.ed-nav-item.is-active .ed-nav-title { font-style: normal; }

.ed-nav-hint {
    font-family: 'Manrope', sans-serif;
    font-size: var(--text-sm, .875rem);
    color: var(--muted);
    line-height: 1.45;
    display: block;
}

/* ============================================================
   Article grid — form on the left, sticky result on the right
   ============================================================ */
.ed-article {
    display: none;
    max-width: 1180px;
    margin: 0 auto;
}

.ed-article.is-active { display: block; }

.ed-article-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: var(--space-8, 2rem);
    align-items: flex-start;
}

.ed-article-rule { display: none; }

@media (max-width: 991px) {
    .ed-article-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6, 1.5rem);
    }
}

/* ============================================================
   Form side — single card
   ============================================================ */
.ed-form-side {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--space-8, 2rem);
}

html[data-theme="dark"] .ed-form-side {
    background: #161e1b;
    border-color: #243430;
}

.ed-form-side .ed-section-head {
    padding-bottom: var(--space-5, 1.25rem);
    margin-bottom: var(--space-6, 1.5rem);
    border-bottom: 1px solid var(--line);
}

.ed-kicker {
    font-family: 'Manrope', sans-serif;
    font-size: var(--text-xs, .75rem);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--brand);
    font-weight: 800;
    display: inline-block;
    padding: .25rem .55rem;
    background: var(--brand-tint);
    border-radius: 6px;
    margin-bottom: var(--space-3, .75rem);
}

.ed-kicker::before,
.ed-kicker::after { display: none; }

html[data-theme="dark"] .ed-kicker {
    background: #122119;
    color: var(--brand-bright);
}

.ed-form-side h2 {
    font-family: 'Manrope', sans-serif;
    font-style: normal;
    font-weight: 800;
    font-size: var(--text-2xl, clamp(1.4rem, 1.1rem + .8vw, 1.65rem));
    line-height: 1.2;
    color: var(--ink);
    margin: 0 0 var(--space-2, .5rem);
    letter-spacing: -.015em;
    overflow-wrap: anywhere;
}

.ed-form-side .ed-subhead {
    font-family: 'Manrope', sans-serif;
    color: var(--body);
    line-height: 1.55;
    font-size: var(--text-sm, .875rem);
    margin: 0;
}

/* ============================================================
   Form fields — match the platform input style
   ============================================================ */
.ed-field {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-2, .5rem);
    padding-block: var(--space-4, 1rem);
    border-bottom: 1px solid var(--line);
}

.ed-field:last-of-type { border-bottom: 0; }

.ed-field-label {
    font-family: 'Manrope', sans-serif;
    font-size: var(--text-xs, .75rem);
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.ed-field-hint {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .68rem;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 50%;
    cursor: help;
    font-weight: 700;
    transition: all .15s ease;
}

.ed-field-hint:hover { color: var(--brand); border-color: var(--brand); }

/* The input row — flex with suffix; brand focus ring */
.ed-field-input {
    display: flex;
    align-items: center;
    gap: var(--space-2, .5rem);
    background: var(--off, #fbfafa);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm, 10px);
    padding: var(--space-2, .5rem) var(--space-4, 1rem);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.ed-field-input:focus-within {
    border-color: var(--brand);
    background: #fff;
    box-shadow: var(--ring);
}

html[data-theme="dark"] .ed-field-input {
    background: #101714;
    border-color: #243430;
}

html[data-theme="dark"] .ed-field-input:focus-within {
    background: #0c1310;
}

.ed-field-input input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    outline: 0;
    padding: 0;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: var(--text-lg, 1.125rem);
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    appearance: textfield;
    -moz-appearance: textfield;
    min-height: 36px;
}

.ed-field-input input::-webkit-outer-spin-button,
.ed-field-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

html[data-theme="dark"] .ed-field-input input { color: var(--ink); }

.ed-field-input .suffix {
    font-family: 'Manrope', sans-serif;
    font-size: var(--text-xs, .75rem);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}

.ed-field-slider {
    padding-top: var(--space-2, .5rem);
}

.ed-field-slider input[type="range"] {
    width: 100%;
    appearance: none;
    background: transparent;
    cursor: pointer;
    height: 18px;
    margin: 0;
    accent-color: var(--brand);
}

.ed-field-slider input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: var(--line);
    border-radius: var(--radius-pill, 999px);
}

.ed-field-slider input[type="range"]::-moz-range-track {
    height: 4px;
    background: var(--line);
    border-radius: var(--radius-pill, 999px);
}

.ed-field-slider input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--brand);
    border: 3px solid #fff;
    border-radius: 50%;
    margin-top: -7px;
    box-shadow: 0 1px 3px rgba(20, 40, 32, .25);
    transition: transform .15s ease;
}

.ed-field-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.ed-field-slider input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--brand);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(20, 40, 32, .25);
    transition: transform .15s ease;
}

.ed-field-slider input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.15);
}

.ed-range-labels {
    display: flex;
    justify-content: space-between;
    font-family: 'Manrope', sans-serif;
    font-size: var(--text-xs, .75rem);
    color: var(--muted);
    margin-top: var(--space-1, .25rem);
    font-weight: 500;
}

/* ============================================================
   Segmented control — pill switch
   ============================================================ */
.ed-seg {
    display: inline-flex;
    background: var(--brand-tint);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill, 999px);
    padding: 4px;
    margin-bottom: var(--space-5, 1.25rem);
    gap: 0;
}

.ed-seg input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ed-seg label {
    font-family: 'Manrope', sans-serif;
    font-size: var(--text-sm, .875rem);
    font-weight: 700;
    color: var(--body);
    padding: .45rem 1rem;
    cursor: pointer;
    transition: all .15s ease;
    background: transparent;
    border-radius: var(--radius-pill, 999px);
    margin: 0;
}

.ed-seg input:checked + label {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 2px 8px rgba(36, 187, 140, .3);
}

.ed-seg label:hover {
    color: var(--brand-strong);
}

.ed-seg input:checked + label:hover {
    color: #fff;
}

html[data-theme="dark"] .ed-seg {
    background: rgba(36, 187, 140, .08);
    border-color: #243430;
}

/* ============================================================
   Presets row
   ============================================================ */
.ed-presets {
    margin-top: var(--space-6, 1.5rem);
    padding-top: var(--space-5, 1.25rem);
    border-top: 1px solid var(--line);
}

.ed-presets-label {
    display: block;
    font-family: 'Manrope', sans-serif;
    font-size: var(--text-xs, .75rem);
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--muted);
    margin-bottom: var(--space-3, .75rem);
}

.ed-preset-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2, .5rem);
}

.ed-preset {
    background: transparent;
    border: 1px solid var(--line);
    padding: .4rem .9rem;
    cursor: pointer;
    font-family: 'Manrope', sans-serif;
    font-style: normal;
    font-weight: 600;
    font-size: var(--text-sm, .875rem);
    color: var(--brand-strong);
    border-radius: var(--radius-pill, 999px);
    transition: all .15s ease;
}

.ed-preset:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(36, 187, 140, .25);
}

.ed-preset::before { content: none; }

/* ============================================================
   Result side
   ============================================================ */
.ed-result-side {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--space-8, 2rem);
    position: sticky;
    top: 90px;
}

html[data-theme="dark"] .ed-result-side {
    background: #161e1b;
    border-color: #243430;
}

@media (max-width: 991px) { .ed-result-side { position: static; } }

.ed-result-head {
    font-family: 'Manrope', sans-serif;
    font-size: var(--text-xs, .75rem);
    letter-spacing: .12em;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--muted);
    margin-bottom: var(--space-5, 1.25rem);
    display: flex;
    align-items: center;
    gap: var(--space-3, .75rem);
}

.ed-result-head::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

/* ===== Primary result number ===== */
.ed-primary {
    margin-bottom: var(--space-5, 1.25rem);
    padding-bottom: var(--space-5, 1.25rem);
    border-bottom: 1px solid var(--line);
}

.ed-primary-label {
    font-family: 'Manrope', sans-serif;
    font-size: var(--text-xs, .75rem);
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: var(--space-2, .5rem);
}

.ed-primary-value {
    font-family: 'Manrope', sans-serif;
    font-style: normal;
    font-weight: 800;
    font-size: clamp(1.85rem, 1.4rem + 1.6vw, 2.6rem);
    line-height: 1.1;
    color: var(--brand-strong);
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
    overflow-wrap: anywhere;
}

html[data-theme="dark"] .ed-primary-value { color: var(--brand-bright); }

.ed-primary-value em {
    font-style: normal;
    font-weight: 700;
    color: var(--brand);
}

/* ===== Stat row — 2-column ===== */
.ed-stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3, .75rem);
    margin-bottom: var(--space-3, .75rem);
}

.ed-stat {
    padding: var(--space-3, .75rem);
    background: var(--off, #fbfafa);
    border-radius: var(--radius-sm, 10px);
    border: 1px solid var(--line);
}

html[data-theme="dark"] .ed-stat {
    background: #101714;
    border-color: #243430;
}

.ed-stat.is-accent {
    background: var(--brand-tint);
    border-color: rgba(36, 187, 140, .25);
}

html[data-theme="dark"] .ed-stat.is-accent {
    background: rgba(36, 187, 140, .08);
}

.ed-stat-label {
    font-family: 'Manrope', sans-serif;
    font-size: var(--text-xs, .75rem);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: var(--space-1, .25rem);
}

.ed-stat-value {
    font-family: 'Manrope', sans-serif;
    font-style: normal;
    font-weight: 800;
    font-size: var(--text-lg, 1.125rem);
    color: var(--ink);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.ed-stat.is-accent .ed-stat-value { color: var(--brand-deep); }

html[data-theme="dark"] .ed-stat.is-accent .ed-stat-value { color: var(--brand-bright); }

/* ===== Breakdown bar ===== */
.ed-breakdown {
    margin: var(--space-5, 1.25rem) 0;
    padding-top: var(--space-4, 1rem);
    border-top: 1px solid var(--line);
}

.ed-breakdown-head {
    font-family: 'Manrope', sans-serif;
    font-size: var(--text-xs, .75rem);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: var(--space-3, .75rem);
}

.ed-breakdown-bar {
    height: 14px;
    display: flex;
    background: var(--brand-tint);
    overflow: hidden;
    margin-bottom: var(--space-3, .75rem);
    border-radius: var(--radius-pill, 999px);
    border: 1px solid var(--line);
}

.ed-breakdown-fill-a {
    background: linear-gradient(90deg, var(--brand), var(--brand-bright));
    transition: width .4s ease;
}

.ed-breakdown-fill-b {
    background: var(--brand-tint);
}

html[data-theme="dark"] .ed-breakdown-fill-b {
    background: rgba(36, 187, 140, .1);
}

.ed-breakdown-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3, .75rem);
    font-family: 'Manrope', sans-serif;
    font-size: var(--text-sm, .875rem);
}

.ed-legend-item {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ed-legend-marker {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: var(--text-xs, .75rem);
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: var(--space-1, .25rem);
}

.ed-legend-marker .swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.ed-legend-marker .swatch.ink {
    background: linear-gradient(90deg, var(--brand), var(--brand-bright));
}

.ed-legend-marker .swatch.brand {
    background: var(--brand-tint);
    border: 1px solid var(--brand);
}

.ed-legend-value {
    font-family: 'Manrope', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: var(--text-base, 1rem);
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

/* ===== Status bar ===== */
.ed-status {
    margin: var(--space-5, 1.25rem) 0;
    padding-top: var(--space-4, 1rem);
    border-top: 1px solid var(--line);
}

.ed-status-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: 'Manrope', sans-serif;
    margin-bottom: var(--space-2, .5rem);
}

.ed-status-label {
    font-size: var(--text-xs, .75rem);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.ed-status-value {
    font-family: 'Manrope', sans-serif;
    font-style: normal;
    font-weight: 800;
    font-size: var(--text-lg, 1.125rem);
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.ed-status-bar {
    height: 8px;
    background: var(--brand-tint);
    border-radius: var(--radius-pill, 999px);
    border: 1px solid var(--line);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-1, .25rem);
}

.ed-status-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), var(--brand-bright));
    border-radius: var(--radius-pill, 999px);
    transition: width .4s ease;
}

.ed-status-fill.is-warn {
    background: linear-gradient(90deg, #e8763d, #f2994a);
}

.ed-status-marks {
    display: flex;
    justify-content: space-between;
    font-family: 'Manrope', sans-serif;
    font-size: .62rem;
    letter-spacing: .06em;
    color: var(--muted);
    font-weight: 600;
}

/* ===== Notes (no italic, no big quote mark) ===== */
.ed-note {
    margin: var(--space-4, 1rem) 0 0;
    padding: var(--space-4, 1rem);
    background: var(--brand-tint);
    border-left: 3px solid var(--brand);
    border-radius: var(--radius-sm, 10px);
    font-family: 'Manrope', sans-serif;
    font-style: normal;
    font-size: var(--text-sm, .875rem);
    line-height: 1.55;
    color: var(--ink);
    position: relative;
}

.ed-note::before { content: none; }

.ed-note.is-success {
    background: var(--brand-tint);
    border-left-color: var(--brand-strong);
}

.ed-note.is-warn {
    background: #fff4eb;
    border-left-color: #e8763d;
    color: #6b4720;
}

html[data-theme="dark"] .ed-note { background: rgba(36, 187, 140, .08); color: var(--body); }
html[data-theme="dark"] .ed-note.is-warn {
    background: rgba(232, 118, 61, .12);
    color: #f2c79a;
}

/* ============================================================
   Footer colophon — simple line, no double-rule
   ============================================================ */
.ed-colophon {
    max-width: 1180px;
    margin: var(--space-12, 3rem) auto 0;
    padding-top: var(--space-5, 1.25rem);
    border-top: 1px solid var(--line);
    text-align: center;
    font-family: 'Manrope', sans-serif;
    font-style: normal;
    color: var(--muted);
    font-size: var(--text-sm, .875rem);
    line-height: 1.6;
}

.ed-colophon strong {
    font-style: normal;
    color: var(--ink);
    letter-spacing: .1em;
    text-transform: uppercase;
    font-family: 'Manrope', sans-serif;
    font-size: var(--text-xs, .75rem);
    display: block;
    margin-bottom: var(--space-2, .5rem);
    font-weight: 800;
}

/* ============================================================
   Basket table (inflation calc)
   ============================================================ */
.ed-basket {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-3, .75rem);
}

.ed-basket thead th {
    font-family: 'Manrope', sans-serif;
    font-size: var(--text-xs, .75rem);
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    font-weight: 800;
    text-align: left;
    padding-bottom: var(--space-3, .75rem);
    border-bottom: 2px solid var(--line);
}

.ed-basket thead th:not(:first-child) { text-align: right; }

.ed-basket tbody td {
    padding: var(--space-3, .75rem) var(--space-2, .5rem);
    border-bottom: 1px solid var(--line);
    font-family: 'Manrope', sans-serif;
    color: var(--ink);
    font-size: var(--text-sm, .875rem);
    vertical-align: middle;
}

.ed-basket tbody tr:last-child td { border-bottom: 0; }
.ed-basket tbody td:first-child { font-weight: 600; }

.ed-basket input[type="number"] {
    background: var(--off, #fbfafa);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm, 10px);
    text-align: right;
    font-family: 'Manrope', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: var(--text-base, 1rem);
    color: var(--ink);
    width: 100%;
    min-width: 70px;
    padding: var(--space-2, .5rem) var(--space-3, .75rem);
    appearance: textfield;
    -moz-appearance: textfield;
    font-variant-numeric: tabular-nums;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.ed-basket input[type="number"]:focus {
    outline: 0;
    border-color: var(--brand);
    background: #fff;
    box-shadow: var(--ring);
}

html[data-theme="dark"] .ed-basket input[type="number"] {
    background: #101714;
    border-color: #243430;
    color: var(--ink);
}

.ed-basket input[type="number"]::-webkit-outer-spin-button,
.ed-basket input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

@media (max-width: 480px) {
    .ed-basket td { padding: var(--space-2, .5rem) var(--space-1, .25rem); font-size: var(--text-xs, .75rem); }
    .ed-basket input[type="number"] { font-size: var(--text-sm, .875rem); min-width: 56px; padding: .35rem .55rem; }
}

/* ============================================================
   Instrument list (yield calc)
   ============================================================ */
.ed-instr-block {
    margin-top: var(--space-6, 1.5rem);
    padding-top: var(--space-5, 1.25rem);
    border-top: 1px solid var(--line);
}

.ed-instr-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2, .5rem);
    margin-top: var(--space-3, .75rem);
}

.ed-instr {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: var(--space-3, .75rem);
    padding: var(--space-3, .75rem);
    background: var(--off, #fbfafa);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm, 10px);
    cursor: pointer;
    font-family: 'Manrope', sans-serif;
    color: var(--ink);
    transition: background .15s ease, border-color .15s ease;
}

.ed-instr:hover {
    border-color: var(--brand-bright);
}

html[data-theme="dark"] .ed-instr {
    background: #101714;
    border-color: #243430;
}

.ed-instr input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand);
    margin: 0;
    cursor: pointer;
}

.ed-instr-name {
    font-weight: 700;
    font-size: var(--text-base, 1rem);
}

.ed-instr input[type="number"] {
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm, 10px);
    text-align: right;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: var(--text-base, 1rem);
    color: var(--ink);
    width: 70px;
    padding: .25rem .55rem;
    appearance: textfield;
    -moz-appearance: textfield;
    font-variant-numeric: tabular-nums;
}

.ed-instr input[type="number"]:focus {
    outline: 0;
    border-color: var(--brand);
    box-shadow: var(--ring);
}

html[data-theme="dark"] .ed-instr input[type="number"] {
    background: #0c1310;
    border-color: #243430;
    color: var(--ink);
}

.ed-instr input[type="number"]::-webkit-outer-spin-button,
.ed-instr input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ed-instr-pct {
    font-family: 'Manrope', sans-serif;
    font-size: var(--text-xs, .75rem);
    color: var(--muted);
    letter-spacing: .06em;
    text-transform: uppercase;
    font-weight: 700;
}

.ed-instr:has(input[type="checkbox"]:checked) {
    background: var(--brand-tint);
    border-color: rgba(36, 187, 140, .35);
}

.ed-instr:has(input[type="checkbox"]:checked) .ed-instr-name {
    color: var(--brand-deep);
}

@media (max-width: 420px) {
    .ed-instr {
        grid-template-columns: auto 1fr auto;
        gap: .55rem;
    }
    .ed-instr-pct {
        grid-column: 2 / 4;
        text-align: right;
        margin-top: -.2rem;
    }
    .ed-instr input[type="number"] { width: 60px; }
}

/* ============================================================
   Result table (yield comparison)
   ============================================================ */
.ed-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-5, 1.25rem) 0;
    font-family: 'Manrope', sans-serif;
    font-size: var(--text-sm, .875rem);
}

.ed-table thead th {
    text-align: left;
    font-size: var(--text-xs, .75rem);
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    font-weight: 800;
    padding: var(--space-2, .5rem) var(--space-3, .75rem);
    background: var(--brand-tint);
    border-bottom: 0;
}

.ed-table thead th:first-child { border-top-left-radius: var(--radius-sm, 10px); }
.ed-table thead th:last-child  { border-top-right-radius: var(--radius-sm, 10px); }
.ed-table thead th:not(:first-child) { text-align: right; }

.ed-table tbody td {
    padding: var(--space-3, .75rem);
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    vertical-align: middle;
}

.ed-table tbody td:first-child { font-weight: 600; }

.ed-table tbody td.num {
    text-align: right;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

.ed-table tbody tr:last-child td { border-bottom: 0; }
.ed-table tbody tr:hover td { background: var(--brand-tint); }

@media (max-width: 480px) {
    .ed-table { font-size: var(--text-xs, .75rem); }
    .ed-table tbody td { padding: var(--space-2, .5rem); }
    .ed-table thead th { font-size: .62rem; padding: var(--space-2, .5rem); }
}

/* ============================================================
   Narrow-mobile hardening
   ============================================================ */
.ed-headline,
.ed-form-side h2,
.ed-primary-value {
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

@media (max-width: 480px) {
    .ed-form-side,
    .ed-result-side { padding: var(--space-5, 1.25rem); }
    .ed-primary-value { font-size: clamp(1.5rem, 1.2rem + 2vw, 2rem); }
    .ed-stat-value { font-size: var(--text-base, 1rem); }
    .ed-result-head { font-size: .62rem; letter-spacing: .1em; }
    .ed-nav-title { font-size: var(--text-base, 1rem); }
    .ed-nav-hint { font-size: var(--text-xs, .75rem); }
    .ed-field-input input { font-size: var(--text-base, 1rem); }
}
