:root {
    --bg: #050908;
    --bg-soft: #07110f;
    --surface: rgba(10, 18, 16, 0.9);
    --surface-strong: #0b1512;
    --surface-soft: #0e1c18;
    --surface-hover: #11221d;
    --border: rgba(153, 190, 178, 0.12);
    --border-strong: rgba(153, 190, 178, 0.22);
    --text: #f4fbf8;
    --muted: #8fa59e;
    --subtle: #60766f;
    --green: #63f2b0;
    --green-strong: #2adf92;
    --green-soft: rgba(99, 242, 176, 0.1);
    --cyan: #72d7d0;
    --red: #ff7080;
    --amber: #f4c767;
    --shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
    --radius-xl: 26px;
    --radius-lg: 20px;
    --radius-md: 15px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 0%, rgba(69, 204, 146, 0.11), transparent 30%),
        radial-gradient(circle at 96% 18%, rgba(60, 150, 144, 0.08), transparent 24%),
        linear-gradient(180deg, #050908 0%, #07100e 45%, #050908 100%);
    font-family: Inter, "Segoe UI", Tahoma, Arial, sans-serif;
    overflow-x: hidden;
}

button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
button, input { outline: none; }
button:focus-visible, input:focus-visible, a:focus-visible {
    box-shadow: 0 0 0 3px rgba(99, 242, 176, 0.18);
    border-radius: 10px;
}

