/* ============================================
   NSE Fee Calculator - Calm Fintech UI
   ============================================ */

:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-alt: #eef3f8;
    --text: #0c1321;
    --text-secondary: #314158;
    --text-muted: #66768d;
    --border: #e1e7f0;
    --accent: #1f6feb;
    --accent-strong: #174bd1;
    --accent-soft: #e6efff;
    --success: #12825c;
    --warning: #b7791f;
    --danger: #c2413a;

    --fee-low: #12825c;
    --fee-moderate: #b7791f;
    --fee-high: #d97706;
    --fee-very-high: #c2413a;

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-pill: 999px;

    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 12px 24px rgba(15, 23, 42, 0.06);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark theme variables — applied by explicit toggle or system preference */
[data-theme="dark"] {
    --bg: #0f141d;
    --surface: #151b26;
    --surface-alt: #111826;
    --text: #eef2f7;
    --text-secondary: #c3cfdf;
    --text-muted: #8fa1ba;
    --border: #253247;
    --accent: #6aa9ff;
    --accent-strong: #93c0ff;
    --accent-soft: rgba(106, 169, 255, 0.15);

    /* Brighter fee colors for dark backgrounds (WCAG AA contrast) */
    --fee-low: #34d399;
    --fee-moderate: #fbbf24;
    --fee-high: #fb923c;
    --fee-very-high: #f87171;
}

/* When theme is "auto" (or unset), follow system preference */
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --bg: #0f141d;
        --surface: #151b26;
        --surface-alt: #111826;
        --text: #eef2f7;
        --text-secondary: #c3cfdf;
        --text-muted: #8fa1ba;
        --border: #253247;
        --accent: #6aa9ff;
        --accent-strong: #93c0ff;
        --accent-soft: rgba(106, 169, 255, 0.15);

        --fee-low: #34d399;
        --fee-moderate: #fbbf24;
        --fee-high: #fb923c;
        --fee-very-high: #f87171;
    }
}

[hidden] { display: none !important; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

body {
    font-family: "Avenir Next", "Avenir", "Helvetica Neue", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.bg-gradient {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at top left, rgba(31, 111, 235, 0.08), transparent 45%),
        radial-gradient(circle at 20% 80%, rgba(17, 133, 97, 0.06), transparent 50%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg) 55%, var(--surface-alt) 100%);
}

.page-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg) var(--space-2xl);
}

/* ============================================
   Navigation
   ============================================ */

.top-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: inherit;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    border-radius: var(--radius-md);
    font-size: 1.2rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: 1.1rem;
    font-weight: 700;
}

.brand-tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.theme-toggle {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--surface-alt);
    border-color: var(--accent);
}

.theme-toggle-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.nav-links a:hover {
    color: var(--text);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
    background: var(--accent-strong);
}

.btn-ghost {
    color: var(--accent);
    border-color: var(--accent);
    background: transparent;
}

