
:root {
    color-scheme: light;

    --white: #ffffff;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-150: #e8eef6;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #eff6ff;
    --accent-soft: rgba(37, 99, 235, 0.08);
    --accent-border: rgba(37, 99, 235, 0.16);
    --accent-shadow: rgba(37, 99, 235, 0.16);

    --success: #047857;
    --success-soft: rgba(16, 185, 129, 0.12);
    --warning: #b45309;
    --warning-soft: rgba(245, 158, 11, 0.14);
    --danger: #b91c1c;
    --danger-soft: rgba(239, 68, 68, 0.12);

    --surface-shadow: 0 18px 40px -24px rgba(15, 23, 42, 0.14);
    --surface-shadow-strong: 0 24px 48px -28px rgba(15, 23, 42, 0.16);
    --surface-shadow-soft: 0 10px 24px -20px rgba(15, 23, 42, 0.12);
    --surface-border: var(--slate-200);
    --surface-card: rgba(255, 255, 255, 0.96);
    --surface-card-strong: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.98));
    --surface-muted: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.96));
    --surface-subtle: rgba(248, 250, 252, 0.88);

    --text-primary: var(--slate-900);
    --text-secondary: var(--slate-600);
    --text-tertiary: var(--slate-500);
    --text-muted: var(--slate-400);

    --focus-ring: rgba(37, 99, 235, 0.18);
    --disabled-opacity: 0.62;

    --font-sans: 'Inter', 'Noto Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-math: 'Noto Sans Math', 'Noto Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    --fm-layer-tooltip-topmost: 1400;
    --fm-layer-tooltip-host: 1470;
    --fm-layer-tooltip-base: 1450;
    --fm-layer-tooltip-panel: 1460;

    --fm-tooltip-bg: #ffffff;
    --fm-tooltip-text: #0f172a;
    --fm-tooltip-border: #cbd5e1;
    --fm-tooltip-shadow: 0 20px 30px -18px rgba(15, 23, 42, 0.16), 0 12px 16px -14px rgba(15, 23, 42, 0.1);

    --fm-font-size-page-title: clamp(2.4rem, 2rem + 1vw, 3.4rem);
    --fm-font-size-form-control: 0.95rem;
    --fm-font-size-math: clamp(1rem, 0.92rem + 0.45vw, 1.3rem);

    --fm-chart-height-base: 20rem;
    --fm-chart-height-responsive: clamp(20rem, 32vw, 28rem);
    --fm-chart-height-responsive-xl: clamp(22rem, 28vw, 32rem);
    --fm-chart-height-tall: clamp(24rem, 40vw, 34rem);
    --fm-chart-height-tall-xl: clamp(28rem, 32vw, 38rem);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background: var(--slate-50);
}

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

body.app-body {
    margin: 0;
    min-height: 100vh;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background:
        radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.08), transparent 34%),
        radial-gradient(circle at 84% 0%, rgba(14, 165, 233, 0.07), transparent 30%),
        linear-gradient(180deg, var(--slate-50) 0%, #ffffff 46%, #f5f8fc 100%);
}

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar-wrap,
.content,
.footer {
    width: min(1200px, calc(100% - 2rem));
    margin-inline: auto;
}

.navbar-wrap {
    position: relative;
    z-index: var(--fm-layer-tooltip-host);
    margin-top: 0;
}

.content {
    flex: 1 1 auto;
    padding: 2rem 0 4rem;
}

.footer {
    margin-bottom: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--slate-200);
    color: var(--text-tertiary);
    text-align: center;
    font-size: 0.95rem;
}

.footer__note {
    margin-top: 0.35rem;
}

