:root {
    --bg: #0b1a2b;
    --panel: rgba(10, 28, 48, 0.8);
    --panel-border: rgba(103, 184, 255, 0.28);
    --text: #e9f3ff;
    --muted: #9db4cf;
    --accent: #67b8ff;
    --raise: #53c7b8;
    --call: #ffad66;
    --fold: #ff7b73;
    --neutral: #84a4c3;
}

body.holdem-page,
body.blackjack-page,
body.gaming-page,
body.poker-methodology-page,
body.blackjack-methodology-page,
body.gambling-legal-page {
    --bg: #0d1b14;
    --panel: rgba(12, 34, 24, 0.78);
    --panel-border: rgba(243, 210, 124, 0.2);
    --text: #f4ecd6;
    --muted: #b8ae95;
    --accent: #f3d27c;
    --raise: #54c07a;
    --call: #f0c75e;
    --fold: #df6b57;
    --neutral: #8aa295;
}

body[data-theme="blue"] {
    --bg: #0b1a2b;
    --panel: rgba(10, 28, 48, 0.8);
    --panel-border: rgba(103, 184, 255, 0.28);
    --text: #e9f3ff;
    --muted: #9db4cf;
    --accent: #67b8ff;
    --raise: #53c7b8;
    --call: #ffad66;
    --fold: #ff7b73;
    --neutral: #84a4c3;
}

body[data-theme="dark"] {
    --bg: #0b0d10;
    --panel: rgba(24, 26, 30, 0.86);
    --panel-border: rgba(210, 216, 224, 0.22);
    --text: #f2f4f7;
    --muted: #aeb6c1;
    --accent: #d7dde5;
    --raise: #7fd3a8;
    --call: #d6b96b;
    --fold: #e27f78;
    --neutral: #9ba3ad;
}