.btn-ghost:hover {
    background: var(--accent-soft);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* ============================================
   Hero
   ============================================ */

.hero {
    padding: var(--space-2xl) 0 var(--space-xl);
}

.hero-content {
    max-width: 800px;
}

/* Hero Badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--accent-soft);
    border-radius: var(--radius-pill);
    margin-bottom: var(--space-lg);
}

.hero-badge-icon {
    font-size: 1.125rem;
}

.hero-badge-text {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
}

/* Hero Title - Multi-line */
.hero-title {
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    display: flex;
    flex-direction: column;
    line-height: 1.05;
    margin-bottom: var(--space-lg);
}

.hero-title-line {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 700;
}

.hero-title-line--accent {
    color: var(--accent);
    position: relative;
}

.hero-title-line--accent::after {
    content: "";
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    height: 12px;
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    border-radius: 4px;
    z-index: -1;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.hero-lead {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
    max-width: 580px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
    align-items: center;
}

/* Hero Proof Cards */
.hero-proof {
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border);
}

.proof-header {
    margin-bottom: var(--space-md);
}

.proof-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.proof-cards {
    display: flex;
    align-items: stretch;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.proof-card {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.proof-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.proof-card--warning {
    border-color: rgba(194, 65, 58, 0.3);
}

.proof-card--warning::before {
    background: var(--fee-very-high);
}

.proof-card--success {
    border-color: rgba(18, 130, 92, 0.3);
}

.proof-card--success::before {
    background: var(--fee-low);
}

.proof-ticker {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.proof-trade {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.proof-divider {
    height: 1px;
    background: var(--border);
    margin: var(--space-xs) 0;
}

.proof-fees {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-sm);
}

.proof-fees-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.proof-fees-amount {
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.proof-percent {
    display: flex;
    flex-direction: column;
    padding: var(--space-sm);
    background: var(--surface-alt);
    border-radius: var(--radius-md);
    margin-top: var(--space-xs);
}

.proof-percent-value {
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    color: var(--fee-very-high);
}

.proof-card--success .proof-percent-value {
    color: var(--fee-low);
}

.proof-percent-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.proof-saved {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-sm);
    border-top: 1px dashed var(--border);
    margin-top: var(--space-xs);
}

.proof-saved-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.proof-saved-value {
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--success);
}

.proof-arrow {
    display: flex;
    align-items: center;
    color: var(--text-muted);
}

.proof-footnote {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Legacy Highlights */
.hero-highlights {
    display: none;
}

/* ============================================
   Sections
   ============================================ */

.section-heading {
    margin: var(--space-2xl) 0 var(--space-lg);
    max-width: 700px;
}

.section-title {
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: 2rem;
    margin-bottom: 0.6rem;
}

.section-lead {
    color: var(--text-secondary);
}

.calculator-shell {
    margin-top: var(--space-2xl);
}

.calculator-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* ============================================
   Calculator Card
   ============================================ */

.calc-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    box-shadow: var(--shadow);
}

/* Direction Switch */
.direction-switch {
    position: relative;
    display: flex;
    gap: var(--space-sm);
    background: var(--surface-alt);
    border-radius: var(--radius-pill);
    padding: var(--space-xs);
    margin-bottom: var(--space-lg);
}

.dir-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.dir-btn:hover {
    color: var(--text);
}

.dir-btn.active {
    color: var(--text);
}

.dir-slider {
    position: absolute;
    left: var(--space-xs);
    top: var(--space-xs);
    bottom: var(--space-xs);
    width: calc(50% - var(--space-xs));
    background: var(--accent-soft);
    border-radius: var(--radius-pill);
    transition: all 0.2s ease;
}

.direction-switch[data-sell="true"] .dir-slider {
    left: calc(50% + var(--space-xs));
    background: rgba(194, 65, 58, 0.15);
}

.dir-icon {
    font-size: 0.75rem;
}

/* ============================================
   Input Grid
   ============================================ */

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.input-group--full {
    grid-column: 1 / -1;
}

/* Input Groups */
.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.input-label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.input-icon {
    color: var(--accent);
    opacity: 0.8;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
}

.input-field {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
}

.input-field::placeholder {
    color: var(--text-muted);
}

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

/* Select */
.input-select {
    padding-right: var(--space-xl);
    cursor: pointer;
}

.input-arrow {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper:focus-within .input-arrow {
    color: var(--accent);
}

/* Price Input */
.input-price {
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: right;
    padding-right: 110px;
}

.price-badge {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-alt);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Quantity Stepper */
.quantity-stepper {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.quantity-stepper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.qty-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--surface-alt);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.qty-btn:hover {
    background: var(--accent);
    color: #ffffff;
}

.qty-btn:active {
    transform: scale(0.98);
}

.input-qty {
    flex: 1;
    text-align: center;
    border: none;
    background: transparent;
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.input-qty:focus {
    box-shadow: none;
}

/* Custom Broker */
.custom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

/* Input Hint */
.input-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   Results Section
   ============================================ */

.results-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Result Main Card */
.result-main {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-align: center;
    box-shadow: var(--shadow);
}

.result-main::before { content: none; }

.result-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    position: relative;
}

.result-action {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.result-pulse { display: none; }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.result-amount-wrapper {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
    position: relative;
}

.result-currency {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.result-amount {
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-strong);
    line-height: 1;
}

.result-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.fee-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(18, 130, 92, 0.12);
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    font-weight: 600;
}

.fee-badge.fee-low { background: rgba(16, 185, 129, 0.15); color: var(--fee-low); }
.fee-badge.fee-moderate { background: rgba(245, 158, 11, 0.15); color: var(--fee-moderate); }
.fee-badge.fee-high { background: rgba(249, 115, 22, 0.15); color: var(--fee-high); }
.fee-badge.fee-very-high { background: rgba(239, 68, 68, 0.15); color: var(--fee-very-high); }

.fee-emoji { font-size: 1rem; }

.fee-divider { color: var(--text-muted); }
.fee-detail { color: var(--text-secondary); font-weight: 500; }

/* Fee Visualizer */
.fee-visualizer {
    padding: var(--space-md);
}

.fee-bar-container {
    position: relative;
    margin-bottom: var(--space-sm);
}

.fee-bar-bg {
    height: 14px;
    background: var(--surface-alt);
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--fee-low) 22%, var(--surface-alt)) 0%,
        color-mix(in srgb, var(--fee-low) 22%, var(--surface-alt)) 32%,
        color-mix(in srgb, var(--fee-moderate) 22%, var(--surface-alt)) 32%,
        color-mix(in srgb, var(--fee-moderate) 22%, var(--surface-alt)) 60%,
        color-mix(in srgb, var(--fee-high) 22%, var(--surface-alt)) 60%,
        color-mix(in srgb, var(--fee-high) 22%, var(--surface-alt)) 84%,
        color-mix(in srgb, var(--fee-very-high) 22%, var(--surface-alt)) 84%,
        color-mix(in srgb, var(--fee-very-high) 22%, var(--surface-alt)) 100%
    );
    border-radius: var(--radius-pill);
    overflow: hidden;
    position: relative;
}

.fee-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--fee-low);
    border-radius: var(--radius-pill);
    transition: width 0.25s ease, background-color 0.25s ease;
    position: relative;
}