.footer a {
    color: var(--accent);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

code,
kbd,
samp,
pre {
    font-family: var(--font-math);
    font-variant-numeric: lining-nums tabular-nums;
    background: var(--slate-100);
    color: var(--slate-800);
    border-radius: 0.45rem;
    border: 1px solid var(--slate-200);
}

.no-tap-highlight {
    -webkit-tap-highlight-color: transparent;
}

button,
a,
input,
select,
textarea,
[role="button"] {
    touch-action: manipulation;
}

.fade-in,
.fade-in-delay {
    opacity: 0;
    will-change: opacity, transform;
    animation: fadeIn 0.5s ease-out both;
}

.fade-in-delay {
    animation-delay: 0.18s;
}

.result-container--compact,
.result-container--tall {
    min-height: auto;
}

/* Typography */
.result-heading {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.numeric-output {
    color: var(--text-primary);
    font-weight: 600;
    font-variant-numeric: lining-nums tabular-nums;
    letter-spacing: 0.005em;
}

.math-callout,
.math-notation {
    font-size: var(--fm-font-size-math);
    line-height: 1.6;
    font-variant-numeric: lining-nums;
}

.math-callout {
    display: grid;
    justify-content: center;
    justify-items: center;
    gap: 0.35rem;
    text-align: center;
}

.math-callout--compact {
    font-size: clamp(0.95rem, 0.9rem + 0.45vw, 1.2rem);
}

.math-callout mjx-container,
.math-notation mjx-container {
    font-variant-numeric: normal;
    overflow: visible;
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
}

.math-callout mjx-container svg,
.math-notation mjx-container svg {
    max-width: 100%;
    height: auto;
    display: block;
}

.page-header {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-width: 760px;
    margin: 0 auto 3rem;
    text-align: center;
}

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

.page-title {
    margin: 0;
    color: var(--slate-900);
    font-family: var(--font-serif);
    font-size: var(--fm-font-size-page-title);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.page-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.75;
}

.page-subtitle strong {
    color: var(--text-primary);
    font-weight: 600;
}

.calculator-section-title {
    margin: 0 0 0.5rem;
    color: var(--text-primary);
    font-size: clamp(1.55rem, 1.4rem + 0.5vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.calculator-section-subtitle {
    margin: 0 0 1.5rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.calculator-muted-text {
    color: var(--text-tertiary);
}

/* Shared surfaces */
.panel-card,
.section-card,
.result-panel,
.formula-card,
.result-assumptions-panel,
.stacked-radio-option,
.regreek-toggle-card,
[data-collapsible-section] {
    position: relative;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
    border: 1px solid var(--surface-border);
    background: var(--surface-card);
    border-radius: 18px;
    box-shadow: var(--surface-shadow);
    backdrop-filter: none;
}

.panel-card,
.section-card,
.result-panel {
    overflow: visible;
}

.panel-card > *,
.section-card > *,
.result-panel > * {
    position: relative;
    z-index: 1;
}

.panel-card:hover,
.section-card:hover,
.result-panel:hover,
.stacked-radio-option:hover,
.regreek-toggle-card:hover,
[data-collapsible-section]:hover {
    transform: none;
    filter: none;
    border-color: var(--slate-300);
    box-shadow: var(--surface-shadow-strong);
}

.panel-card--muted {
    background: var(--surface-muted);
}

.panel-card--result {
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(145deg, rgba(37, 99, 235, 0.2), rgba(203, 213, 225, 0.65) 65%, rgba(203, 213, 225, 0.65)) border-box;
    border: 1.5px solid transparent;
}

.panel-card--result h2,
.panel-card--result h3,
.panel-card--result h4,
.panel-card--result p,
.panel-card--result li,
.panel-card--result span {
    color: inherit;
}

.section-card {
    background: rgba(248, 250, 252, 0.92);
    box-shadow: var(--surface-shadow-soft);
}

.calculator-form-minimal {
    padding: 0.25rem 0 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.calculator-page--minimal [data-calculator-form] .section-card {
    padding: 1rem 0 !important;
    border: 0;
    border-top: 1px solid rgba(203, 213, 225, 0.72);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.calculator-page--minimal [data-calculator-form] .section-card:hover {
    border-color: rgba(203, 213, 225, 0.72);
    box-shadow: none;
}

.calculator-page--minimal .result-container .section-card:not(.formula-card) {
    padding: 1.25rem 0 !important;
    border: 0;
    border-top: 1px solid rgba(203, 213, 225, 0.72);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.calculator-page--minimal .result-container .section-card:not(.formula-card):hover {
    border-color: rgba(203, 213, 225, 0.72);
    box-shadow: none;
}

.formula-card {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--slate-200);
    border-bottom: 1px solid var(--slate-200);
    border-radius: 0;
    box-shadow: none;
}

.formula-card:hover,
.section-card.formula-card:hover {
    border-color: var(--slate-200);
    box-shadow: none;
}

.result-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.96));
}

.calculator-brief,
.calculator-explanation {
    color: var(--text-secondary);
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.calculator-brief {
    max-width: none;
}

.calculator-brief--inline {
    margin-bottom: 1.5rem;
}

.calculator-brief__title,
.calculator-explanation__title {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.35;
}

.calculator-brief__title + *,
.calculator-explanation__title + * {
    margin-top: 0.8rem;
}

.calculator-brief p,
.calculator-brief li,
.calculator-explanation p,
.calculator-explanation li,
.calculator-explanation summary,
.calculator-explanation .option-hint {
    color: var(--text-secondary);
    line-height: 1.72;
}

.calculator-brief em,
.calculator-explanation em {
    color: var(--text-tertiary);
}

.calculator-brief strong,
.calculator-explanation strong {
    color: var(--text-primary);
}

.calculator-brief ul,
.calculator-brief ol,
.calculator-explanation ul,
.calculator-explanation ol {
    margin: 0;
    padding-left: 1.15rem;
}

.calculator-explanation {
    margin-top: 2.25rem;
    border-top: 1px solid var(--slate-200);
    padding-top: 2rem;
}

.calculator-explanation__lead {
    margin: 0.75rem 0 0;
    color: var(--text-secondary);
    line-height: 1.72;
}

.calculator-placeholder {
    background: var(--surface-muted);
}

/* Notes and alerts */
.alert-panel {
    border-radius: 14px;
    padding: 0.9rem 1rem;
    border: 1px solid var(--slate-200);
    line-height: 1.65;
    background: rgba(255, 255, 255, 0.96);
    color: var(--text-secondary);
}

.alert-panel strong {
    color: inherit;
}

.alert-panel--info {
    background: rgba(239, 246, 255, 0.96);
    border-color: rgba(59, 130, 246, 0.16);
    color: var(--accent-hover);
}

.alert-panel--warning {
    background: rgba(255, 251, 235, 0.96);
    border-color: rgba(245, 158, 11, 0.18);
    color: #92400e;
}

.alert-panel--success {
    background: rgba(236, 253, 245, 0.96);
    border-color: rgba(16, 185, 129, 0.18);
    color: var(--success);
}

.alert-panel--danger,
.alert-panel--error {
    background: rgba(254, 242, 242, 0.96);
    border-color: rgba(239, 68, 68, 0.18);
    color: var(--danger);
}

/* Form controls */
.form-label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    color: var(--text-secondary);
    font-size: var(--fm-font-size-form-control);
    font-weight: 600;
    line-height: 1.45;
}

.form-label .label-text {
    flex: 1 1 auto;
    min-width: 0;
}

.form-label .tooltip {
    flex: 0 0 auto;
}

.option-hint {
    display: block;
    margin-top: 0.35rem;
    color: var(--text-tertiary);
    font-size: 0.9rem;
    line-height: 1.45;
    font-style: italic;
}

.input-field {
    display: block;
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: 0.75rem;
    background: #ffffff;
    border: 1px solid var(--slate-300);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
    font-size: var(--fm-font-size-form-control);
    line-height: 1.5;
}

.input-field:hover {
    background: var(--slate-50);
    border-color: var(--slate-300);
}

.input-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--focus-ring);
    background: #ffffff;
}

.input-field:disabled,
.input-field[readonly],
.input-field--disabled {
    opacity: var(--disabled-opacity);
    cursor: not-allowed;
    background: var(--slate-100) !important;
    color: var(--text-tertiary) !important;
    border-color: var(--slate-200) !important;
}

select.input-field option,
select.input-field optgroup {
    background: #ffffff;
    color: var(--text-primary);
}

.input-field--condensed {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    min-width: 4.5rem;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    border-radius: 0.85rem;
    border: 1px solid transparent;
    background: linear-gradient(135deg, #2563eb, #1d4ed8 70%);
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 16px 30px -20px var(--accent-shadow);
}

.primary-button:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 18px 32px -20px rgba(37, 99, 235, 0.2);
}

.primary-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.primary-button:disabled {
    opacity: var(--disabled-opacity);
    cursor: not-allowed;
    box-shadow: none;
}

/* Tooltip system */
[data-tooltip-layer-root] {
    position: relative;
    overflow: visible;
}

.result-container,
.result-container .panel-card--result,
.greek-tooltip-layer {
    overflow: visible;
}

.result-container .panel-card--result {
    transform: none;
    will-change: auto;
    backface-visibility: visible;
    perspective: none;
}

.greek-tooltip-layer {
    position: relative;
    z-index: calc(var(--fm-layer-tooltip-topmost) + 2);
    --fm-layer-tooltip-base: calc(var(--fm-layer-tooltip-topmost) + 2);
    --fm-layer-tooltip-panel: calc(var(--fm-layer-tooltip-topmost) + 3);
    --fm-layer-tooltip-host: calc(var(--fm-layer-tooltip-topmost) + 4);
}

.greek-tooltip-layer .greek-metrics-grid {
    position: relative;
    overflow: visible;
}

.tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
    z-index: var(--fm-layer-tooltip-base);
    isolation: isolate;
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font: inherit;
}

.tooltip svg {
    color: var(--text-muted);
}

.tooltip.tooltip-active,
.tooltip-host-active,
.result-container[data-result-present="true"] .tooltip-host-active {
    position: relative;
    z-index: var(--fm-layer-tooltip-host);
    isolation: isolate;
}

.tooltip .tooltiptext {
    --tooltip-inline-shift: 0px;
    visibility: hidden;
    opacity: 0;
    width: min(280px, calc(100vw - 2.5rem));
    background: var(--fm-tooltip-bg);
    color: var(--fm-tooltip-text);
    font-size: var(--fm-font-size-form-control);
    line-height: 1.5;
    text-align: left;
    border-radius: 0.5rem;
    padding: 1rem;
    position: absolute;
    z-index: var(--fm-layer-tooltip-panel);
    bottom: 125%;
    left: 50%;
    transform: translateX(calc(-50% + var(--tooltip-inline-shift)));
    transition: opacity 0.2s ease;
    box-shadow: var(--fm-tooltip-shadow);
    border: 1px solid var(--fm-tooltip-border);
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    left: calc(50% - var(--tooltip-inline-shift));
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
}

.tooltip .tooltiptext.show-top::after {
    top: 100%;
    border-color: var(--fm-tooltip-bg) transparent transparent transparent;
}

.tooltip .tooltiptext.show-bottom::after {
    bottom: 100%;
    border-color: transparent transparent var(--fm-tooltip-bg) transparent;
}

.tooltip .tooltiptext.show-left {
    left: 0;
    transform: translateX(0);
}

.tooltip .tooltiptext.show-right {
    left: auto;
    right: 0;
    transform: translateX(0);
}

.tooltip .tooltiptext.show-left::after {
    left: 1.5rem;
    margin-left: 0;
}

.tooltip .tooltiptext.show-right::after {
    left: auto;
    right: 1.5rem;
    margin-left: 0;
}

.tooltip .tooltiptext.tooltip-visible {
    visibility: visible;
    opacity: 1;
}

.tooltip:focus {
    outline: none;
}

.tooltip:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.3);
    outline-offset: 2px;
}