.page-glow {
    position: fixed;
    z-index: 0;
    pointer-events: none;
    border-radius: 999px;
    filter: blur(100px);
    opacity: .18;
}
.page-glow-a { width: 360px; height: 360px; top: -160px; left: 8%; background: #2f9f78; }
.page-glow-b { width: 280px; height: 280px; top: 34%; right: -140px; background: #187c79; }

.site-shell {
    position: relative;
    z-index: 1;
    width: min(1480px, calc(100% - 42px));
    margin: 0 auto;
}

.site-header {
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    border-bottom: 1px solid var(--border);
}

.brand, .header-status, .hero-meta, .section-title-row, .legend-row,
.comparison-label, .hero-market-line, .hero-alpha-line, .pulse-item > div,
.opportunity-summary, .history-stats, .site-footer, .footer-brand, .table-footer {
    display: flex;
    align-items: center;
}

.brand { gap: 12px; min-width: max-content; }
.brand-symbol {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(99, 242, 176, .28);
    border-radius: 13px;
    background: linear-gradient(145deg, rgba(99,242,176,.18), rgba(24,76,58,.12));
    color: var(--green);
    font-size: 21px;
    font-weight: 900;
    box-shadow: inset 0 0 24px rgba(99,242,176,.04);
}
.brand-symbol.small { width: 32px; height: 32px; border-radius: 10px; font-size: 16px; }
.brand-copy strong, .brand-copy small, .footer-brand strong, .footer-brand small { display: block; }
.brand-copy strong { font-size: 16px; letter-spacing: -.02em; }
.brand-copy small, .footer-brand small { margin-top: 2px; color: var(--subtle); font-size: 9px; text-transform: uppercase; letter-spacing: .14em; }

.main-nav { display: flex; align-items: center; gap: 8px; }
.main-nav a {
    min-height: 38px;
    display: grid;
    place-items: center;
    padding: 0 13px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 12px;
    transition: 160ms ease;
}
.main-nav a:hover, .main-nav a.active { color: var(--text); background: rgba(99,242,176,.055); }

.header-status { gap: 9px; min-width: 160px; justify-content: flex-end; }
.header-status strong, .header-status small { display: block; text-align: right; }
.header-status strong { font-size: 11px; }
.header-status small { margin-top: 3px; color: var(--subtle); font-size: 9px; }
.live-indicator {
    width: 8px; height: 8px; border-radius: 50%; background: var(--amber);
    box-shadow: 0 0 0 5px rgba(244,199,103,.07);
}
.live-indicator.ready { background: var(--green); box-shadow: 0 0 0 5px rgba(99,242,176,.07); }
.live-indicator.error { background: var(--red); box-shadow: 0 0 0 5px rgba(255,112,128,.07); }

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr);
    align-items: stretch;
    gap: 24px;
    padding: 70px 0 34px;
}
.hero-copy { padding: 18px 4px 16px 0; }
.overline, .section-label {
    color: var(--green);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .17em;
}
.hero h1 {
    margin: 16px 0 18px;
    max-width: 780px;
    font-size: clamp(38px, 5vw, 72px);
    line-height: 1.04;
    letter-spacing: -.055em;
    font-weight: 790;
}
.hero h1 span { color: #9bb1aa; }
.hero-copy > p {
    max-width: 690px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.9;
}
.hero-meta { flex-wrap: wrap; gap: 20px; margin-top: 28px; color: var(--subtle); font-size: 10px; }
.hero-meta b { color: #a9bdb7; }
.meta-dot { display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--green); }

.hero-performance-card {
    position: relative;
    overflow: hidden;
    padding: 28px;
    border: 1px solid rgba(99,242,176,.2);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(165deg, rgba(99,242,176,.09), rgba(11,21,18,.92) 44%),
        #0b1512;
    box-shadow: var(--shadow);
}
.hero-performance-card::after {
    content: ""; position: absolute; width: 240px; height: 240px; border-radius: 50%;
    left: -110px; bottom: -150px; background: rgba(99,242,176,.05); border: 1px solid rgba(99,242,176,.05);
}
.hero-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.hero-card-top span { display: block; color: #c9d8d3; font-size: 12px; }
.hero-card-top small { display: block; margin-top: 5px; color: var(--subtle); font-size: 9px; }
.performance-badge { padding: 5px 9px; border: 1px solid rgba(99,242,176,.2); border-radius: 999px; color: var(--green)!important; background: var(--green-soft); font-size: 8px!important; text-transform: uppercase; letter-spacing: .1em; }
.hero-return { direction: ltr; width: fit-content; margin: 36px 0 28px; font-size: clamp(42px, 4.2vw, 64px); font-weight: 800; letter-spacing: -.055em; }
.hero-market-line, .hero-alpha-line { justify-content: space-between; gap: 20px; padding: 14px 0; border-top: 1px solid var(--border); }
.hero-market-line span, .hero-alpha-line span { color: var(--muted); font-size: 11px; }
.hero-market-line strong, .hero-alpha-line strong { direction: ltr; font-size: 14px; font-variant-numeric: tabular-nums; }
.hero-alpha-line strong { color: var(--green); }

.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric-box {
    min-height: 132px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(12,23,20,.8), rgba(8,15,13,.88));
}
.metric-box.featured { border-color: rgba(99,242,176,.18); }
.metric-label { display: block; color: var(--subtle); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
.metric-number { direction: ltr; display: block; width: fit-content; margin-top: 18px; font-size: 28px; letter-spacing: -.04em; }
.metric-box small { display: block; margin-top: 8px; color: #536862; font-size: 9px; }

.performance-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .65fr); gap: 14px; margin-bottom: 64px; }
.surface {
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(11,20,18,.91), rgba(7,14,12,.93));
    box-shadow: 0 18px 60px rgba(0,0,0,.2);
}
.performance-panel, .pulse-panel { padding: 24px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.section-head.compact { margin-bottom: 18px; }
.section-head h2, .section-title-row h2 { margin: 6px 0 0; font-size: 20px; letter-spacing: -.025em; }
.section-head p, .section-title-row p { margin: 7px 0 0; color: var(--subtle); font-size: 10px; line-height: 1.6; }
.period-pill { direction: ltr; padding: 7px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 9px; }

.comparison-chart { display: grid; gap: 22px; padding: 34px 0 26px; }
.comparison-row { display: grid; grid-template-columns: 145px minmax(0,1fr) 80px; gap: 14px; align-items: center; }
.comparison-label { gap: 9px; direction: ltr; justify-content: flex-end; }
.comparison-label div { direction: rtl; }
.comparison-label b, .comparison-label small { display: block; }
.comparison-label b { font-size: 11px; }
.comparison-label small { margin-top: 2px; color: var(--subtle); font-size: 8px; }
.series-dot { width: 8px; height: 8px; border-radius: 50%; }
.portfolio-dot { background: var(--green); box-shadow: 0 0 14px rgba(99,242,176,.35); }
.market-dot { background: #6f8c84; }
.comparison-track { direction: ltr; height: 14px; border-radius: 999px; background: rgba(127,156,147,.07); overflow: hidden; }
.comparison-fill { width: 0; height: 100%; border-radius: inherit; transition: width 450ms ease; }
.portfolio-fill { background: linear-gradient(90deg, #2adf92, #78f2ba); }
.market-fill { background: linear-gradient(90deg, #4d6961, #8fa59e); }
.comparison-row > strong { direction: ltr; text-align: left; font-size: 12px; }

.alpha-callout { display: grid; grid-template-columns: 42px auto 1fr; align-items: center; gap: 12px; padding: 16px; border: 1px solid rgba(99,242,176,.12); border-radius: 16px; background: rgba(99,242,176,.035); }
.alpha-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--green-soft); color: var(--green); font-size: 19px; }
.alpha-callout span, .alpha-callout strong { display: block; }
.alpha-callout span { color: var(--muted); font-size: 9px; }
.alpha-callout strong { direction: ltr; margin-top: 3px; color: var(--green); font-size: 17px; }
.alpha-callout p { margin: 0; color: var(--subtle); font-size: 9px; line-height: 1.5; }

.pulse-list { display: grid; }
.pulse-item { padding: 16px 0; border-top: 1px solid var(--border); }
.pulse-item:first-child { border-top: 0; }
.pulse-item > span { display: block; margin-bottom: 9px; color: var(--subtle); font-size: 9px; }
.pulse-item > div { justify-content: space-between; gap: 16px; }
.pulse-item b { direction: ltr; font-size: 17px; }
.pulse-item strong { direction: ltr; color: var(--green); font-size: 13px; }
.pulse-item small { color: var(--muted); font-size: 9px; }

.content-section { margin-bottom: 70px; scroll-margin-top: 30px; }
.section-title-row { justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.legend-row { gap: 15px; color: var(--subtle); font-size: 9px; }
.legend-dot { display: inline-block; width: 7px; height: 7px; margin-left: 5px; border-radius: 50%; }
.legend-dot.gain { background: var(--green); }
.legend-dot.loss { background: var(--red); }

.holdings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.holding-card {
    position: relative;
    overflow: hidden;
    min-height: 184px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(12,22,19,.9), rgba(8,15,13,.92));
    transition: 170ms ease;
}
.holding-card:hover { transform: translateY(-2px); border-color: var(--border-strong); background: var(--surface-hover); }
.holding-top, .holding-bottom, .opportunity-top, .opportunity-prices { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ticker-logo { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: rgba(99,242,176,.07); color: #cbf8e7; font-weight: 800; font-size: 10px; }
.holding-identity { display: flex; align-items: center; gap: 10px; }
.holding-identity b { direction: ltr; display: block; font-size: 13px; }
.holding-identity small { display: block; margin-top: 3px; color: var(--subtle); font-size: 8px; }
.return-badge { direction: ltr; padding: 6px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.return-badge.positive { color: var(--green); background: rgba(99,242,176,.08); }
.return-badge.negative { color: var(--red); background: rgba(255,112,128,.08); }
.holding-price { direction: ltr; margin: 26px 0 20px; font-size: 26px; font-weight: 760; letter-spacing: -.035em; }
.holding-price small { margin-right: 5px; color: var(--subtle); font-size: 9px; font-weight: 500; }
.holding-bottom { padding-top: 14px; border-top: 1px solid var(--border); color: var(--subtle); font-size: 8px; }
.holding-bottom strong { direction: ltr; color: #a9bbb5; font-size: 10px; }
.mini-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(99,242,176,.04); }
.mini-progress span { display: block; height: 100%; background: var(--green); }

.opportunity-summary { gap: 8px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 999px; background: rgba(99,242,176,.025); }
.opportunity-summary b { direction: ltr; color: var(--green); }
.opportunity-summary small { color: var(--subtle); font-size: 8px; }
.watch-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(99,242,176,.06); }
.opportunity-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.opportunity-card {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(11,21,18,.94), rgba(7,14,12,.94));
}
.opportunity-top { align-items: flex-start; }
.opportunity-top h3 { direction: ltr; margin: 0; font-size: 17px; }
.opportunity-top p { margin: 4px 0 0; color: var(--subtle); font-size: 8px; }
.opportunity-status { padding: 5px 8px; border-radius: 999px; font-size: 8px; }
.opportunity-status.near { color: var(--green); background: rgba(99,242,176,.08); }
.opportunity-status.watch { color: var(--amber); background: rgba(244,199,103,.08); }
.opportunity-status.ready { color: #9fffd0; background: rgba(99,242,176,.12); }
.opportunity-prices { margin-top: 26px; }
.opportunity-price-block span { display: block; color: var(--subtle); font-size: 8px; }
.opportunity-price-block strong { direction: ltr; display: block; margin-top: 6px; font-size: 18px; }
.entry-price { color: var(--green); }
.distance-track { margin-top: 19px; height: 5px; border-radius: 999px; background: rgba(127,156,147,.08); overflow: hidden; }
.distance-track span { direction: ltr; display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #9cf7cb); }
.distance-copy { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; color: var(--subtle); font-size: 8px; }
.distance-copy strong { direction: ltr; color: #b6c7c1; font-size: 9px; }
.empty-card { grid-column: 1/-1; min-height: 150px; display: grid; place-items: center; border: 1px dashed var(--border); border-radius: var(--radius-lg); color: var(--subtle); font-size: 10px; }

.history-title-row { align-items: flex-end; }
.search-control { width: min(270px, 100%); min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--border); border-radius: 12px; background: #09120f; }
.search-control svg { width: 15px; height: 15px; fill: none; stroke: var(--subtle); stroke-width: 1.8; }
.search-control input { width: 100%; border: 0; color: var(--text); background: transparent; font-size: 11px; }
.search-control input::placeholder { color: #49615a; }
.history-stats { gap: 10px; margin-bottom: 12px; }
.history-stats > div { min-width: 150px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 13px; background: rgba(10,19,16,.62); }
.history-stats span { display: block; color: var(--subtle); font-size: 8px; }
.history-stats strong { direction: ltr; display: block; margin-top: 5px; font-size: 15px; }

.table-shell { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: rgba(7,14,12,.82); }
.data-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 14px 16px; border-bottom: 1px solid rgba(153,190,178,.075); text-align: right; white-space: nowrap; }
.data-table th { color: #6f867f; background: rgba(12,22,19,.8); font-size: 8px; font-weight: 700; letter-spacing: .04em; }
.data-table td { color: #aebfba; font-size: 10px; font-variant-numeric: tabular-nums; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: rgba(99,242,176,.018); }
.data-table .ticker-cell { direction: ltr; color: var(--text); font-weight: 800; }
.status-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 999px; color: var(--green); background: rgba(99,242,176,.065); font-size: 8px; }
.status-chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.table-empty { text-align: center!important; color: var(--subtle)!important; padding: 40px!important; }
.table-footer { justify-content: space-between; gap: 16px; margin-top: 12px; color: var(--subtle); font-size: 9px; }
.ghost-button { min-height: 38px; padding: 0 13px; border: 1px solid var(--border); border-radius: 11px; color: #a5b8b2; background: transparent; cursor: pointer; }
.ghost-button:hover { border-color: var(--border-strong); background: rgba(99,242,176,.03); }
.ghost-button:disabled { opacity: .4; cursor: not-allowed; }

.site-footer { justify-content: space-between; gap: 22px; min-height: 110px; border-top: 1px solid var(--border); color: var(--subtle); font-size: 9px; }
.footer-brand { gap: 9px; }
.site-footer p { margin: 0; text-align: center; }
.site-footer > span { direction: ltr; }

.positive { color: var(--green)!important; }
.negative { color: var(--red)!important; }
.neutral { color: var(--text)!important; }

.skeleton-card { min-height: 184px; border-radius: var(--radius-lg); background: linear-gradient(100deg, #0a1310 20%, #0f1e19 38%, #0a1310 58%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position-x: -200%; } }

.toast {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 20;
    max-width: 360px;
    padding: 12px 15px;
    border: 1px solid rgba(99,242,176,.2);
    border-radius: 13px;
    color: #d8f6e9;
    background: #0d1b17;
    box-shadow: var(--shadow);
    font-size: 10px;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: 180ms ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: rgba(255,112,128,.22); color: #ffd4d9; }

@media (max-width: 1120px) {
    .main-nav { display: none; }
    .hero { grid-template-columns: 1fr .72fr; }
    .metric-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .holdings-grid, .opportunity-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 820px) {
    .site-shell { width: min(100% - 24px, 1480px); }
    .site-header { min-height: 74px; }
    .header-status { min-width: auto; }
    .header-status div { display: none; }
    .hero { grid-template-columns: 1fr; padding-top: 46px; }
    .hero h1 { font-size: clamp(38px, 10vw, 58px); }
    .performance-layout { grid-template-columns: 1fr; }
    .holdings-grid, .opportunity-grid { grid-template-columns: 1fr 1fr; }
    .comparison-row { grid-template-columns: 110px minmax(0,1fr) 64px; }
    .section-title-row, .history-title-row { align-items: flex-start; flex-direction: column; }
    .search-control { width: 100%; }
    .site-footer { flex-direction: column; justify-content: center; text-align: center; padding: 24px 0; }
}

@media (max-width: 560px) {
    .brand-copy small { display: none; }
    .hero-copy { padding-top: 0; }
    .hero-meta { gap: 10px; }
    .hero-performance-card { padding: 22px; }
    .metric-strip { grid-template-columns: 1fr 1fr; }
    .metric-box { min-height: 118px; padding: 15px; }
    .metric-number { font-size: 22px; }
    .performance-panel, .pulse-panel { padding: 18px; }
    .comparison-row { grid-template-columns: 92px minmax(0,1fr) 58px; gap: 9px; }
    .alpha-callout { grid-template-columns: 38px auto; }
    .alpha-callout p { grid-column: 1/-1; }
    .holdings-grid, .opportunity-grid { grid-template-columns: 1fr; }
    .legend-row { display: none; }
    .history-stats { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .history-stats > div { min-width: 0; }
    .history-stats > div:last-child { grid-column: 1/-1; }
}

/* ==========================================================
   Z PORTFOLIO — INTERNAL PAGE NAVIGATION (v5)
   Each top navigation button opens one independent view.
========================================================== */

.app-page {
    display: none;
    width: 100%;
    min-height: calc(100vh - 170px);
    animation: zPageIn 180ms ease;
}

.app-page.active {
    display: block;
}

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

button.brand {
    appearance: none;
    border: 0;
    padding: 0;
    color: inherit;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
    text-align: right;
}

.main-nav .nav-button {
    appearance: none;
    min-height: 38px;
    display: grid;
    place-items: center;
    padding: 0 13px;
    border: 0;
    border-radius: 10px;
    color: var(--muted);
    background: transparent;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: 160ms ease;
}

.main-nav .nav-button:hover,
.main-nav .nav-button.active {
    color: var(--text);
    background: rgba(99,242,176,.07);
}

.internal-page-head {
    min-height: 138px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    padding: 40px 0 24px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border);
}

.internal-page-head h1 {
    margin: 7px 0 5px;
    font-size: clamp(28px, 3.1vw, 44px);
    line-height: 1.15;
    letter-spacing: -.04em;
}

.internal-page-head p {
    max-width: 720px;
    margin: 0;
    color: var(--subtle);
    font-size: 11px;
    line-height: 1.9;
}

#portfolioPage .holdings-grid,
#opportunitiesPage .opportunity-grid {
    padding-bottom: 56px;
}

#historyPage .history-stats {
    margin-bottom: 14px;
}

#historyPage .table-shell {
    margin-bottom: 0;
}

/* Keep navigation available on medium screens instead of hiding it. */
@media (max-width: 1120px) {
    .main-nav {
        display: flex;
        gap: 4px;
    }

    .main-nav .nav-button {
        padding: 0 9px;
        font-size: 11px;
    }
}

@media (max-width: 820px) {
    .site-header {
        flex-wrap: wrap;
        padding: 12px 0;
    }

    .main-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .main-nav .nav-button {
        flex: 0 0 auto;
        min-width: max-content;
    }

    .internal-page-head {
        min-height: auto;
        align-items: flex-start;
        flex-direction: column;
        padding-top: 30px;
    }
}

@media (max-width: 560px) {
    .app-page {
        min-height: calc(100vh - 210px);
    }

    .internal-page-head h1 {
        font-size: 30px;
    }
}


/* ==========================================================
   Z PORTFOLIO MOBILE APP LAYOUT v12
   Automatic responsive layout: desktop / tablet / phone
========================================================== */

.mobile-bottom-nav,
.mobile-history {
    display: none;
}

/* Better touch targets without changing desktop density. */
.nav-button,
.ghost-button,
.mobile-nav-button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@media (min-width: 701px) and (max-width: 1100px) {
    .site-shell {
        width: calc(100% - 32px);
    }

    .hero {
        grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr);
        gap: 20px;
        padding-top: 48px;
    }

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

    .performance-layout {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 700px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        padding-bottom: calc(76px + env(safe-area-inset-bottom));
    }

    .site-shell {
        width: calc(100% - 24px);
        max-width: none;
    }

    .site-header {
        min-height: 68px;
        flex-wrap: nowrap;
        padding: 0;
    }

    .brand-symbol {
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
        border-radius: 11px;
        font-size: 18px;
    }

    .brand-copy strong {
        font-size: 14px;
    }

    .brand-copy small {
        display: none;
    }

    .main-nav {
        display: none !important;
    }

    .header-status {
        min-width: 0;
    }

    .header-status > div {
        display: none !important;
    }

    .app-page {
        min-height: calc(100vh - 145px);
    }

    .hero {
        display: block;
        padding: 34px 0 20px;
    }

    .hero-copy {
        padding: 0;
    }

    .overline,
    .section-label {
        font-size: 8px;
        letter-spacing: .12em;
    }

    .hero h1 {
        margin: 12px 0 14px;
        font-size: clamp(32px, 10vw, 48px);
        line-height: 1.08;
        letter-spacing: -.045em;
    }

    .hero-copy > p {
        font-size: 12px;
        line-height: 1.8;
    }

    .hero-meta {
        gap: 9px;
        margin-top: 18px;
        font-size: 8px;
    }

    .hero-performance-card {
        margin-top: 24px;
        padding: 20px;
    }

    .hero-return {
        margin: 30px 0 22px;
        font-size: 45px;
    }

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

    .metric-box {
        min-height: 116px;
        padding: 14px;
    }

    .metric-label {
        font-size: 7px;
    }

    .metric-number {
        margin-top: 15px;
        font-size: 22px;
    }

    .metric-box small {
        font-size: 7px;
    }

    .performance-layout {
        display: block;
        margin-top: 10px;
        margin-bottom: 25px;
    }

    .performance-panel,
    .pulse-panel {
        padding: 17px;
        margin-bottom: 11px;
    }

    .section-head h2 {
        font-size: 17px;
    }

    .section-head p {
        display: none;
    }

    .comparison-chart {
        padding: 27px 0 22px;
    }

    .comparison-row {
        grid-template-columns: 88px minmax(0, 1fr) 58px;
        gap: 8px;
    }

    .comparison-label b {
        font-size: 9px;
    }

    .comparison-label small {
        font-size: 7px;
    }

    .comparison-track {
        height: 11px;
    }

    .comparison-row > strong {
        font-size: 9px;
    }

    .alpha-callout {
        grid-template-columns: 38px auto;
        gap: 10px;
        padding: 13px;
    }

    .alpha-callout p {
        grid-column: 1 / -1;
        line-height: 1.5;
    }

    .internal-page-head {
        min-height: 0;
        display: block;
        padding: 30px 0 18px;
        margin-bottom: 16px;
    }

    .internal-page-head h1 {
        margin: 6px 0 5px;
        font-size: 29px;
    }

    .internal-page-head p {
        font-size: 9px;
        line-height: 1.7;
    }

    .legend-row {
        display: none;
    }

    .opportunity-summary {
        width: fit-content;
        margin-top: 15px;
    }

    .holdings-grid,
    .opportunity-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding-bottom: 24px !important;
    }

    .holding-card {
        min-height: 177px;
        padding: 16px;
    }

    .holding-price {
        margin: 23px 0 18px;
        font-size: 24px;
    }

    .opportunity-card {
        padding: 16px;
    }

    .opportunity-prices {
        margin-top: 23px;
        gap: 12px;
    }

    .history-title-row .search-control {
        margin-top: 16px;
    }

    .search-control {
        width: 100%;
    }

    /* 16px prevents iPhone Safari from auto-zooming on focus. */
    .search-control input {
        font-size: 16px;
    }

    .history-stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
        width: 100%;
    }

    .history-stats > div {
        min-width: 0;
        padding: 11px 9px;
    }

    .history-stats > div:last-child {
        grid-column: auto;
    }

    .history-stats span {
        font-size: 7px;
    }

    .history-stats strong {
        font-size: 13px;
    }

    .table-shell {
        display: none;
    }

    .mobile-history {
        display: grid;
        gap: 10px;
    }

    .history-mobile-card {
        padding: 17px;
        border: 1px solid var(--border);
        border-radius: 17px;
        background: linear-gradient(180deg, rgba(11,21,18,.95), rgba(7,14,12,.95));
    }

    .history-mobile-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding-bottom: 14px;
        border-bottom: 1px solid var(--border);
    }

    .history-mobile-ticker {
        direction: ltr;
        font-size: 18px;
        font-weight: 800;
    }

    .history-mobile-return {
        direction: ltr;
        font-size: 17px;
        font-weight: 700;
    }

    .history-mobile-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px 12px;
        padding-top: 15px;
    }

    .mobile-data-item span {
        display: block;
        color: var(--subtle);
        font-size: 8px;
    }

    .mobile-data-item strong {
        direction: ltr;
        display: block;
        margin-top: 5px;
        color: #aebfba;
        font-size: 12px;
    }

    .history-mobile-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-top: 16px;
        padding-top: 13px;
        border-top: 1px solid var(--border);
    }

    .history-mobile-footer small {
        color: var(--subtle);
        font-size: 8px;
    }

    .table-footer {
        margin-bottom: 25px;
    }

    .site-footer {
        min-height: auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 25px 0 20px;
        text-align: center;
    }

    .footer-brand {
        justify-content: center;
    }

    .site-footer p {
        margin: 15px auto;
        max-width: 330px;
        line-height: 1.7;
    }

    .mobile-bottom-nav {
        position: fixed;
        z-index: 90;
        left: 0;
        right: 0;
        bottom: 0;
        min-height: calc(66px + env(safe-area-inset-bottom));
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        align-items: start;
        padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border);
        background: rgba(5, 11, 9, .96);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .mobile-nav-button {
        min-height: 50px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 4px;
        border: 0;
        border-radius: 11px;
        color: var(--subtle);
        background: transparent;
        cursor: pointer;
        font-size: 8px;
    }

    .mobile-nav-icon {
        direction: ltr;
        font-size: 17px;
        line-height: 1;
    }

    .mobile-nav-button.active {
        color: var(--green);
        background: rgba(99, 242, 176, .06);
    }

    .toast {
        left: 12px;
        right: 12px;
        bottom: calc(80px + env(safe-area-inset-bottom));
        max-width: none;
    }
}

@media (max-width: 380px) {
    .site-shell {
        width: calc(100% - 18px);
    }

    .hero h1 {
        font-size: 32px;
    }

    .metric-box {
        padding: 12px;
    }

    .metric-number {
        font-size: 19px;
    }

    .comparison-row {
        grid-template-columns: 76px minmax(0, 1fr) 52px;
    }

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

    .history-stats > div:last-child {
        grid-column: 1 / -1;
    }
}

/* ==========================================================
   Z PORTFOLIO v20 — CLEAR TYPOGRAPHY + TODAY PERFORMANCE
   Larger, sharper text while preserving automatic responsive layout.
========================================================== */

:root {
    --muted: #a2b4ae;
    --subtle: #748a82;
}

html,
body,
button,
input {
    font-family: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", Tahoma, Arial, sans-serif;
    text-rendering: optimizeLegibility;
    font-synthesis: none;
}

body {
    font-size: 15px;
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
}

.brand-copy strong {
    font-size: 17px;
    font-weight: 760;
}

.brand-copy small,
.footer-brand small {
    font-size: 10px;
    font-weight: 650;
}

.main-nav .nav-button {
    font-size: 13px;
    font-weight: 650;
}

.header-status strong {
    font-size: 12px;
    font-weight: 700;
}

.header-status small {
    font-size: 10px;
}

.overline,
.section-label {
    font-size: 11px;
    font-weight: 850;
}

.hero-copy > p {
    max-width: 760px;
    font-size: 16px;
    line-height: 1.9;
    font-weight: 500;
    color: #a7b8b2;
}

.hero-meta {
    font-size: 11px;
    font-weight: 600;
}

.hero-card-top span {
    font-size: 14px;
    font-weight: 720;
}

.hero-card-top small {
    font-size: 10px;
}

.performance-badge {
    font-size: 9px !important;
    font-weight: 800;
}

.hero-market-line span,
.hero-alpha-line span {
    font-size: 12px;
    font-weight: 600;
}

.hero-market-line strong,
.hero-alpha-line strong {
    font-size: 15px;
    font-weight: 760;
}

.metric-label {
    font-size: 10px;
    font-weight: 780;
}

.metric-number {
    font-size: 30px;
    font-weight: 780;
}

.metric-box small {
    font-size: 11px;
    line-height: 1.5;
    color: var(--subtle);
    font-weight: 560;
}

/* ----- Today's return cards ----- */
.today-performance-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 14px;
}

.today-card {
    min-height: 112px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 21px 23px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(12, 24, 20, .92), rgba(8, 16, 14, .94));
    box-shadow: 0 12px 34px rgba(0, 0, 0, .13);
}

.portfolio-today-card {
    border-color: rgba(99, 242, 176, .20);
    background:
        linear-gradient(135deg, rgba(99, 242, 176, .065), transparent 44%),
        linear-gradient(180deg, rgba(12, 24, 20, .94), rgba(8, 16, 14, .95));
}

.today-card-copy span,
.today-card-copy small {
    display: block;
}

.today-label {
    color: #e8f3ef;
    font-size: 13px;
    font-weight: 760;
}

.today-card-copy small {
    margin-top: 7px;
    color: var(--subtle);
    font-size: 11px;
    font-weight: 560;
}

.today-value {
    direction: ltr;
    flex: 0 0 auto;
    font-size: 32px;
    font-weight: 820;
    letter-spacing: -.035em;
    font-variant-numeric: tabular-nums;
}

.section-head h2,
.section-title-row h2 {
    font-size: 22px;
    font-weight: 760;
}

.section-head p,
.section-title-row p {
    font-size: 12px;
    line-height: 1.7;
    color: var(--subtle);
}

.period-pill {
    font-size: 10px;
    font-weight: 700;
}

.comparison-label b {
    font-size: 12px;
    font-weight: 760;
}

.comparison-label small {
    font-size: 9px;
}

.comparison-row > strong {
    font-size: 13px;
    font-weight: 760;
}

.alpha-callout span {
    font-size: 10px;
}

.alpha-callout strong {
    font-size: 18px;
    font-weight: 780;
}

.alpha-callout p {
    font-size: 10px;
    line-height: 1.65;
}

.pulse-item > span {
    font-size: 11px;
    font-weight: 600;
}

.pulse-item b {
    font-size: 18px;
    font-weight: 800;
}

.pulse-item strong {
    font-size: 14px;
    font-weight: 760;
}

.pulse-item small {
    font-size: 10px;
}

.internal-page-head h1 {
    font-weight: 780;
}

.internal-page-head p {
    font-size: 13px;
    line-height: 1.85;
    color: var(--subtle);
}

.legend-row {
    font-size: 10px;
    font-weight: 600;
}

.holding-identity b {
    font-size: 14px;
    font-weight: 800;
}

.holding-identity small {
    font-size: 10px;
}

.return-badge {
    font-size: 11px;
}

.holding-price {
    font-size: 27px;
}

.holding-price small {
    font-size: 10px;
}

.holding-bottom {
    font-size: 10px;
}

.holding-bottom strong {
    font-size: 11px;
}

.opportunity-summary small,
.opportunity-status,
.opportunity-top p,
.opportunity-price-block span,
.distance-copy {
    font-size: 10px;
}

.opportunity-top h3 {
    font-size: 19px;
}

.opportunity-price-block strong {
    font-size: 20px;
}

.distance-copy strong {
    font-size: 10px;
}

.search-control input {
    font-size: 13px;
}

.history-stats span {
    font-size: 10px;
}

.history-stats strong {
    font-size: 17px;
}

.data-table th {
    font-size: 10px;
    font-weight: 760;
}

.data-table td {
    font-size: 11px;
    font-weight: 520;
}

.status-chip {
    font-size: 9px;
    font-weight: 700;
}

.table-footer,
.site-footer {
    font-size: 10px;
}

.ghost-button {
    font-size: 11px;
    font-weight: 700;
}

/* Tablet */
@media (min-width: 701px) and (max-width: 1100px) {
    .today-card {
        min-height: 106px;
    }

    .today-value {
        font-size: 29px;
    }
}

/* Phone */
@media (max-width: 700px) {
    .brand-copy strong {
        font-size: 15px;
    }

    .overline,
    .section-label {
        font-size: 9px;
    }

    .hero-copy > p {
        font-size: 14px;
        line-height: 1.85;
    }

    .hero-meta {
        font-size: 10px;
        line-height: 1.6;
    }

    .hero-card-top span {
        font-size: 12px;
    }

    .hero-market-line span,
    .hero-alpha-line span {
        font-size: 11px;
    }

    .hero-market-line strong,
    .hero-alpha-line strong {
        font-size: 14px;
    }

    .metric-label {
        font-size: 9px;
    }

    .metric-number {
        font-size: 23px;
    }

    .metric-box small {
        font-size: 9px;
        line-height: 1.45;
    }

    .today-performance-strip {
        gap: 9px;
        margin-bottom: 10px;
    }

    .today-card {
        min-height: 105px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: space-between;
        gap: 12px;
        padding: 15px;
    }

    .today-label {
        font-size: 11px;
    }

    .today-card-copy small {
        margin-top: 5px;
        font-size: 9px;
    }

    .today-value {
        font-size: 24px;
    }

    .section-head h2 {
        font-size: 19px;
    }

    .comparison-label b {
        font-size: 10px;
    }

    .comparison-label small {
        font-size: 8px;
    }

    .comparison-row > strong {
        font-size: 10px;
    }

    .alpha-callout span,
    .alpha-callout p {
        font-size: 9px;
    }

    .pulse-item > span {
        font-size: 10px;
    }

    .pulse-item small {
        font-size: 9px;
    }

    .internal-page-head p {
        font-size: 11px;
    }

    .holding-identity small,
    .holding-price small,
    .holding-bottom,
    .opportunity-top p,
    .opportunity-price-block span,
    .distance-copy,
    .history-stats span {
        font-size: 9px;
    }

    .mobile-data-item span,
    .history-mobile-footer small {
        font-size: 9px;
    }

    .mobile-data-item strong {
        font-size: 13px;
    }

    .mobile-nav-button {
        font-size: 10px;
        font-weight: 650;
    }

    .mobile-nav-icon {
        font-size: 18px;
    }
}

@media (max-width: 380px) {
    .today-performance-strip {
        grid-template-columns: 1fr;
    }

    .today-card {
        min-height: 88px;
        flex-direction: row;
        align-items: center;
    }
}

/* ============================================================
   SUBSCRIBER ACCESS GATE
============================================================ */

body.subscription-open {
    overflow: hidden;
}

.subscription-gate[hidden],
.member-access-bar[hidden] {
    display: none !important;
}

.subscription-gate {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 22px;
}

.subscription-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 7, 6, .82);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.subscription-card {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: calc(100dvh - 44px);
    overflow-y: auto;
    padding: 30px;
    border: 1px solid rgba(104, 239, 178, .22);
    border-radius: 24px;
    background:
        linear-gradient(155deg, rgba(104, 239, 178, .07), rgba(8, 15, 13, .98) 44%),
        #08100e;
    box-shadow: 0 40px 120px rgba(0, 0, 0, .56);
}

.subscription-close {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--muted);
    background: rgba(255,255,255,.025);
    cursor: pointer;
    font-size: 23px;
    line-height: 1;
}

