/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}


html {
    height: 100%;
    background: #0d3d4a;
}

body {
    height: 100%;
    overflow: auto;
    overscroll-behavior: none;
    background: #0d3d4a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ── Color Variables ───────────────────────────────── */
:root {
    --teal-dark: #0d3d4a;
    --teal-mid: #1a5c6b;
    --teal-light: #2a7a8a;
    --white: #ffffff;
    --white-muted: rgba(255, 255, 255, 0.75);
    --white-faint: rgba(255, 255, 255, 0.15);
    --white-fainter: rgba(255, 255, 255, 0.08);
    --amber: #f59e0b;
    --amber-faint: rgba(245, 158, 11, 0.15);
    --red: #ef4444;
    --green: #22c55e;
}

/* ── Hero (homepage) ───────────────────────────────── */
.hero {
    position: relative;
    height: 100vh;
    height: 100dvh;
    min-height: 560px;
    overflow: hidden;
}

.hero__bg {
    position: absolute;
    inset: 0;
    background-image: url('/assets/Homepage.png');
    background-size: cover;
    background-position: left top;
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right,
        rgba(10, 50, 60, 0.05) 0%, rgba(10, 50, 60, 0.12) 28%,
        rgba(10, 50, 60, 0.52) 50%, rgba(10, 50, 60, 0.76) 65%,
        rgba(10, 50, 60, 0.88) 100%);
}

.hero__content {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.hnav {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.hnav__brand {
    padding: 1rem 1.4rem;
}

.nav-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.site-logo {
    height: 56px;
    width: auto;
    display: block;
}

.hnav__right {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0.4rem 1.5rem 0 0;
}

/* auth.js injects .nav__link and .nav__user into .hnav__right — scale to match Sign In */
.hnav__right .nav__link,
.hnav__right .nav__user {
    font-size: 0.95rem;
    line-height: 52px;
    color: rgba(255, 255, 255, 0.88);
    padding: 0 1rem;
}

.signin-btn {
    display: flex;
    align-items: center;
    height: 52px;
    padding: 0 2rem;
    background: rgba(210, 218, 224, 0.90);
    color: #0d1f26;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    font-family: inherit;
    text-decoration: none;
    border: none;
    white-space: nowrap;
    cursor: pointer;
}

.signin-btn--out { display: none; }
html.auth-preload .signin-btn--in { display: none; }
html.auth-preload .signin-btn--out { display: flex; }

.hamburger {
    width: 52px;
    height: 52px;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 12px;
    cursor: pointer;
    border: none;
}

.hamburger:hover,
.hamburger:focus-visible {
    background: rgba(255, 255, 255, 0.9);
}

.hamburger:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 3px;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #1a2a30;
    border-radius: 1px;
}

.ham-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    max-width: calc(100vw - 2rem);
    background: rgba(8, 22, 12, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 900;
}

.ham-dropdown.is-open {
    display: block;
}

.ham-dropdown__email {
    padding: 14px 16px 12px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.72);
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ham-dropdown__divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0;
}

.ham-dropdown__item {
    display: block;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: background 0.15s ease, color 0.15s ease;
}

.ham-dropdown__item:hover,
.ham-dropdown__item:focus-visible {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.ham-dropdown__item:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: -2px;
}

.ham-dropdown__item--upgrade {
    color: #fbbf24;
}

.ham-dropdown__item--upgrade:hover,
.ham-dropdown__item--upgrade:focus-visible {
    color: #fde68a;
}

.ham-dropdown__item--logout {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
}

.ham-dropdown__item--logout:hover,
.ham-dropdown__item--logout:focus-visible {
    color: rgba(255, 255, 255, 0.78);
}

.ham-dropdown__email--unverified {
    padding-bottom: 4px;
}

.ham-dropdown__verify-status {
    padding: 0 16px 4px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.68);
    letter-spacing: 0.01em;
}

.ham-dropdown__resend {
    display: block;
    width: 100%;
    padding: 0 16px 12px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.72);
    letter-spacing: 0.01em;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ham-dropdown__resend:hover:not(:disabled) {
    color: rgba(255, 255, 255, 0.65);
}

.ham-dropdown__resend:disabled {
    cursor: default;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.5);
}

.hero__main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 28vh 2.25rem 0 53%;
}

.hero__footer {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    padding: 1.5rem 2.25rem 1.75rem 53%;
}

.hero-legal-link {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: color 0.2s ease;
}

.hero-legal-link:hover {
    color: rgba(255, 255, 255, 0.72);
}

.content-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: max-content;
}

.hero .headline {
    margin-top: 0;
    margin-bottom: 1.75rem;
    font-size: 4.5rem;
    line-height: 1.15;
}

.hero .headline strong {
    font-weight: 900;
}

.hero .cta {
    align-self: flex-start;
    display: inline-block;
    border: 2px solid rgba(255, 255, 255, 0.88);
    background: transparent;
    color: #fff;
    padding: 1rem 4rem;
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-decoration: none;
}

.hero .cta:hover {
    background: rgba(255, 255, 255, 0.08);
}

.hero .trust-strip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 2rem;
    gap: 0.85rem;
}

.hero .trust-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.35rem;
    font-weight: 400;
    white-space: nowrap;
}

.hero .trust-item img {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

/* ── Auth preload: hide entire nav right until auth.js resolves final state ── */
html.auth-preload .nav__right,
html.auth-preload .hnav__right {
    visibility: hidden;
}

/* ── Nav ───────────────────────────────────────────── */
.nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5rem;
}