/* Result states */
.result-container {
    min-height: auto;
}

.result-container[data-result-present="true"] {
    position: relative;
    z-index: var(--fm-layer-tooltip-topmost);
}

[data-calculator-layout] {
    --calculator-note-offset: 0px;
}

[data-calculator-layout] .result-container {
    display: flex;
    flex-direction: column;
    align-self: start;
    position: relative;
    padding-top: var(--calculator-note-offset, 0px);
}

[data-calculator-layout] .result-container--align-form {
    align-self: stretch;
    min-height: 100%;
}

[data-calculator-layout] .result-container > .panel-card,
[data-calculator-layout] .result-container [data-calculator-note] {
    flex: 0 0 auto;
}

[data-calculator-layout][data-note-active] .result-container [data-calculator-note] {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
}

[data-calculator-layout] > [data-calculator-form] {
    transition: margin-top 0.3s ease;
    margin-top: 0;
}

[data-calculator-explanation] {
    --calculator-note-offset: 0px;
    --calculator-explanation-base-offset: 2rem;
    transition: margin-top 0.3s ease;
    margin-top: calc(var(--calculator-explanation-base-offset) + var(--calculator-note-offset));
}

.bond-result-stack {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 100%;
}

.bond-result-card {
    flex: 1 1 auto;
}

.bond-price-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid var(--slate-200);
    border-bottom: 1px solid var(--slate-200);
}

.bond-price-strip__item {
    min-width: 0;
    padding: 0.9rem 0.95rem;
}

.bond-price-strip__item + .bond-price-strip__item {
    border-left: 1px solid var(--slate-200);
}

.bond-price-strip__item p {
    overflow-wrap: normal;
}

.bond-price-strip__item .numeric-output {
    margin-top: 0.2rem;
    font-size: clamp(1rem, 2vw, 1.5rem);
    line-height: 1.2;
}