.subscription-kicker {
    color: var(--green);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .16em;
}

.subscription-card h2 {
    margin: 10px 0 12px;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.2;
    font-weight: 850;
}

.subscription-intro {
    margin: 0;
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.9;
}

.subscription-price {
    display: flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    margin: 24px 0 17px;
    direction: ltr;
}

.subscription-price > strong {
    color: var(--green);
    font-size: 58px;
    line-height: 1;
    letter-spacing: -.05em;
}

.subscription-price div {
    direction: rtl;
}

.subscription-price span,
.subscription-price small {
    display: block;
}

.subscription-price span {
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
}

.subscription-price small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.subscription-note {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 13px;
    color: var(--muted);
    background: rgba(255,255,255,.018);
    font-size: 12px;
    line-height: 1.7;
}

.subscriber-login-form {
    display: grid;
    gap: 13px;
    margin-top: 20px;
}

.subscriber-login-form label > span {
    display: block;
    margin-bottom: 7px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
}

.subscriber-login-form input {
    width: 100%;
    min-height: 48px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    background: #07100d;
    outline: 0;
    font-size: 16px;
}

.subscriber-login-form input:focus {
    border-color: rgba(104,239,178,.38);
    box-shadow: 0 0 0 3px rgba(104,239,178,.05);
}