.nav__brand {
    color: var(--white);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-decoration: none;
}

.nav__link {
    color: var(--white-muted);
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s;
}

.nav__link:hover {
    color: var(--white);
}

.nav__right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* nav-state wrappers - transparent flex containers matching nav__right layout */
.nav-state--out,
.nav-state--in {
    display: flex;
    align-items: center;
    gap: inherit;
}

.nav-state--in {
    display: none;
}

.nav__btn {
    color: var(--white);
    font-size: 0.875rem;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 0.4rem 1.2rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav__btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.7);
}

/* ── Headline ──────────────────────────────────────── */
.headline {
    color: var(--white);
    font-size: 3rem;
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    margin-top: 5rem;
}

.headline strong {
    font-weight: 700;
}

/* ── Subtitle ──────────────────────────────────────── */
.subtitle {
    color: var(--white-muted);
    font-size: 1.125rem;
    font-weight: 300;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    max-width: 480px;
}

/* ── CTA Button ────────────────────────────────────── */
.cta-button {
    display: inline-block;
    border: 2px solid var(--white);
    background: transparent;
    color: var(--white);
    padding: 0.875rem 2.5rem;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.cta-button:hover:not(:disabled) {
    background: var(--white);
    color: var(--teal-dark);
}

.cta-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.cta-button--sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
}

/* ── Trust Strip ───────────────────────────────────── */
.trust-strip {
    margin-top: auto;
    margin-left: -5rem;
    margin-right: -5rem;
    display: flex;
    justify-content: flex-start;
    gap: 2.5rem;
    padding: 1.5rem 5rem;
    border-top: 1px solid var(--white-faint);
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--white-muted);
    font-size: 0.85rem;
    font-weight: 400;
}

.trust-item img {
    width: 20px;
    height: 20px;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 900px) {
    .hero__main {
        padding: 8rem 1.5rem 2rem 5%;
    }
    .hero .headline {
        font-size: 2rem;
    }
    .hero .trust-strip {
        margin-left: 0;
        width: 100%;
        gap: 1rem;
    }
    .nav {
        padding: 1rem 2rem;
    }
    .headline {
        font-size: 2.25rem;
    }
}


/* ═══════════════════════════════════════════════════════
   APP PAGE (body.app-page overrides)
   ═══════════════════════════════════════════════════════ */

body.app-page {
    overflow: auto;
    background: none;
    isolation: isolate;
    min-height: 100vh;
    height: auto;
}

body.app-page::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to bottom, var(--teal-mid) 0%, var(--teal-dark) 100%);
}

/* ── App nav: sticky so it stays visible as content scrolls ── */
body.app-page .nav {
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    z-index: 100;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--white-faint);
    background: var(--teal-mid);
}

/* ── App main container ──────────────────────────────── */
.app-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
}

/* ── App typography ──────────────────────────────────── */
.app-headline {
    color: var(--white);
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
}

.app-subtitle {
    color: var(--white-muted);
    font-size: 0.975rem;
    margin-bottom: 2rem;
}

/* ── Upload zone ─────────────────────────────────────── */
.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 1.5rem;
}

.upload-zone:hover,
.upload-zone:focus-visible,
.upload-zone--over {
    border-color: var(--white);
    background: var(--white-faint);
}

.upload-zone:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 3px;
}

.upload-zone--has-file {
    border-color: var(--white);
    border-style: solid;
}

.upload-zone__icon {
    font-size: 2rem;
    color: var(--white-muted);
    margin-bottom: 0.75rem;
}

.upload-zone__label {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.upload-zone__sublabel {
    color: var(--white-muted);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.upload-zone__browse {
    color: var(--white);
    font-size: 0.875rem;
    text-decoration: underline;
    cursor: pointer;
}

/* ── Account rows (Sprint 5 multi-file) ─────────────────────── */
.account-list {
    margin-bottom: 0.6rem;
}

.account-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    background: var(--white-faint);
    border-radius: 3px;
    margin-bottom: 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.account-row--empty {
    border: 1px dashed rgba(255, 255, 255, 0.25);
    background: var(--white-fainter);
    cursor: pointer;
}

.account-row--empty:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: var(--white-faint);
}

.account-row--empty:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 3px;
    border-color: rgba(255, 255, 255, 0.55);
}

.account-row__badge { flex-shrink: 0; }

.account-row__name {
    flex: 1;
    font-size: 0.875rem;
    color: var(--white);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-row__name--placeholder {
    color: var(--white-muted);
    font-style: italic;
}

.account-row__remove {
    flex-shrink: 0;
    color: var(--white-muted);
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    background: none;
    border: none;
    font-size: 0.9rem;
    font-family: inherit;
}

.account-row__remove:hover { color: var(--white); }

.account-row__remove:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
    border-radius: 3px;
    color: var(--white);
}

.add-account-btn {
    width: 100%;
    padding: 0.5rem;
    background: none;
    border: 1px dashed rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    color: var(--white-muted);
    font-size: 0.875rem;
    cursor: pointer;
    text-align: center;
    margin-bottom: 1rem;
    font-family: inherit;
    transition: border-color 0.15s, color 0.15s;
}

.add-account-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--white);
}

.add-account-btn:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 3px;
}

.add-account-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.acb-conflict-warn {
    font-size: 0.78rem;
    color: #f9c74f;
    margin-bottom: 0.75rem;
}