.result-container[data-loading="true"] > :not(.result-loading-overlay) {
    opacity: 0.45;
    filter: blur(1px);
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.result-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: rgba(248, 250, 252, 0.78);
    backdrop-filter: blur(2px);
    border-radius: inherit;
    z-index: 5;
    pointer-events: none;
}

.result-loading-overlay .loading-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: var(--surface-shadow);
}

.result-loading-overlay .loading-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    border: 3px solid rgba(148, 163, 184, 0.35);
    border-top-color: var(--accent);
    animation: fm-spin 0.9s linear infinite;
}

.result-loading-overlay .loading-text {
    font-size: 0.95rem;
}

@keyframes fm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Charts */
.chart-box {
    position: relative;
    height: var(--chart-box-height, var(--fm-chart-height-base));
    flex: 0 0 auto;
    z-index: 0;
}

.chart-box canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.chart-box--responsive {
    --chart-box-height: var(--fm-chart-height-responsive);
}

.chart-box--tall {
    --chart-box-height: var(--fm-chart-height-tall);
}

.bond-chart-box {
    min-height: 22rem;
}

@media (min-width: 1280px) {
    .chart-box--responsive {
        --chart-box-height: var(--fm-chart-height-responsive-xl);
    }

    .chart-box--tall {
        --chart-box-height: var(--fm-chart-height-tall-xl);
    }
}

/* Navigation */
.floating-nav {
    position: relative;
    z-index: var(--fm-layer-tooltip-host);
    border-bottom: 1px solid var(--slate-200);
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    overflow: visible;
    padding: 28px 0 12px;
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-bar__leading,
.header-bar__logo,
.header-controls,
.header-bar__primary {
    display: flex;
    align-items: center;
    min-width: 0;
}

.header-bar__leading {
    gap: 20px;
}

.header-bar__logo {
    text-decoration: none;
    color: var(--slate-900);
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.header-bar__logo:hover {
    opacity: 0.85;
}

.brand__logo {
    display: block;
    width: 112px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.header-bar__brand {
    display: none;
}

.header-bar__primary {
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 1rem;
}

.header-links {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 18px;
    min-width: 0;
}

.header-controls {
    justify-content: flex-end;
    gap: 0.75rem;
    flex: 0 0 auto;
}

.header-controls__currency {
    position: relative;
    z-index: var(--fm-layer-tooltip-topmost);
}

.desktop-language-toggle {
    display: flex;
}

.mobile-menu-button-shell {
    display: none;
    position: relative;
}

.back-link,
.back-link-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--slate-500);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    border: none;
    padding: 0;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.back-link:hover,
.back-link-ghost:hover {
    color: var(--accent);
    transform: none;
}

.back-link svg,
.back-link-ghost svg {
    stroke-width: 2.5;
    width: 18px;
    height: 18px;
}

.mobile-menu-button,
#currency-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--slate-700);
    box-shadow: none;
    font-weight: 600;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.mobile-menu-button:hover,
#currency-button[aria-expanded="true"],
#currency-button:hover {
    color: var(--slate-900);
    background: var(--slate-50);
}

.mobile-menu-button svg,
.currency-button__chevron {
    width: 1.1rem;
    height: 1.1rem;
}

.currency-button__symbol {
    font-size: 1rem;
    font-weight: 600;
}

.nav-link {
    position: relative;
    display: inline-block;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    color: var(--slate-500);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    background: transparent;
    box-shadow: none;
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    color: var(--slate-900);
    background: var(--slate-50);
}

.nav-link.active,
.nav-link--active {
    color: var(--slate-900) !important;
    background: var(--accent-light);
    border-color: rgba(37, 99, 235, 0.15);
    box-shadow: none;
}

.mobile-nav-link {
    display: flex;
    justify-content: flex-start;
    width: 100%;
}

.mobile-menu-panel {
    display: none;
    width: 100%;
    margin-top: 4px;
    padding: 8px;
    border: 1px solid var(--slate-200);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
    box-shadow: 0 12px 28px -18px rgba(15, 23, 42, 0.55);
}

.mobile-menu-panel:not(.hidden) {
    display: block;
}

.mobile-menu-panel__section {
    display: grid;
    gap: 6px;
}

.mobile-menu-panel__section--controls {
    margin-top: 0.9rem;
    justify-items: start;
}

/* Language + currency */
.language-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0;
    border-radius: 9999px;
    background: transparent;
    border: 0;
    box-shadow: none;
    cursor: pointer;
}

.language-toggle input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.language-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    min-width: 9.6rem;
    border-radius: 9999px;
    overflow: hidden;
    background: transparent;
    border: 1px solid var(--slate-200);
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0;
}

.language-option {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0.55rem 0.95rem;
    transition: color 0.25s ease;
}

.language-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.language-label--short {
    display: none;
    text-transform: uppercase;
}

.language-active {
    position: absolute;
    inset: 0 auto 0 0;
    width: 50%;
    border-radius: inherit;
    background: var(--accent-light);
    box-shadow: none;
    transition: transform 0.3s ease;
}

.language-toggle input:checked + .language-track .language-active {
    transform: translateX(100%);
}

.language-toggle input:not(:checked) + .language-track .language-option--en,
.language-toggle input:checked + .language-track .language-option--es {
    color: var(--text-primary);
}

.language-toggle input:focus-visible + .language-track {
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.language-toggle--compact .language-track {
    min-width: 8.8rem;
    font-size: 0.7rem;
}

.language-toggle--compact .language-option {
    padding: 0.45rem 0.75rem;
}

#currency-tooltip {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    z-index: var(--fm-layer-tooltip-topmost);
    width: min(13rem, calc(100vw - 2rem));
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    box-shadow: var(--surface-shadow);
    overflow: hidden;
    pointer-events: none;
}

#currency-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    display: block;
    pointer-events: auto;
}

.currency-tooltip__options {
    padding: 0.5rem;
}