.subscriber-login-button {
    min-height: 50px;
    margin-top: 3px;
    border: 1px solid rgba(104,239,178,.28);
    border-radius: 13px;
    color: #042016;
    background: linear-gradient(135deg, var(--green-strong), var(--green));
    cursor: pointer;
    font-weight: 850;
}

.subscriber-login-button:disabled {
    opacity: .5;
    cursor: wait;
}

.subscriber-login-message {
    margin: 13px 0 0;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--text-soft);
    background: rgba(255,255,255,.02);
    font-size: 12px;
    line-height: 1.6;
}

.subscriber-login-message.error {
    border-color: rgba(255,117,133,.22);
    color: #ffc0c8;
    background: rgba(255,117,133,.05);
}

.subscriber-login-message.success {
    border-color: rgba(104,239,178,.22);
    color: var(--green);
    background: rgba(104,239,178,.05);
}

.subscription-footer-note {
    margin-top: 17px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 11px;
    line-height: 1.7;
}

.subscription-footer-note strong {
    color: var(--text-soft);
}

.member-access-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 14px;
    padding: 13px 15px;
    border: 1px solid rgba(104,239,178,.14);
    border-radius: 15px;
    background: rgba(104,239,178,.035);
}

.member-access-copy {
    display: flex;
    align-items: center;
    gap: 10px;
}