/* ── Upload controls row ─────────────────────────────── */
.upload-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.875rem;
}

.year-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--white-muted);
    font-size: 0.875rem;
}

.year-select {
    background: var(--white-faint);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    border-radius: 2px;
    cursor: pointer;
}

.year-select option {
    background: var(--teal-dark);
    color: var(--white);
}

.year-select:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 3px;
}

.reg-accounts-label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    color: var(--white-muted);
    font-size: 0.875rem;
}

.reg-accounts-input {
    background: var(--white-faint);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    border-radius: 2px;
    width: 22rem;
    max-width: 100%;
}

.reg-accounts-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.reg-accounts-input:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 3px;
}

.error-block {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: var(--white-faint);
    color: var(--white);
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* ── Spinner ─────────────────────────────────────────── */
.spinner-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1.5rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--white-faint);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.spinner-label {
    color: var(--white-muted);
    font-size: 0.975rem;
}

/* ── Results section ─────────────────────────────────── */
.results-section {
    animation: fadeIn 0.3s ease;
}

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

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.results-title {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 300;
}

/* ── Summary cards ───────────────────────────────────── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--white-faint);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 1.25rem 1.5rem;
}

.card-title {
    color: var(--white);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--white-faint);
}

.row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.2rem 0;
    font-size: 0.875rem;
}

.row-label {
    color: var(--white-muted);
}

.row-val {
    color: var(--white);
    font-variant-numeric: tabular-nums;
}

/* ── Section label ───────────────────────────────────── */
.section-label {
    color: var(--white);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

/* ── Warnings ────────────────────────────────────────── */
.warnings-block {
    background: var(--amber-faint);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 4px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.warning-item {
    color: var(--white-muted);
    font-size: 0.875rem;
    padding: 0.4rem 0;
    padding-left: 0.75rem;
    border-left: 3px solid var(--amber);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.warning-item:last-child {
    margin-bottom: 0;
}

/* ── Dispositions table ──────────────────────────────── */
.table-section {
    margin-bottom: 2rem;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--white-faint);
    border-radius: 4px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.data-table th {
    background: rgba(0, 0, 0, 0.2);
    color: var(--white-muted);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.7rem;
    padding: 0.6rem 0.75rem;
    text-align: left;
    white-space: nowrap;
}

.data-table td {
    color: var(--white);
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--white-faint);
    white-space: nowrap;
}

.data-table tbody tr:hover td {
    background: var(--white-faint);
}

.data-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.data-table .neg {
    color: var(--red);
}

.data-table .amber {
    color: var(--amber);
}

.row-superficial td {
    background: rgba(245, 158, 11, 0.07);
}

.tag-sup {
    display: inline-block;
    background: var(--amber);
    color: var(--teal-dark);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 2px;
    margin-left: 0.3rem;
    vertical-align: middle;
    letter-spacing: 0.04em;
}

.badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    letter-spacing: 0.03em;
}

.badge-xml {
    background: rgba(74, 144, 217, 0.15);
    color: #4a90d9;
}

.badge-xlsx {
    background: rgba(52, 168, 83, 0.15);
    color: #34a853;
}

.badge-activeacb {
    background: rgba(150, 120, 220, 0.15);
    color: #a08fe0;
}

/* ── Download row ────────────────────────────────────── */
.download-row {
    display: flex;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--white-faint);
}

.dl-btn {
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: transparent;
    color: var(--white-muted);
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s;
}

.dl-btn:hover {
    border-color: var(--white);
    color: var(--white);
    background: var(--white-faint);
}

.dl-btn:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 3px;
}

/* ── Responsive app page ─────────────────────────────── */
@media (max-width: 700px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
    .upload-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .download-row {
        flex-direction: column;
    }
    .dl-btn {
        width: 100%;
    }
}

/* ── Footer ──────────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--white-muted);
    font-size: 0.75rem;
}

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

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

.footer__sep {
    margin: 0 0.5rem;
}

/* ── Guide pages ─────────────────────────────────────── */
.guide-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
}

.guide-container--wide {
    max-width: 960px;
}

.guide-back {
    display: inline-block;
    color: var(--white-muted);
    font-size: 0.85rem;
    text-decoration: none;
    margin-bottom: 1.5rem;
}

.guide-back:hover { color: var(--white); }

.guide-step--full {
    border-left: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.guide-step--full .guide-step__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.guide-step--full .guide-step__desc {
    margin: 0;
    line-height: 1.65;
}

.guide-img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.5rem;
    display: block;
}

.guide-link {
    color: rgba(125, 211, 252, 0.9);
    text-decoration: none;
}

.guide-link:hover { text-decoration: underline; }

.guide-list {
    color: var(--white-muted);
    font-size: 0.875rem;
    line-height: 1.8;
    padding-left: 1.4rem;
    margin: 0;
}

.guide-list li { margin-bottom: 0.15rem; }

.guide-settings {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    margin: 0;
}

.guide-settings__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    gap: 1rem;
}

.guide-settings__row:last-child { border-bottom: none; }

.guide-settings__row dt {
    color: var(--white-muted);
    font-size: 0.82rem;
    font-weight: 400;
}

.guide-settings__row dd {
    color: var(--white);
    font-size: 0.82rem;
    font-weight: 500;
    margin: 0;
    text-align: right;
}