.currency-tooltip__footer {
    padding: 0.8rem 1rem;
    border-top: 1px solid var(--slate-200);
    color: var(--text-tertiary);
    font-size: 0.78rem;
    line-height: 1.5;
    text-align: center;
}

.currency-option {
    display: block;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    color: var(--text-secondary);
    text-align: left;
    font-size: 0.9rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.currency-option:hover,
.currency-option[aria-selected="true"] {
    background: var(--slate-50);
    color: var(--text-primary);
}

@media (min-width: 1181px) {
    .mobile-menu-panel {
        display: none !important;
    }
}

@media (max-width: 1180px) {
    .floating-nav {
        padding: 28px 0 12px;
    }

    .header-bar {
        flex-wrap: wrap;
        gap: 12px;
        align-items: flex-start;
    }

    .header-bar__leading {
        width: 100%;
        justify-content: space-between;
        gap: 12px;
    }

    .brand__logo {
        width: 88px;
        height: auto;
    }

    .header-bar__primary {
        width: 100%;
        justify-content: flex-end;
        gap: 12px;
    }

    .header-links,
    .desktop-language-toggle {
        display: none !important;
    }

    .mobile-menu-button-shell {
        display: block;
    }

    .mobile-menu-panel .nav-link {
        display: block;
        width: 100%;
        padding: 12px 14px;
        border-radius: 12px;
        border-bottom: none;
        font-size: 15px;
        color: var(--slate-500);
        background: transparent;
        border-left: none;
        transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    }

    .mobile-menu-panel .nav-link:hover,
    .mobile-menu-panel .nav-link:focus-visible {
        background: rgba(148, 163, 184, 0.12);
        color: var(--slate-900);
    }

    .mobile-menu-panel .nav-link:active {
        transform: scale(0.985);
    }

    .mobile-menu-panel .nav-link.active,
    .mobile-menu-panel .nav-link--active {
        position: relative;
        background: rgba(191, 219, 254, 0.55) !important;
        border: 1px solid rgba(37, 99, 235, 0.3) !important;
        color: var(--slate-900) !important;
        font-weight: 600;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    }
}

/* Landing cards */
.suite-grid,
.suite-metadata-grid {
    display: grid;
    gap: 1.5rem;
}

.calculator-directory {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 3.5rem;
    row-gap: 4rem;
    margin-top: 2.5rem;
}

.calculator-entry {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.calculator-entry__head {
    display: flex;
    align-items: flex-start;
    gap: 0.95rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--slate-200);
}

.calculator-entry__icon {
    flex: 0 0 auto;
    font-family: var(--font-serif);
    font-size: 1.9rem;
    line-height: 1;
    font-style: italic;
    color: var(--accent);
}

.calculator-entry__title-group {
    min-width: 0;
}

.calculator-entry__eyebrow,
.suite-card__eyebrow,
.suite-metadata-card__eyebrow {
    margin: 0 0 0.3rem;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.calculator-entry__title,
.suite-card__title,
.suite-metadata-card__title {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.45rem;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.calculator-entry__description,
.suite-card__description,
.suite-metadata-card p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.75;
    max-width: 44ch;
}

.calculator-entry__cta {
    margin-top: 1.2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-primary);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

.calculator-entry:hover .calculator-entry__title,
.calculator-entry:hover .calculator-entry__cta {
    color: var(--accent);
}

.suite-card,
.suite-metadata-card {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid var(--slate-200);
    border-radius: 18px;
    padding: 1.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    box-shadow: var(--surface-shadow);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    transform: none;
}

.suite-card:hover,
.suite-metadata-card:hover {
    border-color: var(--slate-300);
    box-shadow: var(--surface-shadow-strong);
}

.suite-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    margin-bottom: 1.5rem;
}

.suite-card {
    padding: 2rem;
}

.suite-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--accent);
    border: 1px solid rgba(37, 99, 235, 0.12);
}

.suite-card__icon--emerald {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.14);
}

.suite-card__icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.suite-card__list {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.suite-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    align-items: center;
    margin-top: 0.25rem;
}

.inline-action-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.inline-action-link:hover {
    text-decoration: underline;
}

.suite-metadata-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

@media (max-width: 960px) {
    .calculator-directory {
        grid-template-columns: 1fr;
        row-gap: 3rem;
        column-gap: 0;
    }
}

.inline-code-chip {
    display: inline-block;
    padding: 0.2rem 0.45rem;
    border-radius: 8px;
    background: var(--slate-100);
    color: var(--slate-800);
    border: 1px solid var(--slate-200);
}

/* Tabs and options layout */
.options-shell {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
}

.scrolling-tabs-container {
    margin-block: 0;
    padding-block: 0 1.15rem;
    border-bottom: 1px solid var(--slate-200);
}

.scrolling-tabs-container nav {
    padding-block: 0.2rem;
    overflow-y: visible;
}

.options-shell .scrolling-tabs-container {
    margin-bottom: 1.2rem;
}

.options-tab-content {
    padding-top: 1rem;
}

.scroll-button {
    display: none;
}

.tab-button {
    position: relative;
    border: 1px solid transparent;
    border-radius: 0.9rem;
    background: transparent;
    color: var(--text-secondary);
    box-shadow: none;
    white-space: normal;
    text-align: left;
    line-height: 1.4;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0.5rem;
    transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.tab-button::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(219, 234, 254, 0.3));
    opacity: 0;
    transition: opacity 0.22s ease-in-out;
    pointer-events: none;
}

.tab-button svg {
    flex-shrink: 0;
    margin-top: 0.05rem;
    color: inherit;
}

.tab-button:hover,
.tab-button:focus-visible {
    color: var(--text-primary);
}

.tab-button[aria-selected="true"] {
    border-color: rgba(37, 99, 235, 0.16);
    background: var(--accent-light);
    color: var(--text-primary);
}