body[data-theme="light"] {
    --bg: #f5f7fa;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-border: rgba(120, 133, 150, 0.34);
    --text: #17202c;
    --muted: #53606f;
    --accent: #2f5f8f;
    --raise: #187a55;
    --call: #8d6414;
    --fold: #b54840;
    --neutral: #6f7b89;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 16% 0%, rgba(103, 184, 255, 0.24), transparent 36%),
        radial-gradient(circle at 88% 8%, rgba(255, 173, 102, 0.14), transparent 28%),
        linear-gradient(160deg, #071424 0%, #10233a 48%, #0a1a2d 100%);
}

@media (min-width: 901px) {
    body {
        zoom: 90%;
        width: 111.111vw;
        min-height: 111.111dvh;
    }
}

body[data-theme="blue"] {
    background:
        radial-gradient(circle at 16% 0%, rgba(103, 184, 255, 0.24), transparent 36%),
        radial-gradient(circle at 88% 8%, rgba(255, 173, 102, 0.14), transparent 28%),
        linear-gradient(160deg, #071424 0%, #10233a 48%, #0a1a2d 100%);
}

body[data-theme="dark"] {
    background:
        radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.08), transparent 34%),
        radial-gradient(circle at 88% 8%, rgba(170, 176, 188, 0.08), transparent 28%),
        linear-gradient(160deg, #050608 0%, #111318 48%, #08090c 100%);
}

body[data-theme="light"] {
    background:
        radial-gradient(circle at 16% 0%, rgba(125, 148, 175, 0.18), transparent 36%),
        radial-gradient(circle at 88% 8%, rgba(210, 216, 224, 0.24), transparent 28%),
        linear-gradient(160deg, #ffffff 0%, #f0f3f7 48%, #e8edf3 100%);
}

body.portfolio-page,
body.retirement-calculator-page {
    overflow-x: hidden;
    overflow-x: clip;
}

body.holdem-page,
body.blackjack-page,
body.gaming-page,
body.poker-methodology-page,
body.blackjack-methodology-page,
body.gambling-legal-page {
    background:
        radial-gradient(circle at top, rgba(243, 210, 124, 0.16), transparent 30%),
        linear-gradient(160deg, #08110d 0%, #102419 45%, #09150f 100%);
}

body[data-theme="blue"].holdem-page,
body[data-theme="blue"].blackjack-page,
body[data-theme="blue"].gaming-page,
body[data-theme="blue"].poker-methodology-page,
body[data-theme="blue"].blackjack-methodology-page,
body[data-theme="blue"].gambling-legal-page {
    background:
        radial-gradient(circle at 16% 0%, rgba(103, 184, 255, 0.24), transparent 36%),
        radial-gradient(circle at 88% 8%, rgba(255, 173, 102, 0.14), transparent 28%),
        linear-gradient(160deg, #071424 0%, #10233a 48%, #0a1a2d 100%);
}

body[data-theme="dark"].holdem-page,
body[data-theme="dark"].blackjack-page,
body[data-theme="dark"].gaming-page,
body[data-theme="dark"].poker-methodology-page,
body[data-theme="dark"].blackjack-methodology-page,
body[data-theme="dark"].gambling-legal-page {
    background:
        radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.08), transparent 34%),
        radial-gradient(circle at 88% 8%, rgba(170, 176, 188, 0.08), transparent 28%),
        linear-gradient(160deg, #050608 0%, #111318 48%, #08090c 100%);
}

body[data-theme="light"].holdem-page,
body[data-theme="light"].blackjack-page,
body[data-theme="light"].gaming-page,
body[data-theme="light"].poker-methodology-page,
body[data-theme="light"].blackjack-methodology-page,
body[data-theme="light"].gambling-legal-page {
    background:
        radial-gradient(circle at 16% 0%, rgba(125, 148, 175, 0.18), transparent 36%),
        radial-gradient(circle at 88% 8%, rgba(210, 216, 224, 0.24), transparent 28%),
        linear-gradient(160deg, #ffffff 0%, #f0f3f7 48%, #e8edf3 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(170, 210, 255, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(170, 210, 255, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(circle at center, black, transparent 85%);
    pointer-events: none;
}

body.holdem-page::before,
body.blackjack-page::before,
body.gaming-page::before,
body.poker-methodology-page::before,
body.blackjack-methodology-page::before,
body.gambling-legal-page::before {
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

.layout {
    width: min(1240px, calc(100vw - 2rem));
    margin: 0 auto;
    padding: 1rem 0 4rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
    gap: 1rem;
}

body[data-theme="dark"]::before {
    background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
}

body[data-theme="light"]::before {
    background-image: linear-gradient(rgba(50, 70, 95, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(50, 70, 95, 0.06) 1px, transparent 1px);
}

.layout>* {
    min-width: 0;
    max-width: 100%;
}

.layout>.results {
    grid-column: 2;
}

.layout> :not(.results):not(.hero) {
    grid-column: 1;
}

.street-header h2,
.results-header h2 {
    margin: 0;
    font-family: "Segoe UI", sans-serif;
    letter-spacing: 0.02em;
}

.best-hand-line {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    min-height: 1.5rem;
    display: flex;
    align-items: center;
}

.best-hand-line strong {
    color: var(--text);
    font-size: 1.25rem;
}

.nuts-summary {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    min-height: 1.2rem;
    line-height: 1.2;
}

.hero {
    padding: 1rem 0 0.25rem;
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.hero-mark {
    display: flex;
    align-items: center;
    min-height: 2.2rem;
    padding-top: 0.05rem;
}

.hero-copy {
    display: grid;
    gap: 0.15rem;
}

.hero-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

h1 {
    font-family: "Segoe UI", sans-serif;
    margin: 0 0 0.4rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 1.25rem;
}

.eyebrow {
    font-family: "Segoe UI", sans-serif;
    margin: 0 0 0.4rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 1.25rem;
}

.intro {
    max-width: 56rem;
    color: var(--muted);
    line-height: 1;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.settings-toggle {
    display: inline-block;
    margin: 0;
    color: var(--accent);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.settings-collapse {
    display: grid;
    gap: 0.55rem;
}

.settings-collapse[hidden] {
    display: none;
}

.hero .settings-collapse .defaults-panel {
    margin-top: 0.2rem;
}

.panel {
    min-width: 0;
    max-width: 100%;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 1.00rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(14px);
}

.main-panel {
    max-width: none;
    width: 100%;
    min-width: 0;
}

.table-grid {
    display: grid;
    gap: 1rem;
}

.leaderboard-panel {
    display: grid;
    justify-items: center;
}

.leaderboard-ad {
    width: 728px;
    height: 90px;
    border: 1px dashed rgba(243, 210, 124, 0.35);
    border-radius: 14px;
    background: rgba(7, 18, 13, 0.55);
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.15rem;
    text-align: center;
}

.leaderboard-title,
.leaderboard-copy {
    margin: 0;
}

.leaderboard-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.leaderboard-copy {
    color: var(--muted);
    font-size: 0.86rem;
}

.card-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.shared-inputs,
.card-row,
.stats {
    display: grid;
    gap: 1rem;
}

.shared-inputs {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.field-group,
.card-input,
.stat {
    display: grid;
    gap: 0.45rem;
}

.field-group.is-hidden {
    display: none !important;
}

.field-group.is-disabled,
.fp-grid label.is-disabled {
    color: var(--muted);
    opacity: 0.62;
}

input:disabled,
select:disabled,
textarea:disabled {
    color: var(--muted);
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.045);
    cursor: not-allowed;
    opacity: 0.68;
}

.voice-controls {
    margin-top: 0.85rem;
    padding: 0.65rem;
    border-radius: 14px;
    border: 1px solid rgba(243, 210, 124, 0.2);
    background: rgba(7, 18, 13, 0.55);
    display: grid;
    gap: 0.45rem;
}

.voice-actions {
    display: flex;
    gap: 0.5rem;
}

.voice-btn {
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

.voice-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.voice-status {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.voice-controls[data-state="listening"] {
    border-color: rgba(84, 192, 122, 0.6);
    box-shadow: inset 0 0 0 1px rgba(84, 192, 122, 0.22);
}

.voice-controls[data-state="success"] .voice-status {
    color: var(--raise);
}

.voice-controls[data-state="error"] .voice-status,
.voice-controls[data-state="unsupported"] .voice-status {
    color: #ffb1a4;
}

.street {
    display: none;
    border-top: 1px solid rgba(243, 210, 124, 0.14);
    padding-top: 1rem;
    animation: lift 240ms ease;
}

/* Remove the top border for the first street (Hole Cards) */
.table-grid .street:first-child {
    border-top: none;
    padding-top: 0;
}

.street.visible {
    display: grid;
    gap: 1rem;
}

.street-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
}

/* Stack hole cards vertically (one per row) */
.street[data-street="pre-flop"] .card-row {
    grid-template-columns: 1fr;
}

.card-row {
    display: flex;
    gap: 0.75rem;
    margin: 0.75rem 0 0;
    min-height: 48px;
}

.card-input.focused {
    outline: 2px solid var(--accent);
    border-radius: 10px;
}

/* Hole cards display */
.hole-row {
    display: flex;
    gap: 0.75rem;
    margin: 0.75rem 0 0;
    min-height: 40px;
}

.hole-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
}

.hole-slot.focused {
    outline: 3px solid rgba(243, 210, 124, 0.6);
}

.hole-tile {
    font-weight: 800;
    color: var(--text);
}

label,
.stat span {
    color: var(--muted);
    font-size: 0.92rem;
}

input,
select,
button {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 0.85rem 1rem;
    font: inherit;
}

input,
select {
    color: var(--text);
    background: rgba(7, 18, 13, 0.82);
}

button {
    background: linear-gradient(135deg, #f0d38a, #b98d35);
    color: #201507;
    font-weight: 700;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(243, 210, 124, 0.18);
}

/* Compact button groups for card inputs */
.rank-buttons,
.suit-buttons {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.rank-btn,
.suit-btn {
    border-radius: 10px;
    padding: 0.35rem 0.6rem;
    font-weight: 700;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.rank-btn.selected,
.suit-btn.selected {
    background: linear-gradient(135deg, #f0d38a, #b98d35);
    color: #201507;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

/* Compact button groups for card inputs */
.rank-buttons,
.suit-buttons {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.rank-btn,
.suit-btn {
    border-radius: 10px;
    padding: 0.35rem 0.6rem;
    font-weight: 700;
    font-size: 1rem;
    min-width: 3rem;
    min-height: 3rem;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.rank-btn.selected,
.suit-btn.selected {
    background: linear-gradient(135deg, #f0d38a, #b98d35);
    color: #201507;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.results {
    display: grid;
    gap: 1.25rem;
    position: relative;
    top: auto;
    align-self: stretch;
    height: 100%;
    max-height: none;
    overflow: visible;
    z-index: 3;
}

.ads {
    display: grid;
    gap: 1rem;
    align-self: stretch;
    height: 100%;
    align-content: start;
}

.ads h2 {
    margin: 0;
    font-family: "Segoe UI", sans-serif;
    letter-spacing: 0.02em;
}

.ad-placeholder-300-250 {
    width: 300px;
    height: 250px;
    border: 1px dashed rgba(243, 210, 124, 0.35);
    border-radius: 16px;
    background: rgba(7, 18, 13, 0.55);
    padding: 1rem;
    display: grid;
    gap: 0.7rem;
    align-content: start;
    justify-self: center;
}

.ad-placeholder-300-100 {
    width: 300px;
    height: 100px;
    border: 1px dashed rgba(243, 210, 124, 0.35);
    border-radius: 16px;
    background: rgba(7, 18, 13, 0.55);
    padding: 1rem;
    display: grid;
    gap: 0.7rem;
    align-content: start;
    justify-self: center;
}

.ad-tag {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(243, 210, 124, 0.2);
    color: var(--accent);
}

.ad-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.ad-copy {
    margin: 0;
    color: var(--muted);
}

.ad-cta {
    justify-self: start;
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

.results .results-inputs {
    display: grid;
    gap: 0.75rem;
}

.results .separator {
    height: 1px;
    background: rgba(243, 210, 124, 0.12);
    margin: 0.75rem 0;
}

.reset-btn {
    margin-left: 0.75rem;
    padding: 0.45rem 0.8rem;
    font-size: 0.9rem;
    border-radius: 10px;
}

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

.stat {
    padding: 1rem;
    border-radius: 18px;
    background: rgba(7, 18, 13, 0.78);
}

.stat strong {
    font-size: clamp(1.5rem, 4vw, 2.3rem);
    display: block;
    line-height: 1;
    min-height: 2.4rem;
}

.recommendation-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

/* Make the three controls share the row evenly */
.recommendation-wrap>.recommendation,
.recommendation-wrap>.reset-btn,
.recommendation-wrap>.voice-btn {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recommendation-wrap .voice-btn {
    margin-left: 0;
}

.recommendation {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.9rem 1.2rem;
    font-weight: 700;
    letter-spacing: 0.00em;
}

.recommendation.raise {
    background: rgba(84, 192, 122, 0.16);
    color: var(--raise);
}

.recommendation.call {
    background: rgba(240, 199, 94, 0.16);
    color: var(--call);
}

.recommendation.fold {
    background: rgba(223, 107, 87, 0.16);
    color: var(--fold);
}

.recommendation.neutral {
    background: rgba(138, 162, 149, 0.16);
    color: var(--neutral);
}

/* Make recommendation lozenge and action buttons visually match height */
.recommendation,
.reset-btn,
.voice-btn {
    height: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.9rem;
}

.error {
    margin: 0;
    color: #ffb1a4;
}

.status {
    margin: 0;
    color: var(--accent);
    font-weight: 700;
    min-height: 1.25rem;
}

.results .status[hidden] {
    display: block;
    visibility: hidden;
}

.results-voice-controls {
    margin-top: 0.2rem;
    padding: 0 0.5rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    height: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-voice-controls .voice-status {
    margin: 0;
}

.results-voice-controls[data-state="listening"],
.results-voice-controls[data-state="success"],
.results-voice-controls[data-state="error"],
.results-voice-controls[data-state="unsupported"] {
    border: none;
    box-shadow: none;
}

.legal-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding: 0.3rem 0 0.2rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.legal-links p {
    flex: 0 0 100%;
    width: 100%;
    margin: 0.35rem 0 0;
    text-align: center;
}

.deck-legal-links {
    grid-column: 1 / -1;
}

.legal-links a {
    color: var(--accent);
}

.legal-layout {
    width: min(980px, calc(100vw - 2rem));
    margin: 0 auto;
    padding: 1rem 0 2rem;
}

.legal-panel {
    overflow: hidden;
}

.legal-panel h1 {
    margin-top: 0;
    margin-bottom: 0.7rem;
}

.legal-panel pre {
    margin: 0;
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-family: "Segoe UI", sans-serif;
    line-height: 1.45;
    font-size: 0.95rem;
}

.legal-content {
    line-height: 1.55;
}

.legal-content section+section {
    margin-top: 1.35rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--panel-border);
}

.legal-content h2 {
    margin: 0 0 0.55rem;
    color: var(--accent);
    font-size: 1.15rem;
}

.legal-content h3 {
    margin: 0.85rem 0 0.35rem;
    color: var(--text);
    font-size: 1rem;
}

.legal-content p {
    margin: 0.55rem 0;
}

.legal-content ul {
    margin: 0.55rem 0 0.8rem 1.35rem;
    padding: 0;
}

.legal-content li {
    margin: 0.28rem 0;
}

.legal-content pre {
    overflow-x: auto;
    margin: 0.8rem 0;
    padding: 0.85rem;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.45;
}

.legal-back {
    display: inline-block;
    margin-bottom: 0.8rem;
    color: var(--accent);
}

.cookie-consent {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 1200;
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(7, 18, 13, 0.95);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
}

.cookie-consent[hidden] {
    display: none;
}

.cookie-consent__content h2 {
    margin: 0 0 0.3rem;
    font-size: 1.05rem;
    color: var(--accent);
}

.cookie-consent__content p {
    margin: 0;
    color: var(--muted);
    max-width: 62ch;
    line-height: 1.35;
}

.cookie-consent__content a {
    color: var(--accent);
}

.cookie-consent__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.consent-btn {
    min-height: 38px;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    font-weight: 700;
    padding: 0.45rem 0.8rem;
    cursor: pointer;
}

.consent-btn--primary {
    background: linear-gradient(135deg, #f0d38a, #b98d35);
    color: #201507;
    border-color: rgba(240, 211, 138, 0.72);
}

.consent-btn--secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.consent-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(2, 7, 5, 0.7);
}

.consent-modal[hidden] {
    display: none;
}

.consent-modal__card {
    width: min(620px, 100%);
    display: grid;
    gap: 0.85rem;
}

.consent-modal__card h2 {
    margin: 0;
    color: var(--accent);
}

.consent-modal__intro {
    margin: 0;
    color: var(--muted);
}

.consent-option {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 0.6rem;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}

.consent-option strong {
    display: block;
}

.consent-option small {
    color: var(--muted);
}

.consent-modal__actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.consent-manage-floating {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1100;
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    min-height: 36px;
    background: rgba(7, 18, 13, 0.9);
    color: var(--accent);
    border: 1px solid var(--panel-border);
}

.consent-manage-floating[hidden] {
    display: none;
}

/* ============================================================
   HOLDEM PAGE — overflow-safe responsive behavior
   ============================================================ */

.holdem-page .main-panel,
.holdem-page .table-grid,
.holdem-page .deck-panel,
.holdem-page .settings-panel,
.holdem-page .card-panels,
.holdem-page .card-panels>.panel {
    width: 100%;
    min-width: 0;
}

.holdem-page .shared-inputs {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.holdem-page .hand-inputs-panel .shared-inputs {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.holdem-page .hand-inputs-panel input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.holdem-page .card-row {
    flex-wrap: wrap;
}

.holdem-page .card-input {
    flex: 1 1 56px;
    min-width: 56px;
}

@media (max-width: 1180px) {
    .holdem-page .layout {
        grid-template-columns: 1fr;
        width: min(100vw - 1rem, 1120px);
    }

    .holdem-page .layout>.results,
    .holdem-page .layout> :not(.hero) {
        grid-column: 1;
    }

    .holdem-page .card-panels {
        grid-template-columns: 1fr;
    }

    .holdem-page .deck-grid {
        grid-template-columns: repeat(10, 1fr);
    }
}

@media (max-width: 900px) {
    .holdem-page .deck-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

body.calculating .deck-grid,
body.calculating .card-input,
body.calculating .hole-slot,
body.calculating .rank-btn,
body.calculating .suit-btn {
    pointer-events: none;
}

@keyframes lift {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 720px) {
    .layout {
        grid-template-columns: 1fr;
        width: min(100vw - 1rem, 1120px);
        padding-top: 1rem;
    }

    .layout> :not(.hero),
    .layout>.results {
        grid-column: 1;
    }

    .panel {
        padding: 1rem;
        border-radius: 20px;
    }

    .street-header {
        align-items: stretch;
        flex-direction: column;
    }

    /* Disable sticky behavior on small screens */
    .results {
        position: static;
        max-height: none;
        overflow: visible;
        grid-column: 1;
    }

    .card-panels {
        grid-template-columns: 1fr;
    }

    .leaderboard-ad {
        width: min(100%, 728px);
        height: auto;
        min-height: 90px;
        aspect-ratio: 728 / 90;
        padding: 0.5rem;
    }

    .ad-placeholder {
        width: min(100%, 300px);
    }

    .cookie-consent {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-consent__actions {
        justify-content: stretch;
    }

    .cookie-consent__actions .consent-btn {
        flex: 1 1 0;
    }
}

/* Deck grid: 13 columns x 4 rows */
.deck-grid {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 0.45rem;
    margin: 0.75rem 0 0;
}

.card-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text);
    padding: 0 0.5rem;
    border-radius: 6px;
    font-weight: 700;
    height: 44px;
    min-height: 44px;
    cursor: pointer;
}

.card-tile.selected {
    background: linear-gradient(135deg, rgba(243, 210, 124, 0.95), rgba(185, 141, 53, 0.95));
    color: #201507;
}

.card-tile.disabled {
    opacity: 0.35;
    pointer-events: none;
}

.card-tile:not(button) {
    cursor: default;
}

.card-display,
.hole-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.35rem;
    height: 40px;
    min-height: 40px;
    font-weight: 800;
    color: var(--text);
}

.card-display img,
.hole-tile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 720px) {
    .deck-grid {
        grid-template-columns: repeat(7, 1fr);
    }

    .card-tile {
        min-height: 44px;
    }

    .card-display,
    .hole-tile {
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .layout {
        width: calc(100vw - 0.75rem);
        gap: 0.6rem;
        padding: 0.5rem 0 11.5rem;
    }

    .holdem-page .layout {
        /* Keep all Holdem content scrollable above the fixed mobile results tray. */
        padding-bottom: calc(36vh + 0.1rem);
    }

    .hero {
        padding: 0.5rem 0 0.2rem;
        gap: 0.6rem;
        align-items: flex-start;
    }

    .hero img {
        width: 56px;
        height: 56px;
    }

    h1,
    .eyebrow {
        font-size: 1rem;
        letter-spacing: 0.1em;
    }

    .intro {
        font-size: 0.9rem;
        line-height: 1.25;
    }

    .panel {
        padding: 0.8rem;
        border-radius: 16px;
    }

    .table-grid {
        gap: 0.75rem;
    }

    .defaults-panel {
        order: 1;
    }

    .card-panels {
        order: 2;
        gap: 0.5rem;
        grid-template-columns: 1fr 1.2fr;
    }

    .hand-inputs-panel {
        order: 3;
    }

    .deck-panel {
        order: 4;
    }

    .defaults-panel .shared-inputs,
    .hand-inputs-panel .shared-inputs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
    }

    .voice-actions {
        flex-wrap: wrap;
    }

    .defaults-panel .field-group,
    .hand-inputs-panel .field-group {
        min-width: 0;
    }

    .defaults-panel input,
    .hand-inputs-panel input {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .card-panels .panel {
        padding: 0.65rem;
    }

    .hole-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem;
        margin-top: 0.4rem;
    }

    .community-panel .card-row {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.25rem;
        margin-top: 0.4rem;
    }

    .card-input,
    .hole-slot {
        min-width: 0;
    }

    .shared-inputs {
        gap: 0.65rem;
    }

    .field-group,
    .card-input,
    .stat {
        gap: 0.35rem;
    }

    input,
    select,
    button {
        padding: 0.75rem 0.85rem;
    }

    .defaults-panel label,
    .hand-inputs-panel label {
        overflow-wrap: anywhere;
    }

    .rank-btn,
    .suit-btn {
        min-width: 2.8rem;
        min-height: 2.8rem;
        padding: 0.35rem 0.5rem;
    }

    .results {
        position: fixed;
        top: auto;
        left: 0.375rem;
        right: 0.375rem;
        bottom: 0.375rem;
        order: 99;
        gap: 0.6rem;
        z-index: 20;
        border-radius: 14px;
        max-height: 45vh;
        overflow-y: auto;
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.48);
        background: rgba(7, 18, 13, 0.92);
    }

    .holdem-page .results {
        gap: 0.4rem;
        padding: 0.65rem;
        max-height: 38vh;
    }

    .holdem-page .results-header h2 {
        font-size: 1rem;
    }

    .holdem-page .best-hand-line,
    .holdem-page .nuts-summary,
    .holdem-page .status,
    .holdem-page .error {
        margin: 0.15rem 0 0;
        font-size: 0.82rem;
        min-height: 0;
    }

    .holdem-page .stats {
        gap: 0.35rem;
    }

    .holdem-page .stat {
        padding: 0.55rem;
        border-radius: 12px;
        gap: 0.2rem;
    }

    .holdem-page .stat span {
        font-size: 0.75rem;
    }

    .holdem-page .stat strong {
        font-size: 1rem;
        min-height: 1.2rem;
    }

    .holdem-page .recommendation,
    .holdem-page .reset-btn,
    .holdem-page .voice-btn {
        height: 34px;
        min-height: 34px;
        font-size: 0.8rem;
        padding: 0 0.6rem;
    }

    .holdem-page .results-voice-controls {
        height: 36px;
        min-height: 36px;
        margin-top: 0;
        padding: 0 0.2rem;
    }

    .holdem-page .results-voice-controls .voice-status {
        font-size: 0.8rem;
    }

    .deck-legal-links {
        order: 5;
        padding-top: 0.2rem;
        padding-bottom: 0.35rem;
    }

    .stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .stat {
        padding: 0.75rem;
        border-radius: 14px;
    }

    .stat span {
        font-size: 0.82rem;
    }

    .stat strong {
        font-size: 1.15rem;
    }

    .recommendation-wrap {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .reset-btn {
        margin-left: 0;
    }

    .deck-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.4rem;
    }

    .card-tile,
    .card-display,
    .hole-tile {
        min-height: 40px;
        padding: 0.2rem 0.3rem;
        font-size: 0.78rem;
    }

    .holdem-page .card-panels {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   SITE NAV — shown on calculator pages (poker, blackjack)
   ============================================================ */

.site-nav {
    width: 100%;
    background: rgba(7, 18, 13, 0.82);
    border-bottom: 1px solid var(--panel-border);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-nav__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.site-nav__brand img {
    border-radius: 6px;
}

.site-nav__links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.site-nav__theme {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.site-nav__theme select {
    width: auto;
    min-width: 92px;
    height: 34px;
    min-height: 34px;
    max-height: 34px;
    padding: 0 1.8rem 0 0.65rem;
    border-radius: 8px;
    border-color: var(--panel-border);
    background: rgba(7, 18, 13, 0.72);
    color: var(--text);
    font-size: 0.82rem;
}

.site-nav .site-nav__toggle {
    display: none;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-direction: column;
    cursor: pointer;
}

.site-nav__toggle span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 160ms ease, opacity 160ms ease;
}

.site-nav.is-open .site-nav__toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.site-nav.is-open .site-nav__toggle span:nth-child(2) {
    opacity: 0;
}

.site-nav.is-open .site-nav__toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.site-nav__links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
    transition: color 140ms ease, background 140ms ease;
}

.site-nav__links a:hover {
    color: var(--text);
    background: rgba(243, 210, 124, 0.08);
}

.site-nav__links a.active {
    color: var(--accent);
    background: rgba(243, 210, 124, 0.12);
}

/* ============================================================
   LANDING PAGE
   ============================================================ */

.landing-layout {
    width: min(1200px, calc(100vw - 2rem));
    margin: 0 auto;
    padding: 3rem 0 3rem;
    display: grid;
    gap: 2.5rem;
}

.landing-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    width: min(100%, calc(800px + 1.25rem));
    margin: 0 auto;
}

.landing-hero__mark img {
    border-radius: 16px;
}

.landing-hero__copy {
    display: grid;
    gap: 0.4rem;
}

.landing-title {
    font-family: "Segoe UI", sans-serif;
    margin: 0;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 2rem;
}

.landing-tagline {
    margin: 0;
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 600;
}

.landing-sub {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.55;
    max-width: 50rem;
}

.landing-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 400px));
    justify-content: center;
    gap: 1.25rem;
}

.landing-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text);
    width: 100%;
    transition: transform 180ms ease, box-shadow 180ms ease;
    cursor: pointer;
}

.landing-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.38);
}

.landing-card__icon {
    font-size: 2.2rem;
    line-height: 1;
    grid-column: 1;
    grid-row: 1;
    align-self: center;
}

.landing-card__title {
    margin: 0;
    font-family: "Segoe UI", sans-serif;
    font-size: 1.2rem;
    color: var(--accent);
    letter-spacing: 0.02em;
    grid-column: 2;
    grid-row: 1;
    align-self: center;
}

body.landing-page .landing-card__title {
    color: var(--text);
}

.landing-card__desc {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.55;
    grid-column: 1 / -1;
}

.landing-card__cta {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 0.2rem;
    grid-column: 1 / -1;
}

.landing-footer {
    padding-top: 0.5rem;
}

/* Keep landing pages inside viewport at phone sizes */
body.landing-page {
    overflow-x: hidden;
}

body.gaming-page {
    overflow-x: hidden;
}

.landing-page .landing-layout,
.gaming-page .landing-layout {
    max-width: 100%;
}

.landing-page .landing-card,
.gaming-page .landing-card {
    min-width: 0;
}

.landing-page .landing-card__title,
.landing-page .landing-card__desc,
.gaming-page .landing-card__title,
.gaming-page .landing-card__desc {
    overflow-wrap: anywhere;
}

.landing-page .legal-links,
.gaming-page .legal-links {
    flex-wrap: wrap;
    text-align: center;
}

.landing-page .legal-links p,
.gaming-page .legal-links p {
    width: 100%;
    margin: 0.35rem 0 0;
}

@media (max-width: 768px) {

    .landing-page .landing-layout,
    .gaming-page .landing-layout {
        width: min(100%, calc(100vw - 1rem));
        padding: 1.25rem 0 1.75rem;
        gap: 1.25rem;
    }

    .landing-page .landing-hero,
    .gaming-page .landing-hero {
        width: 100%;
        gap: 0.9rem;
    }

    .landing-page .landing-cards,
    .gaming-page .landing-cards {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    .landing-page .landing-card,
    .gaming-page .landing-card {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .landing-page .landing-layout {
        padding: 1.5rem 0 2rem;
        gap: 1.75rem;
    }

    .landing-page .landing-hero {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        text-align: center;
    }

    .landing-page .landing-hero__mark img {
        width: min(44vw, 170px);
        height: auto;
    }

    .landing-page .landing-title {
        font-size: 1.5rem;
        letter-spacing: 0.12em;
    }

    .landing-page .landing-tagline {
        font-size: 1rem;
    }

    .landing-page .landing-sub {
        font-size: 0.92rem;
        line-height: 1.5;
    }

    .landing-page .landing-cards {
        grid-template-columns: 1fr;
        justify-items: stretch;
    }

    .landing-page .landing-card {
        grid-template-columns: 1fr;
        gap: 0.4rem;
        padding: 0.9rem;
    }

    .landing-page .landing-card__icon,
    .landing-page .landing-card__title,
    .landing-page .landing-card__desc,
    .landing-page .landing-card__cta {
        grid-column: 1;
        grid-row: auto;
    }

    .landing-page .landing-footer {
        text-align: center;
        line-height: 1.8;
    }
}

.landing-layout--revamp {
    width: min(1440px, calc(100vw - 2rem));
    gap: 1.6rem;
}

.landing-hero--feature {
    position: relative;
    display: grid;
    align-items: end;
    justify-content: stretch;
    min-height: clamp(360px, 54vh, 520px);
    width: 100%;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

.landing-hero--feature .landing-hero__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    opacity: 0.72;
}

.landing-hero__shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(3, 10, 19, 0.92) 0%, rgba(3, 10, 19, 0.72) 43%, rgba(3, 10, 19, 0.2) 100%),
        linear-gradient(0deg, rgba(3, 10, 19, 0.9) 0%, rgba(3, 10, 19, 0.02) 48%);
}

.landing-hero--feature .landing-hero__copy {
    position: relative;
    z-index: 1;
    align-self: center;
    width: min(720px, 100%);
    padding: clamp(1rem, 3vw, 2.6rem);
    gap: 0.65rem;
}

.landing-eyebrow {
    margin: 0;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.landing-hero--feature .landing-title {
    color: var(--text);
    max-width: 14ch;
    font-size: clamp(2rem, 4.5vw, 4.05rem);
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
}

.landing-hero--feature .landing-sub {
    color: rgba(233, 243, 255, 0.9);
    max-width: 55rem;
    font-size: clamp(0.95rem, 1.25vw, 1.05rem);
    line-height: 1.45;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.landing-hero--feature .landing-actions {
    flex-wrap: nowrap;
}

.landing-primary-cta,
.landing-secondary-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.65rem 0.95rem;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
    text-decoration: none;
    font-weight: 900;
    white-space: nowrap;
}

.landing-primary-cta {
    color: #071424;
    background: linear-gradient(135deg, #f6d878, #c89c35);
    border-color: rgba(246, 216, 120, 0.76);
}

.landing-secondary-cta {
    color: var(--accent);
    background: rgba(5, 16, 28, 0.72);
}

.landing-hero-disclaimer {
    margin: -0.1rem 0 0;
    color: rgba(32, 43, 61, 0.68);
    font-size: 0.82rem;
    line-height: 1.35;
}

.landing-hero-disclaimer a {
    color: var(--accent-strong);
    font-weight: 800;
    text-decoration: none;
}

.landing-hero-disclaimer a:hover {
    text-decoration: underline;
}

.landing-proof {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.landing-proof__item {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.8rem;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    background: rgba(10, 28, 48, 0.58);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.landing-proof__item strong {
    color: var(--accent);
    font-size: 1rem;
}

.landing-proof__item span {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.35;
}

.landing-audience-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.landing-mini-panel {
    display: grid;
    gap: 0.6rem;
    padding: 1rem;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(10, 28, 48, 0.5);
}

.landing-mini-panel h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    line-height: 1.18;
}

.landing-mini-panel ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 1rem;
    margin: 0;
    padding-left: 1.1rem;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.4;
}

.landing-section {
    display: grid;
    gap: 1.2rem;
}

.landing-section__intro {
    display: grid;
    gap: 0.55rem;
    width: min(980px, 100%);
}

.landing-section__intro h2,
.landing-final-cta h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.65rem, 3vw, 2.55rem);
    line-height: 1.08;
}

.landing-section__intro p,
.landing-final-cta p {
    margin: 0;
    max-width: 76rem;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.58;
}

.landing-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.landing-feature-grid--large {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}

.landing-feature {
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    min-width: 0;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--text);
    background: rgba(10, 28, 48, 0.62);
}

.landing-picture {
    display: block;
    min-width: 0;
}

.landing-picture--hero {
    display: contents;
}

.landing-feature--wide {
    grid-row: span 2;
}

.landing-feature--modeler {
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
    grid-template-rows: auto;
}

.landing-feature img {
    display: block;
    width: 100%;
    height: auto;
    object-position: top center;
    background: rgba(0, 0, 0, 0.18);
}

.landing-feature--modeler img {
    height: auto;
}

.landing-feature div {
    display: grid;
    align-content: start;
    gap: 0.45rem;
    padding: 1rem;
}

.landing-feature h3 {
    margin: 0;
    color: var(--accent);
    font-size: 1.12rem;
    line-height: 1.18;
}

.landing-feature p {
    margin: 0;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.5;
}

.landing-feature .landing-card__cta {
    width: fit-content;
    text-decoration: none;
}

.landing-section--modeler {
    padding: 1.2rem;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(10, 28, 48, 0.38);
}

.landing-final-cta {
    display: grid;
    gap: 0.8rem;
    padding: clamp(1.2rem, 3vw, 2rem);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(103, 184, 255, 0.16), rgba(83, 199, 184, 0.08)),
        rgba(10, 28, 48, 0.58);
}

body[data-theme="dark"] .landing-proof__item,
body[data-theme="dark"] .landing-feature,
body[data-theme="dark"] .landing-mini-panel,
body[data-theme="dark"] .landing-section--modeler,
body[data-theme="dark"] .landing-final-cta {
    background: rgba(16, 17, 20, 0.72);
}

body[data-theme="light"] .landing-hero__shade {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.54) 45%, rgba(255, 255, 255, 0.12) 100%),
        linear-gradient(0deg, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.02) 48%);
}

body[data-theme="light"] .landing-hero--feature .landing-sub {
    color: var(--muted);
}

body[data-theme="light"] .landing-secondary-cta,
body[data-theme="light"] .landing-proof__item,
body[data-theme="light"] .landing-feature,
body[data-theme="light"] .landing-mini-panel,
body[data-theme="light"] .landing-section--modeler,
body[data-theme="light"] .landing-final-cta {
    background: rgba(255, 255, 255, 0.78);
}

body[data-theme="light"] .landing-primary-cta {
    color: #17202c;
}

@media (max-width: 980px) {

    .landing-proof,
    .landing-audience-grid,
    .landing-feature-grid,
    .landing-feature-grid--large {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .landing-feature--wide {
        grid-row: auto;
    }

    .landing-feature--modeler {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }

    .landing-feature--modeler img {
        height: auto;
        min-height: 0;
    }
}

@media (max-width: 680px) {
    .landing-layout--revamp {
        width: min(100%, calc(100vw - 1rem));
        gap: 2rem;
    }

    .landing-hero--feature {
        min-height: 560px;
    }

    .landing-hero--feature .landing-hero__image {
        object-position: top center;
    }

    .landing-hero__shade {
        background:
            linear-gradient(0deg, rgba(3, 10, 19, 0.96) 0%, rgba(3, 10, 19, 0.86) 58%, rgba(3, 10, 19, 0.2) 100%);
    }

    .landing-hero--feature .landing-hero__copy {
        align-self: end;
        padding: 1rem;
        text-align: left;
    }

    .landing-hero--feature .landing-title {
        max-width: 100%;
        font-size: 2rem;
    }

    .landing-actions {
        align-items: stretch;
    }

    .landing-hero--feature .landing-actions {
        flex-wrap: wrap;
    }

    .landing-primary-cta,
    .landing-secondary-cta {
        width: 100%;
    }

    .landing-proof,
    .landing-audience-grid,
    .landing-feature-grid,
    .landing-feature-grid--large,
    .landing-feature-grid--themes {
        grid-template-columns: minmax(0, 1fr);
    }

    .landing-mini-panel ul {
        grid-template-columns: minmax(0, 1fr);
    }

    .landing-section--modeler {
        padding: 0.75rem;
    }

    .landing-feature img,
    .landing-feature--wide img,
    .landing-feature--modeler img,
    .landing-feature-grid--themes .landing-feature img {
        height: auto;
        min-height: 0;
    }

    body[data-theme="light"] .landing-hero__shade {
        background:
            linear-gradient(0deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.66) 58%, rgba(255, 255, 255, 0.18) 100%);
    }
}

/* ============================================================
   BLACKJACK PAGE — bj-specific components
   ============================================================ */

.bj-card-row {
    margin-top: 0.75rem;
}

.bj-player-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.bj-card-field select {
    width: 100%;
}

.bj-hand-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.9rem;
}

.bj-mod-btn {
    flex: 1 1 0;
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

.bj-mod-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (max-width: 480px) {
    .bj-player-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
    }
}

/* ============================================================
   PORTFOLIO MODELER PAGE
   ============================================================ */

.portfolio-page .table-grid {
    grid-template-columns: 1fr;
}

.portfolio-page .layout {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 0.75rem clamp(0.5rem, 1.2vw, 1.25rem) 1rem;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0.5rem;
    overflow: hidden;
}

.portfolio-page .main-panel {
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 0.65rem;
    height: auto;
    min-height: 0;
    overflow: hidden;
}

.portfolio-page .main-panel>.street-header,
.portfolio-page .portfolio-actions,
.portfolio-page #portfolio-draft-status,
.portfolio-page .main-panel>div:last-of-type {
    grid-column: 1 / -1;
}

.portfolio-page .portfolio-workspace {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    min-width: 0;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 300px;
    gap: 0.65rem;
    align-items: stretch;
}

.portfolio-page .fp-tabs {
    align-self: stretch;
}

.portfolio-page .portfolio-results {
    min-height: 0;
    overflow: auto;
    padding: 0.65rem;
    border-radius: 14px;
    align-self: stretch;
}

.portfolio-page .portfolio-primary {
    display: grid;
    gap: 0.65rem;
    min-width: 0;
    max-width: 100%;
}

.portfolio-page .portfolio-primary .portfolio-table {
    min-width: 0;
}

.portfolio-page .portfolio-primary .portfolio-table-wrap {
    overflow-x: auto;
    max-width: 100%;
}

.portfolio-page .portfolio-span {
    grid-column: 1 / -1;
}

.portfolio-page .site-nav {
    background: rgba(7, 20, 37, 0.84);
    border-bottom-color: var(--panel-border);
}

.portfolio-page .site-nav__links a:hover {
    background: rgba(103, 184, 255, 0.12);
}

.portfolio-page .site-nav__links a.active {
    background: rgba(103, 184, 255, 0.18);
}

.portfolio-page button,
.retirement-calculator-page button {
    height: 40px;
    min-height: 40px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    padding-top: 0;
    padding-bottom: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.portfolio-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mc-input-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portfolio-page .settings-panel .field-group {
    min-width: 0;
}

.portfolio-page .settings-panel input,
.portfolio-page .settings-panel select {
    width: clamp(120px, 100%, 180px);
    min-width: 120px;
    max-width: 180px;
    height: 45px;
    min-height: 45px;
    max-height: 45px;
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0;
}

.portfolio-page .settings-panel select {
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    padding: 0 2.25rem 0 1rem;
    line-height: 48px;
}

.portfolio-page .settings-panel label {
    overflow-wrap: anywhere;
}

.portfolio-page .override-table {
    min-width: 780px;
}

.portfolio-page .override-table td,
.portfolio-page .override-table th {
    vertical-align: middle;
}

.portfolio-page .override-table input {
    width: clamp(120px, 100%, 160px);
    min-width: 120px;
    max-width: 160px;
}

.portfolio-page .portfolio-override-actions {
    margin-top: 0.75rem;
}

.portfolio-actions {
    margin-top: 0.15rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
}

.portfolio-actions .voice-btn {
    width: auto;
    flex: 0 0 auto;
}

.portfolio-actions .fp-important {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    margin: 0;
    line-height: 1.2;
}

.portfolio-results {
    gap: 0.55rem;
    align-content: start;
}

.portfolio-page .portfolio-results .results-header {
    display: grid;
    gap: 0.1rem;
}

.portfolio-page .portfolio-results .results-header h2 {
    margin: 0;
    font-size: clamp(0.95rem, 0.55vw + 0.72rem, 1.18rem);
    line-height: 1.08;
    overflow-wrap: normal;
    word-break: normal;
}

.portfolio-page .portfolio-results .best-hand-line {
    margin-top: 0;
    min-height: 0;
    font-size: clamp(0.72rem, 0.28vw + 0.62rem, 0.86rem);
    line-height: 1.15;
}

.portfolio-page .portfolio-results .best-hand-line strong {
    font-size: inherit;
}

.portfolio-page .portfolio-results .status {
    min-height: 1rem;
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.15;
}

.portfolio-page .portfolio-results-group-title {
    margin: 0.15rem 0 0;
    color: var(--accent);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.traffic-indicator {
    display: inline-block;
    width: 0.68rem;
    height: 0.68rem;
    margin-left: 0.35rem;
    border-radius: 999px;
    vertical-align: -0.08rem;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(157, 180, 207, 0.45);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.04);
}

.traffic-indicator--green {
    background: #2bd576;
    box-shadow: 0 0 0 2px rgba(43, 213, 118, 0.16), 0 0 10px rgba(43, 213, 118, 0.35);
}

.traffic-indicator--yellow {
    background: #f1c94c;
    box-shadow: 0 0 0 2px rgba(241, 201, 76, 0.16), 0 0 10px rgba(241, 201, 76, 0.32);
}

.traffic-indicator--red {
    background: #f05f57;
    box-shadow: 0 0 0 2px rgba(240, 95, 87, 0.16), 0 0 10px rgba(240, 95, 87, 0.34);
}

.traffic-indicator--neutral {
    background: rgba(157, 180, 207, 0.45);
}

.portfolio-stats {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.portfolio-page .portfolio-results .portfolio-results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
}

.portfolio-page .portfolio-stats .stat,
.retirement-calculator-page .fp-kpis .stat {
    min-width: 0;
}

.portfolio-page .portfolio-stats .stat span,
.retirement-calculator-page .fp-kpis .stat span {
    overflow-wrap: anywhere;
}

.portfolio-page .portfolio-stats .stat strong,
.retirement-calculator-page .fp-kpis .stat strong {
    font-size: clamp(1rem, 1.2vw + 0.65rem, 1.65rem);
    line-height: 1.15;
    min-height: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.portfolio-page .backtest-results-grid .stat span {
    font-size: clamp(0.64rem, 0.38vw + 0.48rem, 0.79rem);
}

.portfolio-page .backtest-results-grid .stat strong {
    font-size: clamp(0.75rem, 0.9vw + 0.49rem, 1.24rem);
}

.portfolio-chart-panel h2,
.portfolio-table-panel h2 {
    margin: 0 0 0.8rem;
}

.chart-surface {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0.6rem;
    width: 100%;
    height: 100%;
    min-height: 320px;
}

.chart-surface svg {
    width: 100%;
    height: 100%;
    display: block;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    overflow: hidden;
}

.portfolio-page #portfolio-panel-chart,
.portfolio-page #portfolio-panel-chart .portfolio-chart-panel {
    min-height: 0;
    height: 100%;
}

.portfolio-page #portfolio-panel-chart .portfolio-chart-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.chart-gridline {
    stroke: rgba(157, 180, 207, 0.25);
    stroke-width: 1;
}

.chart-axis {
    stroke: rgba(233, 243, 255, 0.9);
    stroke-width: 1.2;
}

.chart-axis-tick {
    fill: var(--muted);
    font-size: 16px;
}

.chart-axis-label {
    fill: var(--text);
    font-size: 18px;
    font-weight: 700;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.chart-legend-item i {
    width: 14px;
    height: 3px;
    border-radius: 999px;
    display: inline-block;
}

.chart-range {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.retirement-calculator-page .portfolio-chart-panel {
    overflow: visible;
}

.retirement-calculator-page .chart-surface {
    height: auto;
    min-height: 0;
    grid-template-rows: auto auto auto;
}

.retirement-calculator-page .chart-surface svg {
    height: 450px;
    max-height: 450px;
}

.portfolio-table-wrap {
    overflow-x: auto;
    max-width: 100%;
}

.portfolio-page .portfolio-results .portfolio-stats .stat {
    min-height: 63px;
    padding: 0.58rem 0.62rem;
    gap: 0.35rem;
}

.portfolio-page .portfolio-results .portfolio-stats .stat span {
    font-size: clamp(0.58rem, 0.26vw + 0.5rem, 0.72rem);
    line-height: 1.15;
}

.portfolio-page .portfolio-results .portfolio-stats .stat strong {
    font-size: clamp(0.72rem, 0.72vw + 0.42rem, 1.05rem);
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.portfolio-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.sequence-main-panel {
    display: grid;
    gap: 0.75rem;
}

.sequence-page .layout {
    width: min(96vw, 1680px);
    max-width: min(96vw, 1680px);
    margin: 0 auto;
    padding: 1.25rem 0 0.75rem;
    height: auto;
    min-height: calc(100vh - 54px);
    overflow: visible;
    grid-template-rows: auto auto;
}

.sequence-page .sequence-main-panel {
    grid-template-rows: none;
    height: auto;
    min-height: 0;
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.sequence-dashboard {
    display: grid;
    grid-template-columns: minmax(260px, 0.72fr) minmax(820px, 2.8fr);
    gap: 0.75rem;
    align-items: start;
}

.sequence-header {
    display: grid;
    justify-content: stretch;
    align-items: start;
    gap: 0.35rem;
}

.sequence-header .eyebrow {
    margin: 0;
    font-size: clamp(1.05rem, 0.55vw + 0.84rem, 1.35rem);
    line-height: 1.1;
}

.sequence-intro {
    max-width: 64rem;
    margin: 0;
    color: var(--muted);
    font-size: clamp(0.84rem, 0.25vw + 0.76rem, 0.98rem);
    line-height: 1.35;
}

.sequence-disclaimer {
    margin: 0;
    padding: 0.5rem 0.65rem;
    min-height: 0;
    font-size: 0.82rem;
    line-height: 1.15;
}

.sequence-page .sequence-main-panel>.panel {
    border-radius: 14px;
    padding: 0.85rem;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.sequence-assumptions h2,
.sequence-main-panel .portfolio-table-panel h2,
.sequence-main-panel .portfolio-chart-panel h2 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    line-height: 1.1;
}

.sequence-assumption-grid,
.sequence-highlight-grid {
    gap: 0.55rem;
    grid-template-columns: 1fr;
}

.sequence-highlight-grid {
    grid-template-columns: 1fr;
}

.sequence-assumption-grid .stat,
.sequence-highlight-grid .stat {
    gap: 0.25rem;
    padding: 0.7rem 0.78rem;
    border-radius: 10px;
}

.sequence-assumption-grid .stat span,
.sequence-highlight-grid .stat span {
    font-size: 0.72rem;
    line-height: 1.05;
    white-space: nowrap;
}

.sequence-assumption-grid .stat strong,
.sequence-highlight-grid .stat strong {
    font-size: clamp(1.1rem, 1.05vw + 0.74rem, 1.75rem);
    line-height: 1.05;
    min-height: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

.sequence-highlight--best {
    border-color: rgba(43, 213, 118, 0.42);
}

.sequence-highlight--median {
    border-color: rgba(97, 172, 255, 0.42);
}

.sequence-highlight--worst {
    border-color: rgba(240, 95, 87, 0.42);
}

.sequence-chart-surface {
    display: block;
    height: auto;
    min-height: 510px;
    overflow-x: auto;
}

.sequence-chart {
    display: block;
    width: 100%;
    min-width: 760px;
    height: auto;
}

.sequence-table-wrap {
    margin-top: 0.65rem;
}

.sequence-table-wrap .portfolio-table {
    min-width: 0;
    font-size: 0.86rem;
}

.sequence-table-wrap .portfolio-table th,
.sequence-table-wrap .portfolio-table td {
    padding: 0.48rem 0.6rem;
    line-height: 1.15;
}

@media (max-width: 1100px) {
    .sequence-dashboard {
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.9fr);
    }

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

@media (max-width: 760px) {
    .sequence-page .layout {
        width: 100%;
        max-width: 100%;
        padding-inline: 0.75rem;
    }

    .sequence-dashboard {
        grid-template-columns: 1fr;
    }

    .sequence-chart-panel {
        grid-column: auto;
        grid-row: auto;
    }

    .sequence-assumption-grid,
    .sequence-highlight-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sequence-highlight-grid .stat:last-child {
        grid-column: 1 / -1;
    }

    .sequence-chart-surface {
        min-height: 0;
        overflow-x: hidden;
    }

    .sequence-table-wrap {
        margin-top: 0.45rem;
    }

    .sequence-chart {
        min-width: 0;
        max-width: 100%;
    }
}

.sequence-chart-bg {
    fill: rgba(0, 15, 20, 0.4);
}

.sequence-grid-line {
    stroke: rgba(157, 180, 207, 0.16);
    stroke-width: 1;
}

.sequence-axis {
    stroke: rgba(223, 235, 248, 0.5);
    stroke-width: 1.2;
}

.sequence-axis-label {
    fill: var(--muted);
    font-size: 13px;
}

.sequence-line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sequence-line--muted {
    stroke: rgba(157, 180, 207, 0.24);
    stroke-width: 1.2;
}

.sequence-line--best {
    stroke: #2bd576;
    stroke-width: 3.6;
}

.sequence-line--median {
    stroke: #61acff;
    stroke-width: 3.2;
}

.sequence-line--worst {
    stroke: #f05f57;
    stroke-width: 3.6;
}

.sequence-line-label {
    fill: var(--text);
    stroke: none;
    font-size: 14px;
    font-weight: 800;
}

.sequence-label--best {
    fill: #2bd576;
}

.sequence-label--median {
    fill: #61acff;
}

.sequence-label--worst {
    fill: #f05f57;
}

/* ============================================================
   KNOWLEDGE BASE
   ============================================================ */

.knowledge-base-page .site-nav {
    background: rgba(7, 20, 37, 0.84);
    border-bottom-color: var(--panel-border);
}

body.knowledge-base-page {
    overflow-x: hidden;
    overflow-x: clip;
}

.kb-layout {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 1rem clamp(0.75rem, 2vw, 1rem) 2.5rem;
    display: grid;
    gap: 0.8rem;
}

.kb-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 1rem;
    align-items: end;
}

.kb-header h1 {
    margin-bottom: 0.25rem;
}

.kb-intro {
    max-width: 68rem;
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.kb-notice,
.kb-article-notice {
    color: rgb(255, 174, 0);
}

.kb-notice {
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(255, 174, 0, 0.28);
    border-radius: 8px;
    background: rgba(255, 174, 0, 0.08);
}

.kb-shell {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 0.8rem;
    align-items: start;
}

.kb-filter-panel,
.kb-article-panel {
    border-radius: 12px;
}

.kb-filter-panel {
    position: sticky;
    top: 64px;
}

.kb-filter-panel h2,
.kb-panel-head h2 {
    margin: 0;
    font-size: 1rem;
}

.kb-filter-list {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.kb-filter {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0 0.7rem;
    border-radius: 8px;
    border: 1px solid rgba(103, 184, 255, 0.14);
    background: rgba(255, 255, 255, 0.035);
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.kb-filter span {
    white-space: nowrap;
}

.kb-filter:hover,
.kb-filter.active {
    border-color: rgba(103, 184, 255, 0.45);
    background: rgba(103, 184, 255, 0.14);
}

.kb-filter strong {
    color: var(--accent);
    font-size: 0.86rem;
}

.kb-panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
}

.kb-panel-head p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.kb-article-list {
    display: grid;
    gap: 0.55rem;
}

.kb-article {
    border: 1px solid rgba(103, 184, 255, 0.18);
    border-radius: 10px;
    background: rgba(7, 18, 13, 0.36);
    overflow: hidden;
}

.kb-article[hidden] {
    display: none;
}

.kb-article-summary {
    width: 100%;
    min-height: 0;
    padding: 0.75rem 0.85rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-align: left;
    cursor: pointer;
}

.kb-article-summary small,
.kb-article-summary em {
    display: block;
}

.kb-article-summary small {
    color: var(--accent);
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.kb-article-summary strong {
    display: block;
    margin-top: 0.15rem;
    font-size: 1.04rem;
}

.kb-article-summary em {
    margin-top: 0.16rem;
    color: var(--muted);
    font-style: normal;
    line-height: 1.3;
}

.kb-article-summary b {
    flex: 0 0 auto;
    color: var(--accent);
    font-size: 0.86rem;
}

.kb-article-detail {
    display: grid;
    gap: 0.85rem;
    padding: 0 0.85rem 0.85rem;
}

.kb-article-detail[hidden] {
    display: none;
}

.kb-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.kb-section-grid section,
.kb-related-grid section {
    min-width: 0;
    padding: 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.kb-section-grid h3,
.kb-related-grid h3 {
    margin: 0 0 0.35rem;
    color: var(--accent);
    font-size: 0.86rem;
}

.kb-section-grid p {
    margin: 0;
    color: var(--text);
    line-height: 1.42;
}

.kb-related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.kb-related-grid ul {
    margin: 0;
    padding-left: 1rem;
    color: var(--text);
}

.kb-related-grid li+li {
    margin-top: 0.28rem;
}

.kb-related-grid a {
    color: var(--accent);
    font-weight: 800;
    text-decoration: none;
}

.kb-related-grid a:hover {
    text-decoration: underline;
}

body[data-theme="light"].knowledge-base-page {
    background:
        radial-gradient(circle at 16% 0%, rgba(125, 148, 175, 0.08), transparent 34%),
        linear-gradient(160deg, #ffffff 0%, #f8fafc 48%, #f3f6fa 100%);
}

body[data-theme="light"].knowledge-base-page .site-nav {
    background: rgba(255, 255, 255, 0.94);
    border-bottom-color: rgba(120, 133, 150, 0.22);
}

body[data-theme="light"].knowledge-base-page .panel,
body[data-theme="light"].knowledge-base-page .kb-filter-panel,
body[data-theme="light"].knowledge-base-page .kb-article-panel {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(91, 126, 160, 0.26);
    box-shadow: 0 18px 42px rgba(30, 48, 68, 0.08);
}

body[data-theme="light"].knowledge-base-page .kb-article {
    background: #ffffff;
    border-color: rgba(91, 126, 160, 0.28);
    box-shadow: 0 10px 24px rgba(30, 48, 68, 0.08);
}

body[data-theme="light"].knowledge-base-page .kb-article-summary:hover {
    background: rgba(47, 95, 143, 0.045);
}

body[data-theme="light"].knowledge-base-page .kb-section-grid section,
body[data-theme="light"].knowledge-base-page .kb-related-grid section {
    background: #f7fafc;
    border-color: rgba(91, 126, 160, 0.18);
}

body[data-theme="light"].knowledge-base-page .kb-filter {
    background: #ffffff;
    border-color: rgba(91, 126, 160, 0.18);
}

body[data-theme="light"].knowledge-base-page .kb-filter:hover,
body[data-theme="light"].knowledge-base-page .kb-filter.active {
    background: #eaf4ff;
    border-color: rgba(47, 95, 143, 0.42);
}

body[data-theme="light"].knowledge-base-page .kb-notice {
    background: #fff8e8;
    border-color: rgba(196, 128, 0, 0.28);
}

body[data-theme="light"].knowledge-base-page .kb-notice,
body[data-theme="light"].knowledge-base-page .kb-article-notice {
    color: #9a6200;
}

@media (max-width: 1200px) {
    .portfolio-page .portfolio-workspace {
        grid-template-columns: 210px minmax(0, 1fr);
    }

    .portfolio-page .portfolio-results {
        grid-column: 1 / -1;
    }
}

@media (max-width: 980px) {
    .kb-header,
    .kb-shell {
        grid-template-columns: 1fr;
    }

    .kb-filter-panel {
        position: static;
    }

    .kb-filter-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .portfolio-page .layout {
        width: 100%;
        max-width: 100vw;
        height: auto;
        min-height: calc(100vh - 96px);
        grid-template-rows: auto;
        overflow-x: clip;
        overflow-y: visible;
    }

    .portfolio-page .main-panel {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: calc(100vh - 96px);
        overflow-x: clip;
        overflow-y: visible;
    }

    .portfolio-page .portfolio-workspace {
        width: 100%;
        max-width: 100%;
        grid-template-columns: 1fr;
        grid-template-areas:
            "tabs"
            "content"
            "results";
        align-items: start;
    }

    .portfolio-page .portfolio-workspace>.fp-tabs {
        grid-area: tabs;
        width: 100%;
        max-width: 100%;
    }

    .portfolio-page .portfolio-workspace>.portfolio-primary {
        grid-area: content;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .portfolio-page .portfolio-workspace>.portfolio-results {
        grid-area: results;
        grid-column: 1 / -1;
        justify-self: stretch;
        align-self: start;
        width: 100%;
        max-width: 100%;
        margin: 0;
        position: static;
    }

    .portfolio-page .portfolio-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
        min-width: 0;
    }

    .mc-input-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
    }
}

@media (max-width: 700px) {
    .kb-layout {
        width: 100%;
        padding-top: 0.65rem;
    }

    .kb-header {
        gap: 0.65rem;
    }

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

    .kb-filter {
        min-height: 38px;
        padding-inline: 0.55rem;
        font-size: 0.82rem;
    }

    .kb-article-summary {
        align-items: flex-start;
        padding: 0.68rem;
    }

    .kb-article-summary b {
        font-size: 0.78rem;
    }

    .kb-article-detail {
        padding: 0 0.68rem 0.68rem;
    }

    .kb-section-grid,
    .kb-related-grid {
        grid-template-columns: 1fr;
    }
}

.portfolio-table th,
.portfolio-table td {
    text-align: left;
    padding: 0.52rem 0.6rem;
    border-bottom: 1px solid var(--panel-border);
    white-space: nowrap;
    font-size: 0.9rem;
}

.portfolio-table th {
    color: var(--accent);
    font-weight: 700;
}

.portfolio-table td {
    color: var(--text);
}

/* ============================================================
   FINANCIAL PLANNER PAGE
   ============================================================ */

.retirement-calculator-page .site-nav {
    background: rgba(7, 20, 37, 0.84);
    border-bottom-color: var(--panel-border);
}

.fp-layout {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0.75rem clamp(0.5rem, 1.2vw, 1.25rem) 1rem;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0.5rem;
    overflow: hidden;
}

.chart-background {
    fill: rgba(7, 18, 13, 0.5);
}

.fp-layout>* {
    width: auto;
    min-width: 0;
    max-width: 100%;
    justify-self: stretch;
}

.fp-shell {
    width: auto;
    max-width: 100%;
    height: auto;
    min-height: 0;
    min-width: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    align-content: start;
    gap: 0.65rem;
    overflow: hidden;
}

.fp-header {
    display: grid;
    gap: 0.2rem;
}

.fp-header .intro {
    margin: 0;
    line-height: 1.25;
}

.fp-action-stack {
    display: grid;
    gap: 0.35rem;
}

.fp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.fp-actions>* {
    min-width: 0;
}

.fp-actions .status {
    min-height: 0;
    font-size: 0.9rem;
}

.fp-actions .status.is-error {
    color: #ff9a9a;
    font-weight: 800;
}

.fp-important {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.fp-important a {
    color: var(--accent);
    font-weight: 800;
    text-decoration: none;
}

.fp-important a:hover {
    text-decoration: underline;
}

.rc-scenario-picker {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    height: 40px;
}

.rc-scenario-picker select {
    min-width: 150px;
    max-width: 220px;
    height: 40px;
}

.fp-more {
    position: relative;
}

.fp-more-toggle::before {
    content: "\22EE";
    margin-right: 0.35rem;
    font-size: 1rem;
    line-height: 1;
}

.fp-more-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    z-index: 30;
    display: grid;
    min-width: 190px;
    padding: 0.35rem;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(8, 24, 42, 0.78);
    backdrop-filter: blur(10px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.fp-more-menu[hidden] {
    display: none;
}

.fp-more-menu button,
.fp-more-menu a {
    display: block;
    width: 100%;
    min-height: 34px;
    padding: 0.45rem 0.6rem;
    border: 0;
    border-radius: 6px;
    color: var(--text);
    background: transparent;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.fp-more-menu button:hover,
.fp-more-menu a:hover,
.fp-more-menu button:focus-visible,
.fp-more-menu a:focus-visible {
    color: var(--accent);
    background: rgba(103, 184, 255, 0.14);
    outline: none;
}

.fp-more-menu button:disabled {
    color: var(--muted);
    cursor: not-allowed;
    opacity: 0.55;
}

body[data-theme="dark"] .fp-more-menu {
    background: rgba(24, 26, 30, 0.78);
}

body[data-theme="dark"] .fp-more-menu button:hover,
body[data-theme="dark"] .fp-more-menu a:hover,
body[data-theme="dark"] .fp-more-menu button:focus-visible,
body[data-theme="dark"] .fp-more-menu a:focus-visible {
    background: rgba(215, 221, 229, 0.12);
}

body[data-theme="light"] .fp-more-menu {
    background: rgba(255, 255, 255, 0.72);
}

body[data-theme="light"] .fp-more-menu button:hover,
body[data-theme="light"] .fp-more-menu a:hover,
body[data-theme="light"] .fp-more-menu button:focus-visible,
body[data-theme="light"] .fp-more-menu a:focus-visible {
    background: rgba(47, 95, 143, 0.12);
}

.fp-action-link {
    width: auto;
    min-width: 0;
    text-decoration: none;
}

.fp-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.fp-workspace {
    min-height: 0;
    min-width: 0;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 300px;
    gap: 0.65rem;
}

.fp-tabs,
.fp-content {
    min-height: 0;
    min-width: 0;
    overflow: auto;
}

.fp-tabs {
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    background: rgba(7, 18, 13, 0.35);
    padding: 0.5rem;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(157, 180, 207, 0.55) transparent;
    display: grid;
    gap: 0.35rem;
    align-content: start;
}

.fp-tab-btn {
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.fp-tab-btn.active {
    color: var(--text);
    border-color: var(--panel-border);
    background: rgba(103, 184, 255, 0.14);
}

.fp-tab-separator {
    display: block;
    height: 1px;
    margin: 0.25rem 0;
    background: linear-gradient(90deg, transparent, rgba(103, 184, 255, 0.42), transparent);
}

.fp-content {
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    background: rgba(7, 18, 13, 0.35);
    padding: 0.65rem;
    overflow-x: auto;
    overflow-y: auto;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(157, 180, 207, 0.55) transparent;
    display: grid;
    gap: 0.65rem;
    align-content: start;
}

.fp-results {
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(157, 180, 207, 0.55) transparent;
    min-width: 0;
}

.fp-tabs::-webkit-scrollbar,
.fp-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.fp-results::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.fp-tabs::-webkit-scrollbar-track,
.fp-content::-webkit-scrollbar-track {
    background: transparent;
}

.fp-results::-webkit-scrollbar-track {
    background: transparent;
}

.fp-tabs::-webkit-scrollbar-thumb,
.fp-content::-webkit-scrollbar-thumb {
    background: rgba(157, 180, 207, 0.55);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.fp-results::-webkit-scrollbar-thumb {
    background: rgba(157, 180, 207, 0.55);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.fp-tabs::-webkit-scrollbar-thumb:hover,
.fp-content::-webkit-scrollbar-thumb:hover {
    background: rgba(157, 180, 207, 0.75);
}

.fp-results::-webkit-scrollbar-thumb:hover {
    background: rgba(157, 180, 207, 0.75);
}

.fp-section {
    display: grid;
    gap: 0.5rem;
}

.fp-content [data-tab-panel][hidden] {
    display: none !important;
}

.fp-section h2 {
    margin: 0;
    font-size: 1rem;
}

.fp-section-head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: center;
}

.fp-inline-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.fp-delete-btn {
    width: fit-content;
    max-width: 100%;
    justify-self: start;
    white-space: nowrap;
    padding-inline: 0.85rem;
}

.fp-grid {
    display: grid;
    gap: 0.5rem;
}

.fp-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.fp-grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.fp-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.fp-grid label {
    display: grid;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.retirement-calculator-page input,
.retirement-calculator-page select,
.retirement-calculator-page textarea {
    width: clamp(120px, 100%, 180px);
    min-width: 120px;
    max-width: 180px;
    height: 45px;
    min-height: 45px;
    max-height: 45px;
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0;
}

.retirement-calculator-page select {
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    padding: 0 2.25rem 0 1rem;
    line-height: 48px;
}

.retirement-calculator-page input[type="checkbox"] {
    width: auto;
    min-width: 0;
    max-width: none;
    height: auto;
    min-height: 0;
    max-height: none;
}

.retirement-calculator-page .rc-scenario-setup input {
    text-align: left;
}

.retirement-calculator-page .rc-scenario-setup .fp-grid {
    justify-content: start;
}

.retirement-calculator-page .rc-scenario-setup .fp-grid-4 {
    grid-template-columns: repeat(4, max-content);
    column-gap: 0.65rem;
}

.retirement-calculator-page .rc-scenario-setup .fp-grid-5 {
    grid-template-columns: repeat(5, max-content);
    column-gap: 0.65rem;
}

.retirement-calculator-page .rc-scenario-setup .fp-grid-3 {
    grid-template-columns: repeat(3, max-content);
    column-gap: 0.65rem;
}

.retirement-calculator-page:not(.fp-wizard-page) .rc-scenario-setup .fp-grid-2 {
    grid-template-columns: repeat(2, max-content);
    column-gap: 0.65rem;
}

.retirement-calculator-page .rc-scenario-setup label {
    justify-items: start;
}

.retirement-calculator-page:not(.fp-wizard-page) .rc-scenario-setup label {
    width: 180px;
}

.retirement-calculator-page:not(.fp-wizard-page) .rc-scenario-setup input,
.retirement-calculator-page:not(.fp-wizard-page) .rc-scenario-setup select {
    width: clamp(120px, 100%, 180px);
    min-width: 120px;
    max-width: 180px;
}

.fp-kpis {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
}

.retirement-calculator-page .fp-results-group-title {
    margin: 0.15rem 0 0;
    color: var(--accent);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.retirement-calculator-page .fp-results .fp-results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
}

.retirement-calculator-page .fp-results .fp-kpis .stat {
    min-height: 63px;
    padding: 0.58rem 0.62rem;
    gap: 0.35rem;
}

.retirement-calculator-page .fp-results .fp-kpis .stat span {
    font-size: clamp(0.58rem, 0.26vw + 0.5rem, 0.72rem);
    line-height: 1.15;
}

.retirement-calculator-page .fp-results .fp-kpis .stat strong {
    font-size: clamp(0.72rem, 0.72vw + 0.42rem, 1.05rem);
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.retirement-calculator-page .rc-results-disclaimer,
.portfolio-page .rc-results-disclaimer {
    margin: 0.65rem 0 0;
    color: rgb(255, 174, 0);
    font-size: 0.76rem;
    line-height: 1.35;
}

.retirement-calculator-page .fp-content .mc-stats {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}

.retirement-calculator-page .rc-account-assumptions {
    margin-top: 0.8rem;
}

.retirement-calculator-page .rc-account-assumptions h3 {
    margin: 0 0 0.45rem;
}

.retirement-calculator-page .rc-account-assumptions-table {
    min-width: 720px;
}

.retirement-calculator-page .rc-account-assumptions-table input {
    width: 120px;
    max-width: 100%;
    height: 38px;
    min-height: 38px;
    padding: 0 0.75rem;
}

.retirement-calculator-page .fp-content .mc-stats .stat {
    min-width: 0;
    min-height: 86px;
    padding: 0.7rem 0.8rem;
}

.retirement-calculator-page .fp-content .mc-stats .stat span {
    font-size: clamp(0.68rem, 0.3vw + 0.58rem, 0.82rem);
    line-height: 1.15;
}

.retirement-calculator-page .fp-content .mc-stats .stat strong {
    font-size: clamp(1rem, 0.75vw + 0.72rem, 1.35rem);
    line-height: 1.08;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.fp-table-wrap {
    overflow: auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(157, 180, 207, 0.55) transparent;
}

.retirement-calculator-page .fp-content .fp-section {
    min-width: 0;
}

.retirement-calculator-page .fp-content .fp-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
}

.retirement-calculator-page .fp-content .fp-table-wrap .portfolio-table {
    width: 100%;
    min-width: 760px;
    table-layout: auto;
}

.retirement-calculator-page .fp-content .fp-table-wrap input,
.retirement-calculator-page .fp-content .fp-table-wrap select {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
}

.fp-table-wrap::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.fp-table-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.fp-table-wrap::-webkit-scrollbar-thumb {
    background: rgba(157, 180, 207, 0.55);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.fp-table-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(157, 180, 207, 0.75);
}

.retirement-calculator-page #fp-yearly-table {
    min-width: 1200px;
}

.fp-results .fp-table-wrap {
    overflow-x: hidden;
}

.fp-results .portfolio-table {
    min-width: 0;
    table-layout: fixed;
}

.fp-results .portfolio-table th,
.fp-results .portfolio-table td {
    white-space: normal;
    overflow-wrap: anywhere;
}

.fp-results {
    padding: 0.65rem;
    border-radius: 14px;
    overflow: visible;
}

.fp-results h2 {
    margin: 0 0 0.45rem;
}

.fp-shortfall-alert {
    margin-top: 0.6rem;
    margin-bottom: 0.6rem;
    display: grid;
    gap: 0.35rem;
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(223, 107, 87, 0.45);
    background: rgba(223, 107, 87, 0.12);
    color: #ffd2cb;
}

.fp-shortfall-alert[hidden] {
    display: none;
}

.fp-shortfall-alert strong {
    color: #ffb1a4;
}

.fp-wizard-layout {
    overflow: hidden;
}

.fp-wizard-shell {
    grid-template-rows: auto minmax(0, 1fr);
}

.fp-wizard-start {
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    background: rgba(7, 18, 13, 0.35);
    padding: 1rem;
}

.fp-wizard-choice {
    max-width: 720px;
}

.fp-wizard-app {
    min-height: 0;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 0.65rem;
}

.fp-wizard-steps {
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    background: rgba(7, 18, 13, 0.35);
    padding: 0.5rem;
    display: grid;
    gap: 0.35rem;
    align-content: start;
}

.fp-wizard-steps .fp-tab-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.fp-wizard-main {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0.65rem;
}

.fp-wizard-progress {
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.fp-wizard-progress-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.fp-wizard-progress-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}

.fp-wizard-content {
    min-height: 0;
}

.fp-wizard-item {
    display: grid;
    gap: 0.55rem;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.fp-wizard-item h3 {
    margin: 0;
    font-size: 0.95rem;
}

.fp-important {
    color: rgb(255, 174, 0);
}

.fp-empty-note {
    margin: 0;
    color: var(--muted);
}

.fp-wizard-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.fp-wizard-actions .status {
    min-height: 0;
    color: #ffd2cb;
}

.fp-wizard-actions .fp-important {
    min-width: min(100%, 320px);
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.fp-wizard-review {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: 0.55rem;
}

.fp-wizard-review .stat {
    min-width: 0;
    align-content: start;
    overflow: hidden;
}

.fp-wizard-review .stat span {
    min-width: 0;
    max-width: 100%;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
}

.fp-wizard-review .stat strong {
    min-width: 0;
    max-width: 100%;
    font-size: clamp(0.95rem, 0.55vw + 0.78rem, 1.35rem);
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.fp-wizard-resource-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

@media (max-width: 1200px) {
    .fp-workspace {
        grid-template-columns: 210px minmax(0, 1fr);
    }

    .fp-results {
        grid-column: 1 / -1;
        max-height: none;
    }

}

@media (min-width: 1700px) {
    .fp-workspace {
        grid-template-columns: 240px minmax(0, 1fr) 300px;
    }
}

@media (max-width: 900px) {
    .fp-layout {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: calc(100vh - 96px);
        grid-template-rows: auto;
        overflow-x: clip;
        overflow-y: visible;
    }

    .fp-shell {
        width: auto;
        max-width: 100%;
        height: auto;
        min-height: calc(100vh - 96px);
        overflow-x: clip;
        overflow-y: visible;
    }

    .fp-workspace {
        width: 100%;
        max-width: 100%;
        grid-template-columns: 1fr;
    }

    .retirement-calculator-page:not(.fp-wizard-page) .fp-tabs,
    .retirement-calculator-page:not(.fp-wizard-page) .fp-content,
    .retirement-calculator-page:not(.fp-wizard-page) .fp-results {
        width: 100%;
        max-width: 100%;
    }

    .retirement-calculator-page:not(.fp-wizard-page) .fp-tabs {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        max-height: none;
        overflow: visible;
    }

    .fp-grid-5,
    .fp-grid-4,
    .fp-grid-3,
    .fp-grid-2 {
        grid-template-columns: 1fr;
    }

    .fp-wizard-layout {
        overflow-x: clip;
        overflow-y: visible;
    }

    .fp-wizard-page .fp-layout {
        width: 100%;
        max-width: 100%;
        padding-inline: clamp(0.45rem, 2vw, 0.9rem);
        gap: 0.6rem;
    }

    .fp-wizard-page .fp-shell {
        width: auto;
        max-width: 100%;
        gap: 0.6rem;
    }

    .fp-wizard-shell {
        width: auto;
        max-width: 100%;
        min-height: calc(100vh - 96px);
    }

    .fp-wizard-app {
        width: 100%;
        max-width: 100%;
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .fp-wizard-steps {
        width: 100%;
        max-width: 100%;
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        max-height: none;
        overflow: visible;
    }

    .fp-wizard-main {
        width: 100%;
        max-width: 100%;
        min-height: 0;
    }

    .fp-wizard-page .fp-wizard-content {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
        overflow-y: visible;
    }

    .fp-wizard-page .fp-wizard-item .fp-section-head {
        align-items: start;
    }

    .fp-wizard-page .fp-wizard-item input,
    .fp-wizard-page .fp-wizard-item select,
    .fp-wizard-page .rc-scenario-setup input,
    .fp-wizard-page .rc-scenario-setup select {
        width: clamp(120px, 100%, 180px);
        min-width: 120px;
        max-width: 180px;
    }

}

@media (max-width: 700px) {
    .portfolio-table {
        min-width: 620px;
    }

    .retirement-calculator-page:not(.fp-wizard-page) .fp-actions {
        flex-wrap: nowrap;
        gap: 0.35rem;
    }

    .retirement-calculator-page:not(.fp-wizard-page) .rc-scenario-picker {
        flex: 1 1 auto;
        min-width: 0;
    }

    .retirement-calculator-page:not(.fp-wizard-page) .rc-scenario-picker select {
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .retirement-calculator-page:not(.fp-wizard-page) .fp-actions .voice-btn {
        flex: 0 0 auto;
        padding-inline: 0.7rem;
    }

    .retirement-calculator-page:not(.fp-wizard-page) .fp-more-toggle {
        width: 40px;
        min-width: 40px;
        padding-inline: 0;
        font-size: 0;
    }

    .retirement-calculator-page:not(.fp-wizard-page) .fp-more-toggle::before {
        content: ":";
        margin-right: 0;
        font-size: 1.25rem;
        font-weight: 900;
    }

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

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

    .fp-wizard-page .rc-scenario-setup .fp-grid-2,
    .fp-wizard-page .rc-scenario-setup .fp-grid-3,
    .fp-wizard-page .rc-scenario-setup .fp-grid-4,
    .fp-wizard-page .rc-scenario-setup .fp-grid-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .retirement-calculator-page .fp-content .fp-section-head {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .retirement-calculator-page .fp-content .fp-section-head h2,
    .retirement-calculator-page .fp-content .fp-section-head h3 {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .retirement-calculator-page .fp-content .fp-inline-actions {
        width: 100%;
    }

    .retirement-calculator-page .fp-content .fp-inline-actions button {
        flex: 1 1 180px;
        min-width: 0;
    }

    .retirement-calculator-page:not(.fp-wizard-page) .rc-scenario-setup .fp-grid-2,
    .retirement-calculator-page:not(.fp-wizard-page) .rc-scenario-setup .fp-grid-3,
    .retirement-calculator-page:not(.fp-wizard-page) .rc-scenario-setup .fp-grid-4,
    .retirement-calculator-page:not(.fp-wizard-page) .rc-scenario-setup .fp-grid-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .retirement-calculator-page:not(.fp-wizard-page) .rc-scenario-setup label {
        width: 100%;
        max-width: 100%;
    }

    .retirement-calculator-page:not(.fp-wizard-page) .rc-scenario-setup input,
    .retirement-calculator-page:not(.fp-wizard-page) .rc-scenario-setup select {
        width: clamp(120px, 100%, 180px);
        min-width: 120px;
        max-width: 180px;
    }
}

@media (max-width: 700px) {
    .retirement-calculator-page:not(.fp-wizard-page) .fp-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.3rem;
        padding: 0.4rem;
    }

    .retirement-calculator-page:not(.fp-wizard-page) .fp-tabs .fp-tab-btn {
        min-width: 0;
        height: 38px;
        min-height: 38px;
        padding-inline: 0.45rem;
        font-size: 0.78rem;
    }

    .retirement-calculator-page:not(.fp-wizard-page) .fp-tabs .fp-tab-separator {
        grid-column: 1 / -1;
    }

    .fp-wizard-page .fp-header .eyebrow {
        font-size: clamp(1.35rem, 6vw, 2rem);
        line-height: 1.1;
    }

    .fp-wizard-page .fp-wizard-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.3rem;
        padding: 0.4rem;
    }

    .fp-wizard-page .fp-wizard-steps .fp-tab-btn {
        min-width: 0;
        height: 38px;
        min-height: 38px;
        padding-inline: 0.45rem;
        font-size: 0.78rem;
    }

    .fp-wizard-page .fp-wizard-progress {
        font-size: 0.84rem;
    }

    .fp-wizard-page .fp-wizard-content {
        padding: 0.55rem;
        gap: 0.55rem;
    }

    .fp-wizard-page .fp-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .fp-wizard-page .fp-section-head button {
        width: 100%;
    }

    .fp-wizard-page .fp-wizard-item {
        padding: 0.6rem;
    }

    .fp-wizard-page .fp-wizard-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }

    .fp-wizard-page .fp-wizard-actions button,
    .fp-wizard-page .fp-wizard-actions .fp-action-link {
        width: 100%;
        min-width: 0;
    }

    .fp-wizard-page .fp-wizard-actions .status,
    .fp-wizard-page .fp-wizard-actions .fp-important {
        grid-column: 1 / -1;
        min-width: 0;
    }

    .fp-wizard-page .fp-wizard-review {
        grid-template-columns: 1fr;
    }

    .fp-wizard-page .fp-wizard-resource-links {
        display: grid;
        gap: 0.45rem;
    }
}

@media (max-width: 420px) {
    .fp-wizard-page .fp-layout {
        padding-inline: 0.4rem;
    }

    .fp-wizard-page .fp-shell,
    .fp-wizard-page .fp-wizard-start,
    .fp-wizard-page .fp-wizard-steps,
    .fp-wizard-page .fp-wizard-content {
        border-radius: 10px;
    }

    .fp-wizard-page .fp-wizard-steps {
        grid-template-columns: 1fr;
    }

    .fp-wizard-page .fp-wizard-steps .fp-tab-btn {
        justify-content: center;
        height: 36px;
        min-height: 36px;
    }

    .fp-wizard-page .fp-wizard-actions {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 901px) {

    body.portfolio-page,
    body.retirement-calculator-page {
        height: 111.111dvh;
        min-height: 111.111dvh;
        overflow: hidden;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
    }

    body.portfolio-page>.layout,
    body.retirement-calculator-page>.fp-layout {
        min-height: 0;
        height: 100%;
    }

    body.retirement-calculator-page .fp-results {
        min-height: 0;
        max-height: 100%;
        overflow: auto;
    }

    body.sequence-page {
        height: auto;
        min-height: 100dvh;
        overflow-x: clip;
        overflow-y: auto;
        display: block;
    }

    body.sequence-page>.layout {
        height: auto;
        min-height: calc(100dvh - 54px);
        overflow: visible;
    }
}

body[data-theme="dark"] .site-nav,
body[data-theme="dark"].portfolio-page .site-nav,
body[data-theme="dark"].retirement-calculator-page .site-nav {
    background: rgba(8, 9, 12, 0.88);
    border-bottom-color: var(--panel-border);
}

body[data-theme="light"] .site-nav,
body[data-theme="light"].portfolio-page .site-nav,
body[data-theme="light"].retirement-calculator-page .site-nav {
    background: rgba(255, 255, 255, 0.9);
    border-bottom-color: var(--panel-border);
}

body[data-theme="dark"] .site-nav__theme select,
body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
    background: rgba(12, 13, 16, 0.86);
}

body[data-theme="light"] .site-nav__theme select,
body[data-theme="light"] input,
body[data-theme="light"] select,
body[data-theme="light"] textarea {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(120, 133, 150, 0.38);
}

body[data-theme="dark"] .stat,
body[data-theme="dark"] .card-input,
body[data-theme="dark"] .fp-tabs,
body[data-theme="dark"] .fp-content,
body[data-theme="dark"] .fp-wizard-start,
body[data-theme="dark"] .fp-wizard-panel {
    background: rgba(12, 13, 16, 0.58);
}

body[data-theme="light"] .panel {
    box-shadow: 0 24px 60px rgba(72, 84, 100, 0.16);
}

body[data-theme="light"] .stat,
body[data-theme="light"] .card-input,
body[data-theme="light"] .fp-tabs,
body[data-theme="light"] .fp-content,
body[data-theme="light"] .fp-wizard-start,
body[data-theme="light"] .fp-wizard-panel,
body[data-theme="light"] .portfolio-results,
body[data-theme="light"] .settings-panel,
body[data-theme="light"] .portfolio-table-panel {
    background: rgba(255, 255, 255, 0.76);
}

body[data-theme="dark"] .fp-tab-btn,
body[data-theme="dark"] .site-nav__links a:hover,
body[data-theme="dark"] .site-nav__links a.active {
    background: rgba(255, 255, 255, 0.07);
}

body[data-theme="light"] .fp-tab-btn,
body[data-theme="light"] .site-nav__links a:hover,
body[data-theme="light"] .site-nav__links a.active {
    background: rgba(47, 95, 143, 0.09);
}

body[data-theme="light"] .stat {
    background: rgba(47, 95, 143, 0.09);
}

body[data-theme="light"] .chart-surface {
    background: transparent;
}

body[data-theme="light"] .chart-background {
    fill: transparent;
}

body[data-theme="light"] .fp-wizard-steps {
    background: transparent;
}

body[data-theme="light"] .fp-tab-btn.active {
    background: rgba(47, 95, 143, 0.15);
}

body[data-theme="light"] .cookie-consent {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(47, 95, 143, 0.24);
    box-shadow: 0 18px 44px rgba(30, 48, 68, 0.22);
}

body[data-theme="light"] .cookie-consent__content h2,
body[data-theme="light"] .consent-modal__card h2 {
    color: #1d5d97;
}

body[data-theme="light"] .cookie-consent__content p,
body[data-theme="light"] .consent-modal__intro,
body[data-theme="light"] .consent-option small {
    color: #344254;
}

body[data-theme="light"] .consent-modal {
    background: rgba(15, 28, 42, 0.42);
}

body[data-theme="light"] .consent-option {
    background: #f6f9fc;
    border: 1px solid rgba(47, 95, 143, 0.14);
}

body[data-theme="light"] .consent-btn {
    border-color: rgba(47, 95, 143, 0.28);
    box-shadow: 0 2px 8px rgba(30, 48, 68, 0.08);
}

body[data-theme="light"] .consent-btn--primary {
    background: #f2c84b;
    color: #17202c;
    border-color: #c99a22;
}

body[data-theme="light"] .consent-btn--secondary {
    background: #ffffff;
    color: #1f5e96;
}

body[data-theme="light"] .consent-btn:hover {
    filter: brightness(0.97);
}

body[data-theme="light"] .consent-manage-floating {
    background: rgba(255, 255, 255, 0.96);
    color: #1f5e96;
    border-color: rgba(47, 95, 143, 0.26);
    box-shadow: 0 8px 22px rgba(30, 48, 68, 0.12);
}

body[data-theme="light"] .portfolio-table th,
body[data-theme="light"] .portfolio-table td,
body[data-theme="light"] .fp-tab-separator {
    border-color: rgba(120, 133, 150, 0.24);
}

.retirement-calculator-page .site-nav__theme select,
.portfolio-page .site-nav__theme select {
    height: 34px;
    min-height: 34px;
    max-height: 34px;
    width: auto;
    min-width: 92px;
    max-width: none;
    padding-top: 0;
    padding-bottom: 0;
}

body[data-theme].holdem-page,
body[data-theme].blackjack-page,
body[data-theme].gaming-page {
    --bg: #0d1b14;
    --panel: rgba(12, 34, 24, 0.78);
    --panel-border: rgba(243, 210, 124, 0.2);
    --text: #f4ecd6;
    --muted: #b8ae95;
    --accent: #f3d27c;
    --raise: #54c07a;
    --call: #f0c75e;
    --fold: #df6b57;
    --neutral: #8aa295;
    background:
        radial-gradient(circle at top, rgba(243, 210, 124, 0.16), transparent 30%),
        linear-gradient(160deg, #08110d 0%, #102419 45%, #09150f 100%);
}

body[data-theme].holdem-page::before,
body[data-theme].blackjack-page::before,
body[data-theme].gaming-page::before {
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

/* Nav responsive */
@media (max-width: 600px) {
    .site-nav {
        padding: 0.5rem 0.75rem;
        position: sticky;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .site-nav__brand {
        min-width: 0;
    }

    .site-nav__brand span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .site-nav .site-nav__toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .site-nav__theme {
        order: 4;
        display: none;
        flex: 0 0 100%;
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
        padding-top: 0.35rem;
    }

    .site-nav.is-open .site-nav__theme {
        display: inline-flex;
    }

    .site-nav__theme select {
        min-width: 120px;
    }

    .site-nav__links {
        display: none;
        flex: 0 0 100%;
        width: 100%;
        gap: 0.35rem;
        padding: 0.45rem 0 0.1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        align-items: stretch;
        flex-direction: column;
    }

    .site-nav.is-open .site-nav__links {
        display: flex;
    }

    .site-nav__links a {
        font-size: 0.82rem;
        width: 100%;
        padding: 0.55rem 0.65rem;
        text-align: left;
    }
}

/* ============================================================
   ABOUT PAGE — small helper styles
   ============================================================ */
.about-page .hero {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 1rem 0 1.5rem;
    /* Restrict hero to the primary content column so it matches content width */
    grid-column: 1;
}

/* Make the about page a single centered column to keep content visually centered */
.about-page .layout {
    /* narrower max width for readable biography */
    width: min(920px, calc(100vw - 2rem));
    grid-template-columns: 1fr;
    /* single column */
    justify-items: center;
}

.about-headshot {
    border-radius: 50%;
    border: 4px solid #e6f4ea;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    object-fit: cover;
}

.about-content .about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.about-page .hero,
.about-page .about-content,
.about-page .legal-links {
    width: 100%;
}

/* Keep About page inside viewport on smaller devices */
body.about-page {
    overflow-x: hidden;
}

.about-page .legal-links {
    flex-wrap: wrap;
}

.about-page .legal-links p {
    width: 100%;
    margin: 0.35rem 0 0;
}

.about-page .about-content,
.about-page .about-grid,
.about-page .about-bio,
.about-page .about-resume {
    min-width: 0;
}

.about-page .hero-copy,
.about-page .about-content p,
.about-page .about-content li,
.about-page .about-content h2,
.about-page .about-content h3 {
    overflow-wrap: anywhere;
}

.about-social-row {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.about-page .linkedin-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.about-page .linkedin-link img {
    display: block;
}

.about-md {
    white-space: pre-wrap;
    font-family: inherit;
}

@media (max-width: 900px) {
    .about-content .about-grid {
        grid-template-columns: 1fr;
    }

    .about-page .hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .about-page .layout {
        width: min(100%, calc(100vw - 1rem));
        padding: 0.75rem 0 2rem;
        gap: 1rem;
    }

    .about-page .hero-mark {
        width: 100%;
        justify-content: center;
    }

    .about-page .about-headshot {
        width: min(40vw, 160px);
        height: min(40vw, 160px);
    }

    .about-page .hero-copy {
        width: 100%;
    }

    .about-page .about-content {
        padding: 0.75rem;
    }

    .about-page .about-content .panel {
        padding: 0.85rem;
        min-width: 0;
    }

    .about-page .legal-links {
        text-align: center;
        line-height: 1.8;
    }

    .about-page .site-nav {
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.5rem 0.75rem;
    }

    .about-page .site-nav__brand {
        width: 100%;
        justify-content: center;
    }

    .about-page .site-nav__links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.45rem;
    }
}

@media (max-width: 600px) {
    .about-page .site-nav {
        justify-content: space-between;
    }

    .about-page .site-nav__brand {
        width: auto;
        justify-content: flex-start;
    }

    .about-page .site-nav__links {
        justify-content: flex-start;
        flex-wrap: nowrap;
    }
}