.fee-bar-fill.fee-low { background: var(--fee-low); }
.fee-bar-fill.fee-moderate { background: var(--fee-moderate); }
.fee-bar-fill.fee-high { background: var(--fee-high); }
.fee-bar-fill.fee-very-high { background: var(--fee-very-high); }

.fee-bar-fill::after { content: none; }

.fee-bar-glow { display: none; }

.fee-markers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.fee-markers .marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: color-mix(in srgb, var(--surface) 58%, var(--text) 42%);
    opacity: 0.5;
}

.fee-markers .marker-start { left: 0%; }
.fee-markers .marker-16 { left: 32%; }
.fee-markers .marker-30 { left: 60%; }
.fee-markers .marker-50 { left: 100%; transform: translateX(-2px); }

.fee-labels {
    position: relative;
    height: 1rem;
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.fee-labels span {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
}

.fee-labels .label-start { left: 0%; transform: none; }
.fee-labels .label-16 { left: 32%; }
.fee-labels .label-30 { left: 60%; }
.fee-labels .label-50 { left: 100%; transform: translateX(-100%); }

/* Alert Box */
.alert-box {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(183, 121, 31, 0.12);
    border: 1px solid rgba(183, 121, 31, 0.25);
    border-radius: var(--radius-md);
}

.alert-icon { font-size: 1.25rem; }
.alert-content strong { display: block; font-size: 0.875rem; margin-bottom: 2px; }
.alert-content p { font-size: 0.8125rem; color: var(--text-secondary); }

/* Breakdown Details */
.breakdown-details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.breakdown-toggle {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.breakdown-toggle:hover {
    color: var(--text);
    background: var(--surface-alt);
}

.breakdown-toggle .chevron {
    transition: transform 0.3s var(--ease-out);
}

.breakdown-details[open] .breakdown-toggle .chevron {
    transform: rotate(180deg);
}

.breakdown-list {
    padding: 0 var(--space-lg) var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-item small {
    font-size: 0.75em;
    color: var(--text-muted);
}

.breakdown-item--total {
    font-weight: 600;
    padding-top: var(--space-md);
    border-top: 1px dashed var(--border);
    border-bottom: none;
}

.breakdown-item--grand {
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: 1.125rem;
    font-weight: 700;
    padding-top: var(--space-sm);
}

.breakdown-item--stamp {
    color: var(--warning);
}

/* Result Summary */
.result-summary {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.7;
}

/* Share Button */
.share-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    border: none;
    border-radius: var(--radius-lg);
    background: var(--accent);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
    box-shadow: var(--shadow-soft);
}

.share-btn:hover {
    background: var(--accent-strong);
}

.share-btn .share-hint {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.75;
}

/* ============================================
   Section Titles
   ============================================ */

.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.section-title svg {
    color: var(--accent);
}

.section-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

/* ============================================
   Impact Table
   ============================================ */

.table-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-soft);
}