.tab-button[aria-selected="true"]::after {
    opacity: 1;
}

.tab-panel {
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(0.5rem); }
    to { opacity: 1; transform: translateY(0); }
}

/* Options controls */
.radio-card,
.stacked-radio-option,
.regreek-toggle-card {
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.radio-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border-radius: 0.9rem;
    border: 1px solid var(--slate-200);
    background: var(--white);
    cursor: pointer;
}

.radio-card:hover {
    border-color: rgba(37, 99, 235, 0.22);
    background: rgba(219, 234, 254, 0.18);
    box-shadow: 0 14px 24px -24px rgba(15, 23, 42, 0.14);
}

.radio-card--active {
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.1);
    background: rgba(219, 234, 254, 0.3);
}

.radio-card-title {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
}

.radio-card-description {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-tertiary);
}

.radio-card-input {
    margin-top: 0.25rem;
    flex-shrink: 0;
    accent-color: var(--accent);
}

.breakeven-mode-toggle,
.segmented-toggle {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: rgba(241, 245, 249, 0.92);
    border-radius: 9999px;
    border: 1px solid var(--slate-200);
    box-shadow: none;
}

.mode-toggle-button,
.segmented-toggle-button,
.chip-button {
    border: 1px solid var(--slate-200);
    background: var(--white);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 1.2rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.mode-toggle-button:not(.is-active):hover,
.segmented-toggle-button:not(.is-active):hover,
.chip-button:hover,
.chip-button:focus-visible {
    border-color: var(--slate-300);
    background: var(--slate-50);
    color: var(--text-primary);
    outline: none;
}

.mode-toggle-button.is-active,
.segmented-toggle-button.is-active,
.mode-toggle-button[data-breakeven-mode="pro"].is-active,
.segmented-toggle-button[data-toggle-theme="teal"].is-active {
    border-color: rgba(37, 99, 235, 0.18);
    background: var(--accent-light);
    color: var(--text-primary);
    box-shadow: none;
}

.link-button {
    border: none;
    background: none;
    color: var(--accent);
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.link-button:hover {
    color: var(--accent-hover);
}

.chip-button {
    font-size: 0.75rem;
    padding: 0.3rem 0.75rem;
}

.range-field {
    width: 100%;
    cursor: pointer;
    accent-color: var(--accent);
}

.range-field:focus-visible,
.chip-button:focus-visible,
.stacked-radio-option:focus-visible,
.mode-toggle-button:focus-visible,
.segmented-toggle-button:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
}

.stacked-radio-group {
    display: grid;
    gap: 0.5rem;
}

.stacked-radio-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border-radius: 0.9rem;
    padding: 0.85rem 0.95rem;
    cursor: pointer;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    border: 1px solid var(--slate-200);
    box-shadow: none;
}

.stacked-radio-option:hover,
.stacked-radio-option:focus-within,
.regreek-toggle-card:hover,
.regreek-toggle-card[data-regreek-active="true"] {
    background: rgba(219, 234, 254, 0.28);
    border-color: rgba(37, 99, 235, 0.2);
}

.stacked-radio-option input[type="radio"] {
    margin-top: 0.35rem;
    accent-color: var(--accent);
}

.stacked-radio-option .option-title {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.stacked-radio-option .option-hint {
    display: block;
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.collapsible-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    list-style: none;
}

.collapsible-summary::-webkit-details-marker {
    display: none;
}

.section-card details[open] > .collapsible-summary {
    border-bottom: 1px solid var(--slate-200);
}

.breakeven-pro-sections.hidden {
    display: none;
}

.breakeven-core-section {
    padding-top: 1rem;
    border-top: 1px solid var(--slate-200);
}

.breakeven-core-section [data-breakeven-basic-grid] {
    align-items: start;
}

.breakeven-pro-sections {
    border-top: 1px solid var(--slate-200);
}

.breakeven-pro-section,
.breakeven-pro-section[data-collapsible-section] {
    display: block;
    border: 0;
    border-bottom: 1px solid var(--slate-200);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.breakeven-pro-section:hover,
.breakeven-pro-section[data-collapsible-section]:hover {
    border-color: var(--slate-200);
    box-shadow: none;
}

.breakeven-pro-section .collapsible-summary {
    padding: 1rem 0;
}

.breakeven-pro-section .collapsible-summary + div {
    padding: 0 0 1.25rem;
    border-top: 0;
}

.breakeven-pro-section[open] .collapsible-summary {
    border-bottom: 0;
}

.breakeven-headline-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
}

.breakeven-headline-metrics > div {
    min-width: 0;
    padding-inline: 0.75rem;
    border-left: 1px solid var(--slate-200);
}

.breakeven-headline-metrics > div:first-child {
    border-left: 0;
}

.breakeven-headline-value {
    font-size: 2.25rem;
    line-height: 1.1;
    white-space: nowrap;
}

.breakeven-headline-value .currency-label {
    font-size: 1.5rem !important;
}

.breakeven-trade-detail > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    column-gap: 1.25rem;
    align-items: baseline;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--slate-200);
}

.breakeven-trade-detail dt {
    min-width: 0;
    line-height: 1.35;
}

.breakeven-trade-detail dd {
    min-width: 7rem;
    text-align: right;
    line-height: 1.35;
}

@media (max-width: 640px) {
    .breakeven-headline-metrics {
        gap: 0.5rem;
    }

    .breakeven-headline-metrics > div {
        padding-inline: 0.35rem;
    }

    .breakeven-headline-value {
        font-size: 1.65rem;
    }

    .breakeven-headline-value .currency-label,
    .breakeven-headline-value .text-2xl {
        font-size: 1.05rem !important;
    }

    .breakeven-headline-metrics p {
        overflow-wrap: normal;
    }

    .breakeven-trade-detail > div {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 0.2rem;
    }

    .breakeven-trade-detail dd {
        min-width: 0;
        text-align: left;
    }
}