.member-access-copy strong,
.member-access-copy small {
    display: block;
}

.member-access-copy strong {
    direction: ltr;
    color: var(--text);
    font-size: 12px;
}

.member-access-copy small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.member-access-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 5px rgba(104,239,178,.06);
}

.member-logout-button {
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 10px;
}

.protected-empty {
    min-height: 220px;
}

@media (max-width: 700px) {
    .subscription-gate {
        align-items: end;
        padding: 10px;
    }

    .subscription-card {
        width: 100%;
        max-height: calc(100dvh - 20px);
        padding: 23px 18px calc(20px + env(safe-area-inset-bottom));
        border-radius: 22px;
    }

    .subscription-card h2 {
        padding-left: 34px;
        font-size: 29px;
    }

    .subscription-price > strong {
        font-size: 48px;
    }

    .member-access-bar {
        align-items: flex-start;
        gap: 10px;
    }

    .member-access-copy {
        min-width: 0;
    }

    .member-access-copy strong {
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 220px;
    }
}

/* ============================================================
   SUBSCRIPTION EXPERIENCE v50 — PAYPAL READY
============================================================ */

.subscription-card-pro {
    width: min(760px, 100%);
    padding: 32px;
}

.subscription-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    align-items: start;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
}

.subscription-heading .subscription-intro {
    max-width: 520px;
}