.guide-title {
    color: var(--white);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.guide-subtitle {
    color: var(--white-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.guide-coming-soon {
    color: var(--white-muted);
    font-size: 0.875rem;
    margin-top: 1.5rem;
    text-align: center;
}

/* ── Broker cards ────────────────────────────────────── */
.broker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.broker-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s;
}

.broker-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.broker-card__name {
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.broker-card__desc {
    color: var(--white-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.broker-card__link {
    color: var(--white);
    font-size: 0.875rem;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    display: inline-block;
    transition: all 0.2s;
}

.broker-card__link:hover {
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 500px) {
    .broker-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Guide step blocks ───────────────────────────────── */
.guide-step {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--teal-light);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 0 8px 8px 0;
}

.guide-step__number {
    color: var(--teal-light);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.guide-step__title {
    color: var(--white);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.guide-step__desc {
    color: var(--white-muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

.guide-step__note {
    background: var(--amber-faint);
    border-left: 3px solid var(--amber);
    border-radius: 0 6px 6px 0;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--white-muted);
}

.guide-step__note--important {
    border-left-width: 4px;
    background: rgba(245, 158, 11, 0.12);
}

.guide-step__note p {
    margin: 0;
}

.guide-cta {
    margin-top: 2rem;
    text-align: center;
}

/* ── Legal pages ─────────────────────────────────────── */
.legal-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
}

/* ── Profile page ──────────────────────────────────────────── */
.profile-page {
    max-width: 480px;
    margin: 0 auto;
    padding: 5rem 1.5rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.history-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-title {
    color: var(--white);
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.profile-meta {
    font-size: 0.8rem;
    color: var(--white-muted);
    margin-top: -1rem;
}

.profile-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.profile-card__title {
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.profile-card__current {
    color: var(--white-muted);
    font-size: 0.875rem;
    margin: 0;
}

.profile-card__form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.profile-card__note {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.78rem;
    margin: 0;
}

.profile-card__msg {
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    margin: 0;
}

.profile-card__msg--ok {
    color: #86efac;
    background: rgba(134, 239, 172, 0.08);
    border: 1px solid rgba(134, 239, 172, 0.2);
}

.profile-card__msg--error {
    color: #fff;
    background: rgba(252, 165, 165, 0.08);
    border: 1px solid rgba(252, 165, 165, 0.2);
}

.profile-card--danger .profile-card__msg--error {
    background: transparent;
    border-color: transparent;
}

.cta-button--upgrade {
    border-color: #fbbf24;
    color: #fbbf24;
}

.cta-button--upgrade:hover:not(:disabled) {
    background: rgba(251, 191, 36, 0.1);
}

.cta-button--danger {
    background: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.4);
    color: #fff;
}

.cta-button--danger:hover:not(:disabled) {
    background: rgba(220, 53, 69, 0.3);
    border-color: rgba(220, 53, 69, 0.6);
    color: #fff;
}

.cta-button--subscribe {
    background: var(--teal-light);
    border-color: var(--teal-light);
    color: #fff;
}

.cta-button--subscribe:hover:not(:disabled) {
    background: var(--teal-mid);
    border-color: var(--teal-mid);
    color: #fff;
}

.profile-card--danger {
    border-color: rgba(239, 68, 68, 0.3);
}

.legal-container h1 {
    color: var(--white);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.legal-container h2 {
    color: var(--white);
    font-size: 1.125rem;
    font-weight: 500;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.legal-container p,
.legal-container ul {
    color: var(--white-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.legal-container ul {
    padding-left: 1.5rem;
}

.legal-container a {
    color: var(--white);
}

.legal-container .disclaimer {
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid #f59e0b;
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

.legal-container .disclaimer p,
.legal-container .disclaimer li {
    color: var(--white);
}

/* ── Login page ──────────────────────────────────────── */
.login-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    max-width: 360px;
    margin: 4rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-input {
    width: 100%;
    background: var(--white-faint);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-family: inherit;
    border-radius: 4px;
}

.login-input::placeholder {
    color: var(--white-muted);
}

.login-note {
    color: var(--white-muted);
    font-size: 0.8rem;
    text-align: center;
    margin: 0;
}

.login-back {
    color: var(--white-muted);
    font-size: 0.8rem;
    text-align: center;
    text-decoration: none;
}

.login-back:hover {
    color: var(--white);
}

/* ── Auth nav state ───────────────────────────────────────── */
.nav__user {
    color: var(--white-muted);
    font-size: 0.9rem;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Login page - Sprint 3 additions ─────────────────────── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

body.login-page .login-card {
    margin: 0;
    max-width: 380px;
}

.login-title {
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
}

.login-toggle {
    color: var(--white-muted);
    font-size: 0.8rem;
    text-align: center;
    line-height: 1.8;
    margin-top: 0.75rem;
}

.login-toggle a {
    color: var(--white);
    text-decoration: none;
}

.login-toggle a:hover {
    text-decoration: underline;
}

.login-success {
    color: #4ade80;
    font-size: 0.85rem;
    text-align: center;
    padding: 0.5rem 0;
}

.login-error {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.4);
    color: #fff;
    padding: 0.65rem 0.85rem;
    border-radius: 6px;
    font-size: 0.8rem;
}

.login-submit {
    width: 100%;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

.login-forgot {
    display: block;
    text-align: right;
    color: var(--white-muted);
    font-size: 0.8rem;
    text-decoration: none;
    margin-bottom: 0.5rem;
}

.login-forgot:hover {
    color: var(--white);
}

/* ── Post-result signup CTA banner ───────────────────────── */
.signup-banner {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.signup-banner__check {
    color: #fbbf24;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.signup-banner__copy {
    color: var(--white-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.signup-banner__btn {
    background: #fbbf24; /* hardcoded - --amber not guaranteed in :root */
    color: #000;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.6rem 1.25rem;
    border-radius: 7px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.signup-banner__btn:hover {
    opacity: 0.9;
}

/* ── Nav upgrade badge (auth + unpaid) ──────────────────────────────────── */

.nav__upgrade {
    background: #fbbf24;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.03em;
    line-height: 1;
}

.nav__upgrade:hover { background: #f59e0b; }


/* ── Email verify gate (shown on page-load or 403) ──────────────────────── */

.verify-gate {
    background: rgba(245, 158, 11, 0.08);
    border: 2px solid rgba(245, 158, 11, 0.4);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    margin: 1rem 0;
}

.verify-gate__icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.verify-gate__heading {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    color: var(--white);
}

.verify-gate__copy {
    color: var(--white-muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.verify-gate__btn {
    background: #fbbf24;
    color: #000;
    border: none;
    border-radius: 7px;
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.verify-gate__btn:hover { opacity: 0.9; }
.verify-gate__btn:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 3px;
}
.verify-gate__btn:disabled { opacity: 0.5; cursor: default; }

.gate-status {
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.gate-status--ok  { color: #6ee7b7; }
.gate-status--err { color: #fca5a5; }

/* ── Subscribe gate (shown on 402) ──────────────────────────────────────── */

.subscribe-gate {
    background: rgba(245, 158, 11, 0.08);
    border: 2px solid rgba(245, 158, 11, 0.4);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    margin: 1rem 0;
}

.subscribe-gate__icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subscribe-gate__heading {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    color: var(--white);
}

.subscribe-gate__copy {
    color: var(--white-muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.subscribe-gate__note {
    font-size: 0.8rem;
    opacity: 0.75;
}

.subscribe-gate__btn {
    background: #fbbf24;
    color: #000;
    border: none;
    border-radius: 7px;
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.subscribe-gate__btn:hover { opacity: 0.9; }
.subscribe-gate__btn:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 3px;
}


/* ── FAQ section ─────────────────────────────────────────────────────── */

.faq-section {
    margin: 2rem 0;
}

.faq-section__heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 1.25rem;
}

.faq-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.faq-item summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    color: var(--white);
    font-weight: 600;
    font-size: 0.95rem;
    user-select: none;
    transition: color 0.2s ease, background 0.2s ease;
}

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

.faq-item summary:hover,
.faq-item summary:focus-visible,
.faq-item[open] summary {
    color: var(--white);
}

.faq-item summary:hover::after,
.faq-item summary:focus-visible::after {
    color: var(--white);
}

.faq-item summary:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 4px;
    border-radius: 4px;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.3rem;
    font-weight: 300;
    flex-shrink: 0;
    color: var(--white-muted);
    line-height: 1;
    width: 1rem;
    text-align: right;
    transition: color 0.2s ease, transform 0.2s ease;
}

.faq-item[open] summary::after {
    content: '-';
    color: var(--white);
    transform: rotate(180deg);
}

.faq-item__answer {
    color: var(--white-muted);
    font-size: 0.9rem;
    line-height: 1.65;
    padding-bottom: 1rem;
    animation: faqAnswerIn 0.18s ease;
}

.faq-item__answer p + p {
    margin-top: 0.75rem;
}

@keyframes faqAnswerIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 700px) {
    .faq-section {
        margin: 1.5rem 0;
    }

    .faq-section__heading {
        font-size: 1.1rem;
    }

    .faq-item summary {
        align-items: flex-start;
        padding: 0.9rem 0;
        font-size: 0.9rem;
        line-height: 1.45;
    }

    .faq-item__answer {
        font-size: 0.86rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .faq-item summary,
    .faq-item summary::after,
    .faq-item__answer {
        animation: none;
        transition: none;
    }
}


/* ── Post-payment toast ──────────────────────────────────────────────────── */

.nav-toast {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: #fbbf24;
    color: #000;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem 1.25rem;
    border-radius: 7px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1000;
    white-space: nowrap;
}

.nav-toast--visible { opacity: 1; }


/* ── T5008 pull-up drawer ────────────────────────────────────────────────── */

.t5008-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    position: fixed;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 650;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.88);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 10px 22px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: background 0.2s ease;
}

.t5008-tab:hover {
    background: rgba(255, 255, 255, 0.08);
}

.t5008-tab__arrow {
    font-size: 0.55rem;
    transition: transform 0.35s ease;
    opacity: 0.6;
}

.t5008-tab[aria-expanded="true"] .t5008-tab__arrow {
    transform: rotate(180deg);
}

.t5008-tab[aria-expanded="true"] {
    opacity: 0;
    pointer-events: none;
}

/* Invisible full-screen click-outside handler */
.t5008-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 700;
    opacity: 0;
    pointer-events: none;
}

.t5008-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Drawer: left panel only, translucent over the tree */
.t5008-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: fit-content;
    max-width: 90vw;
    height: 97vh;
    z-index: 750;
    background: rgba(8, 22, 12, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 0 14px 0 0;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    display: flex;
    flex-direction: column;
    overflow: visible; /* allows puller to poke above the top edge */
}

.t5008-drawer.is-open {
    transform: translateY(0);
}

/* Pull-down handle — sticks above the drawer, only visible when open */
.t5008-drawer__puller {
    position: absolute;
    top: -26px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 28, 16, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.55rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, color 0.2s ease, background 0.2s ease;
}

.t5008-drawer.is-open .t5008-drawer__puller {
    opacity: 1;
    pointer-events: auto;
}

.t5008-drawer__puller:hover {
    color: rgba(255, 255, 255, 0.82);
    background: rgba(13, 48, 26, 0.88);
}

.t5008-drawer__body {
    flex: 1;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 12px;
    overflow: hidden;
}

/* Wrap sizes itself to the rendered image — hotspot/lens use absolute % inside */
.t5008-img-wrap {
    position: relative;
    align-self: flex-start;
    flex-shrink: 0;
    overflow: visible;
}

.t5008-img {
    display: block;
    max-height: calc(97vh - 36px);
    width: auto;
    max-width: 88vw;
    border-radius: 2px;
    opacity: 0.93;
}

/* ── Box 20 hotspot ── */
.t5008-hotspot {
    position: absolute;
    cursor: default;
    z-index: 10;
}

.t5008-hotspot__overlay {
    position: absolute;
    inset: 0;
    background: rgba(245, 158, 11, 0.22);
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-radius: 2px;
    animation: box20-pulse 2.8s ease-in-out infinite;
}

@keyframes box20-pulse {
    0%, 100% { opacity: 0.5; }
    50%       { opacity: 1; }
}

.t5008-hotspot__label {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fbbf24;
    background: rgba(0, 0, 0, 0.72);
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
}

.t5008-hotspot__callout {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    background: #12181f;
    border-left: 3px solid #fbbf24;
    border-radius: 0 5px 5px 0;
    padding: 12px 14px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.82);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 30;
}

.t5008-hotspot:hover .t5008-hotspot__callout {
    opacity: 1;
}

/* ── Box 20 instructions paragraph hotspot (no callout, fades on hover) ── */
.t5008-hotspot-para {
    position: absolute;
    z-index: 10;
    pointer-events: none; /* pass all mouse events through to the image */
}

.t5008-hotspot-para .t5008-hotspot__overlay {
    position: absolute;
    inset: 0;
    background: rgba(245, 158, 11, 0.22);
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-radius: 2px;
    animation: box20-pulse 2.8s ease-in-out infinite;
    transition: opacity 0.1s ease;
}

.t5008-hotspot-para.is-hovered .t5008-hotspot__overlay {
    opacity: 0;
}

/* ── Magnifying lens ── */
.t5008-lens {
    position: absolute;
    width: 440px;
    height: 140px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    display: none;
    z-index: 20;
}

.t5008-lens__img {
    position: absolute;
    pointer-events: none;
    display: block;
}

@media (max-width: 900px) {
    .t5008-tab,
    .t5008-overlay,
    .t5008-drawer { display: none; }
}

/* ── Calculation History ─────────────────────────────────────────────────── */

.history-table .history-row {
    cursor: pointer;
}

.history-table .history-row:hover td {
    background: var(--white-faint);
}

.history-filename {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.num.pos {
    color: var(--green);
}

.history-empty__link {
    color: var(--white);
    text-underline-offset: 3px;
}

.history-empty__link:hover {
    color: var(--white-muted);
}

/* ===== Auth overlay ===== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1100;  /* above existing max z-index of 1000 in style.css */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
[aria-hidden="true"].auth-overlay { display: none; }

/* ===== Auth modal card ===== */
.auth-modal {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 4px 16px rgba(0,0,0,0.4);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.modal-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}
.modal-logo img { height: 64px; }
.modal-subtitle {
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 1.25rem;
}
.modal-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.modal-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  margin-bottom: -1px;
  padding: 0.5rem 1rem;
  text-transform: uppercase;
  transition: color 0.15s, border-color 0.15s;
}
.modal-tab:hover { color: rgba(255,255,255,0.85); }
.modal-tab--active {
  border-bottom-color: var(--white);
  color: var(--white);
}
.modal-input {
  background: var(--white-faint);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  color: var(--white);
  display: block;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  width: 100%;
  box-sizing: border-box;
}
.modal-input::placeholder { color: rgba(255,255,255,0.45); }
.modal-input:focus {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.5);
  outline: none;
}

/* ── Password show/hide toggle ─────────────────────────────── */
.password-wrapper {
    position: relative;
}
.password-wrapper .modal-input,
.password-wrapper .login-input {
    padding-right: 48px;
}
.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    padding: 8px;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.password-toggle:hover {
    color: rgba(255, 255, 255, 0.8);
}

.modal-submit {
  background: transparent;
  border: 2px solid var(--white);
  border-radius: 4px;
  color: var(--white);
  cursor: pointer;
  display: block;
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.5rem;
  padding: 0.75rem 1.5rem;
  transition: background 0.15s, color 0.15s;
  width: 100%;
}
.modal-submit:hover:not(:disabled) {
  background: var(--white);
  color: var(--teal-dark);
}
.modal-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.modal-forgot {
  color: rgba(255,255,255,0.55);
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  text-align: right;
  text-decoration: none;
}
.modal-forgot:hover { color: var(--white); }
.modal-divider {
  color: rgba(255,255,255,0.35);
  font-size: 0.8rem;
  margin: 1rem 0;
  text-align: center;
}
.modal-toggle {
  color: rgba(255,255,255,0.55);
  font-size: 0.875rem;
  text-align: center;
}
.modal-toggle a { color: var(--white); text-decoration: underline; }
#authModeForgot .modal-toggle { margin-top: 2rem; }
.modal-error {
  background: rgba(220,53,69,0.15);
  border: 1px solid rgba(220,53,69,0.4);
  border-radius: 4px;
  color: var(--white);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  padding: 0.6rem 0.875rem;
}
.modal-success {
  color: #4ade80;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  text-align: center;
}
.modal-reset-desc {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
@media (max-width: 480px) {
  .auth-modal {
    padding: 1.5rem 1rem;
    max-width: calc(100% - 2rem);
    border-radius: 8px;
  }
  .modal-logo img { height: 48px; }
  .modal-subtitle  { font-size: 1rem; }
}

/* ══════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — @media (max-width: 768px)
   All rules appended 2026-05-25. One block for the whole site.
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

/* ── Global: overflow prevention ─────────────────────────── */
/* TECH DEBT: remove once per-element fixes are sufficient.
   This masks legitimate overflow in devtools — don't leave it
   as the permanent solution. */
html,
body {
    overflow-x: hidden;
}

/* ── Global: tap targets and iOS zoom prevention ──────────── */
/* Bare element selector (0,0,1) loses to class selectors like
   .year-select (0.875rem) and .login-input (0.9rem) which are
   specificity (0,1,0). Enumerate those classes explicitly so the
   media-query cascade wins without needing !important. */
input,
textarea,
select,
.login-input,
.year-select {
    font-size: 1rem;
    min-height: 44px;
}

button,
.modal-submit,
.login-submit {
    min-height: 44px;
}
.cta-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* .signup-banner__btn is an <a> element, not a button —
   not covered by the button rule above. */
.signup-banner__btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

/* ── Global: images ───────────────────────────────────────── */
img {
    max-width: 100%;
    height: auto;
}

/* ── Hero (index.html) ────────────────────────────────────── */

/* Flip gradient top→bottom so background image shows through
   on mobile instead of the left-opaque desktop version. */
.hero__overlay {
    background: linear-gradient(to bottom,
        rgba(10, 50, 60, 0.55) 0%,
        rgba(10, 50, 60, 0.82) 60%,
        rgba(10, 50, 60, 0.96) 100%);
}

/* Remove 53% left offset — stack content vertically, centered. */
.hero__main {
    padding: 7rem 1rem 2rem;
    align-items: center;
}

.hero__footer {
    padding: 1rem 1rem 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* content-group has width:max-content on desktop — causes overflow.
   Must be 100% (not auto) so .hero .cta { width:100% } resolves
   against viewport width, not a shrink-to-content parent. */
.content-group {
    width: 100%;
    align-items: center;
    text-align: center;
}

/* Headline: responsive size. white-space:normal overrides desktop nowrap.
   9vw ≈ 2.1rem at 375px — fills the viewport width on iPhone SE. */
.hero .headline {
    font-size: clamp(1.8rem, 9vw, 2.5rem);
    white-space: normal;
}

/* CTA: full-width button, explicit 44px tap target */
.hero .cta {
    width: 100%;
    text-align: center;
    padding: 0.9rem 1rem;
    min-height: 44px;
}

/* Trust strip: remove inherited border-top/padding/margin from generic
   .trust-strip rule; left-align items below the CTA button. */
.hero .trust-strip {
    border-top: none;
    padding: 0;
    margin-right: 0;
    align-items: flex-start;
    flex-direction: column;
}
.hero .trust-item {
    white-space: normal;
    font-size: 0.9rem;
    text-align: left;
}
/* Hero nav (.hnav): switch from position:absolute to relative so
   it's in document flow on mobile and doesn't overlap hero__main.
   Uniform 0.85rem padding on all sides: hamburger gets 0.85rem above
   AND to its right; logo gets 0.85rem from the left edge. */
.hnav {
    position: relative;
    padding: 0.85rem;
    padding-top: calc(0.85rem + env(safe-area-inset-top, 0px));
}

/* .hnav__brand is an empty div (logo lives in .hnav__right). */
.hnav__brand {
    display: none;
}

/* flex-start: logo takes flex:1 and self-aligns left; signin and
   hamburger pack to the right; 8px gap between them via signin margin. */
.hnav__right {
    padding: 0;
    width: 100%;
    justify-content: flex-start;
    gap: 0;
}

/* picture wraps the img on mobile via <source media="(max-width:768px)">.
   Make it a block that fills nav-logo-link so the img's max-width:100%
   resolves correctly against the available flex space. 55vw cap prevents
   the logo from consuming too much width on very wide mobile screens. */
.nav-logo-link picture {
    display: block;
    width: 100%;
    max-width: 55vw;
}

/* Cropped logo-mobile.png has whitespace removed so the visible content
   fills the full max-height — effectively larger at the same pixel size. */
.site-logo {
    height: auto;
    max-height: 54px;
    max-width: 100%;
    width: auto;
}

/* ── Inner page nav (app, guide, faq, history, profile, etc.) ── */
body.app-page .nav,
.nav {
    padding: 0.85rem;
}

.nav .site-logo {
    height: auto;
    max-height: 54px;
    max-width: 100%;
    width: auto;
}

/* Inner page nav structure: logo left-aligned at 0.85rem from edge;
   signin + 8px gap + hamburger flush to right at 0.85rem from edge. */
.nav__brand {
    display: none;
}

.nav__right {
    width: 100%;
    justify-content: flex-start;
    gap: 0;
}

/* Logo link: flex:1 fills all space to the left of signin+hamburger;
   justify-content:flex-start keeps the image against the left edge. */
.hnav__right .nav-logo-link,
.nav__right .nav-logo-link {
    flex: 1;
    justify-content: flex-start;
}

/* Sign-in/out: match hamburger height (52px); 8px right margin creates
   Option-A gap between the button and the hamburger. */
.signin-btn {
    padding: 0 1rem;
    height: 52px;
    margin-right: 8px;
}

/* ── app.html — calculator container ─────────────────────── */
.app-main {
    padding: 1.5rem 1rem 3rem;
}

/* Modal inputs and submit — global input rule sets font-size and
   min-height on <input> but .modal-input and .modal-submit are
   styled independently; reinforce here. */
.modal-input {
    min-height: 44px;
}

.modal-submit {
    min-height: 44px;
}

/* ── Guide pages ──────────────────────────────────────────── */
.guide-container,
.guide-container--wide {
    padding: 1.25rem 1rem 2.5rem;
}

/* guide-step--full blocks: tighten inner padding */
.guide-step--full {
    padding: 1.25rem 1rem;
}

/* Overflow-prone text in guide pages. guide-ibkr.html uses
   .guide-step__desc for prose and .guide-settings__row dt/dd for
   setting labels. No <code>/<pre>/<kbd> elements exist in guide HTML.
   word-break:break-word (not break-all) preserves word readability. */
.guide-step__desc,
.guide-link,
.guide-settings__row dt,
.guide-settings__row dd {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ── faq.html ─────────────────────────────────────────────── */
/* Accordion tap targets — existing rule has no min-height. */
.faq-item summary {
    min-height: 44px;
    padding: 0.85rem 0;
}
/* ── history.html — table → card layout ──────────────────── */

/* Hide column headers — labels injected via ::before content */
.history-table thead {
    display: none;
}

/* Collapse table structure to block layout */
.history-table,
.history-table tbody,
.history-table tr {
    display: block;
    width: 100%;
}

/* Each row becomes a card — no border, background gives enough definition */
.history-table tr {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.65rem;
    cursor: pointer;
}

/* Remove outer wrapper border on mobile — cards float on the gradient */
.history-page .table-wrapper {
    border: none;
}

/* Override the existing .history-table .history-row:hover td rule
   (style.css ~line 2032) which is more specific than tr:hover.
   Set a subtle background on cells instead. */
.history-table .history-row:hover td {
    background: rgba(255, 255, 255, 0.04);
}

/* Each cell: label on left, value on right */
.history-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0;
    font-size: 0.85rem;
    border: none;
    background: none;
}

/* Column labels injected via ::before — shared style */
.history-table td::before {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

/* nth-child labels match history.js renderTable() column order exactly */
.history-table td:nth-child(1)::before { content: "Date"; }
.history-table td:nth-child(2)::before { content: "Tax Year"; }
.history-table td:nth-child(3)::before { content: "Broker"; }
.history-table td:nth-child(4)::before { content: "File"; }
.history-table td:nth-child(5)::before { content: "Dispositions"; }
.history-table td:nth-child(6)::before { content: "Net Gain / Loss"; }

/* Filename: full-width so value aligns to the card's right edge */
.history-filename {
    max-width: none;
    white-space: normal;
    word-break: break-all;
    text-align: right;
}

/* ── profile.html / history.html ─────────────────────────── */
.profile-page,
.history-page {
    padding: 1.5rem 1rem 3rem;
}

/* ── login.html, reset-password.html ─────────────────────── */
.login-card {
    margin: 2rem 1rem 0;
    max-width: 100%;
}

/* body.login-page centers the card with flexbox — reset margin to 0
   and constrain width with side padding instead. */
body.login-page .login-card {
    margin: 0 1rem;
    max-width: calc(100% - 2rem);
}

/* ── terms.html, privacy.html ─────────────────────────────── */
/* Uses .legal-container, not .guide-container — needs its own rule. */
.legal-container {
    padding: 1.25rem 1rem 2.5rem;
}

} /* end @media (max-width: 768px) — DO NOT ADD RULES BELOW THIS LINE YET */

/* ══════════════════════════════════════════════════════════
   FINE-TUNE — @media (max-width: 480px)
   Small phones: iPhone SE (375px), older iPhones (320px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

/* Hero headline: let 9vw clamp handle sizing down to 320px */

/* Profile cards: tighter inner padding */
.profile-card {
    padding: 1.25rem 0.875rem;
}

} /* end @media (max-width: 480px) */

/* ===== Subscription upsell modal ===== */
.sub-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
[hidden].sub-modal-overlay { display: none; }
.sub-modal {
  position: relative;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 4px 16px rgba(0,0,0,0.4);
  animation: modalIn 0.2s ease;
}
.sub-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--white-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.sub-modal__close:hover { color: var(--white); }
.sub-modal__title {
  color: var(--white);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}
.sub-modal__body {
  color: var(--white-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 0 1.5rem;
}
.sub-modal__cta {
  display: block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--teal-light), var(--teal-mid));
  border: none;
  border-radius: 8px;
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 0.75rem;
}
.sub-modal__cta:hover:not(:disabled) { opacity: 0.9; }
.sub-modal__cta:disabled { opacity: 0.6; cursor: not-allowed; }
.sub-modal__dismiss {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--white-muted);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.5rem 0;
  text-align: center;
}
.sub-modal__dismiss:hover { color: var(--white); }
@media (max-width: 480px) {
  .sub-modal { padding: 2rem 1.25rem; }
}