.actual-premium-container {
    display: none;
}

.actual-premium-container.is-visible {
    display: block;
}

.regreek-toggle-card {
    border-radius: 0.9rem;
    padding: 1.25rem;
    border: 1px solid var(--slate-200);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    box-shadow: none;
}

.regreek-toggle-card:focus-within {
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    width: 3.3rem;
    height: 1.7rem;
    border-radius: 9999px;
    border: 1px solid var(--slate-300);
    background: linear-gradient(135deg, rgba(226, 232, 240, 0.95), rgba(241, 245, 249, 0.98));
    cursor: pointer;
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background: inherit;
}

.toggle-thumb {
    position: absolute;
    top: 0.18rem;
    left: 0.2rem;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 9999px;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
    transition: transform 0.25s ease, background 0.25s ease;
}

.toggle-switch input:focus-visible + .toggle-track {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.toggle-switch input:checked + .toggle-track {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(37, 99, 235, 0.28));
}

.toggle-switch input:checked + .toggle-track + .toggle-thumb {
    transform: translateX(1.6rem);
}

.lockable-field[data-locked="false"] .lock-overlay {
    display: none;
}

.lockable-field[data-locked="true"] .lock-overlay {
    opacity: 0;
    transition: opacity 0.25s ease;
}

.lockable-field[data-locked="true"]:hover .lock-overlay {
    opacity: 1;
}

.lockable-field[data-locked="true"] input {
    cursor: not-allowed;
}

/* Result tiles, badges and assumptions */
.result-tile {
    padding: 1.1rem 1.25rem;
    border-radius: 0.95rem;
    border: 1px solid var(--slate-200);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    text-align: center;
}

.result-tile--subtle {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.96));
}

.result-tile-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
}

.result-tile-value {
    margin-top: 0.3rem;
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.result-tile-description {
    margin-top: 0.45rem;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--text-tertiary);
}

.status-badge,
.iv-rank-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.38rem 0.82rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-width: 1px;
    border-style: solid;
}

.status-badge svg {
    width: 1rem;
    height: 1rem;
}

.status-badge--accent {
    background: rgba(219, 234, 254, 0.85);
    border-color: rgba(37, 99, 235, 0.14);
    color: var(--accent);
}

.status-badge--warm {
    background: rgba(254, 243, 199, 0.9);
    border-color: rgba(245, 158, 11, 0.18);
    color: #b45309;
}

.status-badge--success {
    background: rgba(209, 250, 229, 0.9);
    border-color: rgba(16, 185, 129, 0.18);
    color: var(--success);
}

.status-badge--danger {
    background: rgba(254, 226, 226, 0.9);
    border-color: rgba(239, 68, 68, 0.18);
    color: var(--danger);
}

.status-badge--muted {
    background: rgba(241, 245, 249, 0.96);
    border-color: var(--slate-200);
    color: var(--text-secondary);
}

.iv-rank-status--low {
    color: var(--success);
    background: var(--success-soft);
    border-color: rgba(16, 185, 129, 0.22);
}

.iv-rank-status--neutral {
    color: #b45309;
    background: rgba(250, 204, 21, 0.14);
    border-color: rgba(245, 158, 11, 0.22);
}

.iv-rank-status--high {
    color: var(--danger);
    background: rgba(248, 113, 113, 0.14);
    border-color: rgba(239, 68, 68, 0.22);
}

.iv-rank-status__dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 9999px;
    display: inline-block;
}

.iv-rank-status--low .iv-rank-status__dot { background: #16a34a; }
.iv-rank-status--neutral .iv-rank-status__dot { background: #eab308; }
.iv-rank-status--high .iv-rank-status__dot { background: #ef4444; }

.result-assumptions-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    border-color: var(--slate-200);
    box-shadow: none;
}

details.section-card[data-collapsible-section] {
    overflow: visible;
}

/* Footnotes */
.footnote-ref {
    font-size: 0.7em;
    vertical-align: super;
    margin-left: 2px;
    padding: 0.1em 0.3em;
    background: rgba(37, 99, 235, 0.08);
    border-radius: 4px;
    color: var(--accent);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
}

.footnote-box {
    background: transparent;
    border: 0;
    border-left: 3px solid rgba(148, 163, 184, 0.35);
    border-radius: 0;
    box-shadow: none;
    padding: 1.25rem 0 1.25rem 1rem;
    margin-top: 1.5rem;
    font-style: normal;
    color: var(--text-secondary);
}

.footnote-box .footnote-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--slate-200);
    padding-bottom: 0.75rem;
}

.footnote-box p,
.footnote-box ol,
.footnote-box ul {
    color: var(--text-secondary);
}

.footnote-box strong {
    color: var(--text-primary);
}

/* Shared compatibility for legacy utility-heavy templates */
.calculator-page hr,
.options-shell hr,
.result-container hr,
.panel-card hr {
    border-color: var(--slate-200);
}

.calculator-page .text-white,
.options-shell .text-white,
.result-container .text-white,
.panel-card .text-white,
.section-card .text-white {
    color: var(--text-primary) !important;
}

.calculator-page .text-gray-500,
.calculator-page .text-gray-400,
.options-shell .text-gray-500,
.options-shell .text-gray-400,
.result-container .text-gray-500,
.result-container .text-gray-400,
.panel-card .text-gray-500,
.panel-card .text-gray-400,
.section-card .text-gray-500,
.section-card .text-gray-400 {
    color: var(--text-tertiary) !important;
}

.calculator-page .text-gray-300,
.options-shell .text-gray-300,
.result-container .text-gray-300,
.panel-card .text-gray-300,
.section-card .text-gray-300 {
    color: var(--text-secondary) !important;
}

.calculator-page .text-gray-200,
.options-shell .text-gray-200,
.result-container .text-gray-200,
.panel-card .text-gray-200,
.section-card .text-gray-200 {
    color: var(--text-primary) !important;
}