.subscription-price-usd {
    margin: 0;
    align-self: center;
}

.subscription-price-usd > strong {
    color: var(--text);
    font-size: 48px;
}

.subscription-price-usd span {
    color: var(--green);
}

.subscription-benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin: 18px 0;
}

.subscription-benefits span {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid rgba(104, 239, 178, .10);
    border-radius: 12px;
    color: var(--text-soft);
    background: rgba(104, 239, 178, .025);
    font-size: 11px;
    line-height: 1.5;
}

.subscription-mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,.018);
}

.subscription-mode-button {
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    transition: .16s ease;
}

.subscription-mode-button.active {
    color: #041d14;
    background: linear-gradient(135deg, var(--green-strong), var(--green));
}

.subscription-view {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255,255,255,.012);
}

.subscription-view[hidden] {
    display: none !important;
}

.subscription-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 15px;
}

.subscription-section-head strong {
    font-size: 15px;
}

.subscription-section-head small {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.6;
}

.subscriber-login-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    margin-top: 0;
}

.subscription-field-wide {
    min-width: 0;
}

.subscriber-login-button {
    min-width: 190px;
    padding: 0 18px;
}

.checkout-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.checkout-form label > span {
    display: block;
    margin-bottom: 7px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 750;
}

.checkout-form label em {
    margin-right: 4px;
    color: var(--subtle);
    font-size: 9px;
    font-style: normal;
    font-weight: 500;
}