.impact-table {
    width: 100%;
    border-collapse: collapse;
}

.impact-table th {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.impact-table td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.impact-table tr:last-child td {
    border-bottom: none;
}

.impact-table tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius-lg);
}

.impact-table tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius-lg);
}

/* Verdict Card */
.verdict-card {
    padding: var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    box-shadow: var(--shadow-soft);
}

.verdict-card p {
    margin: 0;
    line-height: 1.6;
}

.verdict-kicker {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.verdict-title {
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: 1.25rem;
    line-height: 1.25;
    margin-bottom: var(--space-sm);
}

.verdict-message {
    color: var(--text-secondary);
}

.verdict-action {
    margin-top: var(--space-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.verdict-action:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-strong);
}

.verdict-action--step {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-strong);
}

.verdict-action--step:hover {
    background: var(--accent);
    color: #fff;
}

.verdict-card--optimal,
.verdict-card--good {
    border-color: color-mix(in srgb, var(--fee-low) 35%, var(--border));
    background: color-mix(in srgb, var(--fee-low) 8%, var(--surface));
}

.verdict-card--moderate {
    border-color: color-mix(in srgb, var(--fee-moderate) 45%, var(--border));
    background: color-mix(in srgb, var(--fee-moderate) 10%, var(--surface));
}

.verdict-card--high {
    border-color: color-mix(in srgb, var(--fee-high) 45%, var(--border));
    background: color-mix(in srgb, var(--fee-high) 10%, var(--surface));
}

.verdict-card--avoid {
    border-color: color-mix(in srgb, var(--fee-very-high) 45%, var(--border));
    background: color-mix(in srgb, var(--fee-very-high) 8%, var(--surface));
}

/* ============================================
   Break Even Section
   ============================================ */