.calculator-page .text-indigo-400,
.options-shell .text-indigo-400,
.result-container .text-indigo-400,
.panel-card .text-indigo-400,
.section-card .text-indigo-400 {
    color: var(--accent) !important;
}

.calculator-page .text-green-400,
.options-shell .text-green-400,
.result-container .text-green-400,
.panel-card .text-green-400,
.section-card .text-green-400,
.calculator-page .text-emerald-400,
.options-shell .text-emerald-400,
.result-container .text-emerald-400,
.panel-card .text-emerald-400,
.section-card .text-emerald-400 {
    color: var(--success) !important;
}

.calculator-page .text-red-400,
.options-shell .text-red-400,
.result-container .text-red-400,
.panel-card .text-red-400,
.section-card .text-red-400 {
    color: var(--danger) !important;
}

.calculator-page .text-amber-200,
.options-shell .text-amber-200,
.result-container .text-amber-200,
.panel-card .text-amber-200,
.section-card .text-amber-200 {
    color: var(--warning) !important;
}

.calculator-page .text-teal-400,
.options-shell .text-teal-400,
.result-container .text-teal-400,
.panel-card .text-teal-400,
.section-card .text-teal-400,
.calculator-page .text-indigo-300,
.options-shell .text-indigo-300,
.result-container .text-indigo-300,
.panel-card .text-indigo-300,
.section-card .text-indigo-300,
.calculator-page .text-purple-400,
.options-shell .text-purple-400,
.result-container .text-purple-400,
.panel-card .text-purple-400,
.section-card .text-purple-400 {
    color: var(--accent) !important;
}

.calculator-page .bg-amber-500\/10,
.options-shell .bg-amber-500\/10 {
    background: rgba(245, 158, 11, 0.1) !important;
}

.calculator-page .border-amber-400\/60,
.options-shell .border-amber-400\/60 {
    border-color: rgba(245, 158, 11, 0.35) !important;
}

.calculator-page .focus-visible\:ring-emerald-300\/60:focus-visible,
.options-shell .focus-visible\:ring-emerald-300\/60:focus-visible {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18) !important;
}

.calculator-page .bg-gray-900\/80,
.options-shell .bg-gray-900\/80 {
    background: rgba(248, 250, 252, 0.98) !important;
}

.calculator-page .border-gray-700\/50,
.options-shell .border-gray-700\/50,
.result-container .border-gray-700\/50,
.panel-card .border-gray-700\/50 {
    border-color: var(--slate-200) !important;
}

/* Scrolling tabs mobile effects */
@media (max-width: 767px) {
    .scrolling-tabs-container {
        position: relative;
    }

    .scrolling-tabs-container nav {
        padding-block: 0.35rem;
    }

    .scrolling-tabs-container::before,
    .scrolling-tabs-container::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        width: 3rem;
        pointer-events: none;
        transition: opacity 0.3s ease;
        opacity: 0;
        z-index: 5;
    }

    .scrolling-tabs-container::before {
        left: 0;
        background: linear-gradient(to right, rgba(248, 250, 252, 0.98), transparent);
    }

    .scrolling-tabs-container::after {
        right: 0;
        background: linear-gradient(to left, rgba(248, 250, 252, 0.98), transparent);
    }

    .scrolling-tabs-container.show-scroll-start::before {
        opacity: 1;
    }

    .scrolling-tabs-container.show-scroll-end::after {
        opacity: 1;
    }

    .scroll-button {
        position: absolute;
        top: 0;
        bottom: 0;
        z-index: 10;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        background-color: transparent;
        border: none;
        color: var(--text-tertiary);
        cursor: pointer;
        transition: opacity 0.3s ease, color 0.2s ease;
        opacity: 0;
        pointer-events: none;
    }

    .scroll-button:hover {
        color: var(--text-primary);
    }

    .scroll-button.left-0 { left: 0; }
    .scroll-button.right-0 { right: 0; }

    .scrolling-tabs-container.show-scroll-start [data-scroll-button="left"],
    .scrolling-tabs-container.show-scroll-end [data-scroll-button="right"] {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Misc utilities */
.scrollbar-none::-webkit-scrollbar {
    display: none;
}

.scrollbar-none {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.footnote-box,
.formula-card,
.calculator-explanation,
.calculator-brief,
.panel-card,
.section-card,
.result-assumptions-panel {
    overflow-wrap: anywhere;
}

.mobile-nav-link,
.tab-button,
.nav-link,
.back-link,
.back-link-ghost,
.language-toggle,
.language-toggle--compact,
#currency-button,
.currency-option {
    min-height: 44px;
}

@media (orientation: landscape) and (max-width: 1024px) {
    .mobile-landscape-grid {
        display: grid;
        grid-template-columns: 1fr 1.25fr;
        gap: 1.5rem;
    }

    .mobile-landscape-form,
    .mobile-landscape-result {
        min-height: 0;
    }

    .mobile-landscape-sticky {
        position: sticky;
        top: 0.75rem;
        align-self: start;
    }

    .chart-box {
        height: 65vh;
        max-height: 500px;
    }
}

@media (min-width: 768px) {
    .tab-button {
        text-align: center;
        justify-content: center;
        align-items: center;
    }

    .tab-button svg {
        margin-top: 0;
    }
}

@media (max-width: 1350px) {
    .language-track {
        min-width: 7rem;
    }

    .language-toggle--compact .language-track {
        min-width: 6.2rem;
    }

    .language-label--full {
        display: none;
    }

    .language-label--short {
        display: inline-flex;
    }
}

@media (max-width: 480px) {
    .tab-button {
        min-width: 0;
        max-width: 100%;
    }

    .language-toggle--compact .language-track {
        min-width: 8.2rem;
        font-size: 0.66rem;
    }

    .language-toggle--compact .language-option {
        padding: 0.4rem 0.65rem;
    }
}