.checkout-form input {
    width: 100%;
    min-height: 48px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    background: #07100d;
    outline: 0;
    font-size: 16px;
}

.checkout-form input:focus {
    border-color: rgba(104,239,178,.38);
    box-shadow: 0 0 0 3px rgba(104,239,178,.05);
}

.discount-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
}

.discount-apply-button {
    min-width: 72px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    color: var(--text-soft);
    background: rgba(255,255,255,.025);
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
}

.discount-apply-button:disabled {
    opacity: .5;
    cursor: wait;
}

.checkout-continue-button {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 2px;
}

.checkout-quote {
    margin-top: 14px;
    padding: 14px 15px;
    border: 1px solid rgba(104,239,178,.12);
    border-radius: 14px;
    background: rgba(104,239,178,.025);
}

.checkout-quote-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    color: var(--muted);
    font-size: 11px;
}

.checkout-quote-row strong {
    direction: ltr;
    color: var(--text-soft);
}

.checkout-quote-row.discount-row strong {
    color: var(--green);
}

.checkout-quote-row.total-row {
    margin-top: 5px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    color: var(--text);
}

.checkout-quote-row.total-row strong {
    color: var(--green);
    font-size: 19px;
}

.checkout-coupon-status {
    display: block;
    margin-top: 4px;
    color: var(--subtle);
    font-size: 9px;
}