.be-card {
    padding: var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.be-main {
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.be-sub {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ============================================
   Broker Section
   ============================================ */

.broker-scroll {
    overflow: visible;
    margin: 0;
    padding: 0;
}

.broker-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--space-sm);
}

.broker-item {
    padding: 0.875rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    min-width: 0;
    display: grid;
    gap: 0.35rem;
    align-content: start;
}

.broker-item.best {
    border-color: var(--accent);
    box-shadow: 0 0 18px rgba(31, 111, 235, 0.18);
}

.broker-name {
    font-size: 0.8125rem;
    line-height: 1.4;
    font-weight: 600;
    margin-bottom: 0.125rem;
    min-height: 2.25em;
}

.broker-rate {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

.broker-fee {
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: 1.0625rem;
    font-weight: 700;
}

.broker-meta {
    margin-top: var(--space-xs);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   Education Section
   ============================================ */

.edu-section {
    margin-top: var(--space-2xl);
}

.edu-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.edu-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.edu-card summary {
    padding: var(--space-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    list-style: none;
    user-select: none;
}

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

.edu-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-alt);
    border-radius: var(--radius-md);
}

.edu-header {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.edu-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.edu-chevron {
    color: var(--text-muted);
    transition: transform 0.3s var(--ease-out);
}

.edu-card[open] .edu-chevron {
    transform: rotate(180deg);
}

.edu-card p {
    padding: 0 var(--space-md) var(--space-md);
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.edu-card code {
    background: var(--surface-alt);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "SF Mono", "Monaco", monospace;
    font-size: 0.875em;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    margin-top: var(--space-2xl);
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}

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

.footer-links a:hover {
    color: var(--text);
}

.footer-dot { color: var(--text-muted); }

.footer-note {
    opacity: 0.7;
}

.footer-sources {
    opacity: 0.5;
    font-size: 0.75rem;
    margin-top: var(--space-xs);
}

.footer-sources a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ============================================
   Sticky Result Bar
   ============================================ */

.sticky-result {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transform: translateY(-100%);
    transition: transform 0.3s var(--ease-out);
}

.sticky-result.visible {
    transform: translateY(0);
}

.sticky-result[hidden] {
    display: flex !important;
    transform: translateY(-100%);
}

.sticky-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.sticky-amount {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}

.sticky-fee {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

/* ============================================
   Loading State
   ============================================ */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.loading-overlay[hidden] {
    opacity: 0;
    visibility: hidden;
}

.spinner-ring {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: var(--space-lg);
}

.spinner-ring .ring {
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

.spinner-ring .ring:nth-child(1) { animation-delay: 0s; }
.spinner-ring .ring:nth-child(2) { animation-delay: -0.4s; }
.spinner-ring .ring:nth-child(3) { animation-delay: -0.8s; }

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

.loading-overlay p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ============================================
   Hidden Share Card
   ============================================ */

.share-card-hidden {
    position: fixed;
    left: -9999px;
    top: 0;
}

.share-card-inner {
    width: 400px;
    padding: var(--space-xl);
    background: var(--accent);
    color: white;
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

.share-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    opacity: 0.9;
}

.share-flag { font-size: 1.5rem; }
.share-title { font-size: 1rem; font-weight: 600; }

.share-trade {
    font-size: 1.125rem;
    margin-bottom: var(--space-lg);
    opacity: 0.95;
}

.share-hero {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.share-label {
    display: block;
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: var(--space-xs);
}

.share-amount {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

.share-fee {
    text-align: center;
    font-size: 1.25rem;
    margin-bottom: var(--space-md);
}

.share-breakdown {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
    opacity: 0.9;
}

.share-footer {
    text-align: center;
    font-size: 0.875rem;
    opacity: 0.7;
    padding-top: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* ============================================
   Responsive
   ============================================ */

/* ============================================
   Trust Section
   ============================================ */

.trust-section {
    margin-top: var(--space-2xl);
}

.aha-panel {
    margin: var(--space-xl) 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-md);
    align-items: stretch;
}

.aha-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-soft);
}

.aha-card--solution {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface));
}

.aha-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.aha-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.aha-divider {
    align-self: center;
    font-size: 1.35rem;
    color: var(--accent);
    font-weight: 700;
}

/* Fee Breakdown Visual */
.fee-breakdown-visual {
    margin: var(--space-xl) 0;
    padding: var(--space-xl);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
}

.breakdown-visual-row {
    margin-bottom: var(--space-md);
}

.breakdown-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    background: var(--surface-alt);
    border-radius: var(--radius-md);
    padding: 0 var(--space-md);
    position: relative;
    overflow: hidden;
}

.breakdown-bar::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--width);
    background: var(--accent);
    border-radius: var(--radius-md);
    transition: width 0.6s var(--ease-out);
}

.breakdown-bar--statutory::before {
    background: var(--warning);
}

.breakdown-bar--stamp::before {
    background: var(--fee-very-high);
}

.breakdown-label,
.breakdown-percent {
    position: relative;
    z-index: 1;
    font-size: 0.875rem;
    font-weight: 600;
}

.breakdown-label {
    color: var(--text);
}

.breakdown-percent {
    color: var(--text-secondary);
}

.breakdown-footnote {
    margin-top: var(--space-md);
    padding-left: var(--space-md);
    font-size: 0.8125rem;
    color: var(--text-muted);
    border-left: 3px solid var(--accent);
    line-height: 1.6;
}

/* Trust Grid */
.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.trust-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.trust-icon {
    font-size: 1.75rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-alt);
    border-radius: var(--radius-md);
}