.checkout-coupon-status.active {
    color: var(--green);
}

.paypal-payment-shell {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid rgba(0, 112, 186, .22);
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(0,112,186,.045), rgba(255,196,57,.025));
}

.paypal-payment-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 13px;
}

.paypal-payment-head strong,
.paypal-payment-head small {
    display: block;
}

.paypal-payment-head strong {
    font-size: 13px;
}

.paypal-payment-head small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.5;
}

.paypal-ready-badge {
    direction: ltr;
    padding: 6px 9px;
    border: 1px solid rgba(255,196,57,.18);
    border-radius: 999px;
    color: #ffd96d;
    background: rgba(255,196,57,.05);
    font-size: 9px;
    font-weight: 850;
}

#paypal-button-container {
    min-height: 0;
}

.paypal-setup-message {
    margin: 0;
    padding: 12px;
    border: 1px dashed rgba(255,196,57,.18);
    border-radius: 11px;
    color: #d8c88e;
    background: rgba(255,196,57,.03);
    font-size: 10px;
    line-height: 1.7;
}

.subscription-security-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    color: var(--muted);
}

.security-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--green);
    background: rgba(104,239,178,.035);
}

.subscription-security-note strong,
.subscription-security-note small {
    display: block;
}

.subscription-security-note strong {
    color: var(--text-soft);
    font-size: 10px;
}

.subscription-security-note small {
    margin-top: 3px;
    font-size: 9px;
    line-height: 1.5;
}

@media (max-width: 700px) {
    .subscription-card-pro {
        padding: 22px 16px calc(18px + env(safe-area-inset-bottom));
    }

    .subscription-heading {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .subscription-heading .subscription-price-usd {
        align-self: auto;
    }

    .subscription-price-usd > strong {
        font-size: 42px;
    }

    .subscription-benefits {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .subscription-benefits span {
        min-height: 36px;
    }

    .subscription-view {
        padding: 14px;
    }

    .subscription-section-head {
        display: block;
    }

    .subscription-section-head small {
        display: block;
        margin-top: 4px;
    }

    .subscriber-login-form,
    .checkout-form {
        grid-template-columns: 1fr;
    }

    .subscriber-login-button,
    .checkout-continue-button {
        width: 100%;
        min-width: 0;
        grid-column: auto;
    }

    .paypal-payment-head {
        display: block;
    }

    .paypal-ready-badge {
        display: inline-block;
        margin-top: 8px;
    }
}