.trust-item h3 {
    font-size: 1.0625rem;
    font-weight: 600;
}

.trust-item p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.trust-item em {
    font-style: normal;
    font-weight: 600;
    color: var(--text);
}

/* ============================================
   Marketing Sections
   ============================================ */

.insight-section,
.features-section,
.steps-section,
.stats-section,
.cta-section {
    margin-top: var(--space-2xl);
}

.split-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-md);
}

.split-card {
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.split-card--accent {
    border-color: var(--accent);
}

.split-card h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-sm);
}

.split-card ul {
    list-style: none;
    display: grid;
    gap: 0.4rem;
    color: var(--text-secondary);
}

.section-note {
    margin-top: var(--space-lg);
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 760px;
}

.section-quote {
    margin-top: var(--space-md);
    max-width: 760px;
    padding: var(--space-md) var(--space-lg);
    border-left: 3px solid var(--accent);
    background: color-mix(in srgb, var(--surface-alt) 70%, transparent);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.9375rem;
    line-height: 1.65;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-md);
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-soft);
}

.feature-card h3 {
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-secondary);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
}

.step-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

.stat-card {
    padding: var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent-strong);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 0.4rem;
}

.cta-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.cta-card h2 {
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    margin-bottom: 0.5rem;
}

.cta-card p {
    color: var(--text-secondary);
}

.cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

/* ============================================
   Animations (Minimal)
   ============================================ */

.fade-in,
.fade-in-up {
    animation: none;
    opacity: 1;
    transform: none;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1200px) {
    .broker-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .nav-links {
        display: none;
    }

    .page-wrapper {
        padding: var(--space-lg) var(--space-md) var(--space-2xl);
    }

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

@media (max-width: 640px) {
    .nav-inner {
        flex-wrap: wrap;
    }

    .hero-actions,
    .cta-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .proof-cards {
        flex-direction: column;
    }

    .proof-arrow {
        transform: rotate(90deg);
        align-self: center;
    }

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

    .fee-breakdown-visual {
        padding: var(--space-md);
    }

    .aha-panel {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .aha-divider {
        justify-self: center;
        transform: rotate(90deg);
        font-size: 1.1rem;
    }

    .breakdown-bar {
        height: 40px;
        padding: 0 var(--space-sm);
    }

    .breakdown-label {
        font-size: 0.8125rem;
    }

    .breakdown-label span {
        display: none;
    }

    .breakdown-label::after {
        content: attr(data-short);
    }

    .broker-list {
        grid-template-columns: 1fr;
    }

    .broker-name {
        min-height: 0;
    }

    /* Impact table → card layout on narrow mobile */
    .impact-table thead {
        display: none;
    }

    .impact-table,
    .impact-table tbody,
    .impact-table tr,
    .impact-table td {
        display: block;
    }

    .impact-table tr {
        padding: var(--space-md) var(--space-lg);
        border-bottom: 1px solid var(--border);
    }

    .impact-table tr:last-child {
        border-bottom: none;
    }

    .impact-table td {
        padding: 2px var(--space-lg);
        border-bottom: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.875rem;
    }

    .impact-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }
}

/* ============================================
   Accessibility
   ============================================ */

*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
