/* GENERATED FILE. Run: php scripts/design/build_css_bundle.php */

/* ===== component source: style.css ===== */
:root {
    --bg-root: #030b18;
    --bg-card: #101b31;
    --bg-card-hover: #182743;

    --text-primary: #f8fafc; /* Slate 50 */
    --text-secondary: #b8c8dd;
    --text-muted: #7f94b1;
    
    --border-subtle: #2a3b57;
    --border-active: #47648b;
    
    --accent-buy: #10b981; /* Emerald 500 */
    --accent-buy-dim: rgba(16, 185, 129, 0.1);
    --accent-sell: #ef4444; /* Red 500 */
    --accent-sell-dim: rgba(239, 68, 68, 0.1);
    --accent-hold: #f59e0b; /* Amber 500 */
    --accent-brand: #39c2ff;
    --focus-ring: rgba(57, 194, 255, 0.5);

    --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Sora', 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ================================================================
   MODEL PORTFOLIOS: RESTRAINED FINANCIAL DATA VISUALS
   One semantic primary series, one neutral benchmark, quiet grids.
   ================================================================ */
:root {
    --mp-chart-primary: #4b9fc3;
    --mp-chart-benchmark: #a8b3c1;
    --mp-chart-grid: rgba(148, 163, 184, 0.14);
    --mp-chart-axis: rgba(203, 213, 225, 0.34);
    --mp-chart-surface: #0b1624;
    --mp-chart-surface-soft: #101d2c;
    --mp-chart-border: rgba(148, 163, 184, 0.2);
    --mp-chart-point-stroke: #08111e;
    --mp-chart-text: #cbd5e1;
    --mp-sector-1: #4b9fc3;
    --mp-sector-2: #5aa6a0;
    --mp-sector-3: #8299b4;
    --mp-sector-4: #b69a66;
    --mp-sector-5: #9b8fb5;
    --mp-sector-6: #9aa6b2;
}

.portfolio-section-nav-shell {
    display: grid;
    gap: 0.7rem;
    margin: 0 0 1.25rem;
}

.portfolio-sticky-nav {
    position: sticky;
    top: 88px;
    z-index: 45;
    display: grid;
    gap: 0.55rem;
    margin: 0 0 1.25rem;
    padding: 0.45rem;
    border: 1px solid rgba(74, 95, 129, 0.2);
    border-radius: 16px;
    background: rgba(7, 12, 22, 0.92);
    box-shadow: 0 12px 28px rgba(2, 8, 23, 0.22);
    backdrop-filter: blur(12px) saturate(135%);
}

.portfolio-sticky-nav .portfolio-section-nav-shell,
.portfolio-sticky-nav .portfolio-subnav-shell {
    margin: 0;
}

.portfolio-sticky-nav .portfolio-section-nav {
    margin-bottom: 0;
}

.social-page {
    display: grid;
    gap: 1.5rem;
}

.social-page .social-hero-premium,
.social-page .social-directory-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(83, 122, 171, 0.16);
    border-radius: 30px;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 30%),
        radial-gradient(circle at 82% 18%, rgba(94, 234, 212, 0.1), transparent 26%),
        linear-gradient(180deg, rgba(10, 19, 35, 0.96), rgba(8, 15, 29, 0.98));
    box-shadow: 0 30px 70px rgba(2, 8, 23, 0.26);
}

.social-page .social-hero-premium::before,
.social-page .social-directory-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 84px 84px;
    opacity: 0.18;
    pointer-events: none;
}

.social-page .social-hero-premium {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
    gap: 1.5rem;
    padding: clamp(1.5rem, 3vw, 2.2rem);
}

.social-page .social-hero-copy,
.social-page .social-hero-spotlight,
.social-page .social-directory-shell > * {
    position: relative;
    z-index: 1;
}

.social-page .social-hero-copy {
    display: grid;
    align-content: start;
    gap: 0;
}

.social-page .social-hero-kicker {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.82rem;
    border-radius: 999px;
    border: 1px solid rgba(94, 234, 212, 0.18);
    background: rgba(15, 23, 42, 0.52);
    color: #8ee8d5;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.social-page .social-hero-premium h1,
.social-page .social-directory-header h2 {
    margin: 0.9rem 0 0;
    color: #f8fbff;
    font-size: clamp(2.2rem, 4.3vw, 3.5rem);
    line-height: 0.96;
    letter-spacing: -0.05em;
    max-width: 10ch;
}

.social-page .social-directory-header h2 {
    font-size: clamp(1.9rem, 3.2vw, 2.6rem);
}

.social-page .social-hero-premium .subtitle,
.social-page .social-directory-header .subtitle {
    max-width: 64ch;
    margin: 0.95rem 0 0;
    color: rgba(215, 226, 244, 0.86);
    font-size: 1.02rem;
    line-height: 1.72;
}

.social-page .social-hero-note,
.social-page .social-directory-header .directory-meta {
    margin: 0.8rem 0 0;
    color: rgba(158, 179, 207, 0.78);
    font-size: 0.94rem;
    line-height: 1.65;
}

.social-page .social-guest-cta {
    margin-top: 1.2rem;
}

.social-page .social-hero-dashboard {
    margin-top: 1.4rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(290px, 0.9fr);
    gap: 0.95rem;
    align-items: stretch;
}

.social-page .social-overview-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.social-page .social-overview-card {
    min-height: 0;
    padding: 1rem 1rem 1.05rem;
    border: 1px solid rgba(89, 126, 172, 0.16);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(16, 27, 49, 0.92), rgba(10, 18, 33, 0.96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.social-page .social-overview-card-featured {
    display: grid;
    align-content: end;
    gap: 0.45rem;
    padding: 1.2rem 1.2rem 1.15rem;
    border-color: rgba(94, 176, 255, 0.2);
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), rgba(56, 189, 248, 0) 42%),
        linear-gradient(180deg, rgba(17, 30, 52, 0.96), rgba(10, 18, 33, 0.98));
}

.social-page .social-overview-label {
    display: block;
    margin-bottom: 0.5rem;
    color: rgba(149, 172, 200, 0.74);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.social-page .social-overview-value {
    display: block;
    color: #f8fbff;
    font-size: clamp(1.3rem, 2.5vw, 1.9rem);
    line-height: 1;
}

.social-page .social-overview-value-featured {
    font-size: clamp(2.4rem, 4vw, 3.4rem);
    letter-spacing: -0.06em;
    line-height: 0.92;
}

.social-page .social-overview-note {
    margin: 0;
    color: rgba(182, 203, 229, 0.82);
    font-size: 0.9rem;
    line-height: 1.55;
}

.social-page .social-hero-spotlight {
    position: relative;
    display: grid;
    gap: 0.95rem;
    padding: 1.2rem;
    border: 1px solid rgba(94, 234, 212, 0.16);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(15, 24, 43, 0.92), rgba(7, 13, 25, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.social-page .social-hero-spotlight::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(94, 234, 212, 0.08), transparent 42%, transparent 58%, rgba(56, 189, 248, 0.08));
    pointer-events: none;
}

.social-page .social-hero-spotlight-surface {
    position: relative;
    height: 148px;
    margin-bottom: 0.35rem;
    border-radius: 20px;
    border: 1px solid rgba(94, 234, 212, 0.12);
    background:
        radial-gradient(circle at center, rgba(94, 234, 212, 0.22), transparent 24%),
        linear-gradient(180deg, rgba(11, 19, 34, 0.72), rgba(8, 14, 27, 0.92));
    overflow: hidden;
}

.social-page .social-hero-orbit,
.social-page .social-hero-core,
.social-page .social-hero-beam {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 999px;
}

.social-page .social-hero-orbit {
    border: 1px solid rgba(125, 211, 252, 0.16);
    background: radial-gradient(circle, rgba(125, 211, 252, 0.08), transparent 72%);
    animation: socialPremiumOrbit 7s ease-in-out infinite;
}

.social-page .social-hero-orbit--outer {
    width: 196px;
    height: 196px;
}

.social-page .social-hero-orbit--inner {
    width: 118px;
    height: 118px;
    animation-duration: 5.2s;
}

.social-page .social-hero-beam {
    width: 320px;
    height: 30px;
    background: linear-gradient(90deg, transparent, rgba(94, 234, 212, 0.14), rgba(56, 189, 248, 0.4), rgba(94, 234, 212, 0.14), transparent);
    filter: blur(2px);
    animation: socialPremiumBeam 5.4s ease-in-out infinite;
}

.social-page .social-hero-core {
    width: 24px;
    height: 24px;
    background: radial-gradient(circle at 30% 30%, #e2fbff, #4fd1ff 56%, #0f3f66 100%);
    box-shadow: 0 0 0 8px rgba(79, 209, 255, 0.08), 0 0 28px rgba(79, 209, 255, 0.48);
    animation: socialPremiumCore 3.5s ease-in-out infinite;
}

.social-page .social-hero-spotlight-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #8fd4ff;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.social-page .social-hero-spotlight-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.social-page .social-hero-spotlight-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0.34rem 0.68rem;
    border-radius: 999px;
    border: 1px solid rgba(94, 176, 255, 0.18);
    background: rgba(8, 16, 31, 0.82);
    color: #d9f6ff;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.social-page .social-hero-spotlight-kicker::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #5eead4, #38bdf8);
    box-shadow: 0 0 16px rgba(94, 234, 212, 0.36);
}

.social-page .social-hero-spotlight h2 {
    margin: 0;
    color: #f8fbff;
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.social-page .social-hero-spotlight-owner {
    margin: -0.1rem 0 0;
    color: rgba(164, 186, 214, 0.84);
    font-size: 0.95rem;
    font-weight: 600;
}

.social-page .social-hero-spotlight-return {
    display: grid;
    gap: 0.25rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(94, 176, 255, 0.18);
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), rgba(56, 189, 248, 0) 52%),
        rgba(8, 16, 31, 0.86);
}

.social-page .social-hero-spotlight-return-label {
    color: rgba(149, 172, 200, 0.78);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.social-page .social-hero-spotlight-return strong {
    font-size: clamp(1.8rem, 2.5vw, 2.5rem);
    line-height: 0.94;
    letter-spacing: -0.05em;
}

.social-page .social-hero-spotlight-copy {
    margin: 0;
    color: rgba(214, 225, 244, 0.8);
    line-height: 1.72;
}

.social-page .social-hero-spotlight-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.1rem;
}

.social-page .social-hero-spotlight-stats .detail-chip {
    border-color: rgba(94, 234, 212, 0.14);
    background: rgba(8, 15, 30, 0.72);
}

.social-page .social-hero-spotlight-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.social-page .social-hero-spotlight-actions .btn-primary,
.social-page .social-hero-spotlight-actions .btn-secondary {
    min-width: 0;
    flex: 1 1 180px;
    justify-content: center;
}

.social-page .social-directory-shell {
    padding: clamp(1.3rem, 2.4vw, 1.8rem);
}

.social-page .social-directory-header {
    padding: 0;
    margin-bottom: 1rem;
}

.social-page .social-table-container {
    margin-top: 0;
    padding: 0.5rem;
    border: 1px solid rgba(83, 122, 171, 0.14);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(10, 17, 31, 0.84), rgba(7, 13, 24, 0.96));
}

.social-page .social-table {
    border-collapse: separate;
    border-spacing: 0 0.72rem;
    background: transparent;
}

.social-page .social-table thead th {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    border-bottom: none;
    color: rgba(154, 177, 203, 0.72);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.social-page .social-table td {
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-top: 1px solid rgba(87, 124, 169, 0.14);
    border-bottom: 1px solid rgba(87, 124, 169, 0.14);
    background: linear-gradient(180deg, rgba(15, 24, 42, 0.92), rgba(9, 16, 29, 0.96));
    vertical-align: middle;
}

.social-page .social-table td:first-child {
    border-left: 1px solid rgba(87, 124, 169, 0.14);
    border-radius: 18px 0 0 18px;
}

.social-page .social-table td:last-child {
    border-right: 1px solid rgba(87, 124, 169, 0.14);
    border-radius: 0 18px 18px 0;
}

.social-page .social-table tbody tr:hover td {
    border-color: rgba(94, 176, 255, 0.24);
    background: linear-gradient(180deg, rgba(17, 30, 52, 0.96), rgba(10, 18, 34, 0.98));
    box-shadow: 0 14px 28px rgba(2, 8, 23, 0.14);
}

.social-page .social-card-heading {
    align-items: flex-start;
    gap: 0.8rem;
}

.social-page .social-card-title-group {
    gap: 0.35rem;
}

.social-page .social-card-title-group strong {
    color: #f8fbff;
    font-size: 1.08rem;
    line-height: 1.2;
}

.social-page .social-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 0.28rem 0.58rem;
    border-radius: 999px;
    border: 1px solid rgba(94, 234, 212, 0.16);
    background: rgba(8, 17, 32, 0.8);
    color: #93e8d6;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.social-page .social-card-owner-inline {
    color: rgba(158, 181, 208, 0.78);
    font-size: 0.9rem;
}

.social-page .portfolio-risk-label {
    padding: 0.42rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.16);
    background: rgba(8, 16, 30, 0.82);
    color: #cfe7ff;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.social-page .listing-quick-facts {
    margin-top: 0.85rem;
    gap: 0.75rem;
}

.social-page .listing-quick-fact {
    min-width: 0;
    padding: 0.7rem 0.82rem;
    border-radius: 16px;
    border: 1px solid rgba(85, 118, 160, 0.14);
    background: rgba(10, 18, 32, 0.76);
}

.social-page .listing-quick-fact-label {
    color: rgba(150, 173, 201, 0.72);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.social-page .listing-quick-fact-value {
    margin-top: 0.3rem;
    color: #f8fbff;
    font-size: 1rem;
}

.social-page .social-owner-cell,
.social-page .social-cell-holdings,
.social-page .social-cell-followers,
.social-page .social-cell-return {
    color: #dfeaf8;
    font-size: 0.96rem;
}

.social-page .social-actions {
    justify-content: flex-end;
    gap: 0.65rem;
}

.social-page .action-link,
.social-page .social-follow-form .social-follow-btn {
    min-height: 40px;
    padding: 0.62rem 0.88rem;
    border-radius: 12px;
    border: 1px solid rgba(92, 132, 178, 0.18);
    background: rgba(11, 20, 35, 0.86);
    color: #e7f1ff;
    font-weight: 700;
    text-decoration: none;
}

.social-page .action-link:hover,
.social-page .social-follow-form .social-follow-btn:hover {
    border-color: rgba(94, 176, 255, 0.3);
    background: rgba(13, 25, 44, 0.96);
}

.social-page .social-follow-form .social-follow-btn[disabled] {
    opacity: 0.56;
    filter: saturate(0.8);
}

.social-page .social-empty-state {
    margin: 0;
    padding: 2rem;
    border: 1px solid rgba(85, 123, 169, 0.14);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(15, 24, 42, 0.9), rgba(9, 16, 29, 0.95));
}

@keyframes socialPremiumOrbit {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.96);
        opacity: 0.42;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.88;
    }
}

@keyframes socialPremiumBeam {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(-16deg) scaleX(0.9);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) rotate(12deg) scaleX(1.06);
        opacity: 0.84;
    }
}

@keyframes socialPremiumCore {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.92);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.08);
    }
}

@media (max-width: 1100px) {
    .social-page .social-hero-premium {
        grid-template-columns: 1fr;
    }

    .social-page .social-hero-dashboard {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 760px) {
    .social-page .social-hero-premium,
    .social-page .social-directory-shell {
        border-radius: 24px;
    }

    .social-page .social-hero-premium {
        padding: 1.2rem;
    }

    .social-page .social-hero-spotlight,
    .social-page .social-table-container,
    .social-page .social-empty-state {
        border-radius: 20px;
    }

    .social-page .social-hero-spotlight-surface {
        height: 138px;
    }

    .social-page .social-table {
        border-spacing: 0 0.85rem;
    }

    .social-page .social-table td,
    .social-page .social-table td:first-child,
    .social-page .social-table td:last-child {
        border-radius: 0;
        border-left: 1px solid rgba(87, 124, 169, 0.14);
        border-right: 1px solid rgba(87, 124, 169, 0.14);
    }

    .social-page .social-table td:first-child {
        border-radius: 18px 18px 0 0;
    }

    .social-page .social-table td:last-child {
        border-radius: 0 0 18px 18px;
    }

    .social-page .social-actions {
        justify-content: stretch;
    }

    .social-page .action-link,
    .social-page .social-follow-form,
    .social-page .social-follow-form .social-follow-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .social-page .social-hero-orbit,
    .social-page .social-hero-beam,
    .social-page .social-hero-core {
        animation: none;
    }
}

.home-page.home-v2-premium .home-v2-positioning {
    position: relative;
    margin: 2.2rem 0 0;
    padding: clamp(2rem, 4vw, 3rem);
    border: 1px solid rgba(94, 234, 212, 0.14);
    border-radius: 30px;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 34%),
        radial-gradient(circle at 85% 22%, rgba(94, 234, 212, 0.14), transparent 28%),
        linear-gradient(135deg, rgba(8, 15, 30, 0.96), rgba(11, 24, 47, 0.9));
    box-shadow: 0 34px 70px rgba(2, 6, 23, 0.34);
    overflow: hidden;
    isolation: isolate;
}

.home-page.home-v2-premium .home-v2-positioning::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 90px 90px;
    opacity: 0.34;
    pointer-events: none;
}

.home-page.home-v2-premium .home-v2-positioning-head,
.home-page.home-v2-premium .home-v2-positioning-grid {
    position: relative;
    z-index: 1;
}

.home-page.home-v2-premium .home-v2-positioning-head {
    max-width: 820px;
    margin-bottom: 1.5rem;
}

.home-page.home-v2-premium .home-v2-positioning-head h2 {
    margin: 0;
    color: #f8fbff;
    font-size: clamp(2rem, 3.8vw, 3rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.home-page.home-v2-premium .home-v2-positioning-head p {
    margin: 0.9rem 0 0;
    max-width: 720px;
    color: rgba(214, 225, 244, 0.82);
    font-size: 1.02rem;
    line-height: 1.7;
}

.home-page.home-v2-premium .home-v2-positioning-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
    gap: 1.2rem;
    align-items: stretch;
}

.home-page.home-v2-premium .home-v2-positioning-manifesto,
.home-page.home-v2-premium .home-v2-positioning-card {
    position: relative;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(9, 16, 31, 0.96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.home-page.home-v2-premium .home-v2-positioning-manifesto {
    padding: 1.55rem;
    min-height: 100%;
}

.home-page.home-v2-premium .home-v2-positioning-manifesto::before,
.home-page.home-v2-premium .home-v2-positioning-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(94, 234, 212, 0.08), transparent 36%, transparent 62%, rgba(96, 165, 250, 0.08));
    pointer-events: none;
}

.home-page.home-v2-premium .home-v2-positioning-manifesto-surface {
    position: relative;
    height: 190px;
    margin-bottom: 1.25rem;
    border-radius: 20px;
    border: 1px solid rgba(94, 234, 212, 0.12);
    background:
        radial-gradient(circle at center, rgba(94, 234, 212, 0.24), transparent 26%),
        linear-gradient(180deg, rgba(13, 21, 39, 0.82), rgba(9, 15, 29, 0.92));
    overflow: hidden;
}

.home-page.home-v2-premium .home-v2-positioning-orbit,
.home-page.home-v2-premium .home-v2-positioning-beam,
.home-page.home-v2-premium .home-v2-positioning-core {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 999px;
}

.home-page.home-v2-premium .home-v2-positioning-orbit {
    border: 1px solid rgba(125, 211, 252, 0.16);
    background: radial-gradient(circle, rgba(125, 211, 252, 0.08), transparent 72%);
    animation: homePremiumOrbitPulse 7.8s ease-in-out infinite;
}

.home-page.home-v2-premium .home-v2-positioning-orbit--outer {
    width: 220px;
    height: 220px;
}

.home-page.home-v2-premium .home-v2-positioning-orbit--inner {
    width: 132px;
    height: 132px;
    animation-duration: 5.6s;
}

.home-page.home-v2-premium .home-v2-positioning-beam {
    width: 360px;
    height: 34px;
    background: linear-gradient(90deg, transparent, rgba(94, 234, 212, 0.16), rgba(96, 165, 250, 0.44), rgba(94, 234, 212, 0.16), transparent);
    filter: blur(2px);
    animation: homePremiumBeamSweep 5.8s ease-in-out infinite;
}

.home-page.home-v2-premium .home-v2-positioning-core {
    width: 26px;
    height: 26px;
    background: radial-gradient(circle at 30% 30%, #dffcff, #4fd1ff 58%, #0f3f66 100%);
    box-shadow: 0 0 0 8px rgba(79, 209, 255, 0.08), 0 0 28px rgba(79, 209, 255, 0.52);
    animation: homePremiumCorePulse 3.8s ease-in-out infinite;
}

.home-page.home-v2-premium .home-v2-positioning-label {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(94, 234, 212, 0.18);
    color: #8ae7d3;
    background: rgba(15, 23, 42, 0.6);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.home-page.home-v2-premium .home-v2-positioning-manifesto blockquote {
    margin: 1rem 0 1.15rem;
    max-width: 10ch;
    color: #f8fbff;
    font-size: clamp(2rem, 4.6vw, 4.4rem);
    line-height: 0.96;
    letter-spacing: -0.06em;
    font-weight: 800;
}

.home-page.home-v2-premium .home-v2-positioning-tape {
    position: relative;
    margin-top: 1.35rem;
    padding: 0.75rem 0;
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.home-page.home-v2-premium .home-v2-positioning-tape-track {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: max-content;
    animation: homePremiumTapeDrift 20s linear infinite;
}

.home-page.home-v2-premium .home-v2-positioning-tape-item {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.72rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(125, 211, 252, 0.14);
    background: rgba(8, 15, 30, 0.82);
    color: rgba(230, 240, 255, 0.86);
    white-space: nowrap;
    font-size: 0.88rem;
    font-weight: 600;
}

.home-page.home-v2-premium .home-v2-positioning-tape-item::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #5eead4, #60a5fa);
    box-shadow: 0 0 16px rgba(94, 234, 212, 0.42);
}

.home-page.home-v2-premium .home-v2-positioning-cards {
    display: grid;
    gap: 1rem;
}

.home-page.home-v2-premium .home-v2-positioning-card {
    padding: 1.2rem 1.2rem 1.25rem;
    transform: translateY(0);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.home-page.home-v2-premium .home-v2-positioning-card:nth-child(2) {
    transform: translateX(0.5rem);
}

.home-page.home-v2-premium .home-v2-positioning-card:nth-child(3) {
    transform: translateX(1rem);
}

.home-page.home-v2-premium .home-v2-positioning-card:hover {
    border-color: rgba(94, 234, 212, 0.24);
    box-shadow: 0 18px 34px rgba(2, 6, 23, 0.24);
    transform: translateY(-4px);
}

.home-page.home-v2-premium .home-v2-positioning-card-index {
    display: inline-flex;
    margin-bottom: 0.8rem;
    color: rgba(96, 165, 250, 0.84);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.home-page.home-v2-premium .home-v2-positioning-card h3 {
    margin: 0;
    color: #f8fbff;
    font-size: 1.14rem;
    line-height: 1.25;
}

.home-page.home-v2-premium .home-v2-positioning-card p {
    margin: 0.68rem 0 0;
    color: rgba(214, 225, 244, 0.78);
    font-size: 0.95rem;
    line-height: 1.68;
}

@keyframes homePremiumOrbitPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.96);
        opacity: 0.44;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.04);
        opacity: 0.9;
    }
}

@keyframes homePremiumBeamSweep {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(-18deg) scaleX(0.9);
        opacity: 0.34;
    }
    50% {
        transform: translate(-50%, -50%) rotate(14deg) scaleX(1.08);
        opacity: 0.88;
    }
}

@keyframes homePremiumCorePulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.92);
        box-shadow: 0 0 0 8px rgba(79, 209, 255, 0.08), 0 0 26px rgba(79, 209, 255, 0.42);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.08);
        box-shadow: 0 0 0 14px rgba(79, 209, 255, 0.12), 0 0 34px rgba(79, 209, 255, 0.56);
    }
}

@keyframes homePremiumTapeDrift {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(calc(-50% - 0.35rem));
    }
}

@media (max-width: 1080px) {
    .home-page.home-v2-premium .home-v2-positioning-grid {
        grid-template-columns: 1fr;
    }

    .home-page.home-v2-premium .home-v2-positioning-card:nth-child(2),
    .home-page.home-v2-premium .home-v2-positioning-card:nth-child(3) {
        transform: none;
    }
}

@media (max-width: 720px) {
    .home-page.home-v2-premium .home-v2-positioning {
        padding: 1.35rem;
        border-radius: 24px;
    }

    .home-page.home-v2-premium .home-v2-positioning-manifesto,
    .home-page.home-v2-premium .home-v2-positioning-card {
        border-radius: 20px;
    }

    .home-page.home-v2-premium .home-v2-positioning-manifesto {
        padding: 1.1rem;
    }

    .home-page.home-v2-premium .home-v2-positioning-manifesto-surface {
        height: 148px;
    }

    .home-page.home-v2-premium .home-v2-positioning-manifesto blockquote {
        max-width: 100%;
        font-size: clamp(1.8rem, 10vw, 2.9rem);
    }

    .home-page.home-v2-premium .home-v2-positioning-tape-item {
        padding: 0.62rem 0.9rem;
        font-size: 0.82rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-page.home-v2-premium .home-v2-positioning-orbit,
    .home-page.home-v2-premium .home-v2-positioning-beam,
    .home-page.home-v2-premium .home-v2-positioning-core,
    .home-page.home-v2-premium .home-v2-positioning-tape-track {
        animation: none;
    }

    .home-page.home-v2-premium .home-v2-positioning-card,
    .home-page.home-v2-premium .home-v2-positioning-card:nth-child(2),
    .home-page.home-v2-premium .home-v2-positioning-card:nth-child(3) {
        transform: none;
    }
}

.portfolio-section-group {
    min-width: 0;
}

.portfolio-section-group-label {
    display: inline-block;
    margin-bottom: 0.38rem;
    color: var(--text-muted);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portfolio-section-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    margin: 0;
    border-bottom: 1px solid rgba(92, 116, 147, 0.22);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.portfolio-section-nav::-webkit-scrollbar { display: none; }

.portfolio-section-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.56rem 1rem;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    margin-bottom: -1px;
    transition: color 0.12s, border-color 0.12s;
}

.portfolio-section-link:hover,
.portfolio-section-link:focus-visible {
    color: var(--text-secondary);
    border-bottom-color: rgba(57, 194, 255, 0.3);
    background: transparent;
    transform: none;
}

.portfolio-section-link.active {
    color: #d6f2ff;
    border-bottom-color: rgba(57, 194, 255, 0.75);
    font-weight: 700;
    background: transparent;
    box-shadow: none;
}

.portfolio-section-nav-secondary {
    border-bottom-color: rgba(92, 116, 147, 0.14);
}

.portfolio-section-link-secondary {
    color: rgba(148, 163, 184, 0.9);
    font-weight: 550;
}

.portfolio-section-link-secondary.active {
    color: #d6f2ff;
}

.portfolio-section-link.is-disabled {
    color: rgba(148, 163, 184, 0.45);
    cursor: not-allowed;
    pointer-events: auto;
}

.portfolio-section-link.is-disabled:hover,
.portfolio-section-link.is-disabled:focus-visible {
    color: rgba(148, 163, 184, 0.45);
    border-bottom-color: transparent;
}

.portfolio-breadcrumb {
    margin: 0.45rem 0 0.55rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.portfolio-breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.portfolio-breadcrumb-item {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.portfolio-breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.12s;
}

.portfolio-breadcrumb-item a:hover,
.portfolio-breadcrumb-item a:focus-visible {
    color: #d6f2ff;
    text-decoration: underline;
    text-decoration-color: rgba(57, 194, 255, 0.45);
    text-underline-offset: 2px;
}

.portfolio-breadcrumb-item [aria-current="page"] {
    color: #d6f2ff;
    font-weight: 600;
}

.portfolio-breadcrumb-sep {
    color: rgba(148, 163, 184, 0.55);
    font-size: 0.85rem;
    line-height: 1;
    user-select: none;
}

.portfolio-subnav-shell {
    margin: 0 0 0.9rem;
}

.portfolio-subnav {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.3rem;
    padding: 0.25rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(92, 116, 147, 0.18);
    border-radius: 999px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    width: max-content;
    max-width: 100%;
}

.portfolio-subnav::-webkit-scrollbar { display: none; }

.portfolio-subnav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.36rem 0.85rem;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.12s, color 0.12s;
}

.portfolio-subnav-link:hover,
.portfolio-subnav-link:focus-visible {
    color: var(--text-secondary);
    background: rgba(57, 194, 255, 0.08);
}

.portfolio-subnav-link.active {
    background: rgba(57, 194, 255, 0.16);
    color: #d6f2ff;
}

.portfolio-subnav-link.is-disabled {
    color: rgba(148, 163, 184, 0.4);
    cursor: not-allowed;
    background: transparent;
}

.portfolio-subnav-link.is-disabled:hover,
.portfolio-subnav-link.is-disabled:focus-visible {
    color: rgba(148, 163, 184, 0.4);
    background: transparent;
}

.portfolio-settings-page-card {
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.35);
    padding: 1.2rem 1.3rem;
}

.portfolio-page-subtitle {
    max-width: 58ch;
    margin: 0.2rem 0 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.accounting-summary-grid,
.evaluator-steps-grid,
.evaluator-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.summary-card,
.detail-card,
.evaluator-step-card,
.audit-holding-card,
.accounting-entry-panel,
.accounting-detail-card {
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(11, 19, 32, 0.98), rgba(8, 14, 25, 0.98));
    box-shadow: var(--shadow-soft);
}

.summary-card,
.detail-card,
.evaluator-step-card,
.audit-holding-card {
    padding: 1rem;
}

.summary-card .label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.summary-card .value {
    display: block;
    margin-top: 0.42rem;
    color: var(--text-primary);
    font-size: 1.4rem;
}

.summary-card .meta {
    display: block;
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.accounting-controls {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0;
}

.accounting-allocation-card {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
    gap: 1rem;
    align-items: start;
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(11, 19, 32, 0.98), rgba(8, 14, 25, 0.98));
    box-shadow: var(--shadow-soft);
    padding: 1rem 1.1rem;
    margin-top: 1rem;
}

.accounting-allocation-card.tone-good {
    border-color: rgba(58, 177, 110, 0.35);
}

.accounting-allocation-card.tone-warn {
    border-color: rgba(208, 158, 53, 0.35);
}

.accounting-allocation-card.tone-risk {
    border-color: rgba(199, 89, 89, 0.35);
}

.allocation-kicker {
    display: inline-block;
    color: var(--text-secondary);
    font-size: 0.77rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.accounting-allocation-copy h3 {
    margin: 0.35rem 0 0;
    color: var(--text-primary);
}

.accounting-allocation-copy p {
    margin: 0.45rem 0 0;
    color: var(--text-secondary);
    max-width: 62ch;
}

.accounting-allocation-metrics,
.accounting-allocation-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.accounting-allocation-metrics {
    justify-content: flex-end;
}

.accounting-allocation-reasons {
    grid-column: 1 / -1;
    margin-top: 0.1rem;
}

.accounting-allocation-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
}

.accounting-allocation-actions select {
    min-width: 200px;
    min-height: 2.8rem;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: rgba(8, 15, 26, 0.96);
    color: var(--text-primary);
    padding: 0.68rem 0.8rem;
}

.accounting-filter-form,
.accounting-entry-form {
    display: grid;
    gap: 0.9rem;
}

.accounting-filter-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    flex: 1;
}

.accounting-filter-form label,
.accounting-entry-form label {
    display: grid;
    gap: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.83rem;
    font-weight: 600;
}

.accounting-filter-form input,
.accounting-filter-form select,
.accounting-entry-form input,
.accounting-entry-form select {
    min-height: 2.8rem;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: rgba(8, 15, 26, 0.96);
    color: var(--text-primary);
    padding: 0.68rem 0.8rem;
}

.accounting-export-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.accounting-export-panel {
    align-self: end;
}

.accounting-export-panel summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.8rem;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: rgba(8, 15, 26, 0.96);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    list-style: none;
    padding: 0.68rem 0.9rem;
}

.accounting-export-panel summary::-webkit-details-marker {
    display: none;
}

.accounting-export-panel[open] .accounting-export-group {
    margin-top: 0.7rem;
}

.portfolio-export-disclosure {
    margin: 0.8rem 0;
}

.portfolio-export-disclosure summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.65rem;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: rgba(8, 15, 26, 0.96);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    list-style: none;
    padding: 0.62rem 0.9rem;
}

.portfolio-export-disclosure summary::-webkit-details-marker {
    display: none;
}

.portfolio-export-disclosure .portfolio-export-panel {
    margin-top: 0.7rem;
}

.accounting-entry-panel {
    margin: 1rem 0;
    overflow: hidden;
}

.accounting-entry-panel summary,
.accounting-detail-card summary {
    list-style: none;
    cursor: pointer;
    padding: 1rem 1.1rem;
    color: var(--text-primary);
    font-weight: 700;
}

.accounting-entry-panel summary::-webkit-details-marker,
.accounting-detail-card summary::-webkit-details-marker {
    display: none;
}

.accounting-entry-form {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    padding: 0 1.1rem 1.1rem;
}

.accounting-entry-note {
    grid-column: span 2;
}

.accounting-secondary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.accounting-detail-card {
    overflow: hidden;
}

.accounting-summary-grid .summary-card.tone-good {
    border-color: rgba(58, 177, 110, 0.35);
    background: linear-gradient(180deg, rgba(16, 39, 31, 0.92), rgba(11, 21, 34, 0.96));
}

.accounting-summary-grid .summary-card.tone-warn {
    border-color: rgba(208, 158, 53, 0.35);
    background: linear-gradient(180deg, rgba(43, 33, 15, 0.92), rgba(11, 21, 34, 0.96));
}

.accounting-summary-grid .summary-card.tone-risk {
    border-color: rgba(199, 89, 89, 0.35);
    background: linear-gradient(180deg, rgba(43, 20, 20, 0.92), rgba(11, 21, 34, 0.96));
}

.accounting-source-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.28rem 0.58rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(25, 39, 61, 0.9);
    color: #d7e6f7;
}

.accounting-source-chip.source-ledger { background: rgba(20, 69, 90, 0.88); }
.accounting-source-chip.source-trade { background: rgba(88, 59, 17, 0.88); }
.accounting-source-chip.source-dividend { background: rgba(20, 87, 58, 0.88); }

.evaluator-steps-section,
.evaluator-holdings-section,
.accounting-history-section,
.evaluator-history-section {
    margin-top: 1rem;
}

.evaluator-delta-section {
    margin-top: 1rem;
}

.evaluator-holding-diff-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.evaluator-diff-group h4 {
    margin: 0 0 0.7rem;
    color: var(--text-primary);
    font-size: 0.98rem;
}

.field-help {
    margin: 0.45rem 0 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}
.field-help-ledger {
    color: var(--accent, rgba(57,194,255,0.9));
    background: rgba(57,194,255,0.07);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
}

.assignment-status-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.55rem;
    padding: 0.62rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(74, 95, 129, 0.38);
    background: rgba(12, 23, 38, 0.7);
}

.assignment-status-card.compact {
    padding: 0.52rem 0.68rem;
}

.assignment-status-card.tone-good {
    border-color: rgba(58, 177, 110, 0.34);
    background: rgba(20, 47, 36, 0.62);
}

.assignment-status-card.tone-warn {
    border-color: rgba(208, 158, 53, 0.34);
    background: rgba(52, 38, 14, 0.62);
}

.assignment-status-copy {
    display: grid;
    gap: 0.16rem;
    min-width: 0;
}

.assignment-status-copy strong,
.assignment-status-copy span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.assignment-status-copy strong {
    font-size: 0.83rem;
    color: var(--text-primary);
}

.assignment-status-copy span {
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.assignment-status-card a {
    color: var(--accent-soft);
    font-size: 0.74rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.assignment-status-card a:hover {
    color: var(--text-primary);
}

.portfolio-page .accounting-entry-form .assignment-status-card {
    margin-top: 0.48rem;
}

.accounting-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.55rem;
}

.accounting-row-actions .tx-inline-form {
    margin: 0;
}

.btn-inline {
    min-height: 34px;
    padding: 0.42rem 0.72rem;
    font-size: 0.76rem;
    line-height: 1.1;
}

.evaluator-step-card.tone-good,
.audit-holding-card.tone-good { border-color: rgba(58, 177, 110, 0.35); }
.evaluator-step-card.tone-warn,
.audit-holding-card.tone-warn { border-color: rgba(208, 158, 53, 0.35); }
.evaluator-step-card.tone-risk,
.audit-holding-card.tone-risk { border-color: rgba(199, 89, 89, 0.35); }

.evaluator-step-title,
.audit-step-row-title {
    display: block;
    color: var(--text-secondary);
    font-size: 0.77rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.evaluator-step-value,
.audit-step-row-value {
    display: block;
    margin-top: 0.38rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.evaluator-step-detail,
.audit-step-row-detail,
.table-note {
    display: block;
    margin-top: 0.32rem;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.5;
}

.detail-chip-row,
.audit-holding-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.detail-chip {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    border-radius: 999px;
    padding: 0.34rem 0.68rem;
    background: rgba(20, 31, 48, 0.92);
    border: 1px solid rgba(81, 104, 138, 0.3);
    color: #d7e6f8;
    font-size: 0.78rem;
    font-weight: 600;
}

.detail-chip.freshness-fresh,
.holding-replacement-chip.freshness-fresh {
    border-color: rgba(16, 185, 129, 0.32);
    color: #86efac;
}

.detail-chip.freshness-aging,
.holding-replacement-chip.freshness-aging {
    border-color: rgba(245, 158, 11, 0.34);
    color: #fcd34d;
}

.detail-chip.freshness-stale,
.holding-replacement-chip.freshness-stale {
    border-color: rgba(248, 113, 113, 0.34);
    color: #fca5a5;
}

.detail-list {
    margin: 0;
    padding-left: 1.15rem;
    color: var(--text-secondary);
}

.audit-holdings-stack {
    display: grid;
    gap: 1rem;
}

.audit-holding-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

.audit-holding-header h4 {
    margin: 0;
    color: var(--text-primary);
}

.audit-step-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 1rem;
}

.audit-step-row {
    border-radius: 14px;
    border: 1px solid rgba(81, 104, 138, 0.28);
    background: rgba(13, 23, 37, 0.92);
    padding: 0.82rem;
}

.evaluator-history-table td {
    vertical-align: top;
}

.evaluator-history-detail-row td {
    padding-top: 0;
    border-top: none;
}

.evaluator-raw-section {
    margin-top: 1rem;
}

.json-panel {
    padding: 0 1rem 1rem;
}

.json-panel pre {
    margin: 0;
    padding: 1rem;
    overflow: auto;
    border-radius: 14px;
    background: rgba(8, 15, 26, 0.96);
    border: 1px solid rgba(81, 104, 138, 0.24);
    color: #d7e6f8;
    font-size: 0.8rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 900px) {
    .portfolio-section-nav {
        margin-bottom: 1rem;
    }

    .accounting-summary-grid,
    .evaluator-steps-grid,
    .evaluator-detail-grid,
    .accounting-allocation-card,
    .accounting-secondary-grid,
    .audit-step-list,
    .accounting-filter-form,
    .accounting-entry-form {
        grid-template-columns: 1fr;
    }

    .accounting-controls,
    .audit-holding-header {
        flex-direction: column;
        align-items: stretch;
    }

    .accounting-allocation-metrics {
        justify-content: flex-start;
    }

    .accounting-allocation-actions,
    .accounting-allocation-actions select {
        width: 100%;
        min-width: 0;
        justify-content: stretch;
    }

    .accounting-entry-note {
        grid-column: auto;
    }
}

body {
    background-color: var(--bg-root);
    background-image: radial-gradient(circle at 50% -20%, #1e293b 0%, #020617 80%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    margin: 0;
    line-height: 1.6;
    min-height: 100vh;
}

body.index-page-bg {
    background-color: var(--bg-root);
    background-image:
        linear-gradient(180deg, rgba(2, 6, 23, 0.58) 0%, rgba(2, 6, 23, 0.72) 44%, rgba(2, 6, 23, 0.9) 100%),
        radial-gradient(circle at 50% -18%, rgba(30, 41, 59, 0.65) 0%, rgba(2, 6, 23, 0.95) 78%);
    background-repeat: no-repeat, no-repeat;
    background-size: cover, cover;
    background-position: center top, center top;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 3000;
    background: var(--text-primary);
    color: var(--bg-root);
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.025em; font-family: var(--font-display); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* Header */
header {
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, rgba(7, 13, 27, 0.95) 0%, rgba(7, 13, 27, 0.86) 100%);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    background: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    padding: 0.5rem;
    touch-action: manipulation;
    z-index: 1000;
}

.mobile-top-actions,
.mobile-lang-shortcut,
.mobile-auth-shortcut,
.nav-mobile-auth,
.nav-mobile-head {
    display: none;
}

.nav-link-icon,
.nav-mobile-section-label {
    display: none;
}

.mobile-nav-overlay {
    display: none;
}

.nav-mobile-close {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    border-radius: 12px;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
}

.nav-mobile-close:hover {
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

.mobile-menu-toggle .bar {
    display: block;
    width: 25px;
    height: 2px;
    background: white;
    margin: 0;
    transition: 0.3s;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-grow: 1;
    margin-left: 3rem;
}

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

.nav-utils {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: auto;
}

.nav-auth {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.nav-auth .nav-btn {
    margin-left: 0;
}
.header-stock-search {
    position: relative;
    width: min(320px, 36vw);
}
.header-stock-search input {
    width: 100%;
    min-height: 38px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 0.5rem 0.7rem 0.5rem 2rem;
    font-size: 0.86rem;
    font-family: var(--font-sans);
    outline: none;
}
.header-stock-search input:focus {
    border-color: var(--border-active);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.05);
}
.header-stock-search input::placeholder {
    color: var(--text-muted);
}
.header-search-icon {
    color: var(--text-muted);
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}
.header-search-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-active);
    border-radius: 10px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    z-index: 120;
    display: none;
    max-height: min(22rem, calc(100dvh - 7rem));
    overflow-y: auto;
    overscroll-behavior: contain;
}

.market-status {
    display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--text-secondary);
    background: var(--bg-card); padding: 0.25rem 0.75rem; border-radius: 99px; border: 1px solid var(--border-subtle);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-buy);
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.15);
}

@media (max-width: 1024px) {
    .main-nav { margin-left: 1.5rem; }
    .nav-links { gap: 1rem; }
    .header-stock-search { width: min(250px, 34vw); }
}

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

    .mobile-top-actions {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        margin-left: auto;
        margin-right: 0.45rem;
    }

    body.index-page-bg {
        background-position: center top, center top;
    }

    .mobile-lang-shortcut {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: 0;
        margin-right: 0;
        min-height: 36px;
        min-width: 42px;
        border-radius: 999px;
        padding: 0.34rem 0.58rem;
        text-decoration: none;
        font-size: 0.74rem;
        font-weight: 800;
        letter-spacing: 0.03em;
        border: 1px solid rgba(147, 197, 253, 0.45);
        color: #e8f4ff;
        background: rgba(30, 64, 175, 0.22);
    }

    .mobile-auth-shortcut {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: 0;
        margin-right: 0;
        border-radius: 999px;
        padding: 0.36rem 0.7rem;
        min-height: 36px;
        min-width: 74px;
        text-decoration: none;
        font-size: 0.75rem;
        font-weight: 700;
        letter-spacing: 0.02em;
        border: 1px solid var(--border-active);
        color: var(--text-primary);
        background: rgba(255, 255, 255, 0.04);
    }

    .mobile-auth-shortcut.login {
        border-color: rgba(147, 197, 253, 0.48);
        background: rgba(30, 64, 175, 0.2);
        color: #e8f4ff;
    }

    .mobile-auth-shortcut.logout {
        border-color: rgba(248, 113, 113, 0.45);
        background: rgba(127, 29, 29, 0.24);
        color: #fecaca;
    }

    .mobile-auth-shortcut.account {
        border-color: rgba(110, 231, 183, 0.45);
        background: rgba(6, 95, 70, 0.25);
        color: #d1fae5;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .mobile-menu-toggle.active .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .mobile-menu-toggle.active .bar:nth-child(2) { opacity: 0; }
    .mobile-menu-toggle.active .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: min(88%, 390px);
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        background: linear-gradient(180deg, #0b1222 0%, #111c33 100%);
        flex-direction: column;
        justify-content: flex-start;
        padding: calc(0.7rem + env(safe-area-inset-top)) 1rem calc(1rem + env(safe-area-inset-bottom));
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 999;
        margin: 0;
        border-left: 1px solid var(--border-subtle);
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }

    .main-nav.active {
        transform: translateX(0);
    }

    .mobile-nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(2, 6, 23, 0.58);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 998;
        backdrop-filter: blur(2px);
    }

    .mobile-nav-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .nav-mobile-auth {
        display: grid;
        width: 100%;
        gap: 0.55rem;
        margin-top: 0.35rem;
        padding-bottom: 0.85rem;
        margin-bottom: 0.45rem;
        border-bottom: 1px solid var(--border-subtle);
    }

    .nav-mobile-auth .nav-mobile-auth-btn {
        width: 100%;
        margin: 0;
        min-height: 46px;
        justify-content: center;
        text-align: center;
        border-radius: 10px;
        font-size: 0.93rem;
    }

    .nav-mobile-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding-bottom: 0.7rem;
        border-bottom: 1px solid var(--border-subtle);
    }

    .nav-mobile-title {
        font-size: 0.72rem;
        letter-spacing: 0.11em;
        text-transform: uppercase;
        color: var(--text-muted);
        font-weight: 700;
    }

    .nav-mobile-section-label {
        display: block;
        font-size: 0.66rem;
        letter-spacing: 0.11em;
        text-transform: uppercase;
        color: var(--text-muted);
        font-weight: 700;
        padding: 0 0.2rem;
    }

.nav-mobile-account-label {
    margin-top: 0.35rem;
    margin-bottom: 0.2rem;
}

    .nav-mobile-main-label {
        margin-bottom: 0.2rem;
    }

    .nav-mobile-language-label {
        margin-bottom: 0.05rem;
    }

    .nav-links {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0.12rem;
    }

    .nav-link {
        display: flex;
        align-items: center;
        gap: 0.62rem;
        width: 100%;
        padding: 0.8rem 0.8rem;
        margin: 0;
        font-size: 1rem;
        border: 1px solid transparent;
        border-radius: 10px;
    }

    .nav-link-icon {
        display: inline-flex;
        width: 1.25rem;
        height: 1.25rem;
        align-items: center;
        justify-content: center;
        color: var(--text-secondary);
        flex: 0 0 auto;
    }

    .nav-link-icon svg {
        width: 1.05rem;
        height: 1.05rem;
        stroke: currentColor;
        fill: none;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .nav-link.active .nav-link-icon {
        color: #d6efff;
    }

    .nav-link-text {
        display: inline-block;
        min-width: 0;
    }

    .nav-link.active {
        background: rgba(57, 194, 255, 0.14);
        border-color: rgba(57, 194, 255, 0.34);
    }

    .nav-btn {
        width: 100%;
        margin: 1rem 0 0 0;
        text-align: center;
        padding: 0.75rem;
        justify-content: center;
    }

    .nav-utils {
        margin-top: 0.55rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-subtle);
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .nav-auth {
        display: none;
    }

    .header-stock-search {
        width: 100%;
        margin-bottom: 0;
    }

    .nav-auth .nav-btn {
        width: 100%;
        margin: 0;
        justify-content: center;
    }

    .lang-switcher {
        margin: 0;
        font-size: 0.95rem;
    }

    .nav-lang-group {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .hide-mobile { display: none; }

    body.menu-open {
        overflow: hidden;
    }
}

.logo { font-size: 1.25rem; font-weight: 900; letter-spacing: -0.05em; display: flex; align-items: center; gap: 0.5rem; color: #fff; text-decoration: none; font-family: var(--font-display);}
.beta-tag {
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    border: 1px solid var(--border-active);
    border-radius: 999px;
    padding: 0.15rem 0.4rem;
    color: var(--text-secondary);
}
.logo:focus-visible,
.nav-link:focus-visible,
.nav-btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-outline:focus-visible {
    outline: 2px solid var(--accent-brand);
    outline-offset: 2px;
}
.lang-switcher {
    display: flex;
    align-items: center;
    margin-left: 0.75rem;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 999px;
    padding: 0.16rem 0.26rem;
}
.nav-lang-group {
    display: flex;
    align-items: center;
}
.lang-switcher .divider { color: var(--border-active); margin: 0 0.22rem; }
.lang-switcher a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.76rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.5rem;
    min-width: 1.7rem;
    padding: 0.14rem 0.32rem;
    border-radius: 999px;
}
.lang-switcher a.active {
    color: var(--text-primary);
    background: rgba(57, 194, 255, 0.2);
    box-shadow: inset 0 0 0 1px rgba(57, 194, 255, 0.35);
}

.nav-btn {
    border: 1px solid #f8fafc;
    background: #f8fafc;
    color: #020617;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.84rem;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    margin-left: 1rem;
}
.nav-btn:hover {
    border-color: #e2e8f0;
    background: #e2e8f0;
    color: #020617;
    text-decoration: none;
}

.nav-link, .nav-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}

/* Hero */
.hero { padding: 4.25rem 0.5rem 2.8rem; text-align: center; max-width: 760px; margin: 0 auto; }
.hero h1 { font-size: clamp(2rem, 5.5vw, 3.2rem); background: linear-gradient(to bottom right, #fff, #94a3b8); -webkit-background-clip: text; color: transparent; margin-bottom: 0.9rem; line-height: 1.12; }
.subtitle { color: var(--text-secondary); font-size: clamp(1rem, 2.8vw, 1.2rem); margin: 0 auto 1.6rem; font-weight: 400; max-width: 60ch; }

.home-page .hero {
    background:
        linear-gradient(155deg, rgba(14, 24, 45, 0.95) 0%, rgba(6, 12, 26, 0.92) 58%),
        radial-gradient(circle at 0% 0%, rgba(57, 194, 255, 0.2) 0%, rgba(57, 194, 255, 0) 48%);
    border: 1px solid var(--border-active);
    border-radius: 20px;
    padding: 3rem 1.4rem 2.3rem;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.34);
    position: relative;
    overflow: hidden;
}

.home-page .hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, rgba(255,255,255,0.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 34px 34px;
    opacity: 0.22;
    pointer-events: none;
}

.home-page .hero h1 {
    background: linear-gradient(130deg, #f8fafc 10%, #cfe7fb 52%, #67c5f5 100%);
    -webkit-background-clip: text;
}

.home-signature {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 0.85rem;
}

.home-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--border-active);
    padding: 0.33rem 0.72rem;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: #d0def0;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.045);
}

.home-pill.home-pill-primary {
    color: #eaf6ff;
    border-color: rgba(57, 194, 255, 0.65);
    background: rgba(57, 194, 255, 0.24);
}

.home-signal-note {
    margin: -0.4rem auto 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 58ch;
}

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

.home-page .hero { animation: riseFade 480ms ease-out both; }
.home-page .utility-point { animation: riseFade 600ms ease-out both; }
.home-page .home-workflow-item { animation: riseFade 700ms ease-out both; }

@media (prefers-reduced-motion: reduce) {
    .home-page .hero,
    .home-page .utility-point,
    .home-page .home-workflow-item {
        animation: none;
    }
}

@media (max-width: 768px) {
    .hero { padding: 2.6rem 0.2rem 2rem; }
    .subtitle { margin-bottom: 1.2rem; }
}

/* Search */
.search-box {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    display: flex; align-items: center;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    max-width: 560px; margin: 0 auto;
    position: relative;
    width: 100%;
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-active);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: none;
    max-height: min(22rem, calc(100dvh - 10rem));
    overflow-y: auto;
    overscroll-behavior: contain;
}

.suggestion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border-subtle);
    text-decoration: none;
    color: inherit;
}

.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover,
.suggestion-item:focus-visible {
    background: var(--bg-card-hover);
}

.suggestion-item:focus-visible {
    outline: 2px solid var(--border-active);
    outline-offset: -2px;
}

.s-info { display: flex; flex-direction: column; text-align: left; }
.s-ticker { font-weight: 700; font-size: 0.875rem; color: var(--text-primary); }
.s-name { font-size: 0.75rem; color: var(--text-muted); }

.s-score { font-weight: 800; font-size: 0.875rem; }
.s-score.buy { color: var(--accent-buy); }
.s-score.sell { color: var(--accent-sell); }
.s-score.hold { color: var(--accent-hold); }
.search-box:focus-within { border-color: var(--text-muted); box-shadow: 0 0 0 2px rgba(255,255,255,0.05); }
.search-icon { color: var(--text-muted); margin-right: 0.75rem; display: flex; }
.search-box input {
    background: transparent; border: none; outline: none; color: var(--text-primary);
    font-size: 1rem; width: 100%; font-family: var(--font-sans); min-height: 38px;
}
.search-box input::placeholder { color: var(--text-muted); }

.hero-quick-links {
    display: flex;
    justify-content: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-top: 0.8rem;
}

.hero-quick-links a {
    color: var(--text-secondary);
    text-decoration: none;
    border: 0;
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 0.86rem;
    font-weight: 600;
}

.hero-quick-links a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.teaser-shell {
    position: relative;
    margin-bottom: 1rem;
}

.teaser-shell.is-locked::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.65));
    pointer-events: none;
    z-index: 2;
}

.teaser-list {
    display: block;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(6, 14, 28, 0.72);
    margin-bottom: 0;
}

.teaser-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-primary);
    border: 0;
    border-bottom: 1px solid var(--border-subtle);
    background: transparent;
    border-radius: 0;
    padding: 0.78rem 0.92rem;
    transition: border-color 0.2s, background-color 0.2s;
}

.teaser-item:last-child {
    border-bottom: 0;
}

.teaser-item:hover {
    background: rgba(255, 255, 255, 0.035);
}

.teaser-item.teaser-item-locked {
    filter: blur(3px);
    opacity: 0.58;
    user-select: none;
    pointer-events: none;
}

.teaser-main {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: baseline;
}

.teaser-ticker {
    font-size: 0.96rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.teaser-rank {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 700;
}

.teaser-sub {
    margin-top: 0.45rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-secondary);
}

.teaser-name {
    font-size: 0.9rem;
}

.teaser-meta {
    margin-top: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
}

.teaser-score {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 700;
}

.teaser-lock-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    width: min(540px, calc(100% - 1.2rem));
    text-align: center;
    background: rgba(2, 6, 23, 0.84);
    border: 1px solid var(--border-active);
    border-radius: 12px;
    padding: 1rem 1rem 1.1rem;
    backdrop-filter: blur(4px);
}

.teaser-lock-overlay h3 {
    font-size: 1.05rem;
    margin: 0 0 0.35rem;
}

.teaser-lock-overlay p {
    margin: 0 0 0.85rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* Grid */
.stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    padding-bottom: 4rem;
}

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

/* Card */
.stock-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex; flex-direction: column; justify-content: space-between;
    transition: transform 0.2s, border-color 0.2s, background-color 0.2s;
    min-height: 180px;
}
.stock-card:hover { transform: translateY(-2px); border-color: var(--border-active); background-color: var(--bg-card-hover); }
.stock-card-link {
    color: inherit;
    text-decoration: none;
}

.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }
.ticker { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.05em; background: rgba(255,255,255,0.03); padding: 4px 8px; border-radius: 4px; }
.rank { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }

.card-body { margin-bottom: 1.5rem; text-align: center; }
.name { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signal-badge {
    display: inline-block; font-size: 0.875rem; font-weight: 800; padding: 0.25rem 1rem; border-radius: 99px; letter-spacing: 0.05em;
}
.signal-badge.buy { color: var(--accent-buy); background: var(--accent-buy-dim); border: 1px solid rgba(16, 185, 129, 0.2); }
.signal-badge.sell { color: var(--accent-sell); background: var(--accent-sell-dim); border: 1px solid rgba(239, 68, 68, 0.2); }
.signal-badge.hold { color: var(--accent-hold); background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.2); }

.card-footer { display: flex; justify-content: space-between; border-top: 1px solid var(--border-subtle); padding-top: 1rem; }
.metric { display: flex; flex-direction: column; }
.metric .label { font-size: 0.65rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.05em; margin-bottom: 2px; }
.metric .value { font-size: 1rem; font-weight: 600; color: var(--text-primary); font-feature-settings: "tnum"; }

/* Blur Overlay */
.blur-overlay {
    grid-column: 1 / -1;
    background: linear-gradient(to bottom, transparent, var(--bg-root));
    padding: 4rem 0;
    text-align: center;
    border: 1px dashed var(--border-active);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.02);
}
.cta-box { max-width: 400px; }
.cta-box h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.cta-box p { color: var(--text-secondary); margin-bottom: 1.5rem; }
.btn-primary {
    background: linear-gradient(135deg, #e7f2ff 0%, #c6dcfa 100%);
    border: 1px solid #d8e8ff;
    color: #06162d;
    text-decoration: none;
    padding: 0.75rem 2rem; border-radius: 8px; font-weight: 700; display: inline-block;
    transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.96; }

@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .stock-grid { grid-template-columns: 1fr; }
}

/* Market Directory Table */
.directory-header { padding: 4rem 0 2rem; }
.directory-meta {
    margin: 0.28rem 0 0.7rem;
    font-size: 0.83rem;
    color: var(--text-muted);
}
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 4rem;
}
.market-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.market-table th {
    text-align: left; padding: 1rem; border-bottom: 1px solid var(--border-active);
    color: var(--text-muted); font-size: 0.7rem; letter-spacing: 0.1em; font-weight: 700;
}
.market-table td { padding: 1rem; border-bottom: 1px solid var(--border-subtle); }
.market-table tr:hover { background: var(--bg-card-hover); }
.sortable-col { cursor: pointer; }
.link-clean { color: inherit; text-decoration: none; }

.market-search {
    width: min(100%, 460px);
    margin: 0 0 1rem;
    padding: 0.7rem 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.market-search::placeholder {
    color: var(--text-muted);
}

.text-right { text-align: right; }
.font-mono { font-family: 'SF Mono', 'Courier New', monospace; font-feature-settings: "tnum"; }
.small-caps { font-variant: small-caps; letter-spacing: 0.05em; font-weight: 600; color: var(--text-secondary); }

.sector-square {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 8px;
    vertical-align: middle;
    background-color: var(--sector-color, rgba(120, 179, 255, 0.45));
}

.badge-mini {
    padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.05em;
}
.badge-mini.buy { color: var(--accent-buy); background: var(--accent-buy-dim); border: 1px solid rgba(16, 185, 129, 0.25); }
.badge-mini.sell { color: var(--accent-sell); background: var(--accent-sell-dim); border: 1px solid rgba(239, 68, 68, 0.25); }
.badge-mini.hold { color: var(--accent-hold); background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.25); }

.buy { color: var(--accent-buy); }
.sell { color: var(--accent-sell); }
.hold { color: var(--accent-hold); }

.nav-link {
    text-decoration: none; color: var(--text-secondary); font-size: 0.875rem;
    font-weight: 700; margin-right: 0; transition: color 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); }

.blur-row td {
    filter: none;
    padding: 2rem;
    position: relative;
    background: rgba(2, 6, 23, 0.55);
}
.locked-row td {
    filter: blur(4px);
    user-select: none;
    pointer-events: none;
}
.table-cta {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    filter: none; z-index: 10;
}
.table-cta a {
    background: var(--text-primary); color: var(--bg-root); padding: 0.5rem 1.5rem;
    border-radius: 6px; font-weight: 700; text-decoration: none;
}

/* Trust Stats */
.trust-stats {
    display: flex; justify-content: center; gap: 0.75rem; margin-bottom: 1.4rem; flex-wrap: wrap;
}
.t-stat {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
    border: 1px solid var(--border-subtle);
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
    padding: 0.45rem 0.7rem;
}
.t-stat span { display: block; font-size: 1.05rem; font-weight: 900; color: var(--text-primary); line-height: 1.2; }
.t-stat.t-stat-buy {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.12);
}
.t-stat.t-stat-buy span { color: var(--accent-buy); }
.t-stat.t-stat-hold {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.12);
}
.t-stat.t-stat-hold span { color: var(--accent-hold); }
.t-stat.t-stat-sell {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.12);
}
.t-stat.t-stat-sell span { color: var(--accent-sell); }

.stock-quote-line {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-top: 0.45rem;
}
.quote-price {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.1;
    color: var(--text-primary);
}
.quote-change {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
}
.quote-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.stock-insights-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}
.related-sector-section {
    margin-top: 2rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--border-subtle);
}
.stock-insight-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1rem;
}
.stock-insight-card h2 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}
.stock-chart-panel {
    margin: 1rem 0 0;
    padding: 1rem 1rem 0.75rem;
}
.stock-chart-panel-empty {
    margin-bottom: 1rem;
}
.stock-chart-topline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.85rem;
}
.stock-chart-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.55rem;
}
.stock-chart-pill-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.26rem;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.16);
    background: rgba(15, 23, 42, 0.6);
}
.stock-chart-pill {
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    padding: 0.42rem 0.72rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.stock-chart-pill:hover,
.stock-chart-pill:focus-visible {
    background: rgba(56, 189, 248, 0.12);
    color: var(--text-primary);
    outline: none;
}
.stock-chart-pill.active {
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.28), rgba(14, 165, 233, 0.18));
    color: #e0f2fe;
    box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.22);
}
.stock-chart-stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem;
    margin-bottom: 0.9rem;
}
.stock-chart-stat {
    border: 1px solid rgba(96, 165, 250, 0.14);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(12, 24, 42, 0.82), rgba(7, 15, 27, 0.72));
    padding: 0.72rem 0.8rem;
    min-width: 0;
}
.stock-chart-stat span {
    display: block;
    margin-bottom: 0.22rem;
    color: var(--text-muted);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.stock-chart-stat strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.24;
    overflow-wrap: anywhere;
}
.stock-chart-canvas {
    width: 100%;
    height: 520px;
}
@media (max-width: 900px) {
    .stock-detail-page .stock-chart-topline {
        flex-direction: column;
        align-items: stretch;
    }

    .stock-detail-page .stock-chart-toolbar {
        justify-content: flex-start;
    }

    .stock-detail-page .stock-chart-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stock-detail-page .stock-chart-canvas {
        height: 460px;
    }
}


/* ============================================================
   HOME PAGE - PREMIUM REFRESH
   Scoped to the landing page to avoid cross-page regressions.
   ============================================================ */
@keyframes homePremiumAuroraShift {
    0% { transform: translate3d(-2%, -3%, 0) scale(1); }
    50% { transform: translate3d(3%, 2%, 0) scale(1.04); }
    100% { transform: translate3d(-1%, 4%, 0) scale(0.99); }
}

@keyframes homePremiumFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.home-page.home-v2-premium {
    position: relative;
    display: grid;
    gap: clamp(1.5rem, 2vw, 2.4rem);
    padding-top: clamp(1.2rem, 2vw, 1.8rem);
    padding-bottom: clamp(2rem, 4vw, 4rem);
    isolation: isolate;
}

.home-page.home-v2-premium::before {
    content: "";
    position: absolute;
    inset: -2.5rem -2rem auto;
    height: min(42rem, 58vw);
    border-radius: 40px;
    background:
        radial-gradient(circle at 18% 22%, rgba(86, 198, 255, 0.22), transparent 32%),
        radial-gradient(circle at 82% 18%, rgba(34, 211, 238, 0.16), transparent 28%),
        radial-gradient(circle at 52% 68%, rgba(94, 234, 212, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(8, 15, 28, 0.92), rgba(3, 7, 18, 0));
    filter: blur(18px);
    opacity: 0.95;
    z-index: -2;
    pointer-events: none;
}

.home-page.home-v2-premium::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg, rgba(7, 13, 25, 0.12), transparent 48%),
        repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.035) 0 1px, transparent 1px 82px),
        repeating-linear-gradient(0deg, rgba(148, 163, 184, 0.025) 0 1px, transparent 1px 82px);
    opacity: 0.5;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.18) 72%, transparent);
    z-index: -1;
    pointer-events: none;
}

.home-page.home-v2-premium .home-v2-hero,
.home-page.home-v2-premium .home-v2-resume,
.home-page.home-v2-premium .home-v2-conversion,
.home-page.home-v2-premium .home-v2-block,
.home-page.home-v2-premium .home-v2-workflow {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(129, 168, 215, 0.16);
    background:
        linear-gradient(145deg, rgba(10, 18, 34, 0.92), rgba(4, 9, 20, 0.9)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 24%);
    box-shadow:
        0 32px 64px rgba(2, 6, 23, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.home-page.home-v2-premium .home-v2-hero::before,
.home-page.home-v2-premium .home-v2-conversion::before,
.home-page.home-v2-premium .home-v2-workflow::before {
    content: "";
    position: absolute;
    inset: auto -8% 52% auto;
    width: clamp(14rem, 26vw, 24rem);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(68, 211, 255, 0.26), rgba(68, 211, 255, 0.06) 46%, transparent 72%);
    filter: blur(8px);
    opacity: 0.95;
    animation: homePremiumAuroraShift 16s ease-in-out infinite;
    pointer-events: none;
}

.home-page.home-v2-premium .home-v2-hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
    gap: clamp(1.25rem, 3vw, 2.5rem);
    padding: clamp(1.5rem, 3vw, 2.8rem);
    border-radius: 34px;
    backdrop-filter: blur(14px);
}

.home-page.home-v2-premium .home-v2-copy,
.home-page.home-v2-premium .home-v2-preview {
    position: relative;
    z-index: 1;
}

.home-page.home-v2-premium .home-v2-copy {
    display: grid;
    align-content: start;
    gap: clamp(0.9rem, 1.7vw, 1.25rem);
}

.home-page.home-v2-premium .home-v2-eyebrow {
    gap: 0.75rem;
}

.home-page.home-v2-premium .home-v2-chip {
    border: 1px solid rgba(150, 199, 255, 0.26);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        rgba(6, 12, 24, 0.78);
    color: #d5eefe;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.home-page.home-v2-premium .home-v2-copy h1 {
    max-width: 10.5ch;
    margin: 0;
    font-size: clamp(3.2rem, 6vw, 5.8rem);
    line-height: 0.96;
    letter-spacing: -0.06em;
    font-weight: 800;
    color: #f9fcff;
    text-wrap: balance;
    text-shadow: 0 10px 36px rgba(16, 185, 255, 0.16);
}

.home-page.home-v2-premium .home-v2-copy h1::first-line {
    color: #dff5ff;
}

.home-page.home-v2-premium .home-v2-subtitle {
    max-width: 34rem;
    margin: 0;
    font-size: clamp(1.08rem, 1.8vw, 1.34rem);
    line-height: 1.55;
    color: rgba(229, 241, 255, 0.9);
    text-wrap: pretty;
}

.home-page.home-v2-premium .home-v2-note {
    max-width: 31rem;
    margin: 0;
    color: rgba(170, 196, 223, 0.86);
    font-size: 0.98rem;
    line-height: 1.65;
}

.home-page.home-v2-premium .home-v2-hero-insights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 0.1rem;
}

.home-page.home-v2-premium .home-v2-hero-insight {
    position: relative;
    overflow: hidden;
    padding: 0.9rem 0.95rem;
    border: 1px solid rgba(132, 173, 219, 0.18);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 60%),
        rgba(8, 15, 30, 0.66);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 14px 28px rgba(2, 6, 23, 0.18);
}

.home-page.home-v2-premium .home-v2-hero-insight::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    border-radius: 18px 0 0 18px;
    background: linear-gradient(180deg, rgba(88, 212, 255, 0.84), rgba(94, 234, 212, 0.22));
}

.home-page.home-v2-premium .home-v2-hero-insight-value {
    display: block;
    color: #f7fcff;
    font-size: clamp(1.15rem, 2vw, 1.6rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.home-page.home-v2-premium .home-v2-hero-insight-label {
    display: block;
    margin-top: 0.3rem;
    color: rgba(171, 195, 220, 0.78);
    font-size: 0.78rem;
    line-height: 1.45;
}

.home-page.home-v2-premium .home-v2-search {
    margin-top: 0.45rem;
    min-height: 4.5rem;
    border: 1px solid rgba(121, 166, 214, 0.22);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
        rgba(5, 10, 21, 0.88);
    box-shadow:
        0 18px 44px rgba(2, 6, 23, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.home-page.home-v2-premium .home-v2-search::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(78, 196, 255, 0.08), transparent 28%, transparent 72%, rgba(94, 234, 212, 0.08));
    pointer-events: none;
}

.home-page.home-v2-premium .home-v2-search input {
    position: relative;
    z-index: 1;
    font-size: 1.03rem;
    color: #f8fbff;
}

.home-page.home-v2-premium .home-v2-search input::placeholder {
    color: rgba(165, 190, 219, 0.7);
}

.home-page.home-v2-premium .home-v2-actions,
.home-page.home-v2-premium .home-v2-actions.home-v2-actions-final {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
}

.home-page.home-v2-premium .home-v2-actions .btn-primary,
.home-page.home-v2-premium .home-v2-actions .btn-secondary {
    min-height: 3.35rem;
    padding: 0.95rem 1.3rem;
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.home-page.home-v2-premium .home-v2-actions .btn-primary {
    background: linear-gradient(135deg, #58d4ff, #2cb6ff 52%, #0b8ddd);
    border: 1px solid rgba(120, 226, 255, 0.38);
    color: #02111f;
    box-shadow: 0 18px 36px rgba(44, 182, 255, 0.28);
}

.home-page.home-v2-premium .home-v2-actions .btn-primary:hover {
    box-shadow: 0 24px 46px rgba(44, 182, 255, 0.34);
}

.home-page.home-v2-premium .home-v2-actions .btn-secondary {
    border: 1px solid rgba(132, 174, 223, 0.28);
    background: rgba(10, 18, 35, 0.82);
    color: #e1eefb;
}

.home-page.home-v2-premium .home-v2-start-paths {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-page.home-v2-premium .home-v2-start-path {
    background: rgba(7, 14, 27, 0.72);
    border: 1px solid rgba(132, 174, 223, 0.22);
    border-radius: 8px;
    color: inherit;
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.85rem;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.home-page.home-v2-premium .home-v2-start-path:hover,
.home-page.home-v2-premium .home-v2-start-path:focus-visible {
    background: rgba(12, 23, 42, 0.92);
    border-color: rgba(88, 212, 255, 0.42);
    transform: translateY(-2px);
}

.home-page.home-v2-premium .home-v2-start-path span {
    color: #58d4ff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.home-page.home-v2-premium .home-v2-start-path strong {
    color: #f8fbff;
    font-size: 0.98rem;
    line-height: 1.25;
}

.home-page.home-v2-premium .home-v2-start-path small {
    color: rgba(177, 200, 225, 0.78);
    font-size: 0.82rem;
    line-height: 1.45;
}

.home-page.home-v2-premium .home-v2-start-path em {
    color: #dff7ff;
    font-size: 0.82rem;
    font-style: normal;
    font-weight: 800;
    margin-top: 0.15rem;
}

.home-page.home-v2-premium .home-v2-links {
    gap: 0.7rem;
}

.home-page.home-v2-premium .home-v2-links a {
    border: 1px solid rgba(131, 170, 216, 0.18);
    border-radius: 999px;
    background: rgba(8, 15, 29, 0.58);
    color: rgba(219, 236, 255, 0.88);
    backdrop-filter: blur(10px);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.home-page.home-v2-premium .home-v2-links a:hover,
.home-page.home-v2-premium .home-v2-links a:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(116, 214, 255, 0.32);
    background: rgba(12, 23, 42, 0.9);
}

.home-page.home-v2-premium .home-v2-trust-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.home-page.home-v2-premium .home-v2-trust-item {
    padding: 1rem 1rem 1.05rem;
    border: 1px solid rgba(122, 162, 206, 0.16);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 58%),
        rgba(7, 14, 27, 0.66);
    min-height: 100%;
}

.home-page.home-v2-premium .home-v2-trust-item strong {
    color: #edf8ff;
    font-size: 0.88rem;
    letter-spacing: 0.02em;
}

.home-page.home-v2-premium .home-v2-trust-item span {
    color: rgba(177, 200, 225, 0.78);
    font-size: 0.86rem;
    line-height: 1.55;
}

.home-page.home-v2-premium .home-v2-preview {
    display: grid;
    align-content: start;
    gap: 1rem;
    padding: clamp(1.2rem, 2vw, 1.6rem);
    border-radius: 28px;
    border: 1px solid rgba(122, 165, 212, 0.22);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 32%),
        linear-gradient(155deg, rgba(14, 30, 55, 0.92), rgba(5, 10, 22, 0.96));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 26px 56px rgba(0, 0, 0, 0.32);
}

.home-page.home-v2-premium .home-v2-preview-radar {
    position: absolute;
    inset: 1.1rem 1.15rem auto auto;
    width: 7.75rem;
    height: 7.75rem;
    pointer-events: none;
    opacity: 0.94;
}

.home-page.home-v2-premium .home-v2-preview-radar-ring,
.home-page.home-v2-premium .home-v2-preview-radar-sweep {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.home-page.home-v2-premium .home-v2-preview-radar-ring {
    border: 1px solid rgba(96, 203, 255, 0.16);
    background: radial-gradient(circle, rgba(88, 212, 255, 0.06), transparent 72%);
}

.home-page.home-v2-premium .home-v2-preview-radar-ring--mid {
    inset: 13%;
}

.home-page.home-v2-premium .home-v2-preview-radar-ring--inner {
    inset: 28%;
}

.home-page.home-v2-premium .home-v2-preview-radar-sweep {
    background: conic-gradient(from 90deg, transparent 0deg, rgba(88, 212, 255, 0.22) 38deg, transparent 78deg);
    mask: radial-gradient(circle, transparent 0 44%, #000 46%);
}

.home-page.home-v2-premium .home-v2-preview-radar-dot {
    position: absolute;
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 50%;
    background: #7de6ff;
    box-shadow: 0 0 0 6px rgba(125, 230, 255, 0.08), 0 0 16px rgba(125, 230, 255, 0.4);
}

.home-page.home-v2-premium .home-v2-preview-radar-dot--a {
    inset: 20% 18% auto auto;
}

.home-page.home-v2-premium .home-v2-preview-radar-dot--b {
    inset: 54% auto auto 22%;
}

.home-page.home-v2-premium .home-v2-preview-radar-dot--c {
    inset: auto 30% 16% auto;
}

.home-page.home-v2-premium .home-v2-preview-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding-right: 8rem;
    color: rgba(181, 211, 238, 0.84);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.home-page.home-v2-premium .home-v2-preview-kicker-line {
    display: block;
    width: 2.4rem;
    height: 1px;
    background: linear-gradient(90deg, rgba(88, 212, 255, 0.88), rgba(88, 212, 255, 0.12));
}

.home-page.home-v2-premium .home-v2-preview::after {
    content: "";
    position: absolute;
    inset: auto auto -12% 60%;
    width: 9rem;
    height: 9rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(94, 234, 212, 0.16), transparent 68%);
    filter: blur(10px);
    animation: homePremiumFloat 11s ease-in-out infinite;
    pointer-events: none;
}

.home-page.home-v2-premium .home-v2-preview-head {
    display: grid;
    gap: 0.45rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(123, 161, 203, 0.16);
    padding-right: 8rem;
}

.home-page.home-v2-premium .home-v2-preview-chart {
    position: relative;
    height: 3.8rem;
    margin-top: -0.1rem;
    margin-bottom: 0.05rem;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(123, 161, 203, 0.12);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 60%),
        linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px),
        linear-gradient(0deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px),
        rgba(7, 14, 27, 0.58);
    background-size: auto, 48px 100%, 100% 16px, auto;
}

.home-page.home-v2-premium .home-v2-preview-chart-line {
    position: absolute;
    inset: auto 0 0 0;
    height: 100%;
    background:
        linear-gradient(180deg, rgba(88, 212, 255, 0.2), transparent 70%),
        linear-gradient(120deg,
            transparent 0 5%,
            rgba(88, 212, 255, 0.18) 5% 7%,
            transparent 7% 22%,
            rgba(88, 212, 255, 0.32) 22% 25%,
            transparent 25% 44%,
            rgba(125, 230, 255, 0.44) 44% 47%,
            transparent 47% 63%,
            rgba(94, 234, 212, 0.38) 63% 66%,
            transparent 66% 82%,
            rgba(88, 212, 255, 0.48) 82% 85%,
            transparent 85% 100%);
    clip-path: polygon(0% 90%, 10% 86%, 18% 72%, 29% 75%, 40% 50%, 54% 56%, 66% 32%, 79% 38%, 100% 8%, 100% 100%, 0% 100%);
}

.home-page.home-v2-premium .home-v2-preview-chart-point {
    position: absolute;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: #d7f8ff;
    border: 2px solid rgba(88, 212, 255, 0.85);
    box-shadow: 0 0 0 7px rgba(88, 212, 255, 0.08);
}

.home-page.home-v2-premium .home-v2-preview-chart-point--a {
    left: 27%;
    top: 48%;
}

.home-page.home-v2-premium .home-v2-preview-chart-point--b {
    left: 53%;
    top: 29%;
}

.home-page.home-v2-premium .home-v2-preview-chart-point--c {
    right: 10%;
    top: 7%;
}

.home-page.home-v2-premium .home-v2-preview-head h2,
.home-page.home-v2-premium .home-v2-block h2,
.home-page.home-v2-premium .home-v2-focus-head h2,
.home-page.home-v2-premium .home-v2-resume-head h2,
.home-page.home-v2-premium .home-v2-conversion-copy h2 {
    margin: 0;
    font-size: clamp(1.4rem, 2vw, 2rem);
    letter-spacing: -0.04em;
    color: #f5fbff;
}

.home-page.home-v2-premium .home-v2-preview-head p,
.home-page.home-v2-premium .home-v2-block-head p,
.home-page.home-v2-premium .home-v2-focus-head p,
.home-page.home-v2-premium .home-v2-resume-head p,
.home-page.home-v2-premium .home-v2-conversion-copy p {
    margin: 0;
    color: rgba(171, 195, 220, 0.82);
    line-height: 1.6;
}

.home-page.home-v2-premium .home-v2-preview-list,
.home-page.home-v2-premium .home-v2-block-list,
.home-page.home-v2-premium .home-v2-workflow-grid,
.home-page.home-v2-premium .home-v2-resume-side-metrics {
    gap: 0.9rem;
}

.home-page.home-v2-premium .home-v2-preview-row,
.home-page.home-v2-premium .home-v2-list-item,
.home-page.home-v2-premium .home-v2-step,
.home-page.home-v2-premium .home-v2-resume-side-card,
.home-page.home-v2-premium .home-v2-resume-row,
.home-page.home-v2-premium .home-v2-resume-primary {
    position: relative;
    border: 1px solid rgba(127, 166, 209, 0.14);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 48%),
        rgba(8, 15, 29, 0.76);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.home-page.home-v2-premium .home-v2-preview-row {
    padding: 1rem 1.05rem;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.home-page.home-v2-premium .home-v2-preview-row::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 20px 0 0 20px;
    background: linear-gradient(180deg, rgba(88, 214, 255, 0.82), rgba(94, 234, 212, 0.18));
    opacity: 0.64;
}

.home-page.home-v2-premium .home-v2-preview-row:hover,
.home-page.home-v2-premium .home-v2-preview-row:focus-visible,
.home-page.home-v2-premium .home-v2-list-item:hover,
.home-page.home-v2-premium .home-v2-step:hover,
.home-page.home-v2-premium .home-v2-focus-card:hover,
.home-page.home-v2-premium .home-v2-resume-row:hover {
    transform: translateY(-4px);
    border-color: rgba(102, 207, 255, 0.3);
    background:
        linear-gradient(180deg, rgba(118, 214, 255, 0.08), transparent 52%),
        rgba(10, 20, 39, 0.92);
    box-shadow:
        0 20px 34px rgba(2, 6, 23, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.home-page.home-v2-premium .home-v2-row-main,
.home-page.home-v2-premium .home-v2-row-name,
.home-page.home-v2-premium .home-v2-row-meta {
    position: relative;
    z-index: 1;
}

.home-page.home-v2-premium .home-v2-row-ticker {
    color: #f3fbff;
}

.home-page.home-v2-premium .home-v2-row-rank,
.home-page.home-v2-premium .home-v2-row-score {
    color: rgba(156, 196, 235, 0.84);
}

.home-page.home-v2-premium .home-v2-preview-footer {
    padding-top: 0.2rem;
}

.home-page.home-v2-premium .home-v2-preview-footer .btn-secondary {
    width: 100%;
    justify-content: center;
}

.home-page.home-v2-premium .home-v2-resume,
.home-page.home-v2-premium .home-v2-conversion,
.home-page.home-v2-premium .home-v2-workflow,
.home-page.home-v2-premium .home-v2-block {
    padding: clamp(1.25rem, 2.5vw, 2rem);
    border-radius: 28px;
}

.home-page.home-v2-premium .home-v2-resume-head,
.home-page.home-v2-premium .home-v2-conversion {
    gap: 1rem;
}

.home-page.home-v2-premium .home-v2-resume-primary {
    padding: 1.35rem;
}

.home-page.home-v2-premium .home-v2-resume-primary-top {
    gap: 1rem;
}

.home-page.home-v2-premium .home-v2-resume-primary h3 {
    color: #f4fbff;
    letter-spacing: -0.03em;
}

.home-page.home-v2-premium .home-v2-resume-primary p,
.home-page.home-v2-premium .home-v2-resume-prompt p,
.home-page.home-v2-premium .home-v2-resume-row span,
.home-page.home-v2-premium .home-v2-resume-side-card em,
.home-page.home-v2-premium .home-v2-resume-list-head em {
    color: rgba(175, 198, 223, 0.8);
}

.home-page.home-v2-premium .home-v2-resume-score {
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(88, 212, 255, 0.18), rgba(88, 212, 255, 0.05));
    border: 1px solid rgba(88, 212, 255, 0.2);
}

.home-page.home-v2-premium .home-v2-resume-prompt {
    margin-top: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(118, 165, 213, 0.14);
    background: rgba(7, 14, 27, 0.76);
}

.home-page.home-v2-premium .home-v2-resume-chip-row {
    margin-top: 1rem;
    gap: 0.65rem;
}

.home-page.home-v2-premium .home-v2-resume-chip-row .detail-chip {
    border-color: rgba(121, 167, 215, 0.16);
    background: rgba(9, 17, 31, 0.8);
}

.home-page.home-v2-premium .home-v2-resume-side-card,
.home-page.home-v2-premium .home-v2-resume-row {
    padding: 1rem 1.05rem;
}

.home-page.home-v2-premium .home-v2-resume-side-card strong,
.home-page.home-v2-premium .home-v2-resume-row strong,
.home-page.home-v2-premium .home-v2-list-item h3,
.home-page.home-v2-premium .home-v2-step h3 {
    color: #f2f9ff;
}

.home-page.home-v2-premium .home-v2-resume-list-head,
.home-page.home-v2-premium .home-v2-focus-head {
    gap: 0.4rem;
}

.home-page.home-v2-premium .home-v2-workflow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-page.home-v2-premium .home-v2-step {
    display: grid;
    gap: 1rem;
    min-height: 100%;
    padding: 1.1rem 1.15rem;
}

.home-page.home-v2-premium .home-v2-step-index {
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid rgba(109, 193, 255, 0.28);
    background: linear-gradient(135deg, rgba(88, 212, 255, 0.18), rgba(88, 212, 255, 0.05));
    color: #dff5ff;
    box-shadow: 0 10px 22px rgba(57, 194, 255, 0.14);
}

.home-page.home-v2-premium .home-v2-focus-strip,
.home-page.home-v2-premium .home-v2-conversion {
    border-radius: 28px;
}

.home-page.home-v2-premium .home-v2-block--full .home-v2-block-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.95rem;
}

.home-page.home-v2-premium .home-v2-list-item {
    min-height: 100%;
    padding: 1.15rem;
}

.home-page.home-v2-premium .home-v2-list-item p,
.home-page.home-v2-premium .home-v2-step p {
    color: rgba(173, 196, 221, 0.82);
    line-height: 1.62;
}

.home-page.home-v2-premium .home-v2-conversion {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.25rem;
}

.home-page.home-v2-premium .home-v2-conversion-copy {
    max-width: 38rem;
}

.home-page.home-v2-premium .home-v2-conversion-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 0.85rem;
}

.home-page.home-v2-premium .home-v2-conversion-metric {
    padding: 1rem 1.05rem;
    border: 1px solid rgba(127, 166, 209, 0.16);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 58%),
        rgba(8, 15, 29, 0.76);
    min-width: 0;
}

.home-page.home-v2-premium .home-v2-conversion-value {
    color: #f7fcff;
    font-size: clamp(1.65rem, 3vw, 2.45rem);
    letter-spacing: -0.05em;
}

.home-page.home-v2-premium .home-v2-conversion-label {
    color: rgba(166, 191, 217, 0.82);
}

.home-page.home-v2-premium .home-v2-actions.home-v2-actions-final {
    grid-column: 1 / -1;
    padding-top: 0.2rem;
}

@media (max-width: 1100px) {
    .home-page.home-v2-premium .home-v2-hero,
    .home-page.home-v2-premium .home-v2-conversion {
        grid-template-columns: 1fr;
    }

    .home-page.home-v2-premium .home-v2-workflow-grid,
    .home-page.home-v2-premium .home-v2-block--full .home-v2-block-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 820px) {
    .home-page.home-v2-premium {
        gap: 1.15rem;
    }

    .home-page.home-v2-premium::before {
        inset: -1rem -0.5rem auto;
        height: 28rem;
    }

    .home-page.home-v2-premium .home-v2-copy h1 {
        max-width: 100%;
    }

    .home-page.home-v2-premium .home-v2-trust-list,
    .home-page.home-v2-premium .home-v2-hero-insights,
    .home-page.home-v2-premium .home-v2-workflow-grid,
    .home-page.home-v2-premium .home-v2-block--full .home-v2-block-list,
    .home-page.home-v2-premium .home-v2-conversion-metrics {
        grid-template-columns: 1fr;
    }

    .home-page.home-v2-premium .home-v2-preview-radar {
        width: 6.6rem;
        height: 6.6rem;
    }

    .home-page.home-v2-premium .home-v2-preview-kicker,
    .home-page.home-v2-premium .home-v2-preview-head {
        padding-right: 6.9rem;
    }

    .home-page.home-v2-premium .home-v2-actions .btn-primary,
    .home-page.home-v2-premium .home-v2-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .home-page.home-v2-premium {
        padding-top: 0.85rem;
    }

    .home-page.home-v2-premium .home-v2-hero,
    .home-page.home-v2-premium .home-v2-resume,
    .home-page.home-v2-premium .home-v2-conversion,
    .home-page.home-v2-premium .home-v2-workflow,
    .home-page.home-v2-premium .home-v2-block {
        padding: 1rem;
        border-radius: 24px;
    }

    .home-page.home-v2-premium .home-v2-search {
        min-height: 4rem;
        border-radius: 18px;
    }

    .home-page.home-v2-premium .home-v2-preview-radar {
        inset: 0.95rem 0.95rem auto auto;
        width: 5.5rem;
        height: 5.5rem;
    }

    .home-page.home-v2-premium .home-v2-preview-kicker,
    .home-page.home-v2-premium .home-v2-preview-head {
        padding-right: 5.9rem;
    }

    .home-page.home-v2-premium .home-v2-preview {
        padding: 1rem;
        border-radius: 24px;
    }

    .home-page.home-v2-premium .home-v2-preview-row,
    .home-page.home-v2-premium .home-v2-list-item,
    .home-page.home-v2-premium .home-v2-step,
    .home-page.home-v2-premium .home-v2-resume-primary,
    .home-page.home-v2-premium .home-v2-resume-side-card,
    .home-page.home-v2-premium .home-v2-resume-row,
    .home-page.home-v2-premium .home-v2-conversion-metric {
        border-radius: 18px;
    }
}

.stock-quote-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.75rem;
}

.stock-detail-header.stock-detail-header-buy {
    background:
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.1), transparent 34%),
        linear-gradient(180deg, rgba(9, 20, 29, 0.96), rgba(7, 14, 24, 0.96));
}

.stock-detail-header.stock-detail-header-sell {
    background:
        radial-gradient(circle at top right, rgba(239, 68, 68, 0.1), transparent 34%),
        linear-gradient(180deg, rgba(20, 15, 24, 0.96), rgba(8, 14, 24, 0.96));
}

.stock-detail-header.stock-detail-header-hold {
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 34%),
        linear-gradient(180deg, rgba(16, 18, 27, 0.96), rgba(8, 14, 24, 0.96));
}

.stock-identity-stack {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.stock-ticker-symbol {
    color: #7dd3fc;
    font-size: 0.86rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.stock-company-name {
    margin: 0;
    color: #f8fbff;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.stock-signal-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

.stock-quote-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.34rem;
    min-height: 32px;
    padding: 0.36rem 0.62rem;
    border-radius: 999px;
    border: 1px solid rgba(69, 110, 152, 0.28);
    background: rgba(9, 18, 33, 0.78);
    color: #e8f2ff;
}

.stock-quote-chip-label {
    color: #8ea6c3;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stock-quote-chip strong {
    color: #f8fbff;
    font-size: 0.82rem;
    font-weight: 800;
}

.stock-trader-board {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.9fr) minmax(0, 1.05fr);
    gap: 0.9rem;
    margin: 1.15rem 0 1.2rem;
}

.stock-trader-card {
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(51, 89, 127, 0.3);
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 34%),
        linear-gradient(180deg, rgba(13, 22, 38, 0.96), rgba(8, 14, 26, 0.92));
    box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.05);
}

.stock-trader-card-thesis {
    border-color: rgba(56, 189, 248, 0.24);
}

.stock-trader-head {
    display: flex;
    flex-direction: column;
    gap: 0.24rem;
    margin-bottom: 0.7rem;
}

.stock-trader-kicker {
    color: #7dd3fc;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.stock-trader-head h2 {
    margin: 0;
    color: #f8fbff;
    font-size: 1.08rem;
    line-height: 1.15;
}

.stock-trader-lede {
    margin: 0 0 0.9rem;
    color: #b4c8df;
    font-size: 0.82rem;
    line-height: 1.55;
}

.stock-timeframe-tape,
.stock-signal-ladder {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 0.9rem;
}

.stock-timeframe-card,
.stock-ladder-item {
    padding: 0.82rem 0.86rem;
    border-radius: 14px;
    border: 1px solid rgba(69, 110, 152, 0.24);
    background: rgba(255, 255, 255, 0.025);
}

.stock-ladder-item {
    display: grid;
    grid-template-rows: 2rem 4.75rem 2.25rem;
    gap: 0.56rem;
    min-height: 10.1rem;
}

.stock-timeframe-card.tone-buy,
.stock-ladder-item.tone-buy {
    border-color: rgba(16, 185, 129, 0.32);
    background: linear-gradient(180deg, rgba(10, 28, 27, 0.92), rgba(10, 18, 25, 0.9));
}

.stock-timeframe-card.tone-sell,
.stock-ladder-item.tone-sell {
    border-color: rgba(239, 68, 68, 0.28);
    background: linear-gradient(180deg, rgba(31, 18, 28, 0.92), rgba(15, 16, 25, 0.9));
}

.stock-timeframe-card.tone-hold,
.stock-ladder-item.tone-hold {
    border-color: rgba(245, 158, 11, 0.22);
    background: linear-gradient(180deg, rgba(30, 24, 19, 0.9), rgba(17, 18, 24, 0.88));
}

.stock-timeframe-label,
.stock-ladder-label {
    display: block;
    color: #8ea6c3;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stock-ladder-label {
    display: flex;
    align-items: flex-start;
    min-height: 2rem;
    line-height: 1.35;
}

.stock-timeframe-card strong,
.stock-ladder-item strong {
    display: block;
    margin-top: 0.34rem;
    color: #f8fbff;
    font-size: 0.98rem;
    line-height: 1.2;
}

.stock-ladder-item .stock-signal-stamp {
    --stamp-ink: #dbeafe;
    --stamp-surface: rgba(148, 163, 184, 0.05);
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 4.75rem;
    margin: 0;
    padding: 0.68rem 0.72rem;
    overflow: hidden;
    border: 3px double var(--stamp-ink);
    border-radius: 7px;
    background: var(--stamp-surface);
    color: var(--stamp-ink);
    font-size: 0.9rem;
    font-weight: 950;
    letter-spacing: 0.09em;
    line-height: 1.05;
    text-align: center;
    text-shadow: 0 0 12px color-mix(in srgb, var(--stamp-ink) 30%, transparent);
    text-transform: uppercase;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--stamp-ink) 18%, transparent);
    transform: none;
}

.stock-ladder-item .stock-signal-stamp::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0.3rem;
    border: 1px solid var(--stamp-ink);
    border-radius: 3px;
    opacity: 0.45;
    pointer-events: none;
}

.stock-ladder-item .stock-signal-stamp::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background: repeating-linear-gradient(
        -12deg,
        transparent 0 9px,
        color-mix(in srgb, var(--stamp-ink) 5%, transparent) 9px 10px
    );
    opacity: 0.75;
    pointer-events: none;
}

.stock-ladder-item.level-strong-buy .stock-signal-stamp {
    --stamp-ink: #6ee7b7;
    --stamp-surface: rgba(16, 185, 129, 0.08);
}

.stock-ladder-item.level-buy .stock-signal-stamp {
    --stamp-ink: #5eead4;
    --stamp-surface: rgba(45, 212, 191, 0.08);
}

.stock-ladder-item.level-weak-buy .stock-signal-stamp {
    --stamp-ink: #67e8f9;
    --stamp-surface: rgba(34, 211, 238, 0.07);
}

.stock-ladder-item.level-hold .stock-signal-stamp {
    --stamp-ink: #fbbf24;
    --stamp-surface: rgba(245, 158, 11, 0.07);
}

.stock-ladder-item.level-weak-sell .stock-signal-stamp {
    --stamp-ink: #fdba74;
    --stamp-surface: rgba(251, 146, 60, 0.07);
}

.stock-ladder-item.level-sell .stock-signal-stamp {
    --stamp-ink: #fca5a5;
    --stamp-surface: rgba(248, 113, 113, 0.07);
}

.stock-ladder-item.level-strong-sell .stock-signal-stamp {
    --stamp-ink: #fb7185;
    --stamp-surface: rgba(244, 63, 94, 0.08);
}

.stock-ladder-score {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    min-height: 2.25rem;
    padding: 0.42rem 0.55rem;
    border: 1px solid rgba(103, 141, 181, 0.22);
    border-radius: 10px;
    background: rgba(4, 11, 22, 0.32);
}

.stock-ladder-score span {
    color: #9eb3ca;
    font-size: 0.58rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.stock-ladder-score strong {
    margin: 0;
    color: #f8fbff;
    font-size: 0.86rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    line-height: 1;
}

.stock-timeframe-card small,
.stock-ladder-item small {
    display: block;
    margin-top: 0.28rem;
    color: #9eb3ca;
    font-size: 0.72rem;
    line-height: 1.3;
}

.stock-why-grid,
.stock-setup-grid {
    display: grid;
    gap: 0.7rem;
}

.stock-why-grid {
    grid-template-columns: 1fr;
}

.stock-why-item,
.stock-setup-item {
    padding: 0.8rem 0.82rem;
    border-radius: 14px;
    border: 1px solid rgba(69, 110, 152, 0.24);
    background: rgba(255, 255, 255, 0.025);
}

.stock-why-item.tone-buy,
.stock-setup-item.tone-buy {
    border-color: rgba(16, 185, 129, 0.3);
}

.stock-why-item.tone-sell,
.stock-setup-item.tone-sell {
    border-color: rgba(239, 68, 68, 0.28);
}

.stock-why-eyebrow,
.stock-setup-item span {
    display: block;
    color: #8ea6c3;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stock-why-item strong,
.stock-setup-item strong {
    display: block;
    margin-top: 0.28rem;
    color: #f8fbff;
    font-size: 0.94rem;
    line-height: 1.25;
}

.stock-why-item p,
.stock-setup-item small {
    display: block;
    margin: 0.34rem 0 0;
    color: #b4c8df;
    font-size: 0.76rem;
    line-height: 1.5;
}

.stock-setup-visual {
    --setup-position: 50%;
    --setup-start: 0%;
    --setup-width: 50%;
    display: block;
    margin-top: 0.62rem;
}

.stock-setup-track {
    position: relative;
    display: block;
    height: 0.45rem;
    overflow: hidden;
    border: 1px solid rgba(103, 141, 181, 0.24);
    border-radius: 999px;
    background: rgba(20, 34, 52, 0.98);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.28);
}

.stock-setup-fill,
.stock-setup-marker,
.stock-setup-zero {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.stock-setup-fill {
    left: 0;
    width: var(--setup-width);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.82), rgba(16, 185, 129, 0.92));
}

.stock-setup-marker {
    left: var(--setup-position);
    z-index: 2;
    width: 0.72rem;
    height: 0.72rem;
    border: 2px solid #f8fbff;
    border-radius: 999px;
    background: #38bdf8;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.16);
    transform: translate(-50%, -50%);
}

.stock-setup-zero {
    display: none;
    left: 50%;
    z-index: 1;
    width: 1px;
    height: 0.85rem;
    background: rgba(226, 232, 240, 0.52);
}

.stock-setup-visual-return .stock-setup-track {
    background: linear-gradient(90deg, rgba(248, 113, 113, 0.2), rgba(148, 163, 184, 0.12) 50%, rgba(16, 185, 129, 0.2));
}

.stock-setup-visual-return .stock-setup-fill {
    left: var(--setup-start);
    width: var(--setup-width);
}

.stock-setup-item.tone-buy .stock-setup-visual-return .stock-setup-fill {
    background: linear-gradient(90deg, rgba(45, 212, 191, 0.82), rgba(16, 185, 129, 0.96));
}

.stock-setup-item.tone-sell .stock-setup-visual-return .stock-setup-fill {
    background: linear-gradient(90deg, rgba(248, 113, 113, 0.96), rgba(251, 146, 60, 0.82));
}

.stock-setup-visual-return .stock-setup-zero {
    display: block;
}

.stock-setup-visual-range .stock-setup-track {
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.22), rgba(245, 158, 11, 0.18) 50%, rgba(16, 185, 129, 0.24));
}

.stock-setup-visual-rank .stock-setup-track {
    background: linear-gradient(90deg, rgba(248, 113, 113, 0.2), rgba(245, 158, 11, 0.18) 50%, rgba(16, 185, 129, 0.24));
}

.stock-setup-visual-risk .stock-setup-track {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.24), rgba(245, 158, 11, 0.18) 52%, rgba(248, 113, 113, 0.2));
}

.stock-setup-visual-risk .stock-setup-fill {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.8), rgba(245, 158, 11, 0.72), rgba(248, 113, 113, 0.84));
}

.stock-setup-visual-labels {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.28rem;
    color: #8ea6c3;
    font-size: 0.58rem;
    font-weight: 750;
    line-height: 1.2;
    white-space: nowrap;
}

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

.stock-peer-board {
    overflow: hidden;
}

.stock-summary-item:not(.stock-summary-item-score) strong {
    font-size: 1.1rem;
}

.stock-summary-item:not(.stock-summary-item-score) small {
    margin-top: 0.08rem;
    color: #9eb3ca;
}

.stock-peer-table {
    display: grid;
    gap: 0.42rem;
}

.stock-peer-table-head,
.stock-peer-row {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(84px, 0.72fr) minmax(72px, 0.55fr) minmax(72px, 0.55fr);
    align-items: center;
    gap: 0.6rem;
}

.stock-peer-table-head {
    padding: 0 0.2rem 0.3rem;
    color: #8ea6c3;
    font-size: 0.63rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stock-peer-row {
    padding: 0.7rem 0.75rem;
    border-radius: 14px;
    border: 1px solid rgba(69, 110, 152, 0.22);
    background: rgba(255, 255, 255, 0.02);
}

.stock-peer-row.is-current {
    border-color: rgba(56, 189, 248, 0.3);
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 40%),
        rgba(255, 255, 255, 0.03);
}

.stock-peer-identity {
    min-width: 0;
}

.stock-peer-identity strong {
    display: block;
    color: #f8fbff;
    font-size: 0.88rem;
    line-height: 1.2;
}

.stock-peer-identity small {
    display: block;
    margin-top: 0.16rem;
    color: #9eb3ca;
    font-size: 0.72rem;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stock-peer-score,
.stock-peer-change {
    color: #f8fbff;
    font-size: 0.82rem;
    font-weight: 800;
}

.stock-peer-change.buy {
    color: #86efac;
}

.stock-peer-change.sell {
    color: #fda4af;
}

@media (max-width: 1180px) {
    .stock-trader-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stock-peer-board {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .stock-trader-board,
    .stock-setup-grid,
    .stock-timeframe-tape,
    .stock-signal-ladder {
        grid-template-columns: 1fr;
    }

    .stock-peer-table-head {
        display: none;
    }

    .stock-peer-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "identity signal"
            "score change";
        gap: 0.35rem 0.7rem;
    }

    .stock-peer-row > :nth-child(1) {
        grid-area: identity;
    }

    .stock-peer-row > :nth-child(2) {
        grid-area: signal;
        justify-self: end;
    }

    .stock-peer-row > :nth-child(3) {
        grid-area: score;
    }

    .stock-peer-row > :nth-child(4) {
        grid-area: change;
        justify-self: end;
    }
}

/* Public portfolio refinement: centered stat cards + local social navigation */
.public-portfolio-page .top-stats-primary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
}

.public-portfolio-page .eval-panel,
.public-portfolio-page .value-panel {
    align-items: center;
    justify-content: center;
    text-align: center !important;
    min-height: 184px;
}

.public-portfolio-page .eval-panel p,
.public-portfolio-page .value-panel p,
.public-portfolio-page .value-meta-note {
    text-align: center;
}

.public-social-rail {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.72fr);
    gap: 1rem;
    margin: 0 0 1rem;
    padding: 0.95rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(56, 189, 248, 0.12);
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 38%),
        linear-gradient(180deg, rgba(10, 18, 31, 0.9), rgba(8, 15, 27, 0.95));
    box-shadow: 0 14px 34px rgba(2, 6, 23, 0.22);
}

.public-social-rail-main,
.public-social-rail-stats,
.public-social-peer-strip {
    position: relative;
    z-index: 1;
}

.public-social-rail-kicker {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.62rem;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.22);
    background: rgba(8, 15, 27, 0.72);
    color: #8ecbff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.public-social-rail h2 {
    margin: 0.75rem 0 0.35rem;
    font-size: clamp(1.18rem, 1.8vw, 1.42rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.public-social-rail p {
    margin: 0;
    max-width: 46rem;
    color: rgba(192, 208, 228, 0.8);
    font-size: 0.94rem;
}

.public-social-rail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.public-social-rail-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    align-content: start;
}

.public-social-rail-stat {
    min-width: 0;
    padding: 0.8rem 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(51, 89, 127, 0.18);
    background: rgba(255, 255, 255, 0.025);
    text-align: center;
}

.public-social-rail-stat-label {
    display: block;
    margin-bottom: 0.42rem;
    color: #8ca7ca;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.public-social-rail-stat-value {
    display: block;
    font-size: clamp(1.08rem, 1.8vw, 1.55rem);
    line-height: 1;
    color: var(--text-primary);
}

.public-social-peer-strip {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.public-social-peer-card {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    min-width: 0;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(51, 89, 127, 0.24);
    background: rgba(255, 255, 255, 0.025);
    color: inherit;
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.public-social-peer-card:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.3);
    background: rgba(56, 189, 248, 0.05);
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.22);
}

.public-social-peer-name {
    color: var(--text-primary);
    font-size: 0.98rem;
    font-weight: 750;
    letter-spacing: -0.02em;
}

.public-social-peer-owner,
.public-social-peer-meta {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

@media (max-width: 900px) {
    .public-social-rail {
        grid-template-columns: minmax(0, 1fr);
        padding: 1rem;
    }

    .public-social-rail-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .public-portfolio-page .eval-panel,
    .public-portfolio-page .value-panel {
        min-height: 152px;
    }
}

@media (max-width: 640px) {
    .public-social-rail-stats,
    .public-portfolio-page .top-stats-primary,
    .public-social-peer-strip {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Model portfolios mobile width hard-fix */
.model-portfolio-page {
    max-width: 100%;
    overflow-x: clip;
}

@media (max-width: 760px) {
    :root {
        --ak-mobile-gutter-left: max(0.78rem, env(safe-area-inset-left));
        --ak-mobile-gutter-right: max(0.78rem, env(safe-area-inset-right));
        --ak-mobile-panel-padding: 0.92rem;
    }

    .model-portfolio-page > .container {
        width: auto !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: var(--ak-mobile-gutter-left) !important;
        padding-right: var(--ak-mobile-gutter-right) !important;
        box-sizing: border-box !important;
    }

    .model-portfolio-page .directory-header,
    .model-portfolio-page .model-portfolio-hero-grid,
    .model-portfolio-page .model-portfolio-action-rail,
    .model-portfolio-page .model-portfolio-grid,
    .model-portfolio-page .model-portfolio-hero-main,
    .model-portfolio-page .model-portfolio-hero-side,
    .model-portfolio-page .top-stats-primary,
    .model-portfolio-page .model-portfolio-panel,
    .model-portfolio-page .model-portfolio-action-card,
    .model-portfolio-page .model-portfolio-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .model-portfolio-page .directory-header,
    .model-portfolio-page .model-portfolio-hero-grid,
    .model-portfolio-page .model-portfolio-action-rail,
    .model-portfolio-page .model-portfolio-grid {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .model-portfolio-page .directory-header p,
    .model-portfolio-page .model-portfolio-panel-note,
    .model-portfolio-page .model-portfolio-action-card p,
    .model-portfolio-page .model-portfolio-card-text,
    .model-portfolio-page .model-portfolio-card-meta,
    .model-portfolio-page .model-portfolio-card-performance-note,
    .model-portfolio-page .model-portfolio-mini-chart-legend,
    .model-portfolio-page .model-portfolio-card-footer {
        max-width: 100% !important;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

/* Market mobile width hard-fix */
.market-directory-page .market-intent-strip,
.market-directory-page .market-intent-grid,
.market-directory-page .market-intent-card,
.market-directory-page .market-intent-actions {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.market-directory-page .market-intent-grid {
    width: 100% !important;
}

.market-directory-page .market-intent-card {
    width: auto !important;
    justify-self: stretch !important;
}

.market-directory-page .market-intent-card h2,
.market-directory-page .market-intent-card p {
    max-width: 100% !important;
}

@media (max-width: 760px) {
    .market-directory-page .market-intent-strip {
        padding-right: 1rem !important;
        padding-left: 1rem !important;
    }

    .market-directory-page .market-intent-grid,
    .market-directory-page .market-intent-actions {
        width: 100% !important;
        padding-right: 1rem !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 760px) {
    .main-footer .container {
        width: auto !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: var(--ak-mobile-gutter-left) !important;
        padding-right: var(--ak-mobile-gutter-right) !important;
        box-sizing: border-box !important;
    }

    .footer-grid,
    .disclaimer-box,
    .footer-bottom,
    .f-col {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .f-col,
    .disclaimer-box {
        padding: 0.95rem 1rem !important;
    }

    .f-col p,
    .f-col a,
    .disclaimer-box,
    .footer-bottom {
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

/* Social mobile width hard-fix */
.social-page {
    max-width: 100%;
    overflow-x: clip;
}

@media (max-width: 760px) {
    .social-page {
        gap: 1rem !important;
    }

    .social-page.container {
        width: auto !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: var(--ak-mobile-gutter-left) !important;
        padding-right: var(--ak-mobile-gutter-right) !important;
        box-sizing: border-box !important;
    }

    .social-page .social-hero-premium,
    .social-page .social-directory-shell {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }

    .social-page .social-hero-premium,
    .social-page .social-directory-shell,
    .social-page .social-hero-copy,
    .social-page .social-hero-spotlight,
    .social-page .social-overview-strip,
    .social-page .social-overview-card,
    .social-page .social-directory-header,
    .social-page .social-table-container,
    .social-page .social-empty-state {
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .social-page .social-table-container,
    .social-page .social-empty-state {
        width: 100% !important;
    }

    .social-page .social-hero-premium,
    .social-page .social-directory-shell {
        padding: var(--ak-mobile-panel-padding) !important;
        border-radius: 24px !important;
    }

    .social-page .social-hero-spotlight,
    .social-page .social-table-container,
    .social-page .social-empty-state,
    .social-page .social-overview-card {
        border-radius: 20px !important;
    }

    .social-page .social-hero-premium h1,
    .social-page .social-directory-header h2,
    .social-page .social-hero-premium .subtitle,
    .social-page .social-directory-header .subtitle,
    .social-page .social-hero-note,
    .social-page .social-hero-spotlight-copy,
    .social-page .social-hero-spotlight-owner,
    .social-page .social-empty-state p {
        max-width: 100% !important;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .social-page .social-hero-spotlight-actions .btn-primary,
    .social-page .social-hero-spotlight-actions .btn-secondary,
    .social-page .social-guest-cta .btn-primary,
    .social-page .social-guest-cta .btn-secondary {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* Market mobile inset normalization */
.market-directory-page {
    max-width: 100%;
    overflow-x: clip;
}

@media (max-width: 760px) {
    .market-directory-page {
        gap: 1rem !important;
    }

    .market-directory-page.container {
        width: auto !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: var(--ak-mobile-gutter-left) !important;
        padding-right: var(--ak-mobile-gutter-right) !important;
        box-sizing: border-box !important;
    }

    .market-directory-page .market-hero-premium,
    .market-directory-page .market-intent-strip,
    .market-directory-page .market-board-shell {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: var(--ak-mobile-panel-padding) !important;
        border-radius: 24px !important;
        box-sizing: border-box !important;
    }

    .market-directory-page .market-hero-copy,
    .market-directory-page .market-spotlight-card,
    .market-directory-page .market-search-shell,
    .market-directory-page .market-hero-stats,
    .market-directory-page .market-hero-stat,
    .market-directory-page .market-intent-grid,
    .market-directory-page .market-intent-card,
    .market-directory-page .market-intent-actions,
    .market-directory-page .market-board-head,
    .market-directory-page .market-board-table-container,
    .market-directory-page .table-container.market-board-table-container {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .market-directory-page .market-spotlight-card,
    .market-directory-page .market-board-table-container {
        border-radius: 20px !important;
    }

    .market-directory-page .market-hero-premium h1,
    .market-directory-page .market-hero-premium .subtitle,
    .market-directory-page .market-hero-note,
    .market-directory-page .market-spotlight-copy h2,
    .market-directory-page .market-spotlight-title,
    .market-directory-page .market-spotlight-body,
    .market-directory-page .market-board-head p,
    .market-directory-page .market-intent-card h2,
    .market-directory-page .market-intent-card p {
        max-width: 100% !important;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .market-directory-page .market-intent-actions > *,
    .market-directory-page .market-spotlight-actions .btn-primary,
    .market-directory-page .market-spotlight-actions .btn-secondary {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* Market premium late overrides */
.market-directory-page {
    position: relative;
    display: grid;
    gap: 1.25rem;
    padding-top: 1rem;
}

.market-directory-page .market-hero-premium,
.market-directory-page .market-board-shell,
.market-directory-page .market-intent-strip {
    border-radius: 30px;
    border: 1px solid rgba(82, 134, 214, 0.18);
    background: linear-gradient(180deg, rgba(13, 22, 38, 0.96) 0%, rgba(8, 16, 29, 0.98) 100%);
    box-shadow: 0 28px 72px rgba(3, 9, 19, 0.34);
}

.market-directory-page .market-hero-premium {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
    gap: 1.25rem;
    padding: 1.45rem;
}

.market-directory-page .market-board-shell {
    padding: 1.1rem;
}

.market-directory-page .market-board-table-container.table-container {
    margin: 0;
    border-radius: 24px;
    border: 1px solid rgba(84, 137, 208, 0.16);
    background: linear-gradient(180deg, rgba(11, 21, 36, 0.96), rgba(7, 14, 26, 0.98));
}

.market-directory-page .market-search-shell .market-search {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.market-directory-page .market-board-shell .market-table thead th {
    background: rgba(13, 24, 40, 0.9);
}

@media (max-width: 1120px) {
    .market-directory-page .market-hero-premium {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .market-directory-page .market-hero-premium,
    .market-directory-page .market-intent-strip,
    .market-directory-page .market-board-shell {
        padding: 1rem;
        border-radius: 24px;
    }
}

.market-directory-page .market-intent-strip,
.market-directory-page .market-intent-grid,
.market-directory-page .market-intent-card,
.market-directory-page .market-intent-actions,
.market-directory-page .market-intent-actions > * {
    min-width: 0;
    box-sizing: border-box;
}

.market-directory-page .market-intent-card {
    width: 100%;
}

.market-directory-page .market-intent-card h2,
.market-directory-page .market-intent-card p {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 760px) {
    .market-directory-page .market-intent-actions > * {
        width: 100%;
    }
}

.market-directory-page {
    --market-premium-border: rgba(82, 134, 214, 0.18);
    --market-premium-surface: linear-gradient(180deg, rgba(13, 22, 38, 0.96) 0%, rgba(8, 16, 29, 0.98) 100%);
    --market-premium-glow: rgba(64, 185, 255, 0.18);
    position: relative;
    display: grid;
    gap: 1.25rem;
    padding-top: 1rem;
    max-width: 100%;
    overflow-x: clip;
}

.market-directory-page::before {
    content: "";
    position: absolute;
    inset: -2rem -6vw auto;
    height: 28rem;
    background:
        radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.18), transparent 38%),
        radial-gradient(circle at 80% 16%, rgba(16, 185, 129, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(18, 33, 55, 0.36), rgba(18, 33, 55, 0));
    pointer-events: none;
    z-index: -1;
    filter: blur(10px);
}

.market-directory-page .market-hero-premium,
.market-directory-page .market-board-shell,
.market-directory-page .market-intent-strip {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--market-premium-border);
    border-radius: 30px;
    background: var(--market-premium-surface);
    box-shadow: 0 28px 72px rgba(3, 9, 19, 0.34);
}

.market-directory-page .market-hero-premium {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
    gap: 1.25rem;
    padding: 1.45rem;
}

.market-directory-page .market-hero-premium::before,
.market-directory-page .market-board-shell::before,
.market-directory-page .market-intent-strip::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 28%, transparent 72%, rgba(255, 255, 255, 0.05)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 20%);
    pointer-events: none;
}

.market-directory-page .market-hero-copy,
.market-directory-page .market-spotlight-card,
.market-directory-page .market-board-head {
    position: relative;
    z-index: 1;
}

.market-directory-page .market-hero-kicker,
.market-directory-page .market-board-kicker,
.market-directory-page .market-spotlight-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(87, 153, 255, 0.24);
    background: rgba(15, 29, 50, 0.78);
    color: #8fc7ff;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.market-directory-page .market-hero-kicker::before,
.market-directory-page .market-board-kicker::before,
.market-directory-page .market-spotlight-kicker::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: #32d4ff;
    box-shadow: 0 0 16px rgba(50, 212, 255, 0.8);
}

.market-directory-page .market-hero-premium h1 {
    margin: 0.9rem 0 0;
    font-size: clamp(2.3rem, 5vw, 4.35rem);
    line-height: 0.92;
    letter-spacing: -0.055em;
    max-width: 10ch;
}

.market-directory-page .market-hero-premium .subtitle {
    max-width: 44rem;
    margin: 1rem 0 0;
    font-size: 1.08rem;
    line-height: 1.75;
    color: rgba(223, 232, 246, 0.92);
}

.market-directory-page .market-hero-note {
    max-width: 43rem;
    margin: 1rem 0 0;
    color: rgba(174, 193, 217, 0.88);
    font-size: 0.98rem;
    line-height: 1.7;
}

.market-directory-page .market-search-shell {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 1.35rem;
    padding: 0.9rem 1.05rem;
    border: 1px solid rgba(86, 147, 227, 0.2);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(17, 32, 54, 0.92), rgba(10, 22, 39, 0.96)),
        radial-gradient(circle at 0% 50%, rgba(55, 131, 255, 0.16), transparent 42%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 36px rgba(5, 12, 24, 0.28);
}

.market-directory-page .market-search-icon {
    display: inline-flex;
    width: 1.1rem;
    height: 1.1rem;
    color: rgba(161, 192, 235, 0.82);
    flex: 0 0 auto;
}

.market-directory-page .market-search-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.market-directory-page .market-search-shell .market-search {
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.market-directory-page .market-search-shell:focus-within {
    border-color: rgba(105, 174, 255, 0.4);
    box-shadow: 0 0 0 1px rgba(105, 174, 255, 0.2), 0 20px 40px rgba(7, 16, 30, 0.36);
}

.market-directory-page .market-hero-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1.15rem;
}

.market-directory-page .market-hero-stat {
    padding: 1rem 1.05rem;
    border-radius: 22px;
    border: 1px solid rgba(79, 126, 199, 0.18);
    background: linear-gradient(180deg, rgba(17, 30, 50, 0.88), rgba(10, 19, 34, 0.9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.market-directory-page .market-hero-stat-label {
    display: block;
    color: rgba(150, 175, 205, 0.92);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.market-directory-page .market-hero-stat-value {
    display: block;
    margin-top: 0.52rem;
    font-size: 1.95rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.05em;
    color: #f5f9ff;
}

.market-directory-page .market-hero-stat-meta {
    display: block;
    margin-top: 0.45rem;
    color: rgba(169, 188, 214, 0.86);
}

.market-directory-page .market-spotlight-card {
    display: grid;
    gap: 1rem;
    align-content: space-between;
    min-height: 100%;
    padding: 1.25rem;
    border-radius: 28px;
    border: 1px solid rgba(92, 151, 236, 0.18);
    background:
        radial-gradient(circle at 76% 18%, rgba(69, 162, 255, 0.18), transparent 30%),
        linear-gradient(180deg, rgba(15, 28, 48, 0.96), rgba(8, 17, 31, 0.98));
}

.market-directory-page .market-spotlight-visual {
    position: relative;
    min-height: 12rem;
    border-radius: 24px;
    border: 1px solid rgba(86, 152, 231, 0.14);
    background:
        linear-gradient(180deg, rgba(13, 24, 42, 0.96), rgba(8, 16, 29, 0.98)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 56px),
        repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 44px);
    overflow: hidden;
}

.market-directory-page .market-spotlight-beam,
.market-directory-page .market-spotlight-core,
.market-directory-page .market-spotlight-orbit,
.market-directory-page .market-spotlight-dot {
    position: absolute;
}

.market-directory-page .market-spotlight-beam {
    inset: 18% auto auto -8%;
    width: 88%;
    height: 38%;
    background: linear-gradient(90deg, transparent, rgba(66, 180, 255, 0.16), rgba(66, 180, 255, 0.34), transparent);
    transform: skewX(-28deg);
    filter: blur(2px);
    animation: marketSpotlightSweep 8s ease-in-out infinite;
}

.market-directory-page .market-spotlight-core {
    inset: 50% auto auto 50%;
    width: 5.5rem;
    height: 5.5rem;
    margin: -2.75rem 0 0 -2.75rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(131, 220, 255, 0.95) 0%, rgba(61, 183, 255, 0.54) 35%, rgba(61, 183, 255, 0) 72%);
    box-shadow: 0 0 44px rgba(60, 191, 255, 0.34);
    animation: marketCorePulse 4.8s ease-in-out infinite;
}

.market-directory-page .market-spotlight-orbit {
    inset: 50% auto auto 50%;
    border-radius: 50%;
    border: 1px solid rgba(122, 188, 255, 0.18);
    transform: translate(-50%, -50%);
}

.market-directory-page .market-spotlight-orbit-a {
    width: 7.75rem;
    height: 7.75rem;
}

.market-directory-page .market-spotlight-orbit-b {
    width: 11.25rem;
    height: 11.25rem;
    animation: marketOrbitRotate 14s linear infinite;
}

.market-directory-page .market-spotlight-dot {
    width: 0.72rem;
    height: 0.72rem;
    border-radius: 50%;
    background: #7ddbff;
    box-shadow: 0 0 16px rgba(125, 219, 255, 0.9);
}

.market-directory-page .market-spotlight-dot-a { top: 20%; left: 18%; animation: marketDotFloat 5.2s ease-in-out infinite; }
.market-directory-page .market-spotlight-dot-b { right: 16%; top: 28%; animation: marketDotFloat 6.2s ease-in-out infinite 0.5s; }
.market-directory-page .market-spotlight-dot-c { left: 50%; bottom: 18%; animation: marketDotFloat 5.6s ease-in-out infinite 0.9s; }

.market-directory-page .market-spotlight-copy h2 {
    margin: 0.85rem 0 0;
    font-size: clamp(1.9rem, 4vw, 2.85rem);
    line-height: 0.95;
    letter-spacing: -0.05em;
}

.market-directory-page .market-spotlight-title {
    margin: 0.35rem 0 0;
    color: rgba(232, 241, 251, 0.92);
    font-size: 1rem;
}

.market-directory-page .market-spotlight-body {
    margin: 0.85rem 0 0;
    color: rgba(177, 197, 223, 0.86);
    line-height: 1.68;
}

.market-directory-page .market-spotlight-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.market-directory-page .market-spotlight-chip {
    display: inline-flex;
    align-items: center;
    min-height: 2.45rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(96, 150, 221, 0.18);
    background: rgba(14, 26, 44, 0.78);
    color: rgba(227, 237, 248, 0.94);
    font-size: 0.88rem;
    font-weight: 700;
}

.market-directory-page .market-spotlight-chip-signal.buy {
    color: #68f5c0;
    border-color: rgba(57, 211, 152, 0.24);
    background: rgba(8, 60, 54, 0.42);
}

.market-directory-page .market-spotlight-chip-signal.sell {
    color: #ff9797;
    border-color: rgba(235, 97, 97, 0.24);
    background: rgba(73, 23, 23, 0.38);
}

.market-directory-page .market-spotlight-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.05rem;
}

.market-directory-page .market-spotlight-actions .btn-primary,
.market-directory-page .market-spotlight-actions .btn-secondary {
    min-width: 10rem;
    justify-content: center;
}

.market-directory-page .market-intent-strip {
    padding: 1.1rem;
}

.market-directory-page .market-board-shell {
    padding: 1.1rem;
}

.market-directory-page .market-board-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.95rem;
}

.market-directory-page .market-board-head h2 {
    margin: 0.8rem 0 0;
    font-size: clamp(1.65rem, 3vw, 2.5rem);
    letter-spacing: -0.045em;
}

.market-directory-page .market-board-head p {
    max-width: 34rem;
    margin: 0;
    color: rgba(179, 198, 222, 0.84);
    line-height: 1.65;
}

.market-directory-page .market-read-guide {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 0 0 1rem;
    padding: 0.85rem 0;
    border-top: 1px solid rgba(129, 174, 223, 0.14);
    border-bottom: 1px solid rgba(129, 174, 223, 0.14);
}

.market-directory-page .market-read-guide-item {
    display: grid;
    gap: 0.25rem;
    padding: 0 1rem;
    border-left: 1px solid rgba(129, 174, 223, 0.12);
}

.market-directory-page .market-read-guide-item:first-child {
    border-left: 0;
    padding-left: 0;
}

.market-directory-page .market-read-guide-item span {
    color: rgba(139, 209, 255, 0.92);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.market-directory-page .market-read-guide-item strong {
    color: #f5f8ff;
    font-size: 0.98rem;
}

.market-directory-page .market-read-guide-item small {
    color: rgba(179, 198, 222, 0.8);
    font-size: 0.82rem;
    line-height: 1.5;
}

.market-directory-page .market-board-table-container {
    margin: 0;
    border-radius: 24px;
    border: 1px solid rgba(84, 137, 208, 0.16);
    background: linear-gradient(180deg, rgba(11, 21, 36, 0.96), rgba(7, 14, 26, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.market-directory-page .market-board-shell .market-table thead th {
    background: rgba(13, 24, 40, 0.9);
}

.market-directory-page .market-board-shell .market-table tbody tr {
    transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.market-directory-page .market-board-shell .market-table tbody tr:hover {
    transform: translateY(-1px);
    background: rgba(20, 34, 56, 0.86);
}

.market-directory-page .market-board-shell .market-table td.ticker-cell strong,
.market-directory-page .market-board-shell .market-table td.name-cell .company-name {
    color: #f5f9ff;
}

.market-directory-page .market-board-shell .market-table td.name-cell .company-name {
    font-weight: 600;
}

.market-directory-page .market-board-shell .table-cta a {
    border-radius: 999px;
}

@keyframes marketSpotlightSweep {
    0%, 100% { transform: translateX(-8%) skewX(-28deg); opacity: 0.2; }
    50% { transform: translateX(28%) skewX(-28deg); opacity: 0.92; }
}

@keyframes marketCorePulse {
    0%, 100% { transform: scale(0.92); opacity: 0.72; }
    50% { transform: scale(1.08); opacity: 1; }
}

@keyframes marketOrbitRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes marketDotFloat {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(-10px); opacity: 1; }
}

@media (max-width: 1120px) {
    .market-directory-page .market-hero-premium {
        grid-template-columns: 1fr;
    }

    .market-directory-page .market-hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .market-directory-page .market-board-head {
        align-items: start;
        flex-direction: column;
    }
}

@media (max-width: 760px) {
    .market-directory-page .market-hero-premium,
    .market-directory-page .market-intent-strip,
    .market-directory-page .market-board-shell {
        padding: 1rem;
        border-radius: 24px;
    }

    .market-directory-page .market-intent-strip,
    .market-directory-page .market-board-shell {
        width: calc(100% - 2rem) !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .market-directory-page::before {
        inset: -1rem 0 auto;
    }

    .market-directory-page .market-hero-stats {
        grid-template-columns: 1fr;
    }

    .market-directory-page .market-search-shell {
        padding: 0.8rem 0.95rem;
        border-radius: 18px;
    }

    .market-directory-page .market-read-guide {
        grid-template-columns: 1fr;
        padding: 0.25rem 0;
    }

    .market-directory-page .market-read-guide-item {
        padding: 0.75rem 0;
        border-top: 1px solid rgba(129, 174, 223, 0.12);
        border-left: 0;
    }

    .market-directory-page .market-read-guide-item:first-child {
        border-top: 0;
        padding-left: 0;
    }

    .market-directory-page .market-spotlight-card {
        padding: 1rem;
        border-radius: 22px;
    }

    .market-directory-page .market-spotlight-visual {
        min-height: 10rem;
        border-radius: 20px;
    }

    .market-directory-page .market-spotlight-actions .btn-primary,
    .market-directory-page .market-spotlight-actions .btn-secondary {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .market-directory-page .market-spotlight-beam,
    .market-directory-page .market-spotlight-core,
    .market-directory-page .market-spotlight-orbit-b,
    .market-directory-page .market-spotlight-dot {
        animation: none;
    }
}

.home-page.home-v2-premium .home-v2-evaluator {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 1.35rem;
    padding: 1.5rem;
    border: 1px solid rgba(129, 174, 223, 0.16);
    border-radius: 30px;
    background:
        radial-gradient(circle at 12% 16%, rgba(84, 194, 255, 0.15), transparent 34%),
        radial-gradient(circle at 86% 24%, rgba(31, 115, 218, 0.18), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 58%),
        rgba(7, 14, 28, 0.86);
    box-shadow: 0 34px 90px rgba(2, 7, 18, 0.42);
    animation: homePremiumReveal 0.85s ease both;
    animation-delay: 0.18s;
}

.home-page.home-v2-premium .home-v2-evaluator::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, transparent 0%, rgba(132, 199, 255, 0.1) 48%, transparent 70%);
    opacity: 0.8;
    transform: translateX(-28%);
    animation: homePremiumEvaluatorBeam 10s linear infinite;
    pointer-events: none;
}

.home-page.home-v2-premium .home-v2-evaluator::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.home-page.home-v2-premium .home-v2-evaluator-head,
.home-page.home-v2-premium .home-v2-evaluator-grid {
    position: relative;
    z-index: 1;
}

.home-page.home-v2-premium .home-v2-section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: fit-content;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(123, 174, 222, 0.22);
    background: rgba(10, 19, 36, 0.7);
    color: #8dd5ff;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.home-page.home-v2-premium .home-v2-evaluator-head h2 {
    margin: 0.7rem 0 0.55rem;
    max-width: 14ch;
    color: #f4fbff;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.home-page.home-v2-premium .home-v2-evaluator-head p {
    max-width: 48rem;
    margin: 0;
    color: rgba(185, 208, 231, 0.84);
    font-size: 1.02rem;
    line-height: 1.7;
}

.home-page.home-v2-premium .home-v2-evaluator-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.home-page.home-v2-premium .home-v2-evaluator-spotlight,
.home-page.home-v2-premium .home-v2-evaluator-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(125, 173, 220, 0.16);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 62%),
        rgba(8, 15, 29, 0.78);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.home-page.home-v2-premium .home-v2-evaluator-spotlight {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 1.2rem;
    padding: 1.35rem;
    border-radius: 26px;
}

.home-page.home-v2-premium .home-v2-evaluator-spotlight::before,
.home-page.home-v2-premium .home-v2-evaluator-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(123, 218, 255, 0.75), rgba(123, 218, 255, 0));
    opacity: 0.9;
}

.home-page.home-v2-premium .home-v2-evaluator-signal {
    position: relative;
    width: 128px;
    aspect-ratio: 1;
    margin: auto 0;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(132, 214, 255, 0.22), rgba(10, 20, 38, 0.18) 46%, transparent 68%);
    filter: drop-shadow(0 0 28px rgba(74, 179, 255, 0.2));
}

.home-page.home-v2-premium .home-v2-evaluator-signal-ring,
.home-page.home-v2-premium .home-v2-evaluator-signal-core,
.home-page.home-v2-premium .home-v2-evaluator-signal-beam {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.home-page.home-v2-premium .home-v2-evaluator-signal-ring {
    border: 1px solid rgba(123, 204, 255, 0.18);
}

.home-page.home-v2-premium .home-v2-evaluator-signal-ring--inner {
    inset: 18%;
    border-color: rgba(123, 204, 255, 0.28);
}

.home-page.home-v2-premium .home-v2-evaluator-signal-core {
    inset: 37%;
    background: radial-gradient(circle, #8fe4ff 0%, #2e9cff 52%, rgba(46, 156, 255, 0.04) 100%);
    box-shadow:
        0 0 0 10px rgba(92, 198, 255, 0.06),
        0 0 26px rgba(92, 198, 255, 0.44);
    animation: homePremiumEvaluatorPulse 4.2s ease-in-out infinite;
}

.home-page.home-v2-premium .home-v2-evaluator-signal-beam {
    inset: 6%;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(124, 219, 255, 0.55) 42deg, transparent 84deg);
    mask: radial-gradient(circle, transparent 0 42%, #000 43% 100%);
    animation: homePremiumRadarSpin 7.5s linear infinite;
}

.home-page.home-v2-premium .home-v2-evaluator-copy {
    display: grid;
    gap: 0.75rem;
    align-content: center;
}

.home-page.home-v2-premium .home-v2-evaluator-copy h3,
.home-page.home-v2-premium .home-v2-evaluator-card h3 {
    margin: 0;
    color: #f7fbff;
    letter-spacing: -0.03em;
}

.home-page.home-v2-premium .home-v2-evaluator-copy h3 {
    font-size: clamp(1.3rem, 2.2vw, 1.9rem);
    line-height: 1.12;
}

.home-page.home-v2-premium .home-v2-evaluator-copy p,
.home-page.home-v2-premium .home-v2-evaluator-card p {
    margin: 0;
    color: rgba(177, 201, 224, 0.84);
    line-height: 1.68;
}

.home-page.home-v2-premium .home-v2-evaluator-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.1rem;
}

.home-page.home-v2-premium .home-v2-evaluator-badges .detail-chip {
    background: rgba(10, 21, 39, 0.78);
    border-color: rgba(132, 186, 232, 0.18);
    color: #dff4ff;
}

.home-page.home-v2-premium .home-v2-evaluator-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.home-page.home-v2-premium .home-v2-evaluator-card {
    min-height: 190px;
    padding: 1.15rem 1.1rem;
    border-radius: 24px;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.home-page.home-v2-premium .home-v2-evaluator-card:hover {
    transform: translateY(-4px);
    border-color: rgba(132, 201, 255, 0.28);
    box-shadow: 0 18px 46px rgba(1, 8, 20, 0.32);
}

.home-page.home-v2-premium .home-v2-evaluator-card-index {
    display: inline-flex;
    margin-bottom: 0.95rem;
    color: #7fd7ff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.home-page.home-v2-premium .home-v2-evaluator-card h3 {
    font-size: 1.08rem;
    line-height: 1.2;
    margin-bottom: 0.55rem;
}

@keyframes homePremiumEvaluatorBeam {
    0% {
        transform: translateX(-28%);
    }
    100% {
        transform: translateX(118%);
    }
}

@keyframes homePremiumEvaluatorPulse {
    0%,
    100% {
        transform: scale(0.96);
        box-shadow:
            0 0 0 10px rgba(92, 198, 255, 0.06),
            0 0 26px rgba(92, 198, 255, 0.34);
    }
    50% {
        transform: scale(1.04);
        box-shadow:
            0 0 0 16px rgba(92, 198, 255, 0.08),
            0 0 34px rgba(92, 198, 255, 0.5);
    }
}

@keyframes homePremiumEvaluatorFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@media (max-width: 1100px) {
    .home-page.home-v2-premium .home-v2-evaluator-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .home-page.home-v2-premium .home-v2-evaluator-spotlight {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .home-page.home-v2-premium .home-v2-evaluator-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .home-page.home-v2-premium .home-v2-evaluator {
        padding: 1rem;
        border-radius: 24px;
    }

    .home-page.home-v2-premium .home-v2-evaluator-spotlight,
    .home-page.home-v2-premium .home-v2-evaluator-card {
        border-radius: 18px;
    }

    .home-page.home-v2-premium .home-v2-evaluator-signal {
        width: 104px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-page.home-v2-premium .home-v2-evaluator,
    .home-page.home-v2-premium .home-v2-evaluator::before,
    .home-page.home-v2-premium .home-v2-evaluator-card,
    .home-page.home-v2-premium .home-v2-evaluator-signal-core,
    .home-page.home-v2-premium .home-v2-evaluator-signal-beam {
        animation: none !important;
    }
}

.home-page.home-v2-premium .home-v2-demo {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 1.35rem;
    padding: clamp(1.25rem, 2.5vw, 1.9rem);
    border: 1px solid rgba(127, 168, 214, 0.16);
    border-radius: 30px;
    background:
        radial-gradient(circle at 10% 18%, rgba(88, 212, 255, 0.14), transparent 28%),
        radial-gradient(circle at 88% 14%, rgba(94, 234, 212, 0.1), transparent 22%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 60%),
        rgba(6, 12, 24, 0.88);
    box-shadow:
        0 32px 70px rgba(2, 6, 23, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    animation: homePremiumReveal 0.85s ease both;
    animation-delay: 0.14s;
}

.home-page.home-v2-premium .home-v2-demo::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, transparent 0%, rgba(127, 221, 255, 0.08) 46%, transparent 68%);
    transform: translateX(-34%);
    animation: homePremiumEvaluatorBeam 12s linear infinite;
    pointer-events: none;
}

.home-page.home-v2-premium .home-v2-demo-head,
.home-page.home-v2-premium .home-v2-demo-grid {
    position: relative;
    z-index: 1;
}

.home-page.home-v2-premium .home-v2-demo-head {
    display: grid;
    gap: 0.7rem;
}

.home-page.home-v2-premium .home-v2-demo-head h2 {
    margin: 0;
    max-width: 15ch;
    color: #f4fbff;
    font-size: clamp(2rem, 3.8vw, 3.2rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.home-page.home-v2-premium .home-v2-demo-head p {
    max-width: 52rem;
    margin: 0;
    color: rgba(178, 202, 227, 0.84);
    line-height: 1.7;
}

.home-page.home-v2-premium .home-v2-demo-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 1rem;
}

.home-page.home-v2-premium .home-v2-demo-actions {
    position: relative;
    z-index: 1;
    padding-top: 0.2rem;
}

.home-page.home-v2-premium .home-v2-demo-audit,
.home-page.home-v2-premium .home-v2-demo-compare {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid rgba(125, 169, 216, 0.16);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 58%),
        rgba(8, 15, 29, 0.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.home-page.home-v2-premium .home-v2-demo-audit::before,
.home-page.home-v2-premium .home-v2-demo-compare::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(123, 218, 255, 0.78), rgba(123, 218, 255, 0));
    opacity: 0.8;
}

.home-page.home-v2-premium .home-v2-demo-panel-head {
    display: grid;
    gap: 0.45rem;
}

.home-page.home-v2-premium .home-v2-demo-panel-kicker,
.home-page.home-v2-premium .home-v2-demo-compare-kicker {
    display: inline-flex;
    width: fit-content;
    color: #8fdfff;
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.home-page.home-v2-premium .home-v2-demo-panel-head h3 {
    margin: 0;
    color: #f7fcff;
    font-size: clamp(1.25rem, 2.2vw, 1.8rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.home-page.home-v2-premium .home-v2-demo-panel-head p {
    margin: 0;
    color: rgba(174, 198, 223, 0.82);
    line-height: 1.64;
}

.home-page.home-v2-premium .home-v2-demo-audit-summary {
    display: grid;
    gap: 0.9rem;
    padding: 1rem 1.05rem;
    border: 1px solid rgba(123, 168, 217, 0.14);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(88, 212, 255, 0.06), transparent 56%),
        rgba(6, 12, 23, 0.88);
}

.home-page.home-v2-premium .home-v2-demo-audit-summary strong {
    color: #eef9ff;
    font-size: 1rem;
    line-height: 1.45;
    font-weight: 700;
}

.home-page.home-v2-premium .home-v2-demo-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.home-page.home-v2-premium .home-v2-demo-metric {
    display: grid;
    gap: 0.28rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid rgba(124, 169, 216, 0.14);
    border-radius: 16px;
    background: rgba(10, 18, 33, 0.78);
}

.home-page.home-v2-premium .home-v2-demo-metric-label {
    color: rgba(164, 191, 218, 0.8);
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-page.home-v2-premium .home-v2-demo-metric-value {
    color: #f8fcff;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.home-page.home-v2-premium .home-v2-demo-signal-list {
    display: grid;
    gap: 0.8rem;
}

.home-page.home-v2-premium .home-v2-demo-signal {
    position: relative;
    padding: 0.95rem 1rem 1rem 1.15rem;
    border: 1px solid rgba(124, 169, 216, 0.14);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 60%),
        rgba(7, 14, 27, 0.72);
}

.home-page.home-v2-premium .home-v2-demo-signal::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    border-radius: 18px 0 0 18px;
    background: rgba(127, 221, 255, 0.56);
}

.home-page.home-v2-premium .home-v2-demo-signal--risk::before {
    background: linear-gradient(180deg, rgba(255, 143, 143, 0.9), rgba(255, 143, 143, 0.26));
}

.home-page.home-v2-premium .home-v2-demo-signal--good::before {
    background: linear-gradient(180deg, rgba(94, 234, 212, 0.88), rgba(94, 234, 212, 0.24));
}

.home-page.home-v2-premium .home-v2-demo-signal--info::before {
    background: linear-gradient(180deg, rgba(88, 212, 255, 0.88), rgba(88, 212, 255, 0.24));
}

.home-page.home-v2-premium .home-v2-demo-signal h4,
.home-page.home-v2-premium .home-v2-demo-compare-top h4 {
    margin: 0;
    color: #f2f9ff;
    letter-spacing: -0.02em;
}

.home-page.home-v2-premium .home-v2-demo-signal p {
    margin: 0.35rem 0 0;
    color: rgba(171, 196, 221, 0.82);
    line-height: 1.6;
}

.home-page.home-v2-premium .home-v2-demo-compare-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    align-items: stretch;
}

.home-page.home-v2-premium .home-v2-demo-compare-card {
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
    border: 1px solid rgba(123, 168, 217, 0.15);
    border-radius: 20px;
    min-height: 100%;
}

.home-page.home-v2-premium .home-v2-demo-compare-card--before {
    background:
        linear-gradient(180deg, rgba(255, 145, 145, 0.06), transparent 58%),
        rgba(10, 16, 29, 0.76);
}

.home-page.home-v2-premium .home-v2-demo-compare-card--after {
    background:
        linear-gradient(180deg, rgba(94, 234, 212, 0.08), transparent 58%),
        rgba(8, 17, 31, 0.8);
}

.home-page.home-v2-premium .home-v2-demo-compare-top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 0.8rem;
}

.home-page.home-v2-premium .home-v2-demo-compare-top h4 {
    font-size: 1.02rem;
    line-height: 1.2;
}

.home-page.home-v2-premium .home-v2-demo-compare-score {
    flex: 0 0 auto;
    padding: 0.38rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(127, 168, 214, 0.16);
    background: rgba(8, 16, 31, 0.82);
    color: #def5ff;
    font-size: 0.78rem;
    font-weight: 800;
}

.home-page.home-v2-premium .home-v2-demo-compare-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.home-page.home-v2-premium .home-v2-demo-compare-items .detail-chip {
    border-color: rgba(123, 168, 217, 0.16);
    background: rgba(9, 17, 31, 0.82);
    color: #e2f3ff;
}

@media (max-width: 1100px) {
    .home-page.home-v2-premium .home-v2-demo-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .home-page.home-v2-premium .home-v2-demo-metrics,
    .home-page.home-v2-premium .home-v2-demo-compare-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .home-page.home-v2-premium .home-v2-demo {
        padding: 1rem;
        border-radius: 24px;
    }

    .home-page.home-v2-premium .home-v2-demo-audit,
    .home-page.home-v2-premium .home-v2-demo-compare,
    .home-page.home-v2-premium .home-v2-demo-signal,
    .home-page.home-v2-premium .home-v2-demo-compare-card,
    .home-page.home-v2-premium .home-v2-demo-audit-summary,
    .home-page.home-v2-premium .home-v2-demo-metric {
        border-radius: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-page.home-v2-premium .home-v2-demo,
    .home-page.home-v2-premium .home-v2-demo::before {
        animation: none !important;
    }
}
/* EOF MOTION MARKER */

/* Motion layer for the premium homepage - final cascade */
@keyframes homePremiumReveal {
    0% {
        opacity: 0;
        transform: translate3d(0, 34px, 0) scale(0.972);
        filter: blur(16px);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
        filter: blur(0);
    }
}

@keyframes homePremiumSweep {
    0% {
        transform: translate3d(-120%, 0, 0) skewX(-18deg);
        opacity: 0;
    }
    18% {
        opacity: 0.5;
    }
    52% {
        transform: translate3d(140%, 0, 0) skewX(-18deg);
        opacity: 0;
    }
    100% {
        transform: translate3d(140%, 0, 0) skewX(-18deg);
        opacity: 0;
    }
}

@keyframes homePremiumGridDrift {
    0% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -26px, 0); }
    100% { transform: translate3d(-16px, 12px, 0); }
}

@keyframes homePremiumButtonGlow {
    0%, 100% {
        box-shadow: 0 18px 36px rgba(44, 182, 255, 0.26), 0 0 0 rgba(88, 212, 255, 0);
    }
    50% {
        box-shadow: 0 28px 58px rgba(44, 182, 255, 0.48), 0 0 28px rgba(88, 212, 255, 0.26);
    }
}

@keyframes homePremiumMetricFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes homePremiumRadarSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes homePremiumRadarBlink {
    0%, 100% {
        opacity: 0.45;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.18);
    }
}

@keyframes homePremiumSurfacePulse {
    0%, 100% {
        box-shadow:
            0 32px 64px rgba(2, 6, 23, 0.45),
            inset 0 1px 0 rgba(255, 255, 255, 0.04);
        border-color: rgba(129, 168, 215, 0.16);
    }
    50% {
        box-shadow:
            0 40px 82px rgba(2, 6, 23, 0.58),
            0 0 36px rgba(72, 198, 255, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.06);
        border-color: rgba(129, 192, 235, 0.24);
    }
}

@keyframes homePremiumHeroHalo {
    0%, 100% {
        filter: blur(8px) saturate(1);
        opacity: 0.78;
    }
    50% {
        filter: blur(14px) saturate(1.18);
        opacity: 1;
    }
}

@keyframes homePremiumCardBreath {
    0%, 100% {
        transform: translateY(0);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }
    50% {
        transform: translateY(-3px);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.08),
            0 18px 30px rgba(2, 6, 23, 0.18);
    }
}

.home-page.home-v2-premium::after {
    animation: homePremiumGridDrift 24s linear infinite alternate;
}

.home-page.home-v2-premium .home-v2-hero,
.home-page.home-v2-premium .home-v2-preview,
.home-page.home-v2-premium .home-v2-conversion {
    animation: homePremiumSurfacePulse 9.5s ease-in-out infinite;
}

.home-page.home-v2-premium .home-v2-hero-insight {
    animation: homePremiumCardBreath 8.8s ease-in-out 1.1s infinite;
}

.home-page.home-v2-premium .home-v2-hero-insight:nth-child(2) {
    animation-delay: 1.7s;
}

.home-page.home-v2-premium .home-v2-hero-insight:nth-child(3) {
    animation-delay: 2.3s;
}

.home-page.home-v2-premium .home-v2-hero::before {
    animation:
        homePremiumAuroraShift 12s ease-in-out infinite,
        homePremiumHeroHalo 7s ease-in-out infinite;
}

.home-page.home-v2-premium .home-v2-copy {
    perspective: 1400px;
}

.home-page.home-v2-premium .home-v2-copy::after {
    content: "";
    position: absolute;
    inset: 6% auto auto 38%;
    width: clamp(9rem, 18vw, 15rem);
    height: clamp(9rem, 18vw, 15rem);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(86, 198, 255, 0.2), transparent 68%);
    filter: blur(18px);
    opacity: 0.72;
    animation: homePremiumFloat 8.5s ease-in-out infinite;
    pointer-events: none;
}

.home-page.home-v2-premium .home-v2-hero::after,
.home-page.home-v2-premium .home-v2-preview::before,
.home-page.home-v2-premium .home-v2-search::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 -24%;
    width: 44%;
    background: linear-gradient(90deg, transparent, rgba(166, 232, 255, 0.28), rgba(255, 255, 255, 0.14), transparent);
    transform: translate3d(-120%, 0, 0) skewX(-18deg);
    filter: blur(2px);
    pointer-events: none;
}

.home-page.home-v2-premium .home-v2-hero::after {
    animation: homePremiumSweep 7.6s ease-in-out infinite;
}

.home-page.home-v2-premium .home-v2-preview::before {
    width: 34%;
    opacity: 0.82;
    animation: homePremiumSweep 9.5s ease-in-out infinite 1.1s;
}

.home-page.home-v2-premium .home-v2-preview-radar-sweep {
    animation: homePremiumRadarSpin 7.2s linear infinite;
    transform-origin: center;
}

.home-page.home-v2-premium .home-v2-preview-radar-dot {
    animation: homePremiumRadarBlink 3.6s ease-in-out infinite;
}

.home-page.home-v2-premium .home-v2-preview-radar-dot--b {
    animation-delay: 1s;
}

.home-page.home-v2-premium .home-v2-preview-radar-dot--c {
    animation-delay: 2s;
}

.home-page.home-v2-premium .home-v2-search::before {
    width: 28%;
    opacity: 0.88;
    animation: homePremiumSweep 6.8s ease-in-out infinite 0.45s;
}

.home-page.home-v2-premium .home-v2-copy > *,
.home-page.home-v2-premium .home-v2-preview,
.home-page.home-v2-premium .home-v2-resume,
.home-page.home-v2-premium .home-v2-workflow,
.home-page.home-v2-premium .home-v2-conversion,
.home-page.home-v2-premium .home-v2-block {
    opacity: 0;
    animation: homePremiumReveal 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    will-change: transform, opacity, filter;
}

.home-page.home-v2-premium .home-v2-eyebrow { animation-delay: 0.05s; }
.home-page.home-v2-premium .home-v2-copy h1 { animation-delay: 0.14s; }
.home-page.home-v2-premium .home-v2-subtitle { animation-delay: 0.24s; }
.home-page.home-v2-premium .home-v2-note { animation-delay: 0.33s; }
.home-page.home-v2-premium .home-v2-search { animation-delay: 0.42s; }
.home-page.home-v2-premium .home-v2-actions:first-of-type { animation-delay: 0.52s; }
.home-page.home-v2-premium .home-v2-links { animation-delay: 0.62s; }
.home-page.home-v2-premium .home-v2-trust-list { animation-delay: 0.72s; }
.home-page.home-v2-premium .home-v2-preview { animation-delay: 0.26s; }
.home-page.home-v2-premium .home-v2-resume { animation-delay: 0.18s; }
.home-page.home-v2-premium .home-v2-workflow { animation-delay: 0.24s; }
.home-page.home-v2-premium .home-v2-conversion { animation-delay: 0.3s; }
.home-page.home-v2-premium .home-v2-block { animation-delay: 0.36s; }

.home-page.home-v2-premium .home-v2-trust-item,
.home-page.home-v2-premium .home-v2-preview-row,
.home-page.home-v2-premium .home-v2-step,
.home-page.home-v2-premium .home-v2-list-item,
.home-page.home-v2-premium .home-v2-conversion-metric,
.home-page.home-v2-premium .home-v2-resume-side-card,
.home-page.home-v2-premium .home-v2-resume-row {
    opacity: 0;
    animation: homePremiumReveal 0.82s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.home-page.home-v2-premium .home-v2-trust-item,
.home-page.home-v2-premium .home-v2-preview-row,
.home-page.home-v2-premium .home-v2-step,
.home-page.home-v2-premium .home-v2-list-item,
.home-page.home-v2-premium .home-v2-resume-side-card,
.home-page.home-v2-premium .home-v2-resume-row {
    animation:
        homePremiumReveal 0.82s cubic-bezier(0.22, 1, 0.36, 1) forwards,
        homePremiumCardBreath 10s ease-in-out 1.2s infinite;
}

.home-page.home-v2-premium .home-v2-trust-item:nth-child(1),
.home-page.home-v2-premium .home-v2-preview-row:nth-child(1),
.home-page.home-v2-premium .home-v2-step:nth-child(1),
.home-page.home-v2-premium .home-v2-list-item:nth-child(1),
.home-page.home-v2-premium .home-v2-conversion-metric:nth-child(1),
.home-page.home-v2-premium .home-v2-resume-side-card:nth-child(1),
.home-page.home-v2-premium .home-v2-resume-row:nth-child(1) { animation-delay: 0.2s; }

.home-page.home-v2-premium .home-v2-trust-item:nth-child(2),
.home-page.home-v2-premium .home-v2-preview-row:nth-child(2),
.home-page.home-v2-premium .home-v2-step:nth-child(2),
.home-page.home-v2-premium .home-v2-list-item:nth-child(2),
.home-page.home-v2-premium .home-v2-conversion-metric:nth-child(2),
.home-page.home-v2-premium .home-v2-resume-side-card:nth-child(2),
.home-page.home-v2-premium .home-v2-resume-row:nth-child(2) { animation-delay: 0.3s; }

.home-page.home-v2-premium .home-v2-trust-item:nth-child(3),
.home-page.home-v2-premium .home-v2-preview-row:nth-child(3),
.home-page.home-v2-premium .home-v2-step:nth-child(3),
.home-page.home-v2-premium .home-v2-list-item:nth-child(3),
.home-page.home-v2-premium .home-v2-conversion-metric:nth-child(3),
.home-page.home-v2-premium .home-v2-resume-row:nth-child(3) { animation-delay: 0.4s; }

.home-page.home-v2-premium .home-v2-step:nth-child(4) { animation-delay: 0.5s; }

.home-page.home-v2-premium .home-v2-actions .btn-primary {
    animation: homePremiumReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.52s forwards, homePremiumButtonGlow 4.5s ease-in-out 1.4s infinite;
}

.home-page.home-v2-premium .home-v2-conversion-metric {
    animation:
        homePremiumReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards,
        homePremiumMetricFloat 8s ease-in-out 1.4s infinite;
}

.home-page.home-v2-premium .home-v2-conversion-metric:nth-child(2) {
    animation-delay: 0.3s, 2s;
}

.home-page.home-v2-premium .home-v2-conversion-metric:nth-child(3) {
    animation-delay: 0.4s, 2.6s;
}

.home-page.home-v2-premium .home-v2-row-ticker,
.home-page.home-v2-premium .home-v2-step-index,
.home-page.home-v2-premium .home-v2-conversion-value {
    transition: transform 0.22s ease, text-shadow 0.22s ease;
}

.home-page.home-v2-premium .home-v2-row-rank,
.home-page.home-v2-premium .home-v2-row-score {
    animation: homePremiumMetricFloat 7s ease-in-out infinite;
}

.home-page.home-v2-premium .home-v2-row-score {
    animation-delay: 1.2s;
}

.home-page.home-v2-premium .home-v2-preview-row:hover .home-v2-row-ticker,
.home-page.home-v2-premium .home-v2-step:hover .home-v2-step-index,
.home-page.home-v2-premium .home-v2-conversion-metric:hover .home-v2-conversion-value {
    transform: translateY(-1px);
    text-shadow: 0 0 18px rgba(104, 214, 255, 0.22);
}

@media (prefers-reduced-motion: reduce) {
    .home-page.home-v2-premium *,
    .home-page.home-v2-premium::before,
    .home-page.home-v2-premium::after,
    .home-page.home-v2-premium .home-v2-copy::after,
    .home-page.home-v2-premium .home-v2-hero::before,
    .home-page.home-v2-premium .home-v2-hero::after,
    .home-page.home-v2-premium .home-v2-preview::before,
    .home-page.home-v2-premium .home-v2-preview::after,
    .home-page.home-v2-premium .home-v2-search::before {
        animation: none !important;
        transition: none !important;
    }

    .home-page.home-v2-premium .home-v2-copy > *,
    .home-page.home-v2-premium .home-v2-preview,
    .home-page.home-v2-premium .home-v2-resume,
    .home-page.home-v2-premium .home-v2-workflow,
    .home-page.home-v2-premium .home-v2-conversion,
    .home-page.home-v2-premium .home-v2-block,
    .home-page.home-v2-premium .home-v2-trust-item,
    .home-page.home-v2-premium .home-v2-preview-row,
    .home-page.home-v2-premium .home-v2-step,
    .home-page.home-v2-premium .home-v2-list-item,
    .home-page.home-v2-premium .home-v2-conversion-metric,
    .home-page.home-v2-premium .home-v2-resume-side-card,
    .home-page.home-v2-premium .home-v2-resume-row {
        opacity: 1 !important;
        filter: none !important;
        transform: none !important;
    }
}

/* Motion layer for the premium homepage */
@keyframes homePremiumReveal {
    0% {
        opacity: 0;
        transform: translate3d(0, 22px, 0) scale(0.985);
        filter: blur(12px);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
        filter: blur(0);
    }
}

@keyframes homePremiumSweep {
    0% {
        transform: translate3d(-120%, 0, 0) skewX(-18deg);
        opacity: 0;
    }
    18% {
        opacity: 0.34;
    }
    52% {
        transform: translate3d(140%, 0, 0) skewX(-18deg);
        opacity: 0;
    }
    100% {
        transform: translate3d(140%, 0, 0) skewX(-18deg);
        opacity: 0;
    }
}

@keyframes homePremiumGridDrift {
    0% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -18px, 0); }
    100% { transform: translate3d(-10px, 8px, 0); }
}

@keyframes homePremiumButtonGlow {
    0%, 100% {
        box-shadow: 0 18px 36px rgba(44, 182, 255, 0.22);
    }
    50% {
        box-shadow: 0 22px 42px rgba(44, 182, 255, 0.38);
    }
}

@keyframes homePremiumMetricFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.home-page.home-v2-premium::after {
    animation: homePremiumGridDrift 24s linear infinite alternate;
}

.home-page.home-v2-premium .home-v2-hero::after,
.home-page.home-v2-premium .home-v2-preview::before,
.home-page.home-v2-premium .home-v2-search::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 -24%;
    width: 34%;
    background: linear-gradient(90deg, transparent, rgba(166, 232, 255, 0.18), transparent);
    transform: translate3d(-120%, 0, 0) skewX(-18deg);
    pointer-events: none;
}

.home-page.home-v2-premium .home-v2-hero::after {
    animation: homePremiumSweep 11s ease-in-out infinite;
}

.home-page.home-v2-premium .home-v2-preview::before {
    width: 28%;
    opacity: 0.7;
    animation: homePremiumSweep 13s ease-in-out infinite 1.5s;
}

.home-page.home-v2-premium .home-v2-search::before {
    width: 22%;
    opacity: 0.72;
    animation: homePremiumSweep 9s ease-in-out infinite 0.8s;
}

.home-page.home-v2-premium .home-v2-copy > *,
.home-page.home-v2-premium .home-v2-preview,
.home-page.home-v2-premium .home-v2-resume,
.home-page.home-v2-premium .home-v2-workflow,
.home-page.home-v2-premium .home-v2-conversion,
.home-page.home-v2-premium .home-v2-block {
    opacity: 0;
    animation: homePremiumReveal 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    will-change: transform, opacity, filter;
}

.home-page.home-v2-premium .home-v2-eyebrow { animation-delay: 0.05s; }
.home-page.home-v2-premium .home-v2-copy h1 { animation-delay: 0.14s; }
.home-page.home-v2-premium .home-v2-subtitle { animation-delay: 0.24s; }
.home-page.home-v2-premium .home-v2-note { animation-delay: 0.33s; }
.home-page.home-v2-premium .home-v2-search { animation-delay: 0.42s; }
.home-page.home-v2-premium .home-v2-actions:first-of-type { animation-delay: 0.52s; }
.home-page.home-v2-premium .home-v2-links { animation-delay: 0.62s; }
.home-page.home-v2-premium .home-v2-trust-list { animation-delay: 0.72s; }
.home-page.home-v2-premium .home-v2-preview { animation-delay: 0.26s; }
.home-page.home-v2-premium .home-v2-resume { animation-delay: 0.18s; }
.home-page.home-v2-premium .home-v2-workflow { animation-delay: 0.24s; }
.home-page.home-v2-premium .home-v2-conversion { animation-delay: 0.3s; }
.home-page.home-v2-premium .home-v2-block { animation-delay: 0.36s; }

.home-page.home-v2-premium .home-v2-trust-item,
.home-page.home-v2-premium .home-v2-preview-row,
.home-page.home-v2-premium .home-v2-step,
.home-page.home-v2-premium .home-v2-list-item,
.home-page.home-v2-premium .home-v2-conversion-metric,
.home-page.home-v2-premium .home-v2-resume-side-card,
.home-page.home-v2-premium .home-v2-resume-row {
    opacity: 0;
    animation: homePremiumReveal 0.82s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.home-page.home-v2-premium .home-v2-trust-item:nth-child(1),
.home-page.home-v2-premium .home-v2-preview-row:nth-child(1),
.home-page.home-v2-premium .home-v2-step:nth-child(1),
.home-page.home-v2-premium .home-v2-list-item:nth-child(1),
.home-page.home-v2-premium .home-v2-conversion-metric:nth-child(1),
.home-page.home-v2-premium .home-v2-resume-side-card:nth-child(1),
.home-page.home-v2-premium .home-v2-resume-row:nth-child(1) { animation-delay: 0.2s; }

.home-page.home-v2-premium .home-v2-trust-item:nth-child(2),
.home-page.home-v2-premium .home-v2-preview-row:nth-child(2),
.home-page.home-v2-premium .home-v2-step:nth-child(2),
.home-page.home-v2-premium .home-v2-list-item:nth-child(2),
.home-page.home-v2-premium .home-v2-conversion-metric:nth-child(2),
.home-page.home-v2-premium .home-v2-resume-side-card:nth-child(2),
.home-page.home-v2-premium .home-v2-resume-row:nth-child(2) { animation-delay: 0.3s; }

.home-page.home-v2-premium .home-v2-trust-item:nth-child(3),
.home-page.home-v2-premium .home-v2-preview-row:nth-child(3),
.home-page.home-v2-premium .home-v2-step:nth-child(3),
.home-page.home-v2-premium .home-v2-list-item:nth-child(3),
.home-page.home-v2-premium .home-v2-conversion-metric:nth-child(3),
.home-page.home-v2-premium .home-v2-resume-row:nth-child(3) { animation-delay: 0.4s; }

.home-page.home-v2-premium .home-v2-step:nth-child(4) { animation-delay: 0.5s; }

.home-page.home-v2-premium .home-v2-actions .btn-primary {
    animation: homePremiumReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.52s forwards, homePremiumButtonGlow 4.5s ease-in-out 1.4s infinite;
}

.home-page.home-v2-premium .home-v2-conversion-metric {
    animation:
        homePremiumReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards,
        homePremiumMetricFloat 8s ease-in-out 1.4s infinite;
}

.home-page.home-v2-premium .home-v2-conversion-metric:nth-child(2) {
    animation-delay: 0.3s, 2s;
}

.home-page.home-v2-premium .home-v2-conversion-metric:nth-child(3) {
    animation-delay: 0.4s, 2.6s;
}

.home-page.home-v2-premium .home-v2-row-ticker,
.home-page.home-v2-premium .home-v2-step-index,
.home-page.home-v2-premium .home-v2-conversion-value {
    transition: transform 0.22s ease, text-shadow 0.22s ease;
}

.home-page.home-v2-premium .home-v2-preview-row:hover .home-v2-row-ticker,
.home-page.home-v2-premium .home-v2-step:hover .home-v2-step-index,
.home-page.home-v2-premium .home-v2-conversion-metric:hover .home-v2-conversion-value {
    transform: translateY(-1px);
    text-shadow: 0 0 18px rgba(104, 214, 255, 0.22);
}

@media (prefers-reduced-motion: reduce) {
    .home-page.home-v2-premium *,
    .home-page.home-v2-premium::before,
    .home-page.home-v2-premium::after,
    .home-page.home-v2-premium .home-v2-hero::before,
    .home-page.home-v2-premium .home-v2-hero::after,
    .home-page.home-v2-premium .home-v2-preview::before,
    .home-page.home-v2-premium .home-v2-preview::after,
    .home-page.home-v2-premium .home-v2-search::before {
        animation: none !important;
        transition: none !important;
    }

    .home-page.home-v2-premium .home-v2-copy > *,
    .home-page.home-v2-premium .home-v2-preview,
    .home-page.home-v2-premium .home-v2-resume,
    .home-page.home-v2-premium .home-v2-workflow,
    .home-page.home-v2-premium .home-v2-conversion,
    .home-page.home-v2-premium .home-v2-block,
    .home-page.home-v2-premium .home-v2-trust-item,
    .home-page.home-v2-premium .home-v2-preview-row,
    .home-page.home-v2-premium .home-v2-step,
    .home-page.home-v2-premium .home-v2-list-item,
    .home-page.home-v2-premium .home-v2-conversion-metric,
    .home-page.home-v2-premium .home-v2-resume-side-card,
    .home-page.home-v2-premium .home-v2-resume-row {
        opacity: 1 !important;
        filter: none !important;
        transform: none !important;
    }
}
/* Portfolio overview hierarchy refresh */
.portfolio-page .portfolio-primary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.78rem;
}

.portfolio-page .portfolio-overview-focus-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.82rem;
    margin: 0 0 0.85rem;
}

.portfolio-page .portfolio-overview-focus-card {
    min-width: 0;
    padding: 1rem 1.05rem;
    border-radius: 16px;
    border: 1px solid rgba(74, 111, 167, 0.18);
    background: linear-gradient(180deg, rgba(12, 24, 43, 0.96), rgba(8, 16, 30, 0.98));
    box-shadow: 0 18px 40px rgba(2, 8, 23, 0.22);
}

.portfolio-page .portfolio-overview-focus-card.tone-good {
    border-color: rgba(58, 177, 110, 0.24);
    background: linear-gradient(180deg, rgba(9, 31, 23, 0.96), rgba(8, 16, 30, 0.98));
}

.portfolio-page .portfolio-overview-focus-card.tone-warn {
    border-color: rgba(208, 158, 53, 0.24);
    background: linear-gradient(180deg, rgba(28, 23, 10, 0.96), rgba(8, 16, 30, 0.98));
}

.portfolio-page .portfolio-overview-focus-card.tone-risk {
    border-color: rgba(199, 89, 89, 0.24);
    background: linear-gradient(180deg, rgba(29, 12, 14, 0.96), rgba(8, 16, 30, 0.98));
}

.portfolio-page .portfolio-overview-focus-label {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.58rem;
    margin-bottom: 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(57, 194, 255, 0.18);
    background: rgba(57, 194, 255, 0.08);
    color: rgba(57, 194, 255, 0.9);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portfolio-page .portfolio-overview-focus-card h3 {
    margin: 0 0 0.45rem;
    font-size: 1.02rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.portfolio-page .portfolio-overview-focus-card p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.55;
}

.portfolio-page .portfolio-overview-focus-card .detail-chip-row {
    margin-top: 0.8rem;
}

.portfolio-page .portfolio-overview-focus-actions {
    margin-top: 0.9rem;
}

.portfolio-page .portfolio-overview-focus-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.62rem 0.92rem;
    border-radius: 12px;
    border: 1px solid rgba(57, 194, 255, 0.24);
    background: rgba(57, 194, 255, 0.08);
    color: rgba(214, 240, 255, 0.96);
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
}

.portfolio-page .portfolio-overview-focus-btn:hover {
    background: rgba(57, 194, 255, 0.14);
    border-color: rgba(57, 194, 255, 0.42);
    color: #ffffff;
    text-decoration: none;
}

.portfolio-page .portfolio-current-holdings-panel {
    margin: 0 0 0.9rem;
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid rgba(74, 111, 167, 0.2);
    background: linear-gradient(180deg, rgba(9, 18, 32, 0.96), rgba(6, 13, 24, 0.98));
    box-shadow: 0 18px 42px rgba(2, 8, 23, 0.22);
}

.portfolio-page .portfolio-current-holdings-panel.tone-good {
    border-color: rgba(58, 177, 110, 0.24);
}

.portfolio-page .portfolio-current-holdings-panel.tone-warn {
    border-color: rgba(245, 158, 11, 0.32);
}

.portfolio-page .portfolio-current-holdings-panel.tone-risk {
    border-color: rgba(239, 68, 68, 0.32);
}

.portfolio-page .portfolio-current-holdings-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.portfolio-page .portfolio-current-holdings-copy {
    min-width: 0;
    max-width: 760px;
}

.portfolio-page .portfolio-current-holdings-kicker {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0.4rem;
    color: rgba(57, 194, 255, 0.9);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portfolio-page .portfolio-current-holdings-copy h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.08rem;
    line-height: 1.22;
    letter-spacing: -0.01em;
}

.portfolio-page .portfolio-current-holdings-copy p {
    margin: 0.32rem 0 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.portfolio-page .portfolio-current-holdings-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-width: 260px;
}

.portfolio-page .portfolio-current-holdings-actions .btn-primary,
.portfolio-page .portfolio-current-holdings-actions .btn-secondary {
    min-height: 40px;
    white-space: nowrap;
}

.portfolio-page .portfolio-current-holdings-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.62rem;
    margin-bottom: 0.78rem;
}

.portfolio-page .portfolio-current-holdings-stat {
    min-width: 0;
    padding: 0.74rem 0.78rem;
    border-radius: 12px;
    border: 1px solid rgba(74, 111, 167, 0.18);
    background: rgba(5, 14, 27, 0.68);
}

.portfolio-page .portfolio-current-holdings-stat span {
    display: block;
    margin-bottom: 0.22rem;
    color: #8ea6c3;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portfolio-page .portfolio-current-holdings-stat strong {
    display: block;
    min-width: 0;
    color: var(--text-primary);
    font-size: 0.96rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.portfolio-page .portfolio-current-holdings-preview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.62rem;
}

.portfolio-page .portfolio-current-holding-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.68rem;
    min-width: 0;
    min-height: 132px;
    padding: 0.76rem;
    border-radius: 13px;
    border: 1px solid rgba(74, 111, 167, 0.2);
    background: rgba(7, 16, 30, 0.72);
    color: var(--text-primary);
    text-decoration: none;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.portfolio-page .portfolio-current-holding-card:hover {
    transform: translateY(-1px);
    border-color: rgba(57, 194, 255, 0.35);
    background: rgba(11, 26, 46, 0.84);
    text-decoration: none;
}

.portfolio-page .portfolio-current-holding-id {
    display: flex;
    align-items: center;
    gap: 0.52rem;
    min-width: 0;
}

.portfolio-page .portfolio-current-holding-id img {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.08);
}

.portfolio-page .portfolio-current-holding-id span {
    min-width: 0;
}

.portfolio-page .portfolio-current-holding-id strong,
.portfolio-page .portfolio-current-holding-id small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portfolio-page .portfolio-current-holding-id strong {
    color: #f3f8ff;
    font-size: 0.88rem;
}

.portfolio-page .portfolio-current-holding-id small {
    margin-top: 0.1rem;
    color: #94a8c0;
    font-size: 0.72rem;
}

.portfolio-page .portfolio-current-holding-metrics {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
    color: #9fb3ca;
    font-size: 0.74rem;
}

.portfolio-page .portfolio-current-holding-metrics span,
.portfolio-page .portfolio-current-holding-metrics strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.portfolio-page .portfolio-current-holding-metrics strong {
    font-size: 0.9rem;
}

.portfolio-page .portfolio-current-holdings-empty {
    padding: 0.9rem;
    border-radius: 13px;
    border: 1px dashed rgba(96, 165, 250, 0.28);
    background: rgba(5, 14, 27, 0.58);
}

.portfolio-page .portfolio-current-holdings-empty strong {
    display: block;
    color: var(--text-primary);
}

.portfolio-page .portfolio-current-holdings-empty p {
    margin: 0.22rem 0 0;
    color: var(--text-secondary);
}

.portfolio-page .portfolio-overview-context-details {
    margin: 0 0 0.9rem;
    border-radius: 16px;
    border: 1px solid rgba(74, 111, 167, 0.18);
    background: rgba(7, 15, 28, 0.72);
    overflow: hidden;
}

.portfolio-page .portfolio-overview-context-details > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    cursor: pointer;
    list-style: none;
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--text-primary);
}

.portfolio-page .portfolio-overview-context-details > summary::-webkit-details-marker {
    display: none;
}

.portfolio-page .portfolio-overview-context-details > summary::after {
    content: '+';
    font-size: 1rem;
    color: var(--text-muted);
}

.portfolio-page .portfolio-overview-context-details[open] > summary::after {
    content: '-';
}

.portfolio-page .portfolio-overview-context-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.78rem;
    padding: 0 1rem 1rem;
}

@media (max-width: 1280px) {
    .portfolio-page .portfolio-primary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 900px) {
    .portfolio-page .portfolio-primary-grid,
    .portfolio-page .portfolio-overview-focus-grid,
    .portfolio-page .portfolio-overview-context-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-page .portfolio-overview-focus-card,
    .portfolio-page .portfolio-current-holdings-panel,
    .portfolio-page .portfolio-overview-context-details {
        border-radius: 14px;
    }

    .portfolio-page .portfolio-current-holdings-main {
        display: grid;
        gap: 0.8rem;
    }

    .portfolio-page .portfolio-current-holdings-actions {
        justify-content: flex-start;
        min-width: 0;
    }

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

    .portfolio-page .portfolio-overview-context-details > summary {
        padding: 0.82rem 0.88rem;
    }

    .portfolio-page .portfolio-overview-context-grid {
        padding: 0 0.88rem 0.88rem;
    }
}

@media (max-width: 640px) {
    .portfolio-page .portfolio-secondary-metric {
        display: none;
    }

    .portfolio-page .portfolio-current-holdings-panel {
        padding: 0.86rem;
    }

    .portfolio-page .portfolio-current-holdings-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .portfolio-page .portfolio-current-holdings-actions .btn-primary,
    .portfolio-page .portfolio-current-holdings-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .portfolio-page .portfolio-current-holdings-summary,
    .portfolio-page .portfolio-current-holdings-preview {
        grid-template-columns: 1fr;
    }

    .portfolio-page .portfolio-current-holding-card {
        min-height: 112px;
    }
}
@media (max-width: 640px) {
    .stock-detail-page .stock-chart-panel {
        padding: 0.82rem 0.82rem 0.68rem;
    }

    .stock-detail-page .stock-chart-pill-group {
        width: 100%;
    }

    .stock-detail-page .stock-chart-pill {
        flex: 1 1 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        text-align: center;
        padding-left: 0.58rem;
        padding-right: 0.58rem;
    }

    .stock-detail-page .stock-chart-stat-grid {
        grid-template-columns: 1fr;
    }

    .stock-detail-page .stock-chart-canvas {
        height: 400px;
    }
}
.insight-meta {
    margin: 0.2rem 0 0.8rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}
.insight-kv {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.82rem;
}
.insight-kv span { color: var(--text-secondary); }
.insight-kv strong { color: var(--text-primary); font-weight: 700; }

.score-matrix {
    display: grid;
    grid-template-columns: 1.2fr repeat(3, 1fr);
    gap: 0.5rem;
}
.score-head {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}
.score-label {
    align-self: center;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.82rem;
}
.score-cell {
    border: 1px solid var(--border-subtle);
    background: rgba(255,255,255,0.015);
    border-radius: 8px;
    padding: 0.45rem 0.35rem 0.4rem;
    display: grid;
    gap: 0.35rem;
    justify-items: center;
    align-content: start;
    text-align: center;
    overflow: hidden;
}
.score-bar-value {
    font-weight: 800;
    font-size: 0.82rem;
    color: var(--text-primary);
}
.score-bar-stage {
    position: relative;
    width: 100%;
    height: 88px;
    display: flex;
    justify-content: center;
}
.score-bar-stage::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 8%;
    bottom: 8%;
    width: min(34px, 46%);
    transform: translateX(-50%);
    border-radius: 12px;
    border: 1px solid rgba(77, 109, 153, 0.32);
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    box-shadow: inset 0 0 0 1px rgba(12, 22, 40, 0.32);
}
.score-bar-stage::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 42%;
    height: 16%;
    width: min(34px, 46%);
    transform: translateX(-50%);
    border-radius: 8px;
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.18);
}
.score-bar-baseline {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(148, 163, 184, 0.22);
    z-index: 1;
}
.score-bar {
    position: absolute;
    left: 50%;
    width: min(34px, 46%);
    transform: translateX(-50%);
    border-radius: 10px 10px 7px 7px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
    z-index: 2;
}
.score-bar--up {
    bottom: 50%;
}
.score-bar--down {
    top: 50%;
    border-radius: 7px 7px 10px 10px;
}
.score-bar--buy {
    background: linear-gradient(180deg, rgba(52, 211, 153, 0.95), rgba(22, 163, 74, 0.7));
}
.score-bar--sell {
    background: linear-gradient(180deg, rgba(248, 113, 113, 0.78), rgba(239, 68, 68, 0.95));
}
.score-bar--hold {
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.95), rgba(249, 115, 22, 0.82));
}

.dividend-pill {
    border: 1px solid var(--border-active);
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.7rem;
}
.dividend-toggle-wrap { margin-top: 0.75rem; }
.related-stock-grid { padding-bottom: 1rem; }
.dividend-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}
.dividend-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}
.metric-box {
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: rgba(255,255,255,0.015);
    padding: 0.5rem 0.45rem;
    text-align: center;
}
.metric-box span {
    display: block;
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
}
.metric-box strong {
    font-size: 0.95rem;
    font-weight: 800;
}
.btn-mini {
    padding: 0.35rem 0.75rem;
    font-size: 0.76rem;
    min-height: auto;
}
.dividend-history-panel {
    display: none;
    margin-top: 0.55rem;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.015);
}
.dividend-history-panel.open { display: block; }
.dividend-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.76rem;
}
.dividend-history-table th,
.dividend-history-table td {
    padding: 0.45rem 0.55rem;
    border-bottom: 1px solid var(--border-subtle);
}
.dividend-history-table tr:last-child td { border-bottom: 0; }
.dividend-history-table th {
    color: var(--text-muted);
    text-align: left;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.projection-grid {
    display: grid;
    gap: 0.55rem;
}
.projection-visual-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: end;
}
.projection-row {
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: rgba(255,255,255,0.015);
    padding: 0.55rem 0.65rem;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.7rem;
    align-items: center;
}
.projection-label {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
}
.projection-price {
    text-align: right;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-primary);
}
.projection-meta {
    grid-column: 1 / 2;
    color: var(--text-muted);
    font-size: 0.72rem;
}
.projection-range {
    grid-column: 2 / 3;
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.projection-bar-card {
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: rgba(255,255,255,0.018);
    padding: 0.68rem 0.62rem 0.64rem;
    display: grid;
    gap: 0.36rem;
    justify-items: center;
    text-align: center;
}

.projection-bar-price {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-primary);
}

.projection-bar-price.buy,
.projection-bar-pct.buy {
    color: #34d399;
}

.projection-bar-price.sell,
.projection-bar-pct.sell {
    color: #f87171;
}

.projection-bar-stage {
    position: relative;
    width: 100%;
    height: 150px;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.projection-bar-baseline {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(148, 163, 184, 0.22);
}

.projection-bar {
    position: absolute;
    left: 50%;
    width: min(48px, 58%);
    transform: translateX(-50%);
    border-radius: 12px 12px 8px 8px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.projection-bar--positive {
    bottom: 50%;
    background: linear-gradient(180deg, rgba(52, 211, 153, 0.95), rgba(22, 163, 74, 0.7));
}

.projection-bar--negative {
    top: 50%;
    background: linear-gradient(180deg, rgba(248, 113, 113, 0.78), rgba(239, 68, 68, 0.95));
    border-radius: 8px 8px 12px 12px;
}

.projection-bar-pct {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.projection-bar-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.projection-bar-range {
    font-size: 0.66rem;
    line-height: 1.32;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .projection-visual-grid {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: minmax(148px, 78%);
        gap: 0.55rem;
        align-items: stretch;
        overflow-x: auto;
        padding-bottom: 0.15rem;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .projection-bar-card {
        min-width: 148px;
        scroll-snap-align: start;
        padding: 0.62rem 0.52rem 0.54rem;
    }

    .projection-bar-stage {
        height: 82px;
    }

    .projection-bar {
        width: min(40px, 52%);
    }

    .projection-bar-pct {
        font-size: 0.74rem;
    }

    .projection-bar-label {
        font-size: 0.72rem;
    }

    .projection-bar-range {
        font-size: 0.64rem;
        line-height: 1.32;
    }
}

.utility-points {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 1.2rem auto 0;
    max-width: 920px;
}

.utility-point {
    background: linear-gradient(180deg, rgba(17, 29, 51, 0.78), rgba(12, 20, 37, 0.82));
    border: 1px solid var(--border-active);
    border-radius: 12px;
    padding: 0.95rem;
    text-align: left;
}

.utility-point h3 {
    font-size: 0.92rem;
    margin-bottom: 0.25rem;
}

.utility-point p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.legal-page {
    padding: 2.2rem 0 3rem;
}

.legal-card {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 1.25rem 1.3rem;
}

.legal-card h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 0.2rem;
}

.legal-meta {
    margin: 0 0 1rem;
    color: var(--text-muted);
    font-size: 0.83rem;
}

.legal-card section {
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border-subtle);
}

.legal-card h2 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.legal-card p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.trust-page .legal-card ul {
    margin: 0.65rem 0 0;
    padding-left: 1.35rem;
    color: var(--text-secondary);
}

.trust-page .legal-card li + li {
    margin-top: 0.45rem;
}

.trust-page-contact {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.stock-analysis-byline {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.stock-analysis-byline a {
    color: var(--accent-primary);
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

/* Footer */
.main-footer {
    background: #020617;
    border-top: 1px solid var(--border-subtle);
    padding: 5rem 0 2rem;
    margin-top: 4rem;
    color: var(--text-secondary);
}
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 4rem; margin-bottom: 4rem;
}
.f-col h4 { color: var(--text-primary); font-size: 1rem; margin-bottom: 1.5rem; }
.f-col p { font-size: 0.875rem; line-height: 1.6; }
.footer-links { margin-top: 0.8rem; }
.footer-links a {
    display: inline-block;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-active);
    font-size: 0.85rem;
    margin: 0 0 0.45rem;
}
.footer-links a:hover { border-color: var(--text-primary); }
.footer-links a:last-child { margin-bottom: 0; }

.contact-info { margin-top: 1rem; font-weight: 600; }
.contact-info a { color: var(--text-primary); text-decoration: none; border-bottom: 1px solid var(--border-active); }
.contact-info a:hover { border-color: var(--text-primary); }

.disclaimer-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    padding: 1.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 3rem;
}
.disclaimer-box strong { color: var(--text-secondary); }

.footer-bottom {
    border-top: 1px solid var(--border-subtle);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.small-print { font-size: 0.75rem; color: var(--text-muted); margin-top: 1rem; }

/* Global Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}
.modal-content {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    border: 1px solid var(--border-active);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

/* Hero Actions */
.hero-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.hero-actions .btn-primary,
.hero-actions .btn-secondary {
    min-width: 150px;
    text-align: center;
}
.btn-secondary {
    display: inline-block;
    background: #13223d;
    border: 1px solid var(--border-active);
    color: var(--text-primary);
    padding: 0.75rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-secondary:hover { background: var(--bg-card-hover); }

/* Feature Promo */
.feature-promo {
    background: linear-gradient(110deg, rgba(13, 25, 46, 0.78), rgba(8, 14, 30, 0.78));
    border: 1px solid var(--border-active);
    border-radius: 24px;
    padding: 1.6rem;
    margin: 2rem 0 4rem;
}
.promo-content {
    display: flex; justify-content: space-between; align-items: center; gap: 2rem;
}
.promo-text h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.promo-text p { color: var(--text-secondary); margin: 0; }
.btn-outline {
    border: 1px solid var(--text-primary);
    color: var(--text-primary);
    padding: 0.75rem 2.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}
.btn-outline:hover { background: var(--text-primary); color: var(--bg-root); }

.home-workflow {
    margin: 0 0 1.35rem;
}

.home-workflow h2 {
    font-size: clamp(1.05rem, 2.5vw, 1.3rem);
    margin: 0 0 0.85rem;
}

.home-workflow-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.home-workflow-item {
    border: 1px solid var(--border-active);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(17, 30, 55, 0.82), rgba(12, 20, 37, 0.58));
    padding: 0.9rem;
}

.home-workflow-item h3 {
    font-size: 0.92rem;
    margin: 0 0 0.3rem;
}

.home-workflow-item p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.83rem;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .promo-content { flex-direction: column; text-align: center; }
    .utility-points { grid-template-columns: 1fr; margin-top: 1rem; }
    .home-workflow-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    .legal-page { padding: 1.35rem 0 2rem; }
    .legal-card { padding: 1rem; border-radius: 12px; }
    .legal-card h2 { font-size: 0.96rem; }
    .quote-price { font-size: 1.7rem; }
    .quote-change { font-size: 0.95rem; }
    .quote-meta { width: 100%; }
    .stock-insights-grid { grid-template-columns: 1fr; }
    .dividend-summary-grid { grid-template-columns: 1fr 1fr; }
    .dividend-metrics { grid-template-columns: 1fr 1fr 1fr; }
    .hero-actions {
        width: 100%;
    }
    .hero-actions .btn-primary,
    .hero-actions .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .container { padding: 0 1rem; }
    .directory-header { padding: 1.8rem 0 1rem; }
    .directory-header .subtitle {
        margin-bottom: 0.8rem;
        font-size: 0.95rem;
        line-height: 1.5;
    }
    .market-search {
        width: 100%;
        margin-bottom: 0.75rem;
        min-height: 42px;
        font-size: 0.95rem;
    }
    .table-container {
        background: transparent;
        border: none;
        border-radius: 0;
        overflow: visible;
    }

    .market-table, .market-table tbody, .market-table tr {
        display: block;
        width: 100%;
    }

    .market-table thead {
        display: none;
    }

    .market-table tr {
        margin-bottom: 0.8rem;
        border: 1px solid var(--border-subtle);
        border-radius: 14px;
        background: var(--bg-card);
        overflow: hidden;
    }

    .market-table td {
        display: grid;
        grid-template-columns: minmax(80px, 96px) minmax(0, 1fr);
        align-items: start;
        gap: 0.25rem 0.75rem;
        width: auto;
        box-sizing: border-box;
        padding: 0.72rem 0.88rem;
        border-bottom: 1px solid var(--border-subtle);
        text-align: left !important;
        font-size: 0.92rem;
        line-height: 1.35;
    }

    .market-table td .cell-value {
        min-width: 0;
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        justify-content: flex-start;
    }

    .market-table td:last-child {
        border-bottom: 0;
    }

    .market-table td::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-size: 0.68rem;
        letter-spacing: 0.05em;
        font-weight: 700;
        text-transform: uppercase;
        text-align: left;
        padding-top: 0.12rem;
    }

    .market-table td.text-right {
        text-align: right !important;
        font-variant-numeric: tabular-nums;
        font-size: 0.95rem;
        font-weight: 700;
    }

    .market-table td.text-right .cell-value {
        width: 100%;
        justify-content: flex-end;
    }

    .market-table td.ticker-cell {
        background: rgba(255,255,255,0.02);
    }

    .market-table td.ticker-cell strong {
        font-size: 1rem;
        letter-spacing: 0.01em;
        color: var(--text-primary);
    }

    .market-table td.name-cell {
        color: var(--text-secondary);
    }

    .market-table td.name-cell .name-value {
        align-items: flex-start;
    }

    .market-table td.name-cell .company-name {
        display: block;
        line-height: 1.35;
        word-break: break-word;
    }

    .market-table td.name-cell .sector-square {
        margin-top: 0.28rem;
        flex: 0 0 auto;
    }

    .market-table td[data-label="Signal"] .badge-mini {
        font-size: 0.74rem;
        letter-spacing: 0.04em;
        padding: 0.2rem 0.55rem;
    }

    .market-table td a {
        color: var(--text-primary);
        text-decoration: none;
    }

    .market-table td a:focus-visible {
        outline: 2px solid var(--accent-brand);
        outline-offset: 2px;
        border-radius: 4px;
    }

    .blur-row td {
        display: block;
        filter: none;
        padding: 1.2rem;
        text-align: center !important;
    }

    .blur-row td::before {
        display: none;
    }

    .table-cta {
        position: static;
        width: auto;
        height: auto;
    }
}

@media (max-width: 768px) {
    .home-page {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .home-page .hero {
        text-align: left;
        padding: 2.1rem 1rem 1.45rem;
        max-width: none;
        border-radius: 16px;
    }

    .home-page .hero h1 {
        font-size: clamp(1.95rem, 8.6vw, 2.45rem);
        line-height: 1.12;
        margin-bottom: 0.7rem;
    }

    .home-page .home-signature {
        justify-content: flex-start;
        margin-bottom: 0.65rem;
    }

    .home-page .home-pill {
        font-size: 0.68rem;
        padding: 0.3rem 0.62rem;
    }

    .home-page .subtitle {
        font-size: 1rem;
        line-height: 1.55;
        margin-bottom: 0.65rem;
        max-width: none;
    }

    .home-page .home-signal-note {
        font-size: 0.88rem;
        margin: 0 0 1rem;
        max-width: none;
    }

    .home-page .trust-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
        margin-bottom: 1.1rem;
        justify-content: stretch;
    }

    .home-page .trust-stats .t-stat:last-child {
        grid-column: 1 / -1;
    }

    .home-page .t-stat {
        font-size: 0.82rem;
        line-height: 1.3;
        padding: 0.55rem 0.65rem;
        border-radius: 12px;
    }

    .home-page .t-stat span {
        font-size: 1.02rem;
    }

    .home-page .search-box {
        margin: 0;
        padding: 0.65rem 0.8rem;
        border-radius: 12px;
    }

    .home-page .search-icon {
        margin-right: 0.65rem;
    }

    .home-page .search-box input {
        min-height: 40px;
        font-size: 1rem;
    }

    .home-page .suggestion-item {
        padding: 0.85rem 0.95rem;
    }

    .home-page .s-ticker {
        font-size: 0.9rem;
    }

    .home-page .s-name {
        font-size: 0.8rem;
    }

    .home-page .hero-quick-links {
        justify-content: flex-start;
        margin-top: 0.95rem;
        gap: 0.5rem;
    }

    .home-page .hero-quick-links a {
        display: inline;
        font-size: 0.82rem;
        padding: 0;
    }

    .home-page .hero-actions {
        margin-top: 1.05rem;
        gap: 0.55rem;
    }

    .home-page .hero-actions .btn-primary,
    .home-page .hero-actions .btn-secondary {
        min-height: 46px;
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
        font-weight: 700;
    }

    .home-page .utility-points {
        margin-top: 1.15rem;
        gap: 0.7rem;
    }

    .home-page .utility-point {
        padding: 1rem;
        border-radius: 12px;
    }

    .home-page .utility-point h3 {
        font-size: 0.96rem;
        line-height: 1.35;
        margin-bottom: 0.35rem;
    }

    .home-page .utility-point p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .home-page .feature-promo {
        margin: 1.5rem 0 2.2rem;
        padding: 1.15rem;
        border-radius: 18px;
    }

    .home-page .home-workflow {
        margin-bottom: 1rem;
    }

    .home-page .home-workflow h2 {
        font-size: 1.08rem;
        margin-bottom: 0.65rem;
    }

    .home-page .home-workflow-grid {
        gap: 0.6rem;
    }

    .home-page .home-workflow-item {
        padding: 0.85rem;
    }

    .home-page .home-workflow-item h3 {
        font-size: 0.9rem;
    }

    .home-page .home-workflow-item p {
        font-size: 0.87rem;
    }

    .home-page .promo-text h2 {
        font-size: 1.2rem;
        line-height: 1.3;
        margin-bottom: 0.4rem;
    }

    .home-page .promo-text p {
        font-size: 0.94rem;
        line-height: 1.5;
    }

    .home-page .feature-promo .btn-outline {
        width: 100%;
        max-width: 320px;
        min-height: 46px;
        text-align: center;
        padding: 0.8rem 1rem;
    }

    .home-page .teaser-list { margin-bottom: 0.9rem; }

    .home-page .teaser-item { padding: 0.82rem 0.84rem; }

    .home-page .teaser-ticker {
        font-size: 0.92rem;
    }

    .home-page .teaser-rank {
        font-size: 0.72rem;
    }

    .home-page .teaser-name {
        font-size: 0.88rem;
        line-height: 1.35;
    }

    .home-page .teaser-meta {
        margin-top: 0.55rem;
    }

    .home-page .teaser-score {
        font-size: 0.75rem;
    }

    .home-page .teaser-lock-overlay {
        width: calc(100% - 0.8rem);
        padding: 0.9rem;
    }

    .home-page .teaser-lock-overlay h3 {
        font-size: 0.98rem;
    }

    .home-page .teaser-lock-overlay p {
        font-size: 0.82rem;
        margin-bottom: 0.7rem;
    }

    .home-page .teaser-lock-overlay .btn-primary {
        min-height: 44px;
        padding: 0.75rem 1rem;
        width: 100%;
        max-width: 260px;
    }

    .home-page .stock-grid {
        gap: 0.9rem;
        padding-bottom: 2.2rem;
    }

    .home-page .stock-card {
        padding: 1.05rem;
        min-height: auto;
        border-radius: 12px;
    }

    .home-page .card-header {
        margin-bottom: 0.95rem;
        align-items: center;
    }

    .home-page .ticker,
    .home-page .rank {
        font-size: 0.78rem;
    }

    .home-page .card-body {
        margin-bottom: 1rem;
        text-align: left;
    }

    .home-page .name {
        font-size: 1.02rem;
        white-space: normal;
        line-height: 1.35;
        margin-bottom: 0.5rem;
    }

    .home-page .signal-badge {
        font-size: 0.82rem;
        padding: 0.32rem 0.85rem;
    }

    .home-page .card-footer {
        padding-top: 0.8rem;
    }

    .home-page .metric .label {
        font-size: 0.72rem;
    }

    .home-page .metric .value {
        font-size: 0.98rem;
    }

    .home-page .blur-overlay {
        padding: 1.7rem 0.75rem;
        border-radius: 12px;
    }

    .home-page .cta-box h3 {
        font-size: 1.2rem;
    }

    .home-page .cta-box p {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }

    .home-page .cta-box .btn-primary {
        width: 100%;
        max-width: 280px;
        min-height: 46px;
        padding: 0.8rem 1rem;
    }
}

/* Flatpickr Custom */
.flatpickr-calendar {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-active) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5) !important;
    color: var(--text-primary) !important;
}
.flatpickr-day { color: var(--text-primary) !important; }
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange {
    background: var(--text-primary) !important;
    color: var(--bg-root) !important;
    border-color: var(--text-primary) !important;
}
.flatpickr-day:hover {
    background: var(--bg-card-hover) !important;
}
.flatpickr-current-month, .flatpickr-weekday {
    color: var(--text-primary) !important;
}
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month {
    fill: var(--text-secondary) !important;
}
.flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover {
    color: var(--text-muted) !important;
}

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

.mobile-cta-bar,
.mobile-dock {
    display: none;
}

@media (max-width: 900px) {
    body.has-mobile-dock,
    body.has-mobile-cta {
        padding-bottom: calc(76px + env(safe-area-inset-bottom));
    }

    .mobile-dock {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 930;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
        padding: 0.6rem 0.72rem calc(0.62rem + env(safe-area-inset-bottom));
        background: linear-gradient(180deg, rgba(4, 10, 21, 0.96), rgba(3, 8, 18, 0.98));
        border-top: 1px solid var(--border-subtle);
        backdrop-filter: blur(10px);
    }

    .mobile-dock.is-authenticated {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .mobile-dock.is-guest {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .mobile-dock-link {
        min-height: 48px;
        border-radius: 10px;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.16rem;
        text-decoration: none;
        font-size: 0.69rem;
        font-weight: 700;
        letter-spacing: 0.02em;
        border: 1px solid var(--border-subtle);
        color: var(--text-primary);
        background: rgba(255, 255, 255, 0.02);
        padding: 0.24rem 0.2rem;
        box-sizing: border-box;
    }

    .mobile-dock-icon {
        width: 1.02rem;
        height: 1.02rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--text-secondary);
        flex: 0 0 auto;
    }

    .mobile-dock-icon svg {
        width: 100%;
        height: 100%;
        stroke: currentColor;
        fill: none;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .mobile-dock-text {
        line-height: 1.1;
        text-align: center;
        white-space: nowrap;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-dock-link.active {
        border-color: var(--border-active);
        background: rgba(57, 194, 255, 0.12);
    }

    .mobile-dock-link.active .mobile-dock-icon {
        color: #e0f2ff;
    }

    .mobile-dock-link.is-auth {
        border-color: rgba(147, 197, 253, 0.55);
        background: rgba(37, 99, 235, 0.24);
        color: #eff8ff;
    }

    .mobile-dock-link.is-logout {
        border-color: rgba(248, 113, 113, 0.46);
        background: rgba(127, 29, 29, 0.2);
        color: #fecaca;
    }

    .mobile-cta-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 930;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
        padding: 0.65rem 0.75rem calc(0.65rem + env(safe-area-inset-bottom));
        background: rgba(2, 6, 23, 0.95);
        border-top: 1px solid var(--border-subtle);
        backdrop-filter: blur(8px);
    }

    .mobile-cta-primary,
    .mobile-cta-secondary {
        min-height: 44px;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        font-size: 0.9rem;
        font-weight: 700;
    }

    .mobile-cta-primary {
        background: var(--text-primary);
        color: var(--bg-root);
    }

    .mobile-cta-secondary {
        border: 1px solid var(--border-active);
        color: var(--text-primary);
        background: rgba(255, 255, 255, 0.02);
    }
}

/* Mobile readability pass: improve contrast and touch ergonomics */
@media (max-width: 900px) {
    :root {
        --text-secondary: #cbd5e1;
        --text-muted: #9fb1c9;
        --border-subtle: #31435f;
        --border-active: #4a5f81;
    }

    body.index-page-bg {
        background-image:
            linear-gradient(180deg, rgba(2, 6, 23, 0.72) 0%, rgba(2, 6, 23, 0.84) 48%, rgba(2, 6, 23, 0.94) 100%),
            radial-gradient(circle at 50% -18%, rgba(30, 41, 59, 0.64) 0%, rgba(2, 6, 23, 0.96) 78%);
    }

    .main-nav {
        background: linear-gradient(180deg, #0b1222 0%, #111c33 100%);
    }

    .nav-mobile-close {
        color: var(--text-primary);
        border-color: rgba(127, 148, 177, 0.35);
        background: rgba(255, 255, 255, 0.02);
    }

    .nav-link {
        color: var(--text-primary);
        font-weight: 700;
        min-height: 46px;
        padding: 0.85rem 0.8rem;
    }

    .nav-btn {
        min-height: 46px;
        font-size: 0.92rem;
    }

    .lang-switcher a,
    .hero-quick-links a {
        color: var(--text-primary);
    }

    .subtitle,
    .utility-point p,
    .promo-text p,
    .teaser-rank,
    .teaser-sub,
    .teaser-score,
    .metric .label,
    .s-name,
    .quote-meta,
    .insight-meta,
    .projection-meta,
    .projection-range,
    .legal-meta,
    .legal-card p,
    .f-col p,
    .disclaimer-box,
    .footer-bottom,
    .small-print {
        color: var(--text-secondary);
    }

    .search-box,
    .market-search,
    .header-stock-search input,
    .market-table tr,
    .stock-card,
    .utility-point,
    .feature-promo,
    .teaser-item,
    .table-container {
        border-color: var(--border-active);
    }

    .search-box input,
    .header-stock-search input,
    .market-search {
        font-size: 16px;
        min-height: 44px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-outline,
    .mobile-cta-primary,
    .mobile-cta-secondary {
        min-height: 46px;
    }

    .btn-secondary {
        background: #0b1730;
        border-color: var(--border-active);
        color: var(--text-primary);
    }

    .market-table tr {
        background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(10, 17, 33, 0.95));
        box-shadow: 0 2px 14px rgba(0, 0, 0, 0.22);
    }

    .market-table td {
        font-size: 0.96rem;
        line-height: 1.45;
    }

    .market-table td::before {
        color: var(--text-secondary);
        font-size: 0.72rem;
    }

    .market-table td.name-cell {
        color: var(--text-primary);
    }

    .market-table td .company-name {
        color: var(--text-secondary);
    }
}

/* Small phone tuning (iPhone mini/SE widths and similar) */
@media (max-width: 430px) {
    .container {
        padding: 0 0.78rem;
    }

    .header-inner {
        min-height: 64px;
        padding: 0 0.78rem;
    }

    .logo {
        font-size: 1.06rem;
        gap: 0.35rem;
    }

    .beta-tag {
        font-size: 0.55rem;
        padding: 0.1rem 0.32rem;
    }

    .main-nav {
        width: min(92%, 360px);
        padding: calc(0.56rem + env(safe-area-inset-top)) 0.78rem 0.82rem;
    }

    .home-page .hero {
        padding: 1.55rem 0.8rem 1.05rem;
    }

    .home-page .hero h1 {
        font-size: clamp(1.75rem, 9.5vw, 2.05rem);
        margin-bottom: 0.58rem;
    }

    .home-page .home-signature {
        gap: 0.42rem;
    }

    .home-page .home-pill {
        font-size: 0.64rem;
        padding: 0.26rem 0.52rem;
    }

    .home-page .subtitle {
        font-size: 0.96rem;
        line-height: 1.45;
        margin-bottom: 0.55rem;
    }

    .home-page .home-signal-note {
        font-size: 0.82rem;
        margin: 0 0 0.82rem;
    }

    .home-page .trust-stats {
        grid-template-columns: 1fr;
        gap: 0.48rem;
    }

    .home-page .trust-stats .t-stat:last-child {
        grid-column: auto;
    }

    .home-page .search-box {
        padding: 0.58rem 0.7rem;
    }

    .home-page .search-box input,
    .header-stock-search input,
    .market-search {
        min-height: 42px;
        font-size: 16px;
    }

    .nav-btn,
    .btn-primary,
    .btn-secondary,
    .btn-outline {
        min-height: 44px;
    }

    .home-page .teaser-list { border-radius: 10px; }

    .home-page .teaser-item,
    .home-page .stock-card {
        padding: 0.8rem;
    }

    .home-page .feature-promo {
        padding: 0.95rem;
        margin: 1.1rem 0 1.5rem;
    }

    .home-page .home-workflow-item {
        padding: 0.72rem;
    }

    .home-page .home-workflow-item h3 {
        font-size: 0.86rem;
    }

    .home-page .home-workflow-item p {
        font-size: 0.82rem;
    }

    .directory-header {
        padding: 1.25rem 0 0.85rem;
    }

    .market-table td {
        grid-template-columns: minmax(74px, 90px) minmax(0, 1fr);
        padding: 0.66rem 0.72rem;
        gap: 0.2rem 0.58rem;
        font-size: 0.91rem;
    }

    .market-table td::before {
        font-size: 0.64rem;
        letter-spacing: 0.045em;
    }

    .quote-price {
        font-size: 1.48rem;
    }

    .stock-insight-card {
        padding: 0.8rem;
    }

    .dividend-metrics,
    .dividend-summary-grid {
        gap: 0.4rem;
    }

    .footer-grid {
        gap: 1.35rem;
    }
}

@media (max-width: 380px) {
    .container {
        padding: 0 0.62rem;
    }

    .header-inner {
        padding: 0 0.62rem;
    }

    .home-page .hero h1 {
        font-size: clamp(1.62rem, 9.2vw, 1.9rem);
    }

    .home-page .subtitle {
        font-size: 0.93rem;
    }

    .home-page .hero-quick-links {
        gap: 0.4rem;
    }

    .home-page .hero-quick-links a {
        font-size: 0.78rem;
        padding: 0;
    }

    .market-table td {
        grid-template-columns: minmax(70px, 84px) minmax(0, 1fr);
        font-size: 0.89rem;
    }
}

/* Home V2 (professional landing redesign) */
.home-v2 {
    padding-top: 2.25rem;
    padding-bottom: 2.25rem;
    max-width: 1140px;
    margin: 0 auto;
}

.home-v2-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 1.15rem;
    background:
        radial-gradient(circle at 86% 10%, rgba(56, 189, 248, 0.14) 0%, rgba(56, 189, 248, 0) 42%),
        linear-gradient(145deg, rgba(10, 19, 35, 0.96) 0%, rgba(5, 11, 22, 0.98) 100%);
    border: 1px solid rgba(71, 100, 139, 0.72);
    border-radius: 22px;
    padding: 1.65rem;
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.3);
}

.home-v2-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.home-v2-copy,
.home-v2-preview {
    position: relative;
    z-index: 1;
}

.home-v2-eyebrow {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.62rem;
}

.home-v2-chip {
    border: 1px solid rgba(81, 159, 214, 0.6);
    background: rgba(49, 110, 156, 0.22);
    color: #d7ebff;
    border-radius: 999px;
    padding: 0.28rem 0.62rem;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    font-weight: 700;
    text-transform: uppercase;
}

.home-v2-copy h1 {
    font-size: clamp(2rem, 4.9vw, 3.2rem);
    line-height: 1.08;
    margin: 0 0 0.68rem;
    background: linear-gradient(150deg, #f8fcff 10%, #d3e7fb 50%, #8cc9ef 100%);
    -webkit-background-clip: text;
    color: transparent;
}

.home-v2-subtitle {
    margin: 0;
    color: var(--text-primary);
    font-size: clamp(0.98rem, 1.8vw, 1.12rem);
    line-height: 1.48;
    max-width: 62ch;
}

.home-v2-note {
    margin: 0.58rem 0 0.85rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.52;
}

.home-v2-search {
    margin: 0;
    max-width: 100%;
}

.home-v2-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.72rem;
}

.home-v2-actions .btn-primary,
.home-v2-actions .btn-secondary {
    min-width: 168px;
    text-align: center;
}

.home-v2-links {
    margin-top: 0.8rem;
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.home-v2-links a {
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
}

.home-v2-links a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.home-v2-preview {
    background: linear-gradient(180deg, rgba(12, 23, 42, 0.68), rgba(10, 17, 31, 0.78));
    border: 1px solid rgba(42, 59, 87, 0.9);
    border-radius: 16px;
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    backdrop-filter: blur(4px);
}

.home-v2-preview-head h2 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 800;
    background: linear-gradient(120deg, var(--text-primary) 30%, #8eccf5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.home-v2-preview-head p {
    margin: 0.24rem 0 0.56rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.home-v2-preview-list {
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.home-v2-preview-row {
    display: block;
    text-decoration: none;
    color: var(--text-primary);
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(127, 148, 177, 0.2);
}

.home-v2-preview-row:last-child {
    border-bottom: 0;
}

.home-v2-preview-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.home-v2-row-main,
.home-v2-row-name,
.home-v2-row-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.home-v2-row-main {
    margin-bottom: 0.18rem;
}

.ticker-with-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.52rem;
    min-width: 0;
}

.stock-logo {
    display: inline-block;
    flex: 0 0 auto;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 50%;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(108, 136, 171, 0.28);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.16);
    padding: 0.15rem;
}

.stock-logo--sm {
    width: 1.45rem;
    height: 1.45rem;
}

.stock-logo--xs {
    width: 1.25rem;
    height: 1.25rem;
    padding: 0.12rem;
}

.mobile-stock-ticker-line {
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
}

.market-directory-page .mobile-stock-ticker-line {
    display: none;
}

.home-v2-row-ticker {
    font-size: 0.92rem;
    font-weight: 800;
}

.home-v2-row-rank {
    font-size: 0.73rem;
    color: var(--text-secondary);
    font-weight: 700;
}

.home-v2-row-name {
    justify-content: flex-start;
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.home-v2-row-score {
    font-size: 0.74rem;
    color: var(--text-secondary);
    font-weight: 700;
}

.home-v2-preview-footer {
    margin-top: 0.8rem;
}

.home-v2-preview-footer .btn-secondary {
    width: 100%;
    text-align: center;
}

.home-v2-proof {
    margin: 1.1rem 0 0.95rem;
    padding: 0.6rem 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    border-top: 1px solid rgba(127, 148, 177, 0.22);
    border-bottom: 1px solid rgba(127, 148, 177, 0.22);
}

.home-v2-proof-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.15rem 0.15rem 0.15rem 0;
    border-right: 1px dashed rgba(127, 148, 177, 0.26);
}

.home-v2-proof-item:last-child {
    border-right: 0;
}

.home-v2-proof-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
}

.home-v2-proof-label {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.home-v2-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.3rem;
    margin-top: 1rem;
}

.home-v2-block {
    border-top: 1px solid rgba(127, 148, 177, 0.22);
    padding-top: 0.75rem;
}

.home-v2-block h2 {
    font-size: 1.2rem;
    margin: 0 0 0.65rem;
}

.home-v2-block-head p {
    margin: -0.15rem 0 0.9rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.55;
    max-width: 50rem;
}

.home-v2-block-list {
    display: grid;
    gap: 0.65rem;
}

.home-v2-list-item,
.home-v2-step {
    border-top: 0;
    border-bottom: 1px solid rgba(127, 148, 177, 0.2);
    padding: 0.62rem 0;
}

.home-v2-list-item:last-child,
.home-v2-step:last-child {
    border-bottom: 0;
}

.home-v2-list-item h3,
.home-v2-step h3 {
    margin: 0 0 0.25rem;
    font-size: 0.96rem;
}

.home-v2-list-item p,
.home-v2-step p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.5;
}

.home-v2-steps {
    display: grid;
    gap: 0.55rem;
}

.home-v2-step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.65rem;
}

.home-v2-step-index {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    background: rgba(57, 194, 255, 0.17);
    border: 1px solid rgba(57, 194, 255, 0.48);
    color: #dff2ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    margin-top: 0.05rem;
}

.home-v2-final {
    margin: 1.35rem 0 0.25rem;
    border: 1px solid rgba(71, 100, 139, 0.75);
    border-radius: 18px;
    padding: 1.35rem;
    background: linear-gradient(125deg, rgba(18, 30, 54, 0.85), rgba(10, 18, 34, 0.74));
    text-align: center;
}

.home-v2-final h2 {
    font-size: clamp(1.2rem, 3vw, 1.65rem);
    margin: 0 0 0.4rem;
}

.home-v2-final p {
    margin: 0 auto;
    color: var(--text-secondary);
    max-width: 64ch;
}

.home-v2-actions-final {
    justify-content: center;
    margin-top: 1rem;
}

@media (max-width: 980px) {
    .home-v2-hero {
        grid-template-columns: 1fr;
        padding: 1.35rem;
        border-radius: 16px;
    }

    .home-v2-copy h1 {
        font-size: clamp(1.85rem, 8.4vw, 2.6rem);
    }

    .home-v2-proof {
        grid-template-columns: 1fr 1fr;
    }

    .home-v2-proof-item:last-child {
        grid-column: 1 / -1;
    }

    .home-v2-sections {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .home-v2 {
        padding-top: 1.25rem;
        padding-bottom: 1.5rem;
    }

    .home-v2-subtitle,
    .home-v2-note,
    .home-v2-links a,
    .home-v2-list-item p,
    .home-v2-step p,
    .home-v2-final p {
        font-size: 0.92rem;
    }

    .home-v2-actions {
        flex-direction: column;
    }

    .home-v2-actions .btn-primary,
    .home-v2-actions .btn-secondary {
        width: 100%;
        min-width: 0;
        min-height: 46px;
    }

    .home-v2-proof {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .home-v2-proof-item {
        border-right: 0;
        border-bottom: 1px dashed rgba(127, 148, 177, 0.28);
        padding: 0.38rem 0;
    }

    .home-v2-proof-item:last-child {
        border-bottom: 0;
        grid-column: auto;
    }

    .home-v2-links {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.36rem;
    }

    .home-v2-links a {
        padding: 0.35rem 0;
    }
}

/* Cross-page professional/mobile polish */
.companies-page .directory-header,
.social-page .directory-header,
.public-portfolio-page .directory-header,
.market-directory-page .directory-header {
    max-width: 980px;
}

.companies-page .market-search {
    max-width: 560px;
}

.companies-page .letter-filter {
    margin-top: 0.9rem;
}

.companies-page .letter-chip {
    min-height: 34px;
}

.social-page .social-guest-cta {
    justify-content: flex-start;
    margin-top: 0.4rem;
}

.social-page .social-table-container {
    border-radius: 12px;
}

.social-page .social-table td[colspan] {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 1rem;
}

.social-page .portfolio-risk-label {
    margin-top: 0.15rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.social-page .social-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.social-page .social-follow-form {
    display: inline-flex;
}

.social-page .action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-primary);
    background: var(--bg-card-hover);
    border: 1px solid var(--border-active);
    padding: 0.28rem 0.58rem;
}

.social-page .social-follow-btn {
    border: none;
    cursor: pointer;
}

.social-page .social-follow-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.public-portfolio-page .panel-eyebrow {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--text-secondary);
}

.public-portfolio-page .value-amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

.public-portfolio-page .value-currency {
    font-size: 1rem;
    color: var(--text-muted);
}

.public-portfolio-page .chart-wrap {
    max-height: 250px;
    display: flex;
    justify-content: center;
}

.public-portfolio-page .holding-name {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.public-portfolio-page .public-holdings-container {
    margin-bottom: 2.5rem;
}

.stock-detail-page .stock-detail-header {
    padding-bottom: 1rem;
}

.stock-detail-page .stock-trust-stats {
    justify-content: flex-start;
    margin-top: 0.75rem;
    margin-bottom: 0;
}

.stock-detail-page .stock-detail-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.6rem;
}

.stock-detail-page .stock-detail-actions .btn-primary,
.stock-detail-page .stock-detail-actions .btn-secondary {
    min-width: 166px;
    text-align: center;
}

.stock-decision-note {
    margin: -0.55rem 0 1.05rem;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.48;
    max-width: 46rem;
}

.market-intent-strip {
    margin: 0.68rem 0 0.85rem;
    padding: 0.82rem 0.9rem;
    border: 1px solid rgba(51, 89, 127, 0.32);
    border-radius: 14px;
    background:
        radial-gradient(circle at top right, rgba(57, 194, 255, 0.06), transparent 28%),
        linear-gradient(180deg, rgba(12, 23, 38, 0.94), rgba(8, 17, 29, 0.98));
}

.market-intent-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.market-intent-card {
    padding: 0.78rem 0.84rem;
    border-radius: 12px;
    border: 1px solid rgba(74, 111, 167, 0.18);
    background: rgba(255, 255, 255, 0.03);
}

.market-intent-card h2 {
    margin: 0 0 0.2rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.market-intent-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.45;
}

.market-intent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.68rem;
}

.stock-detail-page .related-sector-title {
    font-size: 1rem;
    margin: 0 0 0.8rem;
    color: var(--text-secondary);
}

.profile-page .profile-container {
    max-width: 680px;
}

.profile-page .profile-section {
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.24);
}

.profile-page .checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #d2e8ff;
}

.legal-page .legal-card {
    max-width: 920px;
    box-shadow: 0 20px 42px rgba(1, 4, 12, 0.28);
}

.legal-page .legal-meta {
    display: inline-block;
    margin: 0.35rem 0 0.85rem;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 0.2rem 0.62rem;
    font-size: 0.72rem;
    line-height: 1.45;
}

.legal-page .legal-card > p {
    margin-bottom: 0.75rem;
}

.legal-page .legal-card section {
    padding: 0.2rem 0;
}

.unsubscribe-page {
    padding-top: 1.6rem;
}

.unsubscribe-page .unsubscribe-card {
    max-width: 680px;
}

.unsubscribe-page .unsubscribe-message {
    margin: 0.7rem 0 0;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0.82rem 0.9rem;
    font-weight: 600;
    line-height: 1.5;
}

.unsubscribe-page .unsubscribe-ok {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.12);
    color: #9ef4ca;
}

.unsubscribe-page .unsubscribe-err {
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.1);
    color: #fbb2b2;
}

.unsubscribe-page .unsubscribe-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.unsubscribe-page .unsubscribe-actions .btn-primary,
.unsubscribe-page .unsubscribe-actions .btn-secondary {
    min-width: 170px;
    text-align: center;
}

/* Mobile readability uplift */
@media (max-width: 900px) {
    :root {
        --text-secondary: #c9d6e8;
        --text-muted: #9fb3ce;
    }

    .btn-primary,
    .btn-secondary,
    .btn-outline,
    .nav-btn {
        min-height: 44px;
    }

    .directory-header h1 {
        font-size: clamp(1.45rem, 6.2vw, 1.95rem);
        line-height: 1.2;
    }

    .directory-header .subtitle {
        color: var(--text-secondary);
    }

    .table-container {
        border-radius: 12px;
    }

    .profile-page .profile-section {
        padding: 1rem;
        border-radius: 12px;
    }

    .legal-page .legal-card {
        padding: 1.05rem;
        border-radius: 14px;
    }
}

@media (max-width: 980px) {
    .home-v2-proof {
        margin-top: 0.6rem;
        padding-top: 0.35rem;
    }

    .home-v2-final {
        margin-top: 1rem;
    }
}

@media (max-width: 900px) {
    .home-v2 {
        padding-bottom: 1.5rem;
    }

    .home-v2-hero {
        border-radius: 14px;
        padding: 1rem;
        box-shadow: none;
    }

    .home-v2-copy h1 {
        letter-spacing: -0.02em;
    }

    .home-v2-subtitle {
        line-height: 1.5;
    }

    .home-v2-links {
        gap: 0.68rem;
    }

    .home-v2-links a {
        font-size: 0.84rem;
    }

    .home-v2-proof {
        border-bottom: 1px solid var(--border-subtle);
        padding: 0.15rem 0 0.6rem;
        gap: 0.35rem;
    }

    .home-v2-proof-item {
        border: none;
        border-radius: 0;
        background: transparent;
        padding: 0.3rem 0;
        border-bottom: 1px dashed rgba(127, 148, 177, 0.35);
    }

    .home-v2-proof-item:last-child {
        border-bottom: none;
    }

    .home-v2-proof-value {
        font-size: 1.02rem;
    }

    .home-v2-proof-label {
        font-size: 0.74rem;
    }

    .home-v2-sections {
        margin-top: 0.65rem;
        gap: 0.9rem;
    }

    .home-v2-block h2 {
        font-size: 1.05rem;
        margin-bottom: 0.5rem;
    }

    .home-v2-list-item,
    .home-v2-step {
        border-top: none;
        border-bottom: 1px solid var(--border-subtle);
        padding: 0.45rem 0;
    }

    .home-v2-step:last-child,
    .home-v2-list-item:last-child {
        border-bottom: none;
    }

    .home-v2-final {
        padding: 1rem;
        border-radius: 14px;
    }

    .companies-page .letter-filter {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.15rem;
        -webkit-overflow-scrolling: touch;
    }

    .companies-page .letter-chip {
        flex: 0 0 auto;
        min-height: 36px;
        min-width: 36px;
        font-size: 0.78rem;
    }

    .social-page .social-actions-cell {
        text-align: left !important;
    }

    .social-page .social-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .social-page .action-link,
    .social-page .social-follow-btn {
        min-height: 34px;
        padding: 0.24rem 0.56rem;
        font-size: 0.72rem;
        letter-spacing: 0.03em;
    }

    .public-portfolio-page .top-stats {
        gap: 0.9rem;
    }

    .public-portfolio-page .value-amount {
        font-size: 2rem;
    }

    .public-portfolio-page .chart-wrap {
        max-height: 220px;
    }

    .stock-detail-page .stock-trust-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .stock-detail-page .stock-trust-stats .t-stat {
        width: 100%;
    }

    .stock-detail-page .stock-trust-stats .t-stat:last-child {
        grid-column: 1 / -1;
    }

    .stock-detail-page .stock-detail-actions .btn-primary,
    .stock-detail-page .stock-detail-actions .btn-secondary {
        width: 100%;
        min-width: 0;
    }

    .stock-detail-page .projection-row {
        grid-template-columns: 1fr;
    }

    .stock-detail-page .projection-price,
    .stock-detail-page .projection-range {
        text-align: left;
    }

    .stock-detail-page .projection-meta,
    .stock-detail-page .projection-range {
        grid-column: 1 / -1;
    }

    .profile-page .profile-section {
        box-shadow: none;
    }

    .unsubscribe-page .unsubscribe-actions {
        flex-direction: column;
    }

    .unsubscribe-page .unsubscribe-actions .btn-primary,
    .unsubscribe-page .unsubscribe-actions .btn-secondary {
        width: 100%;
        min-width: 0;
    }

    .main-footer {
        margin-top: 2.1rem;
        padding: 2.5rem 0 1.2rem;
    }

    .footer-grid {
        gap: 1.1rem;
        margin-bottom: 1.4rem;
    }

    .disclaimer-box {
        margin-bottom: 1.5rem;
        padding: 1rem;
    }
}

@media (max-width: 430px) {
    .home-v2-proof-item {
        padding: 0.5rem 0.55rem;
    }

    .home-v2-copy h1 {
        font-size: clamp(1.65rem, 8.6vw, 1.98rem);
    }

    .home-v2-subtitle,
    .home-v2-note {
        font-size: 0.9rem;
    }

    .social-page .social-table td {
        padding: 0.66rem 0.72rem;
    }

    .public-portfolio-page .panel-eyebrow {
        letter-spacing: 0.16em;
    }

    .public-portfolio-page .value-amount {
        font-size: 1.75rem;
        margin: 0.35rem 0;
    }

    .stock-detail-page .quote-price {
        font-size: 1.4rem;
    }

    .stock-detail-page .quote-change {
        font-size: 0.9rem;
    }
}

/* Mobile refinement pass: stocks + social + portfolio ergonomics */
@media (max-width: 900px) {
    .stock-detail-page .stock-quote-line {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .stock-detail-page .stock-insight-card {
        padding: 0.9rem;
        border-radius: 10px;
    }

    .stock-detail-page .insight-kv {
        font-size: 0.86rem;
    }

    .social-page .social-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.45rem;
        width: 100%;
    }

    .social-page .action-link,
    .social-page .social-follow-btn {
        width: 100%;
        min-height: 40px;
        justify-content: center;
        text-align: center;
        padding: 0.36rem 0.6rem;
        font-size: 0.78rem;
    }

    .companies-page .directory-header .market-search {
        width: 100%;
        min-height: 48px;
        font-size: 0.95rem;
    }

    .companies-page .letter-filter {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: max-content;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        padding-bottom: 0.15rem;
        margin-top: 0.8rem;
        scrollbar-width: none;
    }

    .companies-page .letter-filter::-webkit-scrollbar {
        display: none;
    }

    .companies-page .letter-chip {
        min-height: 44px;
        padding: 0.58rem 0.85rem;
        white-space: nowrap;
    }

    .social-page .social-guest-cta {
        margin-top: 0.85rem;
    }

    .social-page .social-guest-cta .btn-primary {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }

    .portfolio-page .charts-grid .chart-container > h3 {
        font-size: 0.72rem !important;
        margin-bottom: 0.7rem !important;
    }

    .portfolio-page .charts-grid .chart-container > .chart-canvas-wrap {
        height: 180px !important;
    }

    .portfolio-page .action-stack {
        grid-template-columns: 1fr 1fr !important;
    }

    .portfolio-page .move-form {
        grid-template-columns: 1.25fr 0.75fr !important;
    }

    .portfolio-page .export-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.55rem;
    }

    .portfolio-page .export-grid > div {
        grid-column: 1 / -1;
        margin-left: 0 !important;
        border-left: 0 !important;
        padding-left: 0 !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.45rem !important;
    }

    .portfolio-page .export-grid input[type="date"],
    .portfolio-page .export-grid button {
        width: 100%;
        min-height: 42px;
        box-sizing: border-box;
    }
}

/* Mobile professional polish: landing clarity + navigation */
@media (max-width: 900px) {
    .market-table td .cell-value {
        word-break: break-word;
    }

    .home-v2-hero::after {
        display: none;
    }

    .home-v2-hero {
        border-radius: 16px;
        padding: 1.05rem;
        box-shadow: none;
    }

    .home-v2-copy h1 {
        font-size: clamp(1.78rem, 8.2vw, 2.24rem);
        line-height: 1.12;
        margin-bottom: 0.62rem;
    }

    .home-v2-subtitle {
        font-size: 0.98rem;
        color: #e2ebf8;
    }

    .home-v2-note {
        margin: 0.58rem 0 0.9rem;
        color: #c7d6ea;
        font-size: 0.86rem;
    }

    .home-v2-preview {
        padding: 0.78rem;
        border-radius: 12px;
        border-color: rgba(74, 95, 129, 0.65);
        background: linear-gradient(180deg, rgba(12, 23, 42, 0.88), rgba(9, 16, 30, 0.92));
    }

    .home-v2-preview-head p {
        color: #c5d6ec;
        font-size: 0.8rem;
        margin-bottom: 0.58rem;
    }

    .home-v2-preview-row {
        padding: 0.64rem 0;
    }

    .home-v2-row-name,
    .home-v2-row-rank,
    .home-v2-row-score {
        color: #ccdcf0;
    }

    .home-v2-proof {
        display: none;
    }

    .home-v2-sections {
        margin-top: 0.45rem;
        gap: 0.72rem;
    }

    .home-v2-block {
        padding-top: 0.58rem;
    }

    .home-v2-list-item,
    .home-v2-step {
        padding: 0.5rem 0;
    }

    .home-v2-final {
        margin-top: 0.82rem;
        padding: 0.95rem;
        border-radius: 12px;
    }

    .home-v2-final p {
        color: #d1deef;
        font-size: 0.92rem;
    }
}

@media (max-width: 640px) {
    .home-v2-preview-row:nth-child(n+3) {
        display: none;
    }

    .mobile-dock-link {
        font-size: 0.66rem;
        min-height: 46px;
    }

    .mobile-dock-icon {
        width: 0.98rem;
        height: 0.98rem;
    }
}

@media (max-width: 430px) {
    .mobile-dock {
        gap: 0.4rem;
        padding: 0.52rem 0.56rem calc(0.56rem + env(safe-area-inset-bottom));
    }

    .mobile-dock-link {
        min-height: 44px;
        border-radius: 9px;
        font-size: 0.62rem;
        letter-spacing: 0.01em;
    }

    .mobile-dock-icon {
        width: 0.9rem;
        height: 0.9rem;
    }
}

/* Mobile polish: social/public/profile/legal */
@media (max-width: 900px) {
    .social-page .social-header {
        padding-bottom: 0.7rem;
    }

    .social-page .social-header .subtitle {
        max-width: 60ch;
        font-size: 0.95rem;
        line-height: 1.45;
    }

    .social-page .social-table tr {
        border-radius: 12px;
    }

    .social-page .social-table td:first-child {
        background: rgba(255, 255, 255, 0.02);
    }

    .social-page .social-table td.font-mono {
        font-size: 0.94rem;
    }

    .social-page .action-link,
    .social-page .social-follow-btn {
        border-radius: 10px;
        font-weight: 700;
        letter-spacing: 0.02em;
    }

    .public-portfolio-page .public-portfolio-head {
        padding-bottom: 0.4rem;
    }

    .public-portfolio-page .public-portfolio-head .subtitle {
        font-size: 0.93rem;
        line-height: 1.45;
        color: var(--text-secondary);
    }

    .public-portfolio-page .public-holdings-table tr {
        border-color: var(--border-active);
    }

    .public-portfolio-page .public-holdings-table td:first-child {
        background: rgba(255, 255, 255, 0.02);
    }

    .public-portfolio-page .holding-name {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    .profile-page .profile-container {
        margin: 1.1rem auto 1.85rem;
    }

    .profile-page .profile-section h2 {
        margin-bottom: 0.85rem;
    }

    .profile-page .btn-save,
    .profile-page .btn-delete {
        border-radius: 10px;
    }

    .legal-page .legal-card h1 {
        font-size: clamp(1.3rem, 6vw, 1.65rem);
        line-height: 1.2;
    }

    .legal-page .legal-card h2 {
        font-size: 0.96rem;
    }

    .legal-page .legal-card > p,
    .legal-page .legal-card section p {
        font-size: 0.93rem;
        line-height: 1.55;
    }
}

@media (max-width: 430px) {
    .social-page .social-header .subtitle,
    .public-portfolio-page .public-portfolio-head .subtitle {
        font-size: 0.9rem;
    }

    .legal-page .legal-card > p,
    .legal-page .legal-card section p {
        font-size: 0.9rem;
    }
}

/* Mobile polish: market + companies scanability */
@media (max-width: 900px) {
    .market-directory-page .directory-header,
    .companies-page .directory-header {
        padding-bottom: 0.7rem;
    }

    .market-directory-page .directory-meta,
    .companies-page .directory-meta {
        margin-top: 0.24rem;
        margin-bottom: 0.55rem;
        font-size: 0.8rem;
        color: var(--text-secondary);
    }

    .market-directory-page .table-container,
    .companies-page .table-container {
        margin-bottom: 1.15rem;
    }

    .market-directory-page .market-table tr,
    .companies-page .market-table tr {
        border-color: rgba(74, 95, 129, 0.68);
        background: linear-gradient(180deg, rgba(13, 22, 41, 0.92), rgba(9, 15, 30, 0.9));
        box-shadow: none;
    }

    .market-directory-page .market-table td,
    .companies-page .market-table td {
        grid-template-columns: minmax(72px, 88px) minmax(0, 1fr);
        padding: 0.62rem 0.74rem;
        font-size: 0.91rem;
    }

    .market-directory-page .market-table td::before,
    .companies-page .market-table td::before {
        font-size: 0.66rem;
        color: #c3d3e7;
    }

    .market-directory-page .market-table td.ticker-cell strong,
    .companies-page .market-table td:first-child strong {
        font-size: 0.96rem;
    }

    .market-directory-page .market-table td.name-cell .company-name,
    .companies-page .market-table td:nth-child(2) .cell-value,
    .companies-page .market-table td:nth-child(2) {
        color: var(--text-secondary);
        line-height: 1.35;
    }

    .companies-page .letter-filter {
        margin-top: 0.68rem;
        padding-bottom: 0.24rem;
    }

    .companies-page .letter-chip {
        min-height: 38px;
        min-width: 38px;
        padding: 0 0.68rem;
        border-color: rgba(71, 100, 139, 0.7);
        background: rgba(255, 255, 255, 0.035);
    }
}

@media (max-width: 430px) {
    .market-directory-page .market-table td,
    .companies-page .market-table td {
        grid-template-columns: minmax(68px, 82px) minmax(0, 1fr);
        padding: 0.58rem 0.66rem;
        font-size: 0.88rem;
    }

    .market-directory-page .directory-meta,
    .companies-page .directory-meta {
        font-size: 0.77rem;
    }
}

/* Mobile clarity pass: navigation + landing simplification */
@media (max-width: 900px) {
    .header-inner {
        min-height: 62px;
        padding: 0 0.78rem;
    }

    .logo {
        font-size: 1.02rem;
        letter-spacing: 0.01em;
    }

    .mobile-menu-toggle {
        border: 1px solid var(--border-subtle);
        border-radius: 9px;
        padding: 0.34rem 0.4rem;
        background: rgba(255, 255, 255, 0.03);
    }

    .mobile-menu-toggle .bar {
        width: 18px;
        margin: 4px 0;
    }

    .main-nav {
        width: min(86%, 360px);
    }

    .home-v2 {
        padding-top: 0.95rem;
    }

    .home-v2-hero {
        gap: 0.78rem;
        padding: 0.95rem;
        border-color: rgba(74, 95, 129, 0.74);
        background: linear-gradient(145deg, rgba(8, 15, 29, 0.97), rgba(6, 10, 20, 0.99));
    }

    .home-v2-copy h1 {
        font-size: clamp(1.7rem, 8.2vw, 2.1rem);
        margin-bottom: 0.55rem;
    }

    .home-v2-subtitle {
        font-size: 0.97rem;
        max-width: 40ch;
    }

    .home-v2-note {
        margin: 0.52rem 0 0.78rem;
        font-size: 0.88rem;
    }

    .home-v2-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.48rem;
        margin-top: 0.72rem;
    }

    .home-v2-links a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 38px;
        border: 1px solid rgba(74, 95, 129, 0.74);
        border-radius: 10px;
        padding: 0.38rem 0.5rem;
        background: rgba(255, 255, 255, 0.02);
        color: #d7e7f8;
        text-decoration: none;
    }

    .home-v2-preview {
        margin-top: 0.15rem;
        padding: 0.72rem;
        border-radius: 11px;
    }

    .home-v2-preview-row {
        padding: 0.58rem 0;
    }

    .home-v2-preview-row:nth-child(n+4) {
        display: none;
    }

    .home-v2-proof,
    .home-v2-sections {
        display: none;
    }

    .home-v2-final {
        margin-top: 0.7rem;
        border-radius: 12px;
        padding: 0.9rem;
        text-align: left;
        background: linear-gradient(145deg, rgba(18, 30, 54, 0.7), rgba(10, 18, 34, 0.55));
    }

    .home-v2-actions-final {
        justify-content: flex-start;
        margin-top: 0.78rem;
    }

    .home-v2-actions-final .btn-primary,
    .home-v2-actions-final .btn-secondary {
        width: 100%;
        min-width: 0;
        min-height: 46px;
    }
}

@media (max-width: 640px) {
    .mobile-top-actions {
        gap: 0.3rem;
        margin-right: 0.3rem;
    }

    .mobile-auth-shortcut {
        min-width: 0;
        padding: 0.34rem 0.56rem;
        font-size: 0.7rem;
    }

    .mobile-dock {
        gap: 0.34rem;
        padding: 0.5rem 0.44rem calc(0.54rem + env(safe-area-inset-bottom));
    }

    .mobile-dock-link {
        min-height: 44px;
        border-radius: 8px;
        font-size: 0.6rem;
    }

    .mobile-dock-text {
        letter-spacing: 0;
    }
}

@media (max-width: 430px) {
    .home-v2-links {
        grid-template-columns: 1fr;
    }
}

/* Final mobile pass: declutter layout and strengthen navigation clarity */
@media (max-width: 900px) {
    .header-inner {
        gap: 0.45rem;
    }

    .mobile-top-actions {
        margin-right: 0.22rem;
    }

    .mobile-auth-shortcut {
        min-height: 34px;
        padding: 0.32rem 0.58rem;
        font-size: 0.69rem;
        border-radius: 999px;
    }

    .mobile-menu-toggle {
        border: 1px solid rgba(127, 148, 177, 0.42);
        border-radius: 9px;
        background: rgba(2, 6, 23, 0.55);
        padding: 0.32rem 0.4rem;
    }

    .main-nav {
        width: min(92%, 400px);
        padding: calc(0.72rem + env(safe-area-inset-top)) 0.9rem 0.9rem;
    }

    .nav-mobile-auth {
        gap: 0.42rem;
        padding-bottom: 0.72rem;
    }

    .nav-mobile-auth .nav-mobile-auth-btn {
        min-height: 44px;
        font-size: 0.88rem;
    }

    .nav-links {
        gap: 0.1rem;
    }

    .nav-link {
        min-height: 42px;
        padding: 0.68rem 0.72rem;
        border-radius: 9px;
    }

    .nav-link-text {
        font-size: 0.95rem;
    }

    .nav-utils {
        gap: 0.68rem;
        margin-top: 0.45rem;
        padding-top: 0.62rem;
    }

    .home-v2 {
        padding-top: 0.72rem;
        padding-bottom: 1.1rem;
    }

    .home-v2-hero {
        gap: 0.68rem;
        padding: 0.88rem;
        border-radius: 12px;
    }

    .home-v2-copy h1 {
        font-size: clamp(1.58rem, 7.5vw, 1.96rem);
        margin-bottom: 0.46rem;
    }

    .home-v2-subtitle {
        font-size: 0.93rem;
        line-height: 1.45;
    }

    .home-v2-note {
        margin: 0.42rem 0 0.68rem;
        font-size: 0.82rem;
    }

    .home-v2-links,
    .home-v2-proof,
    .home-v2-sections,
    .home-v2-final {
        display: none;
    }

    .home-v2-preview {
        margin-top: 0.1rem;
        padding: 0.68rem;
        border-radius: 10px;
        border-color: rgba(74, 95, 129, 0.62);
        background: linear-gradient(180deg, rgba(11, 20, 36, 0.78), rgba(8, 15, 28, 0.88));
    }

    .home-v2-preview-head p {
        margin: 0.24rem 0 0.52rem;
        font-size: 0.77rem;
    }

    .home-v2-preview-row {
        padding: 0.54rem 0;
    }

    .home-v2-preview-row:nth-child(n+3) {
        display: none;
    }

    .market-directory-page .table-container,
    .companies-page .table-container,
    .public-portfolio-page .public-holdings-container {
        margin-bottom: 1rem;
    }

    .market-directory-page .market-table tr,
    .companies-page .market-table tr,
    .public-portfolio-page .public-holdings-table tr {
        margin-bottom: 0.54rem;
        border-radius: 10px;
        border-color: rgba(74, 95, 129, 0.64);
        background: linear-gradient(180deg, rgba(12, 20, 36, 0.9), rgba(8, 14, 27, 0.9));
        box-shadow: none;
    }

    .market-directory-page .market-table td,
    .companies-page .market-table td,
    .public-portfolio-page .public-holdings-table td {
        padding: 0.58rem 0.68rem;
        gap: 0.16rem 0.58rem;
        font-size: 0.89rem;
    }

    .market-directory-page .market-table td::before,
    .companies-page .market-table td::before,
    .public-portfolio-page .public-holdings-table td::before {
        font-size: 0.64rem;
    }

    .market-directory-page .market-table td.ticker-cell strong,
    .public-portfolio-page .public-holdings-table td strong {
        font-size: 0.92rem;
    }

    .public-portfolio-page .holding-name {
        font-size: 0.75rem;
        line-height: 1.32;
    }
}

@media (max-width: 430px) {
    .mobile-auth-shortcut {
        font-size: 0.65rem;
        padding: 0.28rem 0.5rem;
        min-height: 32px;
    }

    .home-v2-copy h1 {
        font-size: clamp(1.44rem, 8vw, 1.8rem);
    }

    .home-v2-subtitle {
        font-size: 0.88rem;
    }

    .home-v2-preview-row:nth-child(n+2) {
        display: none;
    }

    .main-nav {
        width: min(94%, 360px);
    }
}

/* Final mobile pass: social + companies simplification */
@media (max-width: 900px) {
    .social-page .social-header {
        padding-bottom: 0.55rem;
    }

    .social-page .social-header .subtitle {
        font-size: 0.9rem;
        line-height: 1.42;
        max-width: 58ch;
    }

    .social-page .social-table-container {
        margin-bottom: 1rem;
    }

    .social-page .social-table tr {
        margin-bottom: 0.52rem;
        border-radius: 10px;
        border-color: rgba(74, 95, 129, 0.62);
        background: linear-gradient(180deg, rgba(12, 20, 36, 0.9), rgba(8, 14, 27, 0.9));
        box-shadow: none;
    }

    .social-page .social-table td {
        padding: 0.54rem 0.64rem;
        gap: 0.14rem 0.52rem;
        font-size: 0.87rem;
    }

    .social-page .social-table td::before {
        font-size: 0.62rem;
        color: #c7d7ea;
    }

    .social-page .social-table td:first-child {
        background: transparent;
    }

    .social-page .portfolio-risk-label {
        font-size: 0.67rem;
        margin-top: 0.12rem;
    }

    .social-page .social-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.38rem;
        width: 100%;
    }

    .social-page .social-follow-form {
        width: 100%;
        display: block;
    }

    .social-page .social-follow-form .social-follow-btn,
    .social-page .action-link {
        width: 100%;
        min-height: 38px;
        border-radius: 8px;
        font-size: 0.73rem;
        padding: 0.3rem 0.5rem;
        text-align: center;
        justify-content: center;
    }

    .social-page .social-actions-cell {
        padding-top: 0.42rem;
    }

    .companies-page .directory-header {
        padding-bottom: 0.58rem;
    }

    .companies-page .directory-header .subtitle {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .companies-page .directory-meta {
        margin-bottom: 0.45rem;
        font-size: 0.76rem;
    }

    .companies-page .market-search {
        margin-bottom: 0.55rem;
        min-height: 40px;
        font-size: 0.9rem;
    }

    .companies-page .letter-filter {
        margin-top: 0.48rem;
        gap: 0.34rem;
        padding-bottom: 0.18rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .companies-page .letter-chip {
        min-height: 34px;
        min-width: 34px;
        padding: 0 0.58rem;
        font-size: 0.72rem;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.03);
    }

    .companies-page .table-container {
        margin-bottom: 0.9rem;
    }

    .companies-page .market-table tr {
        margin-bottom: 0.5rem;
        border-radius: 10px;
        border-color: rgba(74, 95, 129, 0.62);
        background: linear-gradient(180deg, rgba(12, 20, 36, 0.9), rgba(8, 14, 27, 0.9));
        box-shadow: none;
    }

    .companies-page .market-table td {
        padding: 0.54rem 0.62rem;
        gap: 0.14rem 0.52rem;
        font-size: 0.86rem;
    }

    .companies-page .market-table td::before {
        font-size: 0.62rem;
    }

    .companies-page .market-table td:first-child strong {
        font-size: 0.91rem;
    }

    .companies-page .market-table td:nth-child(2) {
        color: var(--text-secondary);
        line-height: 1.32;
    }
}

@media (max-width: 430px) {
    .social-page .social-actions {
        grid-template-columns: 1fr;
    }

    .social-page .social-table td {
        padding: 0.5rem 0.58rem;
        font-size: 0.84rem;
    }

    .companies-page .letter-chip {
        min-height: 32px;
        min-width: 32px;
        padding: 0 0.5rem;
        font-size: 0.68rem;
    }

    .companies-page .market-table td {
        padding: 0.5rem 0.56rem;
        font-size: 0.83rem;
    }
}

/* Final mobile pass: stock detail + profile simplification */
@media (max-width: 900px) {
    .stock-detail-page .stock-detail-header {
        padding-bottom: 0.62rem;
    }

    .stock-detail-page .stock-detail-header .subtitle {
        font-size: 0.88rem;
        line-height: 1.42;
        margin-top: 0.3rem;
    }

    .stock-detail-page .stock-quote-line {
        gap: 0.24rem;
        margin-top: 0.32rem;
    }

    .stock-detail-page .quote-price {
        font-size: 1.36rem;
        line-height: 1.16;
    }

    .stock-detail-page .quote-change {
        font-size: 0.84rem;
    }

    .stock-detail-page .quote-meta {
        font-size: 0.72rem;
    }

    .stock-detail-page .stock-insights-grid {
        gap: 0.62rem;
        margin: 0.72rem 0 0.92rem;
    }

    .stock-detail-page .stock-insight-card {
        border-radius: 10px;
        padding: 0.72rem;
        border-color: rgba(74, 95, 129, 0.54);
        background: rgba(12, 22, 40, 0.76);
    }

    .stock-detail-page .stock-insight-card h2 {
        font-size: 0.84rem;
        margin-bottom: 0.5rem;
    }

    .stock-detail-page .insight-meta {
        margin: 0.14rem 0 0.52rem;
        font-size: 0.7rem;
    }

    .stock-detail-page .insight-kv {
        gap: 0.55rem;
        padding: 0.34rem 0;
        font-size: 0.76rem;
    }

    .stock-detail-page .score-matrix {
        gap: 0.34rem;
        grid-template-columns: 1fr repeat(3, minmax(0, 1fr));
    }

    .stock-detail-page .score-cell {
        border-radius: 7px;
        padding: 0.34rem 0.28rem 0.3rem;
    }

    .stock-detail-page .score-bar-value {
        font-size: 0.74rem;
    }

    .stock-detail-page .score-bar-stage {
        height: 72px;
    }

    .stock-detail-page .score-label {
        font-size: 0.74rem;
    }

    .stock-detail-page .dividend-pill {
        margin-bottom: 0.5rem;
        padding: 0.24rem 0.58rem;
        font-size: 0.68rem;
    }

    .stock-detail-page .dividend-metrics {
        grid-template-columns: 1fr 1fr;
        gap: 0.36rem;
    }

    .stock-detail-page .dividend-summary-grid {
        grid-template-columns: 1fr;
        gap: 0.36rem;
        margin-bottom: 0.36rem;
    }

    .stock-detail-page .metric-box {
        padding: 0.42rem;
        border-radius: 7px;
    }

    .stock-detail-page .metric-box span {
        font-size: 0.64rem;
    }

    .stock-detail-page .metric-box strong {
        font-size: 0.83rem;
    }

    .stock-detail-page .projection-grid {
        gap: 0.4rem;
    }

    .stock-detail-page .projection-row {
        border-radius: 7px;
        padding: 0.42rem 0.5rem;
        gap: 0.12rem 0.5rem;
    }

    .stock-detail-page .projection-label {
        font-size: 0.72rem;
    }

    .stock-detail-page .projection-price {
        font-size: 0.8rem;
    }

    .stock-detail-page .projection-meta,
    .stock-detail-page .projection-range {
        font-size: 0.66rem;
    }

    .stock-detail-page .stock-detail-actions {
        gap: 0.48rem;
        margin-bottom: 0.9rem;
    }

    .stock-detail-page .related-sector-section {
        margin-top: 0.92rem;
        padding-top: 0.84rem;
    }

    .stock-detail-page .related-sector-title {
        margin: 0 0 0.54rem;
        font-size: 0.88rem;
    }

    .profile-page .profile-container {
        margin: 0.95rem auto 1.4rem;
    }

    .profile-page .profile-section {
        border-radius: 10px;
        padding: 0.86rem;
        background: rgba(12, 22, 40, 0.74);
        border-color: rgba(74, 95, 129, 0.5);
        box-shadow: none;
    }

    .profile-page .profile-section h2 {
        margin-bottom: 0.62rem;
        font-size: 0.95rem;
    }

    .profile-page .form-group {
        margin-bottom: 0.66rem;
    }

    .profile-page .form-group label {
        font-size: 0.78rem;
        margin-bottom: 0.34rem;
    }

    .profile-page .form-group input[type="text"],
    .profile-page .form-group select {
        min-height: 42px;
        padding: 0.6rem 0.7rem;
        font-size: 0.92rem;
    }

    .profile-page .checkbox-group {
        font-size: 0.88rem;
    }

    .profile-page .delete-help-text {
        font-size: 0.82rem;
    }

    .profile-page .btn-save,
    .profile-page .btn-delete {
        min-height: 42px;
        font-size: 0.9rem;
        border-radius: 9px;
    }
}

@media (max-width: 430px) {
    .stock-detail-page .quote-price {
        font-size: 1.24rem;
    }

    .stock-detail-page .quote-change {
        font-size: 0.8rem;
    }

    .stock-detail-page .stock-insight-card {
        padding: 0.64rem;
    }

    .stock-detail-page .score-matrix {
        grid-template-columns: 1fr 1fr;
    }

    .stock-detail-page .score-head {
        font-size: 0.62rem;
    }

    .stock-detail-page .dividend-metrics {
        grid-template-columns: 1fr;
    }

    .stock-detail-page .projection-row {
        grid-template-columns: 1fr;
    }

    .stock-detail-page .projection-price,
    .stock-detail-page .projection-meta,
    .stock-detail-page .projection-range {
        text-align: left;
        grid-column: auto;
    }

    .profile-page .profile-section {
        padding: 0.74rem;
    }

    .profile-page .profile-section h2 {
        font-size: 0.9rem;
    }

    .profile-page .form-group input[type="text"],
    .profile-page .form-group select {
        min-height: 40px;
        font-size: 0.88rem;
    }

    .profile-page .btn-save,
    .profile-page .btn-delete {
        min-height: 40px;
        font-size: 0.86rem;
    }
}

/* Professional pass: cleaner landing and clearer mobile navigation */
.home-v2-sections {
    display: none;
}

.home-v2-proof {
    margin-top: 0.9rem;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    border-top: 1px solid rgba(127, 148, 177, 0.16);
    border-bottom: 1px solid rgba(127, 148, 177, 0.16);
}

.home-v2-final {
    margin-top: 1rem;
    border-color: rgba(71, 100, 139, 0.58);
    background: linear-gradient(125deg, rgba(16, 27, 46, 0.64), rgba(8, 15, 27, 0.58));
}

@media (max-width: 900px) {
    :root {
        --text-secondary: #d6e2f1;
        --text-muted: #b2c3da;
    }

    header {
        border-bottom-color: rgba(116, 139, 171, 0.36);
        background: linear-gradient(180deg, rgba(6, 12, 24, 0.97) 0%, rgba(5, 10, 20, 0.96) 100%);
    }

    .header-inner {
        min-height: 64px;
        gap: 0.5rem;
        padding: 0 0.78rem;
    }

    .mobile-top-actions {
        margin-left: auto;
        margin-right: 0.3rem;
        gap: 0.36rem;
    }

    .mobile-auth-shortcut {
        min-height: 38px;
        border-radius: 999px;
        padding: 0.38rem 0.72rem;
        font-size: 0.76rem;
        letter-spacing: 0.01em;
        border-color: rgba(123, 149, 182, 0.55);
        background: rgba(255, 255, 255, 0.05);
        color: #f1f6ff;
    }

    .mobile-auth-shortcut.login {
        border-color: rgba(147, 197, 253, 0.66);
        background: rgba(30, 64, 175, 0.3);
    }

    .mobile-auth-shortcut.account {
        border-color: rgba(110, 231, 183, 0.62);
        background: rgba(6, 95, 70, 0.3);
        color: #e6fff3;
    }

    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(127, 148, 177, 0.48);
        border-radius: 10px;
        padding: 0;
        background: rgba(2, 6, 23, 0.56);
    }

    .mobile-menu-toggle .bar {
        width: 18px;
        margin: 3px 0;
    }

    .main-nav {
        width: min(94vw, 390px);
        padding: calc(0.72rem + env(safe-area-inset-top)) 0.95rem 0.95rem;
        background: linear-gradient(180deg, rgba(8, 16, 30, 0.98), rgba(10, 19, 34, 0.98));
    }

    .nav-mobile-head {
        position: sticky;
        top: calc(-0.72rem - env(safe-area-inset-top));
        z-index: 2;
        background: linear-gradient(180deg, rgba(8, 16, 30, 0.99), rgba(8, 16, 30, 0.95));
        margin: calc(-0.72rem - env(safe-area-inset-top)) -0.95rem 0.6rem;
        padding: calc(0.72rem + env(safe-area-inset-top)) 0.95rem 0.65rem;
    }

    .nav-mobile-auth {
        gap: 0.48rem;
        margin-top: 0;
        padding-bottom: 0.78rem;
    }

    .nav-mobile-auth .nav-mobile-auth-btn {
        min-height: 46px;
        border-radius: 12px;
        font-size: 0.92rem;
    }

    .nav-link {
        min-height: 46px;
        border-radius: 10px;
        padding: 0.74rem 0.78rem;
    }

    .nav-link-text {
        font-size: 0.97rem;
    }

    .nav-link.active {
        background: rgba(57, 194, 255, 0.16);
        border-color: rgba(57, 194, 255, 0.4);
    }

    .nav-utils {
        margin-top: 0.58rem;
        padding-top: 0.72rem;
        gap: 0.72rem;
    }

    .home-v2 {
        padding-top: 0.86rem;
        padding-bottom: 1rem;
    }

    .home-v2-hero {
        border-radius: 14px;
        padding: 1rem;
        gap: 0.8rem;
        border-color: rgba(80, 106, 141, 0.55);
        background: linear-gradient(145deg, rgba(8, 16, 30, 0.96), rgba(5, 11, 21, 0.98));
    }

    .home-v2-copy h1 {
        font-size: clamp(1.62rem, 7.2vw, 2rem);
        line-height: 1.14;
    }

    .home-v2-subtitle {
        color: #e6effb;
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .home-v2-note {
        margin: 0.45rem 0 0.76rem;
        color: #c9d9ec;
        font-size: 0.84rem;
    }

    .home-v2-preview {
        margin-top: 0.12rem;
        border-radius: 11px;
        border-color: rgba(76, 99, 130, 0.45);
        background: rgba(10, 18, 32, 0.74);
        padding: 0.75rem;
    }

    .home-v2-preview-row {
        padding: 0.6rem 0;
    }

    .home-v2-preview-row:nth-child(n+3) {
        display: none;
    }

    .home-v2-final {
        display: block;
        border-radius: 12px;
        padding: 0.92rem;
        margin-top: 0.72rem;
    }

    .home-v2-final p {
        font-size: 0.9rem;
    }

    .home-v2-actions-final {
        margin-top: 0.72rem;
    }

    .home-v2-actions-final .btn-primary,
    .home-v2-actions-final .btn-secondary {
        width: 100%;
        min-height: 46px;
    }

    .mobile-dock {
        gap: 0.24rem;
        padding: 0.52rem 0.48rem calc(0.56rem + env(safe-area-inset-bottom));
        border-top-color: rgba(116, 139, 171, 0.3);
        background: linear-gradient(180deg, rgba(4, 9, 19, 0.97), rgba(3, 7, 15, 0.98));
    }

    .mobile-dock-link {
        min-height: 48px;
        border: 1px solid transparent;
        background: transparent;
        border-radius: 10px;
        padding: 0.24rem 0.1rem;
    }

    .mobile-dock-link.active {
        border-color: rgba(57, 194, 255, 0.4);
        background: rgba(57, 194, 255, 0.14);
    }

    .mobile-dock-link.is-auth {
        border-color: rgba(147, 197, 253, 0.5);
        background: rgba(30, 64, 175, 0.24);
    }

    .mobile-dock-link.is-logout {
        border-color: rgba(248, 113, 113, 0.5);
        background: rgba(127, 29, 29, 0.24);
    }

    .mobile-dock-icon {
        width: 1.04rem;
        height: 1.04rem;
    }

    .mobile-dock-text {
        font-size: 0.67rem;
        letter-spacing: 0.01em;
    }
}

@media (max-width: 430px) {
    .mobile-auth-shortcut {
        min-height: 36px;
        padding: 0.32rem 0.62rem;
        font-size: 0.72rem;
    }

    .main-nav {
        width: 96vw;
    }

    .mobile-dock {
        gap: 0.18rem;
        padding-left: 0.35rem;
        padding-right: 0.35rem;
    }

    .mobile-dock-link {
        min-height: 46px;
        border-radius: 9px;
        padding: 0.2rem 0.06rem;
    }

    .mobile-dock-text {
        font-size: 0.6rem;
    }

    .home-v2-copy h1 {
        font-size: clamp(1.5rem, 8.2vw, 1.82rem);
    }
}

/* Global mobile simplification: cleaner list rhythm on data-heavy pages */
@media (max-width: 900px) {
    .market-directory-page .table-container,
    .companies-page .table-container,
    .social-page .social-table-container,
    .public-portfolio-page .public-holdings-container {
        border: 1px solid rgba(74, 95, 129, 0.3);
        border-radius: 12px;
        background: rgba(8, 14, 26, 0.42);
        overflow: hidden;
        margin-bottom: 0.85rem;
    }

    .market-directory-page .market-table tr,
    .companies-page .market-table tr,
    .social-page .social-table tr,
    .public-portfolio-page .public-holdings-table tr {
        margin-bottom: 0 !important;
        border: 0 !important;
        border-bottom: 1px solid rgba(74, 95, 129, 0.26) !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .market-directory-page .market-table tr:last-child,
    .companies-page .market-table tr:last-child,
    .social-page .social-table tr:last-child,
    .public-portfolio-page .public-holdings-table tr:last-child {
        border-bottom: 0 !important;
    }

    .market-directory-page .market-table td,
    .companies-page .market-table td,
    .social-page .social-table td,
    .public-portfolio-page .public-holdings-table td {
        padding: 0.54rem 0.64rem !important;
        border-bottom: 1px solid rgba(74, 95, 129, 0.18) !important;
        background: transparent !important;
    }

    .market-directory-page .market-table td:last-child,
    .companies-page .market-table td:last-child,
    .social-page .social-table td:last-child,
    .public-portfolio-page .public-holdings-table td:last-child {
        border-bottom: 0 !important;
    }

    .market-directory-page .market-table td.ticker-cell,
    .companies-page .market-table td:first-child,
    .social-page .social-table td:first-child,
    .public-portfolio-page .public-holdings-table td:first-child {
        background: transparent !important;
    }
}

@media (max-width: 430px) {
    .market-directory-page .market-table td,
    .companies-page .market-table td,
    .social-page .social-table td,
    .public-portfolio-page .public-holdings-table td {
        padding: 0.5rem 0.58rem !important;
    }
}

/* Mobile professional pass: simplified hierarchy and stronger readability */
@media (max-width: 900px) {
    :root {
        --text-secondary: #d9e4f4;
        --text-muted: #bfd0e6;
    }

    .header-inner {
        min-height: 66px;
    }

    .logo {
        font-size: 1.04rem;
    }

    .mobile-top-actions {
        gap: 0.34rem;
        margin-right: 0.18rem;
    }

    .mobile-auth-shortcut {
        min-height: 36px;
        padding: 0.34rem 0.58rem;
        font-size: 0.68rem;
        font-weight: 800;
    }

    .mobile-auth-shortcut.account {
        background: rgba(13, 64, 44, 0.34);
        border-color: rgba(134, 239, 172, 0.56);
        color: #e7fff2;
    }

    .mobile-auth-shortcut.logout {
        background: rgba(120, 32, 32, 0.34);
        border-color: rgba(248, 113, 113, 0.6);
        color: #ffe3e3;
    }

    .mobile-auth-shortcut.login {
        background: rgba(30, 64, 175, 0.34);
        border-color: rgba(147, 197, 253, 0.6);
        color: #eaf3ff;
    }

    .main-nav {
        width: min(92vw, 380px);
    }

    .home-page.home-v2 {
        padding-top: 0.82rem;
        padding-bottom: 1.2rem;
    }

    .home-v2-hero {
        border-radius: 14px;
        padding: 1rem;
        gap: 0.82rem;
        background: linear-gradient(150deg, rgba(8, 16, 30, 0.95), rgba(6, 12, 22, 0.98));
        border: 1px solid rgba(98, 127, 165, 0.58);
    }

    .home-v2-copy h1 {
        font-size: clamp(1.66rem, 7.7vw, 2.06rem);
        line-height: 1.13;
    }

    .home-v2-subtitle {
        font-size: 0.97rem;
        line-height: 1.5;
        color: #e9f1fc;
    }

    .home-v2-note {
        font-size: 0.87rem;
        color: #cfdcf0;
        margin: 0.48rem 0 0.78rem;
    }

    .home-v2-actions {
        gap: 0.52rem;
        margin-top: 0.74rem;
    }

    .home-v2-actions .btn-primary,
    .home-v2-actions .btn-secondary {
        width: 100%;
        min-height: 46px;
    }

    .home-v2-links {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.34rem;
        margin-top: 0.68rem;
    }

    .home-v2-links a {
        justify-content: flex-start;
        border: 1px solid rgba(97, 122, 155, 0.56);
        border-radius: 10px;
        padding: 0.44rem 0.62rem;
        background: rgba(10, 20, 35, 0.52);
        color: #deebfb;
    }

    .home-v2-preview {
        border: 0;
        border-top: 1px solid rgba(114, 140, 176, 0.36);
        border-radius: 0;
        padding: 0.72rem 0 0;
        margin-top: 0.02rem;
        background: transparent;
        backdrop-filter: none;
    }

    .home-v2-preview-head h2 {
        font-size: 0.92rem;
    }

    .home-v2-preview-head p {
        font-size: 0.78rem;
        color: #c7d9ef;
        margin: 0.2rem 0 0.5rem;
    }

    .home-v2-preview-list {
        border-top: 1px solid rgba(102, 126, 160, 0.34);
        border-bottom: 0;
    }

    .home-v2-preview-row {
        padding: 0.56rem 0;
        border-bottom: 1px solid rgba(90, 113, 145, 0.34);
    }

    .home-v2-preview-row:nth-child(n+3) {
        display: none;
    }

    .home-v2-preview-row:hover {
        background: transparent;
    }

    .home-v2-preview-footer {
        margin-top: 0.58rem;
    }

    .home-v2-preview-footer .btn-secondary {
        min-height: 42px;
    }

    .home-v2-proof,
    .home-v2-sections,
    .home-v2-final {
        display: none;
    }

    .market-directory-page .directory-header,
    .companies-page .directory-header {
        padding: 1.15rem 0 0.58rem;
    }

    .market-directory-page .directory-header h1,
    .companies-page .directory-header h1 {
        font-size: clamp(1.34rem, 6.5vw, 1.72rem);
    }

    .market-directory-page .directory-header .subtitle,
    .companies-page .directory-header .subtitle {
        font-size: 0.92rem;
        line-height: 1.44;
        margin-bottom: 0.5rem;
        color: #d8e5f5;
    }

    .market-directory-page .directory-meta,
    .companies-page .directory-meta {
        font-size: 0.79rem;
        margin: 0.2rem 0 0.52rem;
        color: #c0d2e8;
    }

    .market-directory-page .table-container,
    .companies-page .table-container {
        border: 1px solid rgba(90, 114, 145, 0.34);
        border-radius: 12px;
        background: rgba(8, 14, 25, 0.38);
        overflow: hidden;
    }

    .market-directory-page .market-table tr,
    .companies-page .market-table tr {
        margin: 0 !important;
        border: 0 !important;
        border-bottom: 1px solid rgba(90, 114, 145, 0.3) !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    .market-directory-page .market-table tr:last-child,
    .companies-page .market-table tr:last-child {
        border-bottom: 0 !important;
    }

    .market-directory-page .market-table td,
    .companies-page .market-table td {
        grid-template-columns: minmax(76px, 92px) minmax(0, 1fr);
        padding: 0.6rem 0.68rem !important;
        gap: 0.14rem 0.62rem;
        font-size: 0.9rem !important;
        border-bottom: 1px solid rgba(90, 114, 145, 0.16) !important;
    }

    .market-directory-page .market-table td:last-child,
    .companies-page .market-table td:last-child {
        border-bottom: 0 !important;
    }

    .market-directory-page .market-table td::before,
    .companies-page .market-table td::before {
        font-size: 0.63rem;
        color: #c4d5ea;
    }

    .market-directory-page .market-table td.ticker-cell strong,
    .companies-page .market-table td:first-child strong {
        font-size: 0.98rem;
    }

    .market-directory-page .market-table td.name-cell .company-name,
    .companies-page .market-table td:nth-child(2) {
        color: #dce8f8;
        line-height: 1.34;
    }

    .market-directory-page .market-table td .badge-mini {
        font-size: 0.7rem;
        letter-spacing: 0.03em;
        padding: 0.18rem 0.48rem;
    }

    .companies-page .market-search,
    .market-directory-page .market-search {
        min-height: 42px;
        font-size: 0.93rem;
        margin-bottom: 0.55rem;
    }

    .companies-page .letter-filter {
        margin-top: 0.5rem;
        gap: 0.34rem;
    }

    .companies-page .letter-chip {
        min-height: 34px;
        min-width: 34px;
        font-size: 0.72rem;
        padding: 0 0.56rem;
    }

    .stock-detail-page .directory-header.stock-detail-header {
        padding: 1rem 0 0.56rem;
    }

    .stock-detail-page .stock-detail-header h1 {
        font-size: clamp(1.2rem, 5.5vw, 1.55rem);
        line-height: 1.25;
    }

    .stock-detail-page .stock-quote-line {
        margin-top: 0.3rem;
        gap: 0.3rem;
    }

    .stock-detail-page .quote-price {
        font-size: 1.34rem;
    }

    .stock-detail-page .quote-change {
        font-size: 0.86rem;
        font-weight: 700;
    }

    .stock-detail-page .quote-meta {
        font-size: 0.73rem;
        color: #bfd2e9;
    }

    .stock-detail-page .stock-trust-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem;
        margin-top: 0.64rem;
    }

    .stock-detail-page .stock-trust-stats .t-stat {
        min-height: 52px;
        border-radius: 10px;
    }

    .stock-detail-page .stock-insights-grid {
        gap: 0.62rem;
        margin: 0.68rem 0 0.9rem;
    }

    .stock-detail-page .stock-insight-card {
        border-radius: 11px;
        padding: 0.76rem;
        border: 1px solid rgba(94, 118, 149, 0.45);
        background: rgba(9, 16, 29, 0.66);
    }

    .stock-detail-page .stock-insight-card h2 {
        font-size: 0.9rem;
        margin-bottom: 0.52rem;
    }

    .stock-detail-page .insight-kv {
        padding: 0.36rem 0;
        font-size: 0.8rem;
    }

    .stock-detail-page .score-matrix {
        gap: 0.34rem;
    }

    .stock-detail-page .score-cell {
        border-radius: 7px;
        font-size: 0.75rem;
        padding: 0.34rem 0.3rem;
    }

    .stock-detail-page .stock-detail-actions {
        gap: 0.52rem;
        margin-bottom: 0.96rem;
    }

    .stock-detail-page .stock-detail-actions .btn-primary,
    .stock-detail-page .stock-detail-actions .btn-secondary {
        width: 100%;
        min-width: 0;
        min-height: 44px;
    }
}

@media (max-width: 430px) {
    .mobile-auth-shortcut {
        font-size: 0.65rem;
        min-height: 34px;
        padding: 0.28rem 0.5rem;
    }

    .home-v2-copy h1 {
        font-size: clamp(1.48rem, 8.3vw, 1.82rem);
    }

    .home-v2-subtitle {
        font-size: 0.91rem;
    }

    .home-v2-note {
        font-size: 0.83rem;
    }

    .market-directory-page .market-table td,
    .companies-page .market-table td {
        padding: 0.54rem 0.6rem !important;
        font-size: 0.86rem !important;
        grid-template-columns: minmax(70px, 84px) minmax(0, 1fr);
    }

    .companies-page .letter-chip {
        min-height: 32px;
        min-width: 32px;
        font-size: 0.68rem;
    }

    .stock-detail-page .stock-insight-card {
        padding: 0.68rem;
    }
}

/* Institutional refinement: landing desktop + social/public mobile usability */
@media (min-width: 901px) {
    .home-page.home-v2 {
        max-width: 1220px;
        padding-top: 2.4rem;
        padding-bottom: 2.2rem;
    }

    .home-v2-hero {
        grid-template-columns: minmax(0, 1.28fr) minmax(0, 0.72fr);
        gap: 1.35rem;
        padding: 2rem;
        border-radius: 22px;
        border: 1px solid rgba(94, 123, 160, 0.62);
        background:
            radial-gradient(circle at 88% 6%, rgba(56, 189, 248, 0.08) 0%, rgba(56, 189, 248, 0) 44%),
            linear-gradient(152deg, rgba(8, 15, 28, 0.98), rgba(6, 11, 21, 0.99));
        box-shadow: 0 24px 50px rgba(0, 0, 0, 0.34);
    }

    .home-v2-copy h1 {
        font-size: clamp(2.22rem, 4.2vw, 3.05rem);
        line-height: 1.08;
        margin-bottom: 0.72rem;
        letter-spacing: -0.02em;
    }

    .home-v2-subtitle {
        max-width: 56ch;
        color: #e6f0fd;
        font-size: 1.04rem;
    }

    .home-v2-note {
        margin: 0.62rem 0 1rem;
        font-size: 0.9rem;
        color: #c6d8ee;
    }

    .home-v2-chip {
        background: rgba(32, 75, 117, 0.28);
        border-color: rgba(97, 152, 204, 0.58);
        color: #d8eaff;
    }

    .home-v2-actions {
        margin-top: 0.86rem;
        gap: 0.56rem;
    }

    .home-v2-actions .btn-primary,
    .home-v2-actions .btn-secondary {
        min-width: 190px;
        min-height: 44px;
    }

    .home-v2-links {
        margin-top: 0.78rem;
        gap: 0.75rem;
    }

    .home-v2-links a {
        font-size: 0.82rem;
        letter-spacing: 0.02em;
    }

    .home-v2-preview {
        border-radius: 16px;
        padding: 1rem 1.05rem;
        background: linear-gradient(180deg, rgba(10, 19, 33, 0.82), rgba(8, 14, 26, 0.88));
        border: 1px solid rgba(83, 108, 139, 0.58);
        backdrop-filter: none;
    }

    .home-v2-preview-head h2 {
        font-size: 0.94rem;
        letter-spacing: 0.02em;
    }

    .home-v2-preview-head p {
        font-size: 0.79rem;
        color: #bed2ea;
        margin: 0.28rem 0 0.68rem;
    }

    .home-v2-preview-row {
        padding: 0.62rem 0;
    }

    .home-v2-row-main {
        margin-bottom: 0.22rem;
    }

    .home-v2-row-ticker {
        font-size: 0.9rem;
    }

    .home-v2-row-rank,
    .home-v2-row-score {
        font-size: 0.72rem;
    }

    .home-v2-preview-footer .btn-secondary {
        min-height: 40px;
        font-size: 0.82rem;
    }
}

@media (max-width: 900px) {
    .social-page .social-header {
        padding: 1rem 0 0.56rem;
    }

    .social-page .social-header h1 {
        font-size: clamp(1.32rem, 6.4vw, 1.7rem);
        line-height: 1.22;
    }

    .social-page .social-header .subtitle {
        margin-top: 0.22rem;
        margin-bottom: 0.52rem;
        font-size: 0.92rem;
        line-height: 1.45;
        color: #d8e5f5;
    }

    .social-page .social-guest-cta {
        width: 100%;
        margin-top: 0.36rem;
    }

    .social-page .social-guest-cta .btn-primary {
        width: 100%;
        min-height: 44px;
    }

    .social-page .social-table-container {
        border: 1px solid rgba(92, 116, 147, 0.34);
        border-radius: 12px;
        background: rgba(8, 14, 26, 0.4);
        overflow: hidden;
    }

    .social-page .social-table tr {
        margin-bottom: 0 !important;
        border: 0 !important;
        border-bottom: 1px solid rgba(92, 116, 147, 0.3) !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    .social-page .social-table tr:last-child {
        border-bottom: 0 !important;
    }

    .social-page .social-table td {
        padding: 0.58rem 0.66rem !important;
        gap: 0.12rem 0.56rem !important;
        border-bottom: 1px solid rgba(92, 116, 147, 0.16) !important;
        background: transparent !important;
        font-size: 0.88rem !important;
    }

    .social-page .social-table td:last-child {
        border-bottom: 0 !important;
    }

    .social-page .social-table td::before {
        font-size: 0.63rem !important;
        color: #c5d7eb !important;
    }

    .social-page .portfolio-risk-label {
        font-size: 0.69rem;
        color: #bdd1e8;
        margin-top: 0.14rem;
    }

    .social-page .social-actions-cell {
        padding-top: 0.38rem !important;
    }

    .social-page .social-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.34rem !important;
        width: 100%;
        justify-content: stretch !important;
    }

    .social-page .social-follow-form {
        width: 100%;
    }

    .social-page .action-link,
    .social-page .social-follow-form .social-follow-btn {
        width: 100%;
        min-height: 40px;
        border-radius: 9px;
        font-size: 0.76rem;
        font-weight: 700;
        justify-content: center;
        text-align: center;
        padding: 0.3rem 0.52rem;
    }

    .public-portfolio-page .public-portfolio-head {
        padding: 1rem 0 0.54rem;
    }

    .public-portfolio-page .public-portfolio-head h1 {
        font-size: clamp(1.24rem, 5.8vw, 1.56rem);
        line-height: 1.24;
    }

    .public-portfolio-page .public-portfolio-head .subtitle {
        margin-top: 0.18rem;
        margin-bottom: 0.48rem;
        font-size: 0.9rem;
        line-height: 1.43;
        color: #d4e2f3;
    }

    .public-portfolio-page .public-follow-form,
    .public-portfolio-page .public-portfolio-head > .btn-primary {
        width: 100%;
    }

    .public-portfolio-page .public-follow-form .btn-primary,
    .public-portfolio-page .public-portfolio-head > .btn-primary {
        width: 100%;
        min-height: 44px;
    }

    .public-portfolio-page .top-stats {
        gap: 0.46rem !important;
        margin-bottom: 0.66rem !important;
    }

    .public-portfolio-page .eval-panel,
    .public-portfolio-page .value-panel {
        border-radius: 10px !important;
        border: 1px solid rgba(92, 116, 147, 0.34) !important;
        background: rgba(8, 14, 26, 0.46) !important;
        padding: 0.62rem 0.7rem !important;
    }

    .public-portfolio-page .eval-score {
        font-size: 1.86rem !important;
        margin-top: 0.08rem !important;
    }

    .public-portfolio-page .value-amount {
        font-size: 1.58rem !important;
        margin-top: 0.08rem !important;
    }

    .public-portfolio-page .chart-container {
        border-radius: 10px !important;
        border: 1px solid rgba(92, 116, 147, 0.3) !important;
        background: rgba(8, 14, 26, 0.28) !important;
        padding: 0.7rem !important;
        margin-bottom: 0.7rem !important;
    }

    .public-portfolio-page .public-holdings-container {
        border: 1px solid rgba(92, 116, 147, 0.34) !important;
        border-radius: 12px !important;
        background: rgba(8, 14, 26, 0.4) !important;
        overflow: hidden;
        margin-bottom: 1rem !important;
    }

    .public-portfolio-page .public-holdings-table tr {
        margin-bottom: 0 !important;
        border: 0 !important;
        border-bottom: 1px solid rgba(92, 116, 147, 0.3) !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    .public-portfolio-page .public-holdings-table tr:last-child {
        border-bottom: 0 !important;
    }

    .public-portfolio-page .public-holdings-table td {
        padding: 0.58rem 0.66rem !important;
        gap: 0.12rem 0.56rem !important;
        border-bottom: 1px solid rgba(92, 116, 147, 0.16) !important;
        background: transparent !important;
        font-size: 0.88rem !important;
    }

    .public-portfolio-page .public-holdings-table td:last-child {
        border-bottom: 0 !important;
    }

    .public-portfolio-page .public-holdings-table td::before {
        font-size: 0.63rem !important;
        color: #c5d7eb !important;
    }

    .public-portfolio-page .public-holdings-table td strong {
        font-size: 0.96rem;
    }

    .public-portfolio-page .holding-name {
        font-size: 0.74rem;
        color: #c1d4ea;
    }
}

@media (max-width: 430px) {
    .social-page .social-table td,
    .public-portfolio-page .public-holdings-table td {
        padding: 0.52rem 0.58rem !important;
        font-size: 0.84rem !important;
    }

    .social-page .action-link,
    .social-page .social-follow-form .social-follow-btn,
    .public-portfolio-page .public-follow-form .btn-primary,
    .public-portfolio-page .public-portfolio-head > .btn-primary {
        min-height: 38px;
        font-size: 0.72rem;
    }
}

/* Mobile navigation IA pass: keep auth 1-tap and reduce dock clutter */
@media (max-width: 900px) {
    .mobile-top-actions {
        display: inline-flex;
        flex-wrap: nowrap;
        align-items: center;
    }

    .mobile-auth-shortcut {
        white-space: nowrap;
        text-decoration: none;
    }

    .mobile-dock,
    .mobile-dock.is-authenticated,
    .mobile-dock.is-guest {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .mobile-dock-link {
        min-height: 46px;
    }
}

@media (max-width: 430px) {
    .mobile-top-actions {
        gap: 0.24rem;
    }

    .mobile-auth-shortcut {
        min-height: 34px;
        padding: 0.26rem 0.48rem;
        font-size: 0.68rem;
        font-weight: 800;
    }
}

/* Final contrast pass: mobile auth/navigation/profile readability */
@media (max-width: 900px) {
    .mobile-auth-shortcut {
        min-height: 36px;
        font-size: 0.71rem;
        letter-spacing: 0.01em;
    }

    .mobile-dock-link {
        min-height: 48px;
    }

    .mobile-dock-text {
        font-size: 0.68rem;
        letter-spacing: 0.01em;
    }

    .profile-page .profile-section {
        background: rgba(10, 18, 33, 0.78);
        border-color: rgba(92, 116, 147, 0.52);
    }

    .profile-page .form-group label {
        color: #d8e5f5;
        font-size: 0.8rem;
    }

    .profile-page .form-group input[type="text"],
    .profile-page .form-group select {
        border-color: rgba(92, 116, 147, 0.6);
        min-height: 44px;
        font-size: 0.94rem;
    }

    .profile-page .checkbox-group {
        border-color: rgba(92, 116, 147, 0.52);
        background: rgba(255, 255, 255, 0.03);
    }

    .profile-page .btn-save,
    .profile-page .btn-delete {
        min-height: 44px;
        font-size: 0.92rem;
    }
}

@media (max-width: 430px) {
    .mobile-auth-shortcut {
        min-height: 34px;
        font-size: 0.67rem;
    }

    .mobile-dock-text {
        font-size: 0.64rem;
    }

    .profile-page .form-group label {
        font-size: 0.78rem;
    }

    .profile-page .form-group input[type="text"],
    .profile-page .form-group select {
        min-height: 42px;
        font-size: 0.9rem;
    }
}

/* Final mobile consistency pass: social/public tables align with portfolio rhythm */
@media (max-width: 900px) {
    .social-page .social-table-container,
    .public-portfolio-page .public-holdings-container {
        border: 1px solid rgba(92, 116, 147, 0.36) !important;
        border-radius: 12px !important;
        background: rgba(8, 14, 26, 0.42) !important;
        overflow: hidden;
    }

    .social-page .social-table tr,
    .public-portfolio-page .public-holdings-table tr {
        margin: 0 !important;
        border: 0 !important;
        border-bottom: 1px solid rgba(92, 116, 147, 0.3) !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    .social-page .social-table tr:last-child,
    .public-portfolio-page .public-holdings-table tr:last-child {
        border-bottom: 0 !important;
    }

    .social-page .social-table td,
    .public-portfolio-page .public-holdings-table td {
        padding: 0.58rem 0.68rem !important;
        gap: 0.14rem 0.62rem !important;
        border-bottom: 1px solid rgba(92, 116, 147, 0.16) !important;
        background: transparent !important;
        font-size: 0.89rem !important;
    }

    .social-page .social-table td:last-child,
    .public-portfolio-page .public-holdings-table td:last-child {
        border-bottom: 0 !important;
    }

    .social-page .social-table td::before,
    .public-portfolio-page .public-holdings-table td::before {
        font-size: 0.66rem !important;
        color: #c5d7eb !important;
        letter-spacing: 0.05em;
    }

    .social-page .portfolio-risk-label,
    .public-portfolio-page .holding-name {
        font-size: 0.75rem !important;
        line-height: 1.35 !important;
        color: #c1d4ea !important;
    }

    .public-portfolio-page .public-holdings-table td strong,
    .social-page .social-table td:first-child strong {
        font-size: 0.97rem;
    }

    .social-page .social-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.36rem !important;
        width: 100%;
    }

    .social-page .action-link,
    .social-page .social-follow-form .social-follow-btn,
    .public-portfolio-page .public-follow-form .btn-primary,
    .public-portfolio-page .public-portfolio-head > .btn-primary {
        min-height: 42px;
        font-size: 0.79rem;
        font-weight: 700;
        border-radius: 9px;
    }
}

@media (max-width: 430px) {
    .social-page .social-table td,
    .public-portfolio-page .public-holdings-table td {
        padding: 0.54rem 0.6rem !important;
        font-size: 0.85rem !important;
    }

    .social-page .social-table td::before,
    .public-portfolio-page .public-holdings-table td::before {
        font-size: 0.63rem !important;
    }

    .social-page .action-link,
    .social-page .social-follow-form .social-follow-btn,
    .public-portfolio-page .public-follow-form .btn-primary,
    .public-portfolio-page .public-portfolio-head > .btn-primary {
        min-height: 40px;
        font-size: 0.74rem;
    }
}

/* Final stock detail pass: mobile hierarchy aligned with portfolio readability */
@media (max-width: 900px) {
    .stock-detail-page .directory-header.stock-detail-header {
        padding: 1.02rem 0 0.62rem;
        margin-bottom: 0.2rem;
        border-bottom: 1px solid rgba(92, 116, 147, 0.24);
    }

    .stock-detail-page .stock-detail-header h1 {
        font-size: clamp(1.32rem, 6vw, 1.7rem);
        line-height: 1.22;
        margin-bottom: 0.2rem;
    }

    .stock-detail-page .stock-detail-header .subtitle {
        margin-top: 0.3rem;
        font-size: 0.92rem;
        line-height: 1.42;
        color: #d7e4f4;
    }

    .stock-detail-page .stock-quote-line {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 0.26rem 0.52rem;
        margin-top: 0.32rem;
        align-items: baseline;
    }

    .stock-detail-page .quote-price {
        font-size: 1.46rem;
        line-height: 1.14;
    }

    .stock-detail-page .quote-change {
        font-size: 0.9rem;
        font-weight: 800;
        text-align: right;
    }

    .stock-detail-page .quote-meta {
        grid-column: 1 / -1;
        font-size: 0.75rem;
        color: #bfd2e8;
    }

    .stock-detail-page .stock-trust-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.46rem;
        margin-top: 0.62rem;
    }

    .stock-detail-page .stock-trust-stats .t-stat {
        min-height: 54px;
        border-radius: 10px;
        padding: 0.44rem 0.58rem;
    }

    .stock-detail-page .stock-trust-stats .t-stat span {
        font-size: 0.98rem;
        line-height: 1.15;
    }

    .stock-detail-page .stock-insights-grid {
        gap: 0.66rem;
        margin: 0.72rem 0 0.92rem;
    }

    .stock-detail-page .stock-insight-card {
        border-radius: 10px;
        padding: 0.8rem;
        border: 1px solid rgba(92, 116, 147, 0.4);
        background: rgba(8, 14, 26, 0.54);
    }

    .stock-detail-page .stock-insight-card h2 {
        font-size: 0.9rem;
        margin-bottom: 0.54rem;
    }

    .stock-detail-page .insight-meta {
        margin: 0.14rem 0 0.52rem;
        font-size: 0.74rem;
        color: #c3d5ea;
    }

    .stock-detail-page .insight-kv {
        padding: 0.38rem 0;
        font-size: 0.82rem;
        gap: 0.58rem;
    }

    .stock-detail-page .score-matrix {
        gap: 0.36rem;
    }

    .stock-detail-page .score-head {
        font-size: 0.64rem;
    }

    .stock-detail-page .score-label {
        font-size: 0.76rem;
    }

    .stock-detail-page .score-cell {
        border-radius: 7px;
        padding: 0.36rem 0.32rem;
        font-size: 0.78rem;
    }

    .stock-detail-page .dividend-metrics {
        grid-template-columns: 1fr 1fr;
        gap: 0.38rem;
    }

    .stock-detail-page .dividend-summary-grid {
        grid-template-columns: 1fr;
        gap: 0.38rem;
    }

    .stock-detail-page .metric-box {
        padding: 0.44rem;
    }

    .stock-detail-page .metric-box span {
        font-size: 0.68rem;
    }

    .stock-detail-page .metric-box strong {
        font-size: 0.86rem;
    }

    .stock-detail-page .projection-grid {
        gap: 0.44rem;
    }

    .stock-detail-page .projection-row {
        padding: 0.46rem 0.56rem;
        border-radius: 8px;
        grid-template-columns: 1fr auto;
        gap: 0.16rem 0.58rem;
    }

    .stock-detail-page .projection-label {
        font-size: 0.74rem;
    }

    .stock-detail-page .projection-price {
        font-size: 0.84rem;
    }

    .stock-detail-page .projection-meta,
    .stock-detail-page .projection-range {
        grid-column: 1 / -1;
        text-align: left;
        font-size: 0.7rem;
    }

    .stock-detail-page .stock-detail-actions {
        gap: 0.52rem;
        margin-bottom: 0.96rem;
    }

    .stock-detail-page .stock-detail-actions .btn-primary,
    .stock-detail-page .stock-detail-actions .btn-secondary {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        font-size: 0.9rem;
    }

    .stock-detail-page .related-sector-section {
        margin-top: 0.98rem;
        padding-top: 0.86rem;
    }

    .stock-detail-page .related-sector-title {
        margin: 0 0 0.58rem;
        font-size: 0.92rem;
        color: #d5e3f3;
    }

    .stock-detail-page .related-stock-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding-bottom: 0;
    }

    .stock-detail-page .related-stock-grid .stock-card {
        border-radius: 10px;
        border-color: rgba(92, 116, 147, 0.36);
        background: rgba(8, 14, 26, 0.5);
        min-height: 0;
        padding: 0.92rem 0.96rem;
    }

    .stock-detail-page .related-stock-grid .card-header {
        margin-bottom: 0.72rem;
        gap: 0.5rem;
    }

    .stock-detail-page .related-stock-grid .card-body {
        margin-bottom: 0.72rem;
        text-align: left;
        display: grid;
        gap: 0.42rem;
        justify-items: start;
    }

    .stock-detail-page .related-stock-grid .name {
        margin-bottom: 0;
        font-size: 0.98rem;
        line-height: 1.3;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .stock-detail-page .related-stock-grid .signal-badge {
        font-size: 0.74rem;
        padding: 0.24rem 0.72rem;
    }

    .stock-detail-page .related-stock-grid .card-footer {
        padding-top: 0.72rem;
    }

    .stock-detail-page .related-stock-grid .metric .label {
        font-size: 0.6rem;
    }

    .stock-detail-page .related-stock-grid .metric .value {
        font-size: 0.96rem;
    }
}

@media (max-width: 430px) {
    .stock-detail-page .stock-detail-header h1 {
        font-size: clamp(1.2rem, 6.2vw, 1.48rem);
    }

    .stock-detail-page .stock-detail-header .subtitle {
        font-size: 0.88rem;
    }

    .stock-detail-page .quote-price {
        font-size: 1.32rem;
    }

    .stock-detail-page .quote-change {
        font-size: 0.84rem;
    }

    .stock-detail-page .score-matrix {
        grid-template-columns: 1fr 1fr;
    }

    .stock-detail-page .score-head {
        font-size: 0.62rem;
    }

    .stock-detail-page .dividend-metrics {
        grid-template-columns: 1fr;
    }

    .stock-detail-page .projection-row {
        grid-template-columns: 1fr;
    }

    .stock-detail-page .projection-price {
        text-align: left;
    }
}

/* Final desktop pass: market + companies professional hierarchy */
@media (min-width: 901px) {
    .market-directory-page .directory-header,
    .companies-page .directory-header {
        max-width: 1160px;
        margin: 0 auto;
        padding: 2.2rem 0 1rem;
    }

    .market-directory-page .directory-header h1,
    .companies-page .directory-header h1 {
        font-size: clamp(1.82rem, 2.25vw, 2.3rem);
        line-height: 1.16;
        letter-spacing: -0.02em;
        background: linear-gradient(125deg, var(--text-primary) 25%, #8eccf5 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
    }

    .market-directory-page .directory-header .subtitle,
    .companies-page .directory-header .subtitle {
        margin-top: 0.3rem;
        margin-bottom: 0.52rem;
        max-width: 74ch;
        font-size: 0.97rem;
        line-height: 1.5;
        color: #d4e1f2;
    }

    .market-directory-page .directory-meta,
    .companies-page .directory-meta {
        display: inline-flex;
        align-items: center;
        border: 1px solid rgba(92, 116, 147, 0.45);
        border-radius: 999px;
        padding: 0.22rem 0.62rem;
        margin: 0 0 0.7rem;
        font-size: 0.78rem;
        color: #c6d8ed;
        background: rgba(255, 255, 255, 0.02);
    }

    .market-directory-page .market-search,
    .companies-page .market-search {
        width: min(620px, 62vw);
        min-height: 44px;
        border-color: rgba(92, 116, 147, 0.55);
        background: rgba(8, 14, 26, 0.62);
        font-size: 0.92rem;
        margin-bottom: 0.78rem;
        transition: border-color 0.15s ease, box-shadow 0.15s ease;
    }

    .market-directory-page .market-search:focus,
    .companies-page .market-search:focus {
        outline: none;
        border-color: rgba(57, 194, 255, 0.55);
        box-shadow: 0 0 0 3px rgba(57, 194, 255, 0.12);
    }

    .companies-page .letter-filter {
        margin-top: 0.72rem;
        gap: 0.42rem;
    }

    .companies-page .letter-chip {
        min-height: 34px;
        min-width: 34px;
        padding: 0 0.6rem;
        border-color: rgba(92, 116, 147, 0.56);
        background: rgba(255, 255, 255, 0.02);
        font-size: 0.74rem;
    }

    .companies-page .letter-chip.active {
        background: #eaf3ff;
        border-color: #eaf3ff;
        color: #071120;
    }

    .market-directory-page .table-container,
    .companies-page .table-container {
        max-width: 1160px;
        margin: 0 auto 1.4rem;
        border: 1px solid rgba(92, 116, 147, 0.36);
        border-radius: 14px;
        background: rgba(8, 14, 26, 0.44);
        overflow: hidden;
    }

    .market-directory-page .market-table,
    .companies-page .market-table {
        font-size: 0.9rem;
    }

    .market-directory-page .market-table thead th,
    .companies-page .market-table thead th {
        position: sticky;
        top: 0;
        z-index: 1;
        padding: 0.78rem 0.9rem;
        border-bottom: 1px solid rgba(92, 116, 147, 0.42);
        background: linear-gradient(180deg, rgba(13, 23, 40, 0.97), rgba(10, 18, 32, 0.96));
        color: #c2d4ea;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        font-weight: 700;
    }

    .market-directory-page .market-table td,
    .companies-page .market-table td {
        padding: 0.82rem 0.9rem;
        border-bottom: 1px solid rgba(92, 116, 147, 0.24);
        color: #dbe7f7;
        vertical-align: middle;
    }

    .market-directory-page .market-table tbody tr:last-child td,
    .companies-page .market-table tbody tr:last-child td {
        border-bottom: 0;
    }

    .market-directory-page .market-table tbody tr,
    .companies-page .market-table tbody tr {
        transition: background 0.12s ease;
    }

    .market-directory-page .market-table tbody tr:hover,
    .companies-page .market-table tbody tr:hover {
        background: rgba(57, 194, 255, 0.06);
    }

    .market-directory-page .market-table td.ticker-cell strong,
    .companies-page .market-table td:first-child strong {
        font-size: 0.95rem;
        color: #eef5ff;
        letter-spacing: 0.01em;
    }

    .market-directory-page .market-table td.market-cell-score .cell-value.buy { color: var(--accent-buy); font-weight: 800; }
    .market-directory-page .market-table td.market-cell-score .cell-value.sell { color: var(--accent-sell); font-weight: 800; }
    .market-directory-page .market-table td.market-cell-score .cell-value.hold { color: var(--text-secondary); }

    .market-directory-page .market-table td.ticker-cell a.link-clean:hover {
        color: #8eccf5;
        text-decoration: underline;
        text-underline-offset: 3px;
    }

    .market-directory-page .market-table td.name-cell .company-name,
    .companies-page .market-table td:nth-child(2) {
        color: #d4e2f3;
        line-height: 1.4;
    }

    .market-directory-page .market-table td.text-right,
    .companies-page .market-table td.text-right {
        font-variant-numeric: tabular-nums;
        font-weight: 700;
    }

    .market-directory-page .market-table .badge-mini {
        font-size: 0.71rem;
        padding: 0.2rem 0.52rem;
        letter-spacing: 0.04em;
    }

    .market-directory-page .blur-row td {
        background: rgba(8, 14, 26, 0.74);
    }

    .market-directory-page .table-cta a {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        padding: 0.48rem 0.88rem;
        font-weight: 700;
    }
}

/* Final desktop pass: social + public portfolio professional hierarchy */
@media (min-width: 901px) {
    .social-page .directory-header {
        max-width: 1160px;
        margin: 0 auto;
        padding: 2.2rem 0 1rem;
    }

    .social-page .directory-header h1 {
        font-size: clamp(1.82rem, 2.25vw, 2.3rem);
        line-height: 1.16;
        letter-spacing: -0.02em;
    }

    .social-page .directory-header .subtitle {
        margin-top: 0.3rem;
        margin-bottom: 0.6rem;
        max-width: 74ch;
        font-size: 0.97rem;
        line-height: 1.5;
        color: #d4e1f2;
    }

    .social-page .social-guest-cta {
        margin-top: 0.36rem;
    }

    .social-page .social-guest-cta .btn-primary {
        min-height: 42px;
        padding: 0.56rem 0.98rem;
        font-size: 0.84rem;
    }

    .social-page .social-table-container {
        max-width: 1160px;
        margin: 0 auto 1.4rem;
        border: 1px solid rgba(92, 116, 147, 0.36);
        border-radius: 14px;
        background: rgba(8, 14, 26, 0.44);
        overflow: hidden;
    }

    .social-page .social-table {
        font-size: 0.9rem;
    }

    .social-page .social-table thead th {
        position: sticky;
        top: 0;
        z-index: 1;
        padding: 0.78rem 0.9rem;
        border-bottom: 1px solid rgba(92, 116, 147, 0.42);
        background: linear-gradient(180deg, rgba(13, 23, 40, 0.97), rgba(10, 18, 32, 0.96));
        color: #c2d4ea;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        font-weight: 700;
    }

    .social-page .social-table td {
        padding: 0.82rem 0.9rem;
        border-bottom: 1px solid rgba(92, 116, 147, 0.24);
        color: #dbe7f7;
        vertical-align: middle;
    }

    .social-page .social-table tbody tr:last-child td {
        border-bottom: 0;
    }

    .social-page .social-table tbody tr:hover {
        background: rgba(56, 189, 248, 0.08);
    }

    .social-page .social-table td:first-child strong {
        font-size: 0.95rem;
        color: #eef5ff;
    }

    .social-page .social-table td.small-caps {
        color: #d4e2f3;
        letter-spacing: 0.01em;
    }

    .social-page .social-table td.text-right {
        font-variant-numeric: tabular-nums;
        font-weight: 700;
    }

    .social-page .portfolio-risk-label {
        margin-top: 0.16rem;
        font-size: 0.73rem;
        color: #c1d4ea;
    }

    .social-page .social-actions {
        justify-content: flex-end;
        gap: 0.38rem;
    }

    .social-page .action-link,
    .social-page .social-follow-btn {
        min-height: 34px;
        padding: 0.28rem 0.62rem;
        border-radius: 8px;
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.02em;
    }

    .social-page .action-link {
        background: rgba(255, 255, 255, 0.02);
        border-color: rgba(92, 116, 147, 0.48);
    }

    .social-page .social-follow-btn {
        border: 1px solid rgba(16, 185, 129, 0.5);
        background: rgba(16, 185, 129, 0.14);
        color: #d1fae5;
    }
}

/* Final consistency sweep: cleaner hierarchy, lighter landing, clearer mobile nav */
@media (min-width: 901px) {
    .home-page.home-v2 {
        max-width: 1180px;
        padding-top: 2.1rem;
        padding-bottom: 2.35rem;
    }

    .home-v2-hero {
        gap: 1.85rem;
        border-radius: 20px;
        border-color: rgba(88, 112, 143, 0.5);
        box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
    }

    .home-v2-preview {
        border-radius: 14px;
        border-color: rgba(88, 112, 143, 0.5);
        background: linear-gradient(180deg, rgba(10, 18, 33, 0.76), rgba(8, 14, 26, 0.84));
    }

    .home-v2-proof {
        margin-top: 1.22rem;
        padding: 0.72rem 0;
        gap: 1rem;
        border-top: 1px solid rgba(102, 126, 157, 0.28);
        border-bottom: 1px solid rgba(102, 126, 157, 0.28);
    }

    .home-v2-proof-item {
        border-right: 0;
        padding: 0.06rem 0;
    }

    .home-v2-proof-item + .home-v2-proof-item {
        border-left: 1px solid rgba(102, 126, 157, 0.22);
        padding-left: 1rem;
    }

    .home-v2-sections {
        gap: 1.95rem;
        margin-top: 1.32rem;
    }

    .home-v2-block {
        border-top: 0;
        padding-top: 0;
    }

    .home-v2-block h2 {
        font-size: 1.03rem;
        margin-bottom: 0.62rem;
        letter-spacing: 0.02em;
    }

    .home-v2-list-item,
    .home-v2-step {
        border: 0;
        padding: 0.58rem 0;
    }

    .home-v2-list-item + .home-v2-list-item,
    .home-v2-step + .home-v2-step {
        border-top: 1px solid rgba(102, 126, 157, 0.24);
    }

    .home-v2-step-index {
        width: 1.55rem;
        height: 1.55rem;
        font-size: 0.72rem;
        margin-top: 0.08rem;
    }

    .market-directory-page .directory-header,
    .companies-page .directory-header,
    .social-page .directory-header,
    .public-portfolio-page .directory-header {
        max-width: 1160px;
        padding: 2rem 0 0.9rem;
    }

    .market-directory-page .directory-header h1,
    .companies-page .directory-header h1,
    .social-page .directory-header h1,
    .public-portfolio-page .directory-header h1 {
        font-size: clamp(1.82rem, 2.2vw, 2.3rem);
        line-height: 1.14;
    }

    .market-directory-page .directory-header .subtitle,
    .companies-page .directory-header .subtitle,
    .social-page .directory-header .subtitle,
    .public-portfolio-page .directory-header .subtitle {
        margin-top: 0.3rem;
        margin-bottom: 0.62rem;
        max-width: 74ch;
        font-size: 0.97rem;
        line-height: 1.5;
        color: #d5e3f3;
    }
}

@media (max-width: 900px) {
    .container {
        padding: 0 0.95rem;
    }

    .header-inner {
        min-height: 64px;
        padding: 0 0.8rem;
    }

    .logo {
        font-size: 1.02rem;
    }

    .mobile-top-actions {
        gap: 0.34rem;
        margin-right: 0.24rem;
    }

    .mobile-auth-shortcut {
        min-height: 38px;
        min-width: 70px;
        padding: 0.34rem 0.58rem;
        border-radius: 999px;
        font-size: 0.72rem;
        font-weight: 800;
        border-width: 1px;
    }

    .mobile-menu-toggle {
        padding: 0.36rem 0.34rem;
        border: 1px solid rgba(96, 122, 156, 0.5);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.02);
    }

    .mobile-menu-toggle .bar {
        width: 20px;
        margin: 4px 0;
        background: #e8f2ff;
    }

    .main-nav {
        width: min(90vw, 360px);
        padding: calc(0.64rem + env(safe-area-inset-top)) 0.82rem 0.92rem;
    }

    .nav-mobile-head {
        padding-bottom: 0.62rem;
    }

    .nav-mobile-auth {
        margin-top: 0.2rem;
        padding-bottom: 0.68rem;
        margin-bottom: 0.42rem;
        gap: 0.42rem;
    }

    .nav-mobile-auth .nav-mobile-auth-btn {
        min-height: 42px;
        border-radius: 10px;
        font-size: 0.88rem;
    }

    .nav-mobile-section-label {
        font-size: 0.64rem;
        letter-spacing: 0.1em;
        color: #a8bdd7;
    }

    .nav-link {
        padding: 0.72rem 0.68rem;
        border-radius: 10px;
    }

    .nav-link-text {
        font-size: 0.9rem;
        font-weight: 700;
    }

    .nav-utils {
        margin-top: 0.5rem;
        padding-top: 0.62rem;
        gap: 0.65rem;
    }

    .market-directory-page .directory-header,
    .companies-page .directory-header,
    .social-page .directory-header,
    .public-portfolio-page .directory-header,
    .stock-detail-page .directory-header {
        padding: 1rem 0 0.56rem;
        margin-bottom: 0.14rem;
    }

    .market-directory-page .directory-header h1,
    .companies-page .directory-header h1,
    .social-page .directory-header h1,
    .public-portfolio-page .directory-header h1,
    .stock-detail-page .directory-header h1 {
        font-size: clamp(1.3rem, 6vw, 1.66rem);
        line-height: 1.22;
    }

    .market-directory-page .directory-header .subtitle,
    .companies-page .directory-header .subtitle,
    .social-page .directory-header .subtitle,
    .public-portfolio-page .directory-header .subtitle,
    .stock-detail-page .directory-header .subtitle {
        margin-top: 0.22rem;
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
        line-height: 1.43;
        color: #d5e3f4;
    }

    .market-directory-page .table-container,
    .companies-page .table-container,
    .social-page .social-table-container,
    .public-portfolio-page .public-holdings-container,
    .portfolio-page .holdings-container {
        border: 1px solid rgba(92, 116, 147, 0.36) !important;
        border-radius: 12px !important;
        background: rgba(8, 14, 26, 0.42) !important;
        overflow: hidden;
    }

    .market-directory-page .market-table td::before,
    .companies-page .market-table td::before,
    .social-page .social-table td::before,
    .public-portfolio-page .public-holdings-table td::before,
    .portfolio-page .holdings-table td::before {
        font-size: 0.64rem !important;
        letter-spacing: 0.06em;
        color: #c4d6eb !important;
    }

    .home-page.home-v2 {
        padding-top: 0.84rem;
        padding-bottom: 1.22rem;
    }

    .home-v2-hero {
        border-radius: 12px;
        border-color: rgba(94, 118, 150, 0.44);
        box-shadow: none;
        padding: 0.92rem;
        gap: 0.72rem;
    }

    .home-v2-copy h1 {
        font-size: clamp(1.56rem, 7.2vw, 1.96rem);
        line-height: 1.14;
    }

    .home-v2-subtitle {
        font-size: 0.94rem;
        line-height: 1.46;
    }

    .home-v2-note {
        margin: 0.44rem 0 0.72rem;
        font-size: 0.84rem;
    }

    .home-v2-links a {
        border: 1px solid rgba(98, 123, 156, 0.48);
        border-radius: 9px;
        padding: 0.42rem 0.58rem;
        background: rgba(9, 18, 33, 0.5);
    }

    .home-v2-preview {
        border-top: 1px solid rgba(104, 129, 160, 0.34);
        margin-top: 0.08rem;
    }

    .home-v2-preview-row {
        padding: 0.52rem 0;
    }

    .home-v2-preview-row:nth-child(n+3),
    .home-v2-proof,
    .home-v2-sections,
    .home-v2-final {
        display: none;
    }
}

@media (max-width: 430px) {
    .container {
        padding: 0 0.82rem;
    }

    .mobile-auth-shortcut {
        min-height: 34px;
        min-width: 64px;
        padding: 0.26rem 0.46rem;
        font-size: 0.67rem;
    }

    .mobile-menu-toggle {
        padding: 0.3rem 0.28rem;
        border-radius: 9px;
    }

    .main-nav {
        width: min(92vw, 336px);
        padding: calc(0.58rem + env(safe-area-inset-top)) 0.74rem 0.84rem;
    }

    .nav-link {
        padding: 0.66rem 0.62rem;
    }

    .nav-link-text {
        font-size: 0.86rem;
    }

    .home-v2-copy h1 {
        font-size: clamp(1.42rem, 8vw, 1.78rem);
    }

    .home-v2-subtitle {
        font-size: 0.89rem;
    }

    .home-v2-note {
        font-size: 0.81rem;
    }
}

/* Final index conversion pass: simpler first-fold and clearer desktop CTA flow */
@media (min-width: 901px) {
    .home-page.home-v2 {
        padding-top: 1.9rem;
        padding-bottom: 2.25rem;
    }

    .home-v2-hero {
        grid-template-columns: minmax(0, 1.34fr) minmax(0, 0.66fr);
        gap: 1.95rem;
        border-radius: 18px;
        padding: 1.86rem;
        border-color: rgba(88, 112, 143, 0.44);
        box-shadow: 0 16px 32px rgba(0, 0, 0, 0.26);
    }

    .home-v2-copy h1 {
        max-width: 18ch;
        font-size: clamp(2.24rem, 4vw, 2.98rem);
        line-height: 1.08;
        margin-bottom: 0.72rem;
    }

    .home-v2-subtitle {
        max-width: 58ch;
        font-size: 1.03rem;
        line-height: 1.52;
    }

    .home-v2-note {
        margin: 0.56rem 0 0.88rem;
        max-width: 60ch;
        font-size: 0.9rem;
    }

    .home-v2-search {
        max-width: 620px;
    }

    .home-v2-copy > .home-v2-actions {
        display: none;
    }

    .home-v2-links {
        margin-top: 0.62rem;
        gap: 0.7rem;
    }

    .home-v2-links a {
        font-size: 0.8rem;
        letter-spacing: 0.01em;
    }

    .home-v2-preview {
        border-radius: 14px;
        padding: 0.92rem 0.95rem;
        border-color: rgba(88, 112, 143, 0.42);
        background: linear-gradient(180deg, rgba(10, 18, 33, 0.72), rgba(8, 14, 26, 0.83));
    }

    .home-v2-preview-head p {
        margin: 0.24rem 0 0.56rem;
    }

    .home-v2-preview-row {
        padding: 0.56rem 0;
    }

    .home-v2-conversion {
        margin: 0.88rem 0 0.42rem;
        padding: 0.72rem 0;
        border-top: 1px solid rgba(98, 123, 156, 0.34);
        border-bottom: 1px solid rgba(98, 123, 156, 0.34);
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) auto auto;
        gap: 1rem;
        align-items: center;
    }

    .home-v2-conversion-copy h2 {
        margin: 0;
        font-size: 1.04rem;
        letter-spacing: 0.01em;
        color: #e8f2ff;
    }

    .home-v2-conversion-copy p {
        margin: 0.2rem 0 0;
        font-size: 0.84rem;
        line-height: 1.45;
        color: #c8d9ee;
        max-width: 58ch;
    }

    .home-v2-conversion-metrics {
        display: inline-flex;
        align-items: center;
        gap: 0.72rem;
    }

    .home-v2-conversion-metric {
        min-width: 104px;
        display: flex;
        flex-direction: column;
        gap: 0.06rem;
        padding-left: 0.72rem;
        border-left: 1px solid rgba(98, 123, 156, 0.26);
    }

    .home-v2-conversion-metric:first-child {
        border-left: 0;
        padding-left: 0;
    }

    .home-v2-conversion-value {
        font-size: 1.04rem;
        font-weight: 800;
        color: #eef5ff;
        line-height: 1.14;
    }

    .home-v2-conversion-label {
        font-size: 0.72rem;
        color: #bfd1e8;
        letter-spacing: 0.02em;
    }

    .home-v2-actions.home-v2-actions-final {
        margin-top: 0;
        margin-left: auto;
        gap: 0.5rem;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    .home-v2-actions.home-v2-actions-final .btn-primary,
    .home-v2-actions.home-v2-actions-final .btn-secondary {
        min-width: 166px;
        min-height: 42px;
        font-size: 0.82rem;
    }

    .home-v2-sections {
        margin-top: 0.9rem;
        gap: 1.7rem;
    }

    .home-v2-block h2 {
        font-size: 1.01rem;
        margin-bottom: 0.54rem;
    }

    .home-v2-list-item h3,
    .home-v2-step h3 {
        font-size: 0.9rem;
    }

    .home-v2-list-item p,
    .home-v2-step p {
        font-size: 0.82rem;
        line-height: 1.46;
    }
}

@media (max-width: 900px) {
    .home-v2-conversion {
        display: none;
    }
}

/* Market + social conversion strip: cleaner page entry and stronger CTA */
@media (min-width: 901px) {
    .market-directory-page .entry-conversion,
    .social-page .entry-conversion,
    .companies-page .entry-conversion {
        max-width: 1160px;
        margin: 0 auto 0.82rem;
        padding: 0.68rem 0.04rem;
        border-top: 1px solid rgba(98, 123, 156, 0.32);
        border-bottom: 1px solid rgba(98, 123, 156, 0.32);
        display: grid;
        grid-template-columns: minmax(0, 1.14fr) auto auto;
        align-items: center;
        gap: 0.84rem;
    }

    .market-directory-page .entry-conversion-copy h2,
    .social-page .entry-conversion-copy h2,
    .companies-page .entry-conversion-copy h2 {
        margin: 0;
        font-size: 0.96rem;
        letter-spacing: 0.01em;
        color: #e8f2ff;
    }

    .market-directory-page .entry-conversion-copy p,
    .social-page .entry-conversion-copy p,
    .companies-page .entry-conversion-copy p {
        margin: 0.2rem 0 0;
        font-size: 0.8rem;
        line-height: 1.45;
        color: #c6d8ee;
        max-width: 64ch;
    }

    .market-directory-page .entry-conversion-metrics,
    .social-page .entry-conversion-metrics,
    .companies-page .entry-conversion-metrics {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
    }

    .market-directory-page .entry-conversion-metric,
    .social-page .entry-conversion-metric,
    .companies-page .entry-conversion-metric {
        min-width: 96px;
        display: flex;
        flex-direction: column;
        gap: 0.08rem;
        padding-left: 0.5rem;
        border-left: 1px solid rgba(98, 123, 156, 0.24);
    }

    .market-directory-page .entry-conversion-metric:first-child,
    .social-page .entry-conversion-metric:first-child,
    .companies-page .entry-conversion-metric:first-child {
        padding-left: 0;
        border-left: 0;
    }

    .market-directory-page .entry-conversion-value,
    .social-page .entry-conversion-value,
    .companies-page .entry-conversion-value {
        font-size: 0.98rem;
        line-height: 1.16;
        font-weight: 800;
        color: #eef5ff;
    }

    .market-directory-page .entry-conversion-label,
    .social-page .entry-conversion-label,
    .companies-page .entry-conversion-label {
        font-size: 0.68rem;
        line-height: 1.22;
        color: #bdd1e8;
    }

    .market-directory-page .entry-conversion-actions,
    .social-page .entry-conversion-actions,
    .companies-page .entry-conversion-actions {
        margin-left: auto;
        display: inline-flex;
        align-items: center;
        gap: 0.46rem;
    }

    .market-directory-page .entry-conversion-actions .btn-primary,
    .market-directory-page .entry-conversion-actions .btn-secondary,
    .social-page .entry-conversion-actions .btn-primary,
    .social-page .entry-conversion-actions .btn-secondary,
    .companies-page .entry-conversion-actions .btn-primary,
    .companies-page .entry-conversion-actions .btn-secondary {
        min-width: 154px;
        min-height: 40px;
        font-size: 0.79rem;
    }
}

@media (max-width: 900px) {
    .market-directory-page .entry-conversion,
    .social-page .entry-conversion,
    .companies-page .entry-conversion {
        margin: 0.26rem 0 0.62rem;
        padding: 0.66rem;
        border: 1px solid rgba(92, 116, 147, 0.34);
        border-radius: 11px;
        background: rgba(8, 14, 26, 0.4);
    }

    .market-directory-page .entry-conversion-copy h2,
    .social-page .entry-conversion-copy h2,
    .companies-page .entry-conversion-copy h2 {
        margin: 0;
        font-size: 0.88rem;
    }

    .market-directory-page .entry-conversion-copy p,
    .social-page .entry-conversion-copy p,
    .companies-page .entry-conversion-copy p {
        margin: 0.22rem 0 0;
        font-size: 0.82rem;
        line-height: 1.43;
        color: #c7d9ee;
    }

    .market-directory-page .entry-conversion-metrics,
    .social-page .entry-conversion-metrics,
    .companies-page .entry-conversion-metrics {
        margin-top: 0.52rem;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.4rem;
    }

    .social-page .entry-conversion-metrics,
    .companies-page .entry-conversion-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .market-directory-page .entry-conversion-metric,
    .social-page .entry-conversion-metric,
    .companies-page .entry-conversion-metric {
        border: 1px solid rgba(92, 116, 147, 0.34);
        border-radius: 9px;
        background: rgba(255, 255, 255, 0.02);
        padding: 0.4rem 0.45rem;
        display: flex;
        flex-direction: column;
        gap: 0.08rem;
    }

    .market-directory-page .entry-conversion-value,
    .social-page .entry-conversion-value,
    .companies-page .entry-conversion-value {
        font-size: 0.9rem;
        font-weight: 800;
        color: #edf5ff;
    }

    .market-directory-page .entry-conversion-label,
    .social-page .entry-conversion-label,
    .companies-page .entry-conversion-label {
        font-size: 0.66rem;
        line-height: 1.22;
        color: #bfd2e8;
    }

    .market-directory-page .entry-conversion-actions,
    .social-page .entry-conversion-actions,
    .companies-page .entry-conversion-actions {
        margin-top: 0.52rem;
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.42rem;
    }

    .market-directory-page .entry-conversion-actions .btn-primary,
    .market-directory-page .entry-conversion-actions .btn-secondary,
    .social-page .entry-conversion-actions .btn-primary,
    .social-page .entry-conversion-actions .btn-secondary,
    .companies-page .entry-conversion-actions .btn-primary,
    .companies-page .entry-conversion-actions .btn-secondary {
        width: 100%;
        min-height: 42px;
        font-size: 0.84rem;
        text-align: center;
    }
}

@media (max-width: 430px) {
    .market-directory-page .entry-conversion,
    .social-page .entry-conversion,
    .companies-page .entry-conversion {
        padding: 0.58rem;
    }

    .market-directory-page .entry-conversion-copy h2,
    .social-page .entry-conversion-copy h2,
    .companies-page .entry-conversion-copy h2 {
        font-size: 0.84rem;
    }

    .market-directory-page .entry-conversion-copy p,
    .social-page .entry-conversion-copy p,
    .companies-page .entry-conversion-copy p {
        font-size: 0.78rem;
    }

    .market-directory-page .entry-conversion-actions .btn-primary,
    .market-directory-page .entry-conversion-actions .btn-secondary,
    .social-page .entry-conversion-actions .btn-primary,
    .social-page .entry-conversion-actions .btn-secondary,
    .companies-page .entry-conversion-actions .btn-primary,
    .companies-page .entry-conversion-actions .btn-secondary {
        min-height: 40px;
        font-size: 0.8rem;
    }
}

/* Index overflow hotfix: keep forms and conversion strips inside viewport */
.search-box {
    box-sizing: border-box;
    max-width: min(100%, 560px);
}

.search-box input {
    min-width: 0;
}

.home-page.home-v2,
.home-page.home-v2 .home-v2-hero,
.home-page.home-v2 .home-v2-conversion,
.home-page.home-v2 .home-v2-search,
.home-page.home-v2 .home-v2-conversion-metrics,
.home-page.home-v2 .home-v2-actions.home-v2-actions-final {
    box-sizing: border-box;
    max-width: 100%;
}

.home-page.home-v2 .home-v2-copy,
.home-page.home-v2 .home-v2-preview,
.home-page.home-v2 .home-v2-conversion-copy,
.home-page.home-v2 .home-v2-conversion-metric {
    min-width: 0;
}

@media (min-width: 901px) and (max-width: 1240px) {
    .home-v2-conversion {
        grid-template-columns: 1fr;
        gap: 0.72rem;
    }

    .home-v2-conversion-metrics {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.44rem;
    }

    .home-v2-conversion-metric {
        min-width: 0;
        padding-left: 0.42rem;
    }

    .home-v2-actions.home-v2-actions-final {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .market-directory-page .entry-conversion,
    .social-page .entry-conversion,
    .companies-page .entry-conversion {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }

    .market-directory-page .entry-conversion-metrics,
    .social-page .entry-conversion-metrics,
    .companies-page .entry-conversion-metrics {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.42rem;
    }

    .market-directory-page .entry-conversion-metric,
    .social-page .entry-conversion-metric,
    .companies-page .entry-conversion-metric {
        min-width: 0;
    }

    .market-directory-page .entry-conversion-actions,
    .social-page .entry-conversion-actions,
    .companies-page .entry-conversion-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

/* Hard desktop guard for index CTA overflow */
@media (min-width: 901px) {
    .home-page.home-v2 {
        overflow-x: clip;
    }

    .home-page.home-v2 .home-v2-conversion {
        grid-template-columns: 1fr;
        gap: 0.72rem;
    }

    .home-page.home-v2 .home-v2-conversion-metrics {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.42rem;
    }

    .home-page.home-v2 .home-v2-conversion-metric {
        min-width: 0;
        padding: 0.4rem 0.45rem;
        border-left: 0;
        border: 1px solid rgba(98, 123, 156, 0.24);
        border-radius: 9px;
        background: rgba(255, 255, 255, 0.02);
    }

    .home-page.home-v2 .home-v2-actions.home-v2-actions-final {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .home-page.home-v2 .home-v2-actions.home-v2-actions-final .btn-primary,
    .home-page.home-v2 .home-v2-actions.home-v2-actions-final .btn-secondary {
        min-width: 0;
        max-width: 100%;
        flex: 0 1 auto;
    }
}

/* Final CTA fit fix: long Norwegian labels should never hit right edge */
.home-page.home-v2 .home-v2-actions.home-v2-actions-final,
.market-directory-page .entry-conversion-actions,
.social-page .entry-conversion-actions,
.companies-page .entry-conversion-actions {
    width: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.42rem;
    justify-items: stretch;
    padding: 0 0.08rem;
}

.home-page.home-v2 .home-v2-actions.home-v2-actions-final .btn-primary,
.home-page.home-v2 .home-v2-actions.home-v2-actions-final .btn-secondary,
.market-directory-page .entry-conversion-actions .btn-primary,
.market-directory-page .entry-conversion-actions .btn-secondary,
.social-page .entry-conversion-actions .btn-primary,
.social-page .entry-conversion-actions .btn-secondary,
.companies-page .entry-conversion-actions .btn-primary,
.companies-page .entry-conversion-actions .btn-secondary {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.62rem 0.92rem;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.home-page.home-v2 .home-v2-conversion,
.market-directory-page .entry-conversion,
.social-page .entry-conversion,
.companies-page .entry-conversion {
    overflow: hidden;
}

/* Mobile baseline reset: enforce professional, readable hierarchy across all pages */
@media (max-width: 900px) {
    :root {
        --text-secondary: #d5e2f2;
        --text-muted: #b0c2d9;
        --border-subtle: #344a67;
    }

    html {
        font-size: 16px;
    }

    body {
        line-height: 1.58;
        text-rendering: optimizeLegibility;
    }

    .container {
        padding-left: 0.95rem !important;
        padding-right: 0.95rem !important;
    }

    h1 {
        font-size: clamp(1.5rem, 6.4vw, 1.98rem) !important;
        line-height: 1.18 !important;
        letter-spacing: -0.02em !important;
    }

    h2 {
        font-size: clamp(1.12rem, 4.8vw, 1.38rem) !important;
        line-height: 1.24 !important;
    }

    h3 {
        font-size: clamp(1rem, 4.1vw, 1.16rem) !important;
        line-height: 1.3 !important;
    }

    p,
    .subtitle,
    .insight-meta,
    .home-v2-subtitle,
    .home-v2-note,
    .directory-meta,
    .entry-conversion-copy p,
    .public-portfolio-page .directory-header .subtitle,
    .stock-detail-page .directory-header .subtitle {
        font-size: 0.95rem !important;
        line-height: 1.56 !important;
    }

    .btn-primary,
    .btn-secondary,
    .btn-outline,
    .nav-btn,
    .mobile-cta-primary,
    .mobile-cta-secondary,
    .home-v2-actions .btn-primary,
    .home-v2-actions .btn-secondary,
    .entry-conversion-actions .btn-primary,
    .entry-conversion-actions .btn-secondary {
        min-height: 44px !important;
        padding: 0.64rem 0.95rem !important;
        font-size: 0.92rem !important;
        line-height: 1.24 !important;
        border-radius: 11px !important;
    }

    .header-inner {
        min-height: 66px !important;
        padding: 0 0.8rem !important;
    }

    .logo {
        font-size: 1.05rem !important;
        letter-spacing: -0.03em !important;
    }

    .mobile-top-actions {
        gap: 0.34rem !important;
        margin-right: 0.32rem !important;
    }

    .mobile-auth-shortcut,
    .mobile-lang-shortcut {
        min-height: 34px !important;
        padding: 0.34rem 0.62rem !important;
        font-size: 0.76rem !important;
        border-radius: 999px !important;
    }

    .mobile-auth-shortcut {
        min-width: 68px !important;
    }

    .mobile-lang-shortcut {
        min-width: 42px !important;
    }

    .mobile-menu-toggle {
        padding: 0.32rem !important;
    }

    .main-nav {
        width: min(86%, 360px) !important;
        padding: calc(0.72rem + env(safe-area-inset-top)) 0.88rem 1rem !important;
    }

    .nav-mobile-title {
        font-size: 0.7rem !important;
    }

    .nav-mobile-section-label {
        font-size: 0.68rem !important;
    }

    .nav-link {
        min-height: 42px !important;
        padding: 0.74rem 0.72rem !important;
        border-radius: 11px !important;
    }

    .nav-link-text {
        font-size: 0.93rem !important;
        line-height: 1.3 !important;
    }

    .market-table td,
    .portfolio-page .holdings-table td,
    .public-portfolio-page .public-holdings-table td,
    .social-page table td {
        font-size: 0.9rem !important;
        line-height: 1.45 !important;
    }

    .market-table td::before,
    .portfolio-page .holdings-table td::before,
    .public-portfolio-page .public-holdings-table td::before,
    .social-page table td::before {
        font-size: 0.66rem !important;
        letter-spacing: 0.06em !important;
        color: #9eb4cd !important;
    }

    .badge-mini,
    .portfolio-risk-label,
    .holding-name,
    .panel-eyebrow,
    .metric .label {
        font-size: 0.74rem !important;
    }

    .home-v2-hero,
    .home-v2-conversion,
    .entry-conversion,
    .portfolio-page .panel,
    .stock-insight-card,
    .chart-container,
    .table-container {
        border-radius: 12px !important;
    }
}

@media (max-width: 430px) {
    .container {
        padding-left: 0.72rem !important;
        padding-right: 0.72rem !important;
    }

    h1 {
        font-size: clamp(1.34rem, 7.6vw, 1.72rem) !important;
    }

    h2 {
        font-size: clamp(1.04rem, 5.6vw, 1.26rem) !important;
    }

    p,
    .subtitle,
    .insight-meta,
    .home-v2-subtitle,
    .home-v2-note,
    .directory-meta {
        font-size: 0.9rem !important;
    }

    .mobile-auth-shortcut,
    .mobile-lang-shortcut {
        font-size: 0.72rem !important;
    }

    .mobile-auth-shortcut {
        min-width: 62px !important;
    }

    .mobile-lang-shortcut {
        min-width: 40px !important;
    }

    .nav-link-text {
        font-size: 0.89rem !important;
    }

    .btn-primary,
    .btn-secondary,
    .entry-conversion-actions .btn-primary,
    .entry-conversion-actions .btn-secondary {
        font-size: 0.88rem !important;
    }

    .market-table td,
    .portfolio-page .holdings-table td,
    .public-portfolio-page .public-holdings-table td,
    .social-page table td {
        font-size: 0.86rem !important;
    }
}

/* Mobile overhaul v2: simplified hierarchy and spacing */
@media (max-width: 900px) {
    body {
        background-image: radial-gradient(circle at 50% -24%, #1b2c44 0%, #040b17 78%) !important;
    }

    .home-page.home-v2 .home-v2-hero,
    .home-page.home-v2 .home-v2-conversion,
    .home-page.home-v2 .home-v2-block,
    .market-directory-page .entry-conversion,
    .social-page .entry-conversion,
    .companies-page .entry-conversion,
    .portfolio-page .panel,
    .stocks-page .stock-insight-card,
    .table-container {
        background: rgba(14, 23, 39, 0.96) !important;
        border: 1px solid #385170 !important;
        box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24) !important;
    }

    .home-page.home-v2 .home-v2-hero {
        padding: 0.95rem !important;
        gap: 0.78rem !important;
    }

    .home-page.home-v2 .home-v2-copy h1 {
        font-size: clamp(1.62rem, 7.2vw, 2.02rem) !important;
        line-height: 1.15 !important;
        letter-spacing: -0.018em !important;
        margin-bottom: 0.42rem !important;
    }

    .home-page.home-v2 .home-v2-subtitle,
    .home-page.home-v2 .home-v2-note {
        font-size: 0.98rem !important;
        line-height: 1.52 !important;
        color: #dce8f7 !important;
    }

    .home-page.home-v2 .home-v2-chip,
    .home-page.home-v2 .home-v2-links a,
    .home-page.home-v2 .home-v2-row-rank,
    .home-page.home-v2 .home-v2-row-score,
    .home-page.home-v2 .home-v2-proof-label,
    .entry-conversion-label,
    .panel-eyebrow,
    .portfolio-risk-label {
        font-size: 0.76rem !important;
    }

    .home-page.home-v2 .home-v2-preview-head h2,
    .home-page.home-v2 .home-v2-block h2,
    .entry-conversion-copy h2,
    .stocks-page .stock-insight-card h2 {
        font-size: 1.06rem !important;
        line-height: 1.25 !important;
    }

    .home-page.home-v2 .home-v2-preview-head p,
    .home-page.home-v2 .home-v2-list-item p,
    .home-page.home-v2 .home-v2-step p,
    .entry-conversion-copy p {
        font-size: 0.92rem !important;
        line-height: 1.48 !important;
    }

    .home-page.home-v2 .home-v2-preview-row,
    .home-page.home-v2 .home-v2-list-item,
    .home-page.home-v2 .home-v2-step {
        padding: 0.66rem 0.64rem !important;
    }

    .home-page.home-v2 .home-v2-proof,
    .home-page.home-v2 .home-v2-sections,
    .home-page.home-v2 .home-v2-final {
        margin-top: 0.68rem !important;
        gap: 0.58rem !important;
    }

    .home-page.home-v2 .home-v2-actions {
        gap: 0.48rem !important;
    }

    .home-page.home-v2 .home-v2-preview-row:nth-child(n+4) {
        display: none !important;
    }

    .market-directory-page .directory-header h1,
    .companies-page .directory-header h1,
    .social-page .directory-header h1,
    .public-portfolio-page .directory-header h1,
    .stock-detail-page .directory-header h1,
    .portfolio-page .directory-header h1 {
        font-size: clamp(1.36rem, 6.1vw, 1.76rem) !important;
        line-height: 1.18 !important;
    }

    .market-directory-page .directory-header .subtitle,
    .companies-page .directory-header .subtitle,
    .social-page .directory-header .subtitle,
    .public-portfolio-page .directory-header .subtitle,
    .stock-detail-page .directory-header .subtitle,
    .portfolio-page .directory-header .subtitle {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
    }

    .market-table tr,
    .portfolio-page .holdings-table tr,
    .public-portfolio-page .public-holdings-table tr,
    .social-page .social-table tr {
        padding: 0.62rem 0.66rem !important;
        gap: 0.34rem !important;
        border-radius: 10px !important;
    }

    .market-table td,
    .portfolio-page .holdings-table td,
    .public-portfolio-page .public-holdings-table td,
    .social-page .social-table td {
        padding: 0.2rem 0 !important;
        font-size: 0.93rem !important;
        line-height: 1.44 !important;
    }

    .market-table td::before,
    .portfolio-page .holdings-table td::before,
    .public-portfolio-page .public-holdings-table td::before,
    .social-page .social-table td::before {
        font-size: 0.67rem !important;
        letter-spacing: 0.055em !important;
        color: #a9bed7 !important;
    }

    .market-table td.ticker-cell strong,
    .portfolio-page .holdings-table td strong,
    .public-portfolio-page .public-holdings-table td strong,
    .social-page .social-table td strong {
        font-size: 0.99rem !important;
    }

    .entry-conversion-actions {
        grid-template-columns: 1fr !important;
    }

    .mobile-dock-link {
        min-height: 58px !important;
        font-size: 0.72rem !important;
    }

    .mobile-dock-text {
        font-size: 0.7rem !important;
    }
}

@media (max-width: 430px) {
    .home-page.home-v2 .home-v2-copy h1 {
        font-size: clamp(1.46rem, 7.8vw, 1.82rem) !important;
    }

    .home-page.home-v2 .home-v2-subtitle,
    .home-page.home-v2 .home-v2-note,
    .market-directory-page .directory-header .subtitle,
    .companies-page .directory-header .subtitle,
    .social-page .directory-header .subtitle,
    .public-portfolio-page .directory-header .subtitle,
    .stock-detail-page .directory-header .subtitle,
    .portfolio-page .directory-header .subtitle {
        font-size: 0.92rem !important;
    }

    .market-table td,
    .portfolio-page .holdings-table td,
    .public-portfolio-page .public-holdings-table td,
    .social-page .social-table td {
        font-size: 0.88rem !important;
    }
}

/* Mobile layout polish: final shared pass for phone-first usability */
@media (max-width: 900px) {
    body.has-mobile-dock,
    body.has-mobile-cta {
        padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important;
    }

    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    select,
    textarea {
        font-size: 16px !important;
    }

    header {
        box-shadow: 0 10px 30px rgba(2, 6, 23, 0.28);
    }

    .header-inner {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto auto !important;
        gap: 0.5rem !important;
        min-height: 64px !important;
        padding: 0 0.78rem !important;
    }

    .logo {
        min-width: 0;
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .beta-tag {
        font-size: 0.58rem;
        padding: 0.14rem 0.34rem;
        vertical-align: middle;
    }

    .mobile-top-actions {
        justify-self: end;
        gap: 0.38rem !important;
        margin-right: 0 !important;
        max-width: 100%;
    }

    .mobile-auth-shortcut,
    .mobile-lang-shortcut {
        min-height: 35px !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
        backdrop-filter: blur(10px);
    }

    .mobile-auth-shortcut.account,
    .mobile-auth-shortcut.login {
        min-width: 72px !important;
    }

    .mobile-menu-toggle {
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(96, 165, 250, 0.16);
    }

    .main-nav {
        width: min(84vw, 348px) !important;
        padding: calc(0.82rem + env(safe-area-inset-top)) 0.9rem 1.05rem !important;
        background:
            linear-gradient(180deg, rgba(8, 14, 28, 0.99) 0%, rgba(13, 24, 42, 0.985) 100%) !important;
        border-left: 1px solid rgba(106, 137, 174, 0.26) !important;
        box-shadow: -18px 0 40px rgba(2, 6, 23, 0.56) !important;
    }

    .nav-mobile-head {
        position: sticky;
        top: calc(env(safe-area-inset-top) * -1);
        margin: -0.1rem 0 0.5rem;
        padding-top: 0.15rem;
        background: linear-gradient(180deg, rgba(8, 14, 28, 0.98) 0%, rgba(8, 14, 28, 0.92) 100%);
        z-index: 2;
    }

    .nav-mobile-auth {
        gap: 0.62rem !important;
        margin-top: 0.2rem !important;
        margin-bottom: 0.62rem !important;
        padding: 0.2rem 0 0.95rem !important;
    }

    .nav-mobile-auth .nav-mobile-auth-btn {
        min-height: 48px !important;
        background: rgba(255, 255, 255, 0.035);
        border: 1px solid rgba(106, 137, 174, 0.2);
    }

    .nav-links {
        gap: 0.34rem !important;
    }

    .nav-link {
        min-height: 48px !important;
        padding: 0.82rem 0.8rem !important;
        border-radius: 13px !important;
        background: rgba(255, 255, 255, 0.025);
        border-color: rgba(106, 137, 174, 0.14) !important;
    }

    .nav-link.active {
        background: linear-gradient(180deg, rgba(23, 72, 130, 0.34), rgba(11, 34, 66, 0.4)) !important;
        border-color: rgba(103, 181, 255, 0.34) !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }

    .nav-link-icon {
        width: 1.18rem !important;
        height: 1.18rem !important;
    }

    .nav-utils {
        gap: 0.72rem !important;
        margin-top: 0.72rem !important;
        padding-top: 0.88rem !important;
    }

    .header-stock-search input {
        min-height: 46px !important;
        border-radius: 12px !important;
        padding-left: 2.15rem !important;
    }

    .lang-switcher {
        width: 100%;
    }

    .directory-header,
    .stock-card-hero,
    .portfolio-page .directory-header {
        gap: 0.7rem;
    }

    .table-container,
    .chart-container,
    .portfolio-page .panel,
    .stock-insight-card {
        overflow: hidden;
    }

    .main-footer {
        margin-top: 2.8rem !important;
        padding: 2.7rem 0 calc(6.4rem + env(safe-area-inset-bottom)) !important;
        background:
            linear-gradient(180deg, rgba(2, 6, 23, 0.88) 0%, rgba(2, 6, 23, 1) 100%) !important;
    }

    .footer-grid {
        gap: 1.1rem !important;
        margin-bottom: 1.5rem !important;
    }

    .f-col {
        padding: 1rem 1rem 0.95rem;
        border-radius: 14px;
        border: 1px solid rgba(79, 104, 140, 0.26);
        background: rgba(11, 18, 33, 0.78);
    }

    .f-col h4 {
        margin-bottom: 0.75rem !important;
        font-size: 0.94rem !important;
    }

    .f-col p,
    .contact-info,
    .footer-links a {
        font-size: 0.84rem !important;
        line-height: 1.55 !important;
    }

    .footer-links {
        display: grid;
        gap: 0.55rem;
        margin-top: 0.9rem;
    }

    .footer-links a {
        margin: 0 !important;
        padding-bottom: 0.24rem;
        width: fit-content;
    }

    .disclaimer-box {
        margin-bottom: 1.5rem !important;
        padding: 1rem !important;
        border-radius: 14px !important;
        font-size: 0.78rem !important;
        line-height: 1.55 !important;
    }

    .footer-bottom {
        padding-top: 1.2rem !important;
        text-align: left !important;
    }

    .mobile-dock,
    .mobile-dock.is-authenticated,
    .mobile-dock.is-guest {
        left: 0.45rem !important;
        right: 0.45rem !important;
        bottom: max(0.45rem, env(safe-area-inset-bottom)) !important;
        gap: 0.32rem !important;
        padding: 0.36rem !important;
        border: 1px solid rgba(82, 107, 141, 0.34) !important;
        border-radius: 18px !important;
        background: linear-gradient(180deg, rgba(6, 13, 25, 0.95), rgba(4, 9, 19, 0.98)) !important;
        box-shadow: 0 14px 34px rgba(2, 6, 23, 0.42) !important;
    }

    .mobile-dock-link {
        min-height: 58px !important;
        gap: 0.22rem !important;
        border-radius: 14px !important;
        border-color: transparent !important;
        background: transparent !important;
        padding: 0.36rem 0.2rem !important;
    }

    .mobile-dock-link.active {
        background: linear-gradient(180deg, rgba(24, 83, 152, 0.34), rgba(10, 36, 68, 0.42)) !important;
        border-color: rgba(103, 181, 255, 0.34) !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .mobile-dock-link.is-auth {
        background: linear-gradient(180deg, rgba(20, 70, 140, 0.36), rgba(10, 39, 87, 0.42)) !important;
    }

    .mobile-dock-icon {
        width: 1.08rem !important;
        height: 1.08rem !important;
    }

    .mobile-dock-text {
        font-size: 0.68rem !important;
        letter-spacing: 0.02em;
    }
}

@media (max-width: 430px) {
    .header-inner {
        gap: 0.36rem !important;
        padding: 0 0.62rem !important;
    }

    .logo {
        font-size: 1rem !important;
    }

    .mobile-top-actions {
        gap: 0.28rem !important;
    }

    .mobile-auth-shortcut,
    .mobile-lang-shortcut {
        padding: 0.32rem 0.54rem !important;
    }

    .mobile-auth-shortcut.account,
    .mobile-auth-shortcut.login {
        min-width: 64px !important;
    }

    .main-nav {
        width: min(100vw, 320px) !important;
        padding-left: 0.8rem !important;
        padding-right: 0.8rem !important;
    }

    .f-col {
        padding: 0.92rem 0.88rem 0.88rem;
    }

    .mobile-dock,
    .mobile-dock.is-authenticated,
    .mobile-dock.is-guest {
        left: 0.38rem !important;
        right: 0.38rem !important;
    }

    .mobile-dock-text {
        font-size: 0.64rem !important;
    }
}

/* Mobile page activation pass: market, social, and public portfolio */
@media (max-width: 900px) {
    .home-page.home-v2 {
        padding-top: 0.95rem !important;
    }

    .home-page.home-v2 .home-v2-hero {
        gap: 0.9rem !important;
    }

    .home-page.home-v2 .home-v2-preview {
        margin-top: 0 !important;
    }

    .home-page.home-v2 .home-v2-preview-list {
        gap: 0 !important;
    }

    .home-page.home-v2 .home-v2-preview-row {
        padding: 0.78rem 0.72rem !important;
    }

    .home-page.home-v2 .home-v2-actions,
    .home-page.home-v2 .home-v2-actions.home-v2-actions-final {
        grid-template-columns: 1fr !important;
        width: 100%;
    }

    .market-directory-page .directory-header,
    .social-page .directory-header,
    .public-portfolio-page .directory-header,
    .stock-detail-page .directory-header {
        padding-top: 1.1rem !important;
        gap: 0.72rem !important;
    }

    .market-directory-page .market-search {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 46px !important;
        margin-top: 0.15rem;
        box-sizing: border-box;
    }

    .market-directory-page .table-container,
    .social-page .social-table-container,
    .public-portfolio-page .public-holdings-container {
        border-radius: 14px !important;
    }

    .market-directory-page .market-table tr,
    .social-page .social-table tr {
        padding: 0.74rem 0.72rem !important;
    }

    .market-directory-page .name-value,
    .public-portfolio-page .holding-name {
        display: flex;
        align-items: flex-start;
        gap: 0.42rem;
        flex-wrap: wrap;
    }

    .stock-detail-page .stock-detail-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.55rem !important;
        margin-bottom: 1rem !important;
    }

    .stock-detail-page .related-stock-grid {
        padding-bottom: 0 !important;
    }

    .stock-detail-page .dividend-history-panel {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .social-page .social-guest-cta,
    .public-portfolio-page .directory-header form,
    .public-portfolio-page .directory-header > a.btn-primary {
        width: 100%;
    }

    .social-page .social-guest-cta .btn-primary,
    .public-portfolio-page .directory-header form .btn-primary,
    .public-portfolio-page .directory-header > a.btn-primary {
        width: 100%;
        text-align: center;
    }

    .public-portfolio-page .directory-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .public-portfolio-page .top-stats {
        gap: 0.7rem !important;
        margin-bottom: 1rem !important;
    }

    .public-portfolio-page .chart-container {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }
}

@media (max-width: 430px) {
    .home-page.home-v2 .home-v2-preview-row {
        padding: 0.72rem 0.64rem !important;
    }

    .market-directory-page .market-table td,
    .social-page .social-table td,
    .public-portfolio-page .public-holdings-table td {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .stock-detail-page .stock-insight-card {
        padding: 0.82rem !important;
    }
}

/* Mobile polish pass: companies, profile, legal */
@media (max-width: 900px) {
    .companies-page .directory-header {
        gap: 0.62rem !important;
    }

    .companies-page .entry-conversion {
        margin-top: 0.72rem !important;
    }

    .companies-page .entry-conversion-metrics {
        gap: 0.42rem !important;
    }

    .companies-page .entry-conversion-metric {
        min-height: 92px;
    }

    .companies-page .market-table td.small-caps .cell-value {
        justify-content: flex-start;
        text-align: left;
    }

    .companies-page .market-table td:nth-child(2) .cell-value {
        display: block;
    }

    .companies-page .market-table td:nth-child(2) .company-name {
        display: block;
        line-height: 1.42;
    }

    .companies-page .market-table td[colspan] {
        text-align: center;
        justify-content: center;
        color: var(--text-secondary);
        font-weight: 700;
        min-height: 92px;
    }

    .profile-page .profile-container {
        margin-top: 0.78rem !important;
    }

    .profile-page .profile-section {
        border-radius: 14px !important;
    }

    .profile-page .checkbox-group {
        align-items: flex-start;
        line-height: 1.45;
    }

    .profile-page .checkbox-group input[type="checkbox"] {
        margin-top: 0.1rem;
        flex: 0 0 auto;
    }

    .profile-page .delete-section {
        margin-top: 0.2rem;
    }

    .legal-page {
        padding-top: 0.92rem;
    }

    .legal-page .legal-card {
        border-radius: 16px !important;
    }

    .legal-page .legal-card h1 {
        line-height: 1.16;
    }

    .legal-page .legal-card section {
        padding: 0.45rem 0 !important;
    }
}

@media (max-width: 430px) {
    .companies-page .letter-chip {
        min-width: 38px !important;
        height: 38px !important;
        padding: 0 0.5rem !important;
    }

    .companies-page .entry-conversion-metric {
        min-height: 84px;
    }

    .profile-page .checkbox-group {
        padding: 0.5rem 0.54rem !important;
    }

    .legal-page .legal-card {
        padding: 0.92rem !important;
    }
}

/* Mobile stabilization pass: prevent clipped data cells and off-canvas bleed */
@media (max-width: 900px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }

    .container {
        width: 100%;
        max-width: 100%;
    }

    /* Keep hidden mobile nav outside interaction without widening layout. */
    .main-nav {
        width: min(84vw, 348px) !important;
        max-width: min(84vw, 348px) !important;
        right: 0 !important;
        transform: none !important;
        clip-path: inset(0 0 0 100%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: clip-path 0.28s ease, opacity 0.2s ease, visibility 0s linear 0.28s !important;
    }

    .main-nav.active {
        clip-path: inset(0 0 0 0) !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transition: clip-path 0.28s ease, opacity 0.2s ease !important;
    }

    .market-directory-page .table-container,
    .companies-page .table-container,
    .social-page .social-table-container,
    .public-portfolio-page .public-holdings-container,
    .portfolio-page .holdings-container {
        overflow: hidden !important;
    }

    .market-directory-page .market-table tr,
    .companies-page .market-table tr,
    .social-page .social-table tr,
    .public-portfolio-page .public-holdings-table tr,
    .portfolio-page .holdings-table tr {
        padding: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .market-directory-page .market-table td,
    .companies-page .market-table td,
    .social-page .social-table td,
    .public-portfolio-page .public-holdings-table td,
    .portfolio-page .holdings-table td {
        display: grid !important;
        grid-template-columns: minmax(72px, 92px) minmax(0, 1fr) !important;
        align-items: start !important;
        gap: 0.22rem 0.72rem !important;
        width: auto !important;
        box-sizing: border-box !important;
        padding: 0.66rem 0.86rem !important;
    }

    .market-directory-page .market-table td .cell-value,
    .companies-page .market-table td .cell-value,
    .social-page .social-table td .cell-value,
    .public-portfolio-page .public-holdings-table td .cell-value,
    .portfolio-page .holdings-table td .cell-value {
        min-width: 0;
        max-width: 100%;
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.4rem;
        overflow-wrap: anywhere;
    }

    .market-directory-page .market-table td.text-right .cell-value,
    .companies-page .market-table td.text-right .cell-value,
    .social-page .social-table td.text-right .cell-value,
    .public-portfolio-page .public-holdings-table td.text-right .cell-value,
    .portfolio-page .holdings-table td.text-right .cell-value {
        width: 100%;
        justify-content: flex-end !important;
        text-align: right;
    }

    .companies-page .letter-filter {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        padding-bottom: 0.24rem !important;
    }

    .companies-page .letter-chip {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }
}

@media (max-width: 430px) {
    .market-directory-page .market-table td,
    .companies-page .market-table td,
    .social-page .social-table td,
    .public-portfolio-page .public-holdings-table td,
    .portfolio-page .holdings-table td {
        grid-template-columns: minmax(68px, 84px) minmax(0, 1fr) !important;
        padding: 0.6rem 0.74rem !important;
    }
}

/* Unified interface pass: simplify and normalize the public site */
:root {
    --bg-root: #06111d;
    --bg-card: #0d1a2d;
    --bg-card-hover: #13253c;
    --text-primary: #f4f8fb;
    --text-secondary: #c3d1e0;
    --text-muted: #8397b0;
    --border-subtle: #223954;
    --border-active: #33597f;
    --accent-brand: #78b3ff;
    --focus-ring: rgba(120, 179, 255, 0.36);
}

body {
    background:
        radial-gradient(circle at top, rgba(27, 54, 86, 0.42) 0%, rgba(10, 21, 37, 0) 30%),
        linear-gradient(180deg, #07111d 0%, #040b14 100%) !important;
    color: var(--text-primary);
}

.container {
    max-width: 1240px;
    padding-left: clamp(1rem, 2vw, 1.5rem) !important;
    padding-right: clamp(1rem, 2vw, 1.5rem) !important;
}

header {
    background: rgba(7, 15, 26, 0.96) !important;
    border-bottom: 1px solid rgba(51, 89, 127, 0.34) !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
}

.header-inner {
    max-width: 1240px;
    min-height: 72px !important;
    padding: 0 clamp(1rem, 2vw, 1.5rem) !important;
    gap: 1rem;
}

.logo {
    font-size: 1.08rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.04em !important;
}

.beta-tag {
    background: rgba(120, 179, 255, 0.12);
    border: 1px solid rgba(120, 179, 255, 0.22);
    color: #dce9f8;
}

.main-nav {
    margin-left: 2rem;
}

.nav-links {
    gap: 0.55rem;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0.6rem 0.88rem;
    border-radius: 999px;
    border: 1px solid transparent;
    color: var(--text-secondary);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(51, 89, 127, 0.34);
}

.header-stock-search input,
.market-search,
.search-box input,
.profile-page input[type="text"],
.profile-page select,
.portfolio-page input:not([type="checkbox"]):not([type="radio"]),
.portfolio-page select,
.public-portfolio-page input:not([type="checkbox"]):not([type="radio"]),
.public-portfolio-page select {
    background: rgba(5, 13, 24, 0.9) !important;
    border: 1px solid rgba(51, 89, 127, 0.54) !important;
    border-radius: 14px !important;
    color: var(--text-primary) !important;
    box-shadow: none !important;
}

.header-stock-search input:focus,
.market-search:focus,
.search-box input:focus,
.profile-page input[type="text"]:focus,
.profile-page select:focus,
.portfolio-page input:not([type="checkbox"]):not([type="radio"]):focus,
.portfolio-page select:focus,
.public-portfolio-page input:not([type="checkbox"]):not([type="radio"]):focus,
.public-portfolio-page select:focus {
    outline: none;
    border-color: var(--accent-brand) !important;
    box-shadow: 0 0 0 3px rgba(120, 179, 255, 0.14) !important;
}

.btn-primary,
.btn-secondary,
.nav-btn,
.btn-save,
.btn-delete,
.btn-export,
.badge-mini.action-link,
.social-follow-btn {
    min-height: 46px;
    border-radius: 12px !important;
    font-weight: 800 !important;
    letter-spacing: -0.01em;
    box-shadow: none !important;
    padding: 0.68rem 1rem;
}

.btn-primary,
.btn-save {
    background: linear-gradient(180deg, #edf4fc 0%, #d7e6f6 100%) !important;
    border: 1px solid #d7e6f6 !important;
    color: #081321 !important;
}

.btn-secondary,
.nav-btn,
.btn-export {
    background: rgba(12, 24, 39, 0.92) !important;
    border: 1px solid rgba(51, 89, 127, 0.58) !important;
    color: var(--text-primary) !important;
}

.btn-delete {
    background: rgba(96, 26, 26, 0.12) !important;
    border: 1px solid rgba(239, 68, 68, 0.42) !important;
    color: #ffb4b4 !important;
}

.nav-btn-icon {
    width: 46px;
    min-width: 46px;
    padding: 0 !important;
    justify-content: center !important;
}

.nav-btn-icon svg {
    width: 1.05rem;
    height: 1.05rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.home-page,
.market-directory-page,
.companies-page,
.social-page,
.public-portfolio-page,
.portfolio-page,
.profile-page,
.legal-page,
.stock-detail-page {
    padding-top: 1.25rem;
    padding-bottom: 3.5rem;
}

.directory-header,
.home-v2-hero,
.home-v2-conversion,
.home-v2-block,
.entry-conversion,
.stock-insight-card,
.profile-page .profile-section,
.legal-page .legal-card,
.portfolio-page .sidebar,
.portfolio-page .portfolio-toolbar,
.portfolio-page .estimate-section,
.portfolio-page .optimizer-suggestions,
.portfolio-page .export-section,
.portfolio-page .import-section,
.public-portfolio-page .dividend-event-list,
.public-portfolio-page .dividend-history-dropdown,
.table-container,
.chart-container {
    background: linear-gradient(180deg, rgba(14, 26, 42, 0.96), rgba(10, 19, 31, 0.98)) !important;
    border: 1px solid rgba(51, 89, 127, 0.38) !important;
    border-radius: 18px !important;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.18) !important;
}

.directory-header,
.home-v2-hero,
.home-v2-conversion,
.home-v2-block,
.entry-conversion {
    padding: 1.4rem 1.5rem;
}

.directory-header > * + * {
    margin-top: 0.7rem;
}

.directory-header h1,
.stock-detail-page .directory-header h1,
.portfolio-page .directory-header h1,
.public-portfolio-page .directory-header h1 {
    font-size: clamp(1.8rem, 3vw, 2.7rem) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.04em !important;
}

.directory-header .subtitle,
.home-v2-subtitle,
.home-v2-note,
.entry-conversion-copy p,
.public-portfolio-page .directory-header .subtitle,
.stock-detail-page .directory-header .subtitle {
    max-width: 48rem;
    color: var(--text-secondary) !important;
    font-size: 0.95rem;
    line-height: 1.58;
}

.directory-meta {
    margin-top: 0;
    color: var(--text-muted) !important;
    font-size: 0.84rem;
    line-height: 1.5;
}

.directory-header .market-search {
    margin-top: 0.9rem;
}

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

.social-guest-cta {
    margin-top: 0.4rem;
    justify-content: flex-start;
}

.companies-page .directory-header .market-search {
    width: min(100%, 34rem);
}

.companies-page .letter-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.95rem;
}

.companies-page .letter-chip {
    min-height: 42px;
    padding: 0.55rem 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.social-page .social-guest-cta {
    width: 100%;
    margin-top: 0.9rem;
}

.social-page .social-guest-cta .btn-primary {
    min-width: 220px;
}

.hero-actions,
.home-v2-actions,
.entry-conversion-actions,
.stock-detail-actions,
.social-guest-cta {
    gap: 0.65rem;
}

.home-v2-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 1.15rem;
    align-items: start;
}

.home-v2-eyebrow,
.home-v2-links,
.home-v2-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.home-v2-chip {
    border-radius: 999px;
    border: 1px solid rgba(120, 179, 255, 0.32);
    background: rgba(120, 179, 255, 0.1);
    color: #dce8f8;
    padding: 0.36rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.home-v2-search {
    margin: 1rem 0 0;
}

.home-v2-actions {
    margin-top: 1rem;
}

.home-v2-trust-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.home-v2-trust-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    border: 1px solid rgba(57, 194, 255, 0.18);
    border-top: 2px solid rgba(57, 194, 255, 0.42);
    background: rgba(57, 194, 255, 0.03);
}

.home-v2-trust-item strong {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-primary);
}

.home-v2-trust-item span {
    color: var(--text-secondary);
    font-size: 0.81rem;
    line-height: 1.45;
}

.home-v2-actions .btn-primary,
.home-v2-actions .btn-secondary,
.entry-conversion-actions .btn-primary,
.entry-conversion-actions .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 184px;
}

.home-v2-preview-list,
.home-v2-block-list,
.home-v2-steps {
    display: grid;
    gap: 0.75rem;
}

.home-v2-preview-row,
.home-v2-list-item,
.home-v2-step,
.entry-conversion-metric {
    border: 1px solid rgba(51, 89, 127, 0.3);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.9rem 1rem;
    transition: background 0.15s ease, border-color 0.15s ease;
}

@media (hover: hover) {
    .home-v2-preview-row:hover {
        background: rgba(57, 194, 255, 0.05);
        border-color: rgba(57, 194, 255, 0.26);
    }
}

.home-v2-preview-empty {
    border: 1px dashed rgba(57, 194, 255, 0.22);
    border-radius: 14px;
    background: rgba(57, 194, 255, 0.04);
    padding: 1.1rem 1rem;
}

.home-v2-preview-empty strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.96rem;
    font-weight: 800;
}

.home-v2-preview-empty p {
    margin: 0.45rem 0 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.55;
}

.home-v2-conversion {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.95fr) auto;
    gap: 0.82rem;
    align-items: center;
    margin-top: 0.9rem;
}

.home-v2-conversion-metrics,
.entry-conversion-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.62rem;
}

.home-v2-conversion-value,
.entry-conversion-value {
    display: block;
    font-size: 1.28rem;
    font-weight: 800;
    color: var(--text-primary);
}

.home-v2-conversion-label,
.entry-conversion-label {
    display: block;
    margin-top: 0.14rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.home-v2-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.home-v2-step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.62rem;
    align-items: start;
}

.home-v2-step-index {
    width: 1.78rem;
    height: 1.78rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(120, 179, 255, 0.12);
    border: 1px solid rgba(120, 179, 255, 0.24);
    color: #e5eef9;
    font-weight: 800;
}

.home-v2-focus-strip {
    display: grid;
    gap: 0.82rem;
    margin-top: 0.9rem;
    padding: 1.08rem 1.15rem;
    border-radius: 16px;
    border: 1px solid rgba(51, 89, 127, 0.3);
    background: linear-gradient(180deg, rgba(12, 23, 38, 0.92), rgba(8, 17, 29, 0.98));
}

.home-v2-workflow {
    display: grid;
    gap: 0.82rem;
    margin-top: 0.9rem;
    padding: 1.08rem 1.15rem;
    border-radius: 16px;
    border: 1px solid rgba(51, 89, 127, 0.3);
    background:
        radial-gradient(circle at top right, rgba(57, 194, 255, 0.08), transparent 32%),
        linear-gradient(180deg, rgba(12, 23, 38, 0.92), rgba(8, 17, 29, 0.98));
}

.home-v2-workflow-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.72rem;
}

.home-v2-workflow-grid .home-v2-step {
    padding: 0.8rem 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(74, 111, 167, 0.18);
    background: rgba(255,255,255,0.03);
}

@media (max-width: 1100px) {
    .home-v2-workflow-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .home-v2-workflow-grid {
        grid-template-columns: 1fr;
    }
}

.home-v2-focus-head h2 {
    margin: 0;
    font-size: clamp(1.08rem, 2.7vw, 1.42rem);
    background: linear-gradient(125deg, var(--text-primary) 25%, #8eccf5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.home-v2-focus-head p {
    margin: 0.24rem 0 0;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.48;
    max-width: 48rem;
}

.home-v2-focus-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.home-v2-focus-card {
    padding: 0.82rem 0.88rem;
    border-radius: 13px;
    border: 1px solid rgba(57, 194, 255, 0.2);
    border-top: 2px solid rgba(57, 194, 255, 0.5);
    background: rgba(57, 194, 255, 0.03);
    transition: background 0.15s ease, border-color 0.15s ease;
}

@media (hover: hover) {
    .home-v2-focus-card:hover {
        background: rgba(57, 194, 255, 0.06);
        border-color: rgba(57, 194, 255, 0.3);
        border-top-color: rgba(57, 194, 255, 0.7);
    }
}

.home-v2-focus-card h3 {
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 0.28rem;
    color: var(--text-primary);
}

.home-v2-focus-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.45;
}

.companies-page .letter-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.companies-page .letter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: 0 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(51, 89, 127, 0.44) !important;
    background: rgba(255, 255, 255, 0.02) !important;
    color: var(--text-secondary) !important;
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
}

.companies-page .letter-chip.active {
    background: #edf4fc !important;
    border-color: #edf4fc !important;
    color: #081321 !important;
}

.market-table,
.social-table,
.public-holdings-table,
.holdings-table {
    width: 100%;
    border-collapse: collapse;
}

.market-table thead th,
.social-table thead th,
.public-holdings-table thead th,
.holdings-table thead th {
    padding: 0.84rem 0.95rem;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(51, 89, 127, 0.3);
}

.market-table td,
.social-table td,
.public-holdings-table td,
.holdings-table td {
    padding: 0.92rem 0.95rem;
    border-bottom: 1px solid rgba(51, 89, 127, 0.22);
    vertical-align: middle;
}

.market-table tbody tr:hover,
.social-table tbody tr:hover,
.public-holdings-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.market-table td .cell-value,
.social-table td .cell-value,
.public-holdings-table td .cell-value {
    min-width: 0;
}

.market-table .ticker-cell .ticker-with-logo strong,
.home-v2-row-main .ticker-with-logo .home-v2-row-ticker {
    min-width: 0;
}

.market-table .ticker-cell .ticker-with-logo,
.market-table .name-cell .ticker-with-logo {
    color: inherit;
    text-decoration: none;
}

.social-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.social-follow-form {
    margin: 0;
}

.stock-trust-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.stock-trust-stats .t-stat {
    min-height: 84px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.18rem;
    border-radius: 14px;
    border: 1px solid rgba(51, 89, 127, 0.34);
    background: rgba(255, 255, 255, 0.02);
}

.stock-detail-header {
    padding-bottom: 0.8rem;
}

.stock-decision-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: start;
}

.stock-decision-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.38rem;
}

.stock-decision-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0.18rem 0.52rem;
    border-radius: 999px;
    border: 1px solid rgba(120, 179, 255, 0.28);
    background: rgba(120, 179, 255, 0.1);
    color: #dce8f8;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stock-decision-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0.28rem 0.72rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
}

.stock-decision-pill.buy {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.36);
    color: #8cf3c9;
}

.stock-decision-pill.hold {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.36);
    color: #ffd58a;
}

.stock-decision-pill.sell {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.36);
    color: #ffb4b4;
}

.stock-decision-title {
    margin: 0;
    font-size: 0.94rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stock-decision-body {
    max-width: 42rem;
    margin: 0.18rem 0 0;
    color: rgba(211, 224, 242, 0.78);
    font-size: 0.92rem;
    line-height: 1.55;
}

.holding-decision-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.55rem;
}

.holding-return-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(51, 89, 127, 0.3);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.holding-return-chip.buy {
    color: #8cf3c9;
    border-color: rgba(16, 185, 129, 0.32);
    background: rgba(16, 185, 129, 0.12);
}

.holding-return-chip.sell {
    color: #ffb4b4;
    border-color: rgba(239, 68, 68, 0.32);
    background: rgba(239, 68, 68, 0.12);
}

.day-change-chip {
    opacity: 0.9;
    font-weight: 700;
}

.totals-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.34rem;
    margin: 0 0 0.9rem;
    padding: 0.3rem;
    border-radius: 999px;
    border: 1px solid rgba(51, 89, 127, 0.3);
    background: rgba(8, 14, 26, 0.35);
}

.totals-mode-label {
    font-size: 0.66rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    padding: 0 0.3rem 0 0.2rem;
}

.totals-mode-btn {
    min-height: 34px;
    padding: 0.36rem 0.78rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.totals-mode-btn.is-active {
    background: rgba(56, 189, 248, 0.16);
    color: #f8fbff;
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.22);
}

.holding-dividend-cell {
    min-width: 150px;
}

.holding-dividend-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.12rem;
}

.holding-dividend-value {
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.holding-dividend-meta {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.holding-dividend-next {
    font-size: 0.68rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.holding-dividend-next.forecast {
    color: #fcd34d;
}

.holding-dividend-yield {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(57, 194, 255, 0.88);
    letter-spacing: 0.03em;
    line-height: 1.35;
}
.holding-dividend-stipulated-mark {
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(245, 158, 11, 0.8);
    cursor: default;
    margin-left: 0.08em;
    vertical-align: middle;
}

.holding-quick-facts {
    display: none;
}

.holding-support-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 0.95fr) minmax(0, 1.2fr);
    gap: 0.75rem;
}

.holding-support-panel {
    min-width: 0;
    padding: 0.58rem 0.72rem;
    border-radius: 8px;
    border: 1px solid rgba(51, 89, 127, 0.18);
    background: rgba(6, 12, 22, 0.26);
    box-shadow: none;
}

.holding-support-panel.tone-good {
    border-color: rgba(16, 185, 129, 0.3);
}

.holding-support-panel.tone-warn {
    border-color: rgba(245, 158, 11, 0.3);
}

.holding-support-panel.tone-risk {
    border-color: rgba(239, 68, 68, 0.3);
}

/* === Panel header row === */
.hsp-head {
    display: flex;
    align-items: center;
    gap: 0.38rem;
    flex-wrap: wrap;
}

.hsp-type-tag {
    flex-shrink: 0;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-right: 0.42rem;
    border-right: 1px solid rgba(100, 116, 139, 0.28);
    margin-right: 0.04rem;
    line-height: 1;
    white-space: nowrap;
}

.hsp-primary-text {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
}

.hsp-amount {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Secondary chips row */
.hsp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.26rem;
    margin-top: 0.3rem;
}

/* Sector direction + delta row */
.hsp-detail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.28rem;
    font-size: 0.68rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.hsp-detail-item {
    white-space: nowrap;
}

.hsp-delta {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.hsp-delta.pos { color: #6ee7b7; }
.hsp-delta.neg { color: #fca5a5; }

/* Notes text row */
.hsp-notes {
    margin-top: 0.28rem;
    font-size: 0.68rem;
    color: var(--text-secondary);
    line-height: 1.38;
    opacity: 0.85;
}

.holding-support-panel-tax {
    border-left: 2px solid rgba(245, 158, 11, 0.32);
}

.holding-support-panel-tax.tone-risk {
    border-left-color: rgba(239, 68, 68, 0.34);
}

.holding-support-panel-tax.tone-good {
    border-left-color: rgba(16, 185, 129, 0.32);
}

.holding-support-panel-sector {
    border-left: 2px solid rgba(59, 130, 246, 0.3);
}

.holding-support-panel-replacement {
    border-left: 2px solid rgba(148, 163, 184, 0.3);
}

.holding-support-panel-replacement.tone-risk {
    border-left-color: rgba(239, 68, 68, 0.32);
}

.holding-support-panel-replacement.tone-good {
    border-left-color: rgba(16, 185, 129, 0.3);
}

.portfolio-page .holding-main-cell {
    padding-top: 0.82rem;
    padding-bottom: 0.82rem;
}

.portfolio-page .ticker-line {
    color: var(--text-primary);
    font-size: 0.94rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.portfolio-page .holding-subline {
    margin-top: 0.18rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    line-height: 1.34;
}

.portfolio-page .holding-decision-line {
    margin-top: 0.48rem;
}

.portfolio-page .holding-dividend-summary {
    padding-top: 0;
}

.portfolio-page .holdings-table td.metric-value,
.portfolio-page .holdings-table td.metric-pl {
    font-size: 0.86rem;
    font-weight: 800;
}

.portfolio-page .holdings-table td.metric-amount,
.portfolio-page .holdings-table td.metric-avg,
.portfolio-page .holdings-table td.metric-price,
.portfolio-page .holdings-table td.holding-dividend-cell {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.portfolio-page .holdings-table tr.holding-row:hover td {
    background: rgba(255, 255, 255, 0.015);
}

.holding-tax-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.36rem;
    margin-top: 0.46rem;
}

.holding-tax-chip {
    display: inline-flex;
    align-items: center;
    min-height: 1.7rem;
    padding: 0.22rem 0.56rem;
    border-radius: 999px;
    border: 1px solid rgba(81, 104, 138, 0.28);
    background: rgba(17, 28, 43, 0.92);
    color: #d7e6f8;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

.holding-tax-chip.tone-good {
    border-color: rgba(16, 185, 129, 0.35);
    color: #7ee7be;
}

.holding-tax-chip.tone-warn {
    border-color: rgba(245, 158, 11, 0.35);
    color: #fcd34d;
}

.holding-tax-chip.tone-risk {
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.holding-tax-note {
    margin-top: 0.38rem;
    color: var(--text-secondary);
    font-size: 0.74rem;
    line-height: 1.42;
}

.holding-sector-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.36rem;
    margin-top: 0.44rem;
}

.holding-sector-chip {
    display: inline-flex;
    align-items: center;
    min-height: 1.7rem;
    padding: 0.22rem 0.56rem;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.24);
    background: rgba(13, 23, 38, 0.92);
    color: #bfdbfe;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

.holding-sector-note {
    margin-top: 0.36rem;
    color: var(--text-secondary);
    font-size: 0.74rem;
    line-height: 1.42;
}

.holding-replacement-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.36rem;
    margin-top: 0.42rem;
}

.holding-replacement-chip {
    display: inline-flex;
    align-items: center;
    min-height: 1.7rem;
    padding: 0.22rem 0.56rem;
    border-radius: 999px;
    border: 1px solid rgba(81, 104, 138, 0.28);
    background: rgba(17, 28, 43, 0.92);
    color: #d7e6f8;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

.holding-replacement-chip.tone-good {
    border-color: rgba(16, 185, 129, 0.35);
    color: #7ee7be;
}

.holding-replacement-chip.tone-warn {
    border-color: rgba(245, 158, 11, 0.35);
    color: #fcd34d;
}

.holding-replacement-chip.tone-risk {
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.holding-replacement-note {
    margin-top: 0.34rem;
    color: var(--text-secondary);
    font-size: 0.74rem;
    line-height: 1.42;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.portfolio-page .holding-support-panel {
    padding: 0.62rem 0.68rem;
    border-radius: 9px;
    background: rgba(8, 14, 26, 0.18);
}

.portfolio-page .holding-support-panel-replacement .holding-replacement-strip {
    gap: 0.28rem;
}

.portfolio-page .holding-support-panel-replacement .holding-replacement-chip {
    padding: 0.16rem 0.4rem;
    font-size: 0.64rem;
}

.portfolio-page .holding-support-panel .holding-tax-strip,
.portfolio-page .holding-support-panel .holding-sector-strip,
.portfolio-page .holding-support-panel .holding-replacement-strip {
    margin-top: 0;
}

.portfolio-page .holding-tax-chip,
.portfolio-page .holding-sector-chip,
.portfolio-page .holding-replacement-chip {
    min-height: 1.42rem;
    padding: 0.12rem 0.42rem;
    font-size: 0.62rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.02);
}

.portfolio-page .holding-tax-note,
.portfolio-page .holding-sector-note,
.portfolio-page .holding-replacement-note {
    margin-top: 0.24rem;
    color: var(--text-secondary);
    font-size: 0.69rem;
    line-height: 1.36;
}

.portfolio-page .action-stack .badge-mini,
.portfolio-page .action-stack .action-btn {
    min-height: 28px;
    padding: 0.2rem 0.46rem;
    font-size: 0.66rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.012);
    border-color: rgba(81, 104, 138, 0.16);
    color: #d7e3f5;
    font-weight: 650;
}

.portfolio-page .action-stack .history-btn:hover,
.portfolio-page .action-stack .sell-btn:hover,
.portfolio-page .action-stack .move-open-btn:hover {
    background: rgba(255, 255, 255, 0.04);
}

.portfolio-page .holdings-table thead th {
    padding-top: 0.74rem;
    padding-bottom: 0.74rem;
    color: #8ea6c3;
    background: rgba(255, 255, 255, 0.015);
}

.portfolio-page .holdings-table td {
    padding-top: 0.86rem;
    padding-bottom: 0.86rem;
}

.portfolio-page .holdings-table tr.holding-row:hover + .holding-support-row td.holding-support-cell {
    background: rgba(255, 255, 255, 0.018);
}

.holding-quick-fact {
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
    min-width: 0;
    padding: 0.45rem 0.5rem;
    border-radius: 9px;
    border: 1px solid rgba(51, 89, 127, 0.24);
    background: rgba(255,255,255,0.03);
}

.holding-quick-fact-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1.2;
}

.holding-quick-fact-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stock-signal-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 0.82rem;
}

.stock-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    padding: 0.82rem 0.86rem;
    border-radius: 13px;
    border: 1px solid rgba(51, 89, 127, 0.3);
    background: rgba(255, 255, 255, 0.02);
}

.stock-summary-item span {
    color: var(--text-muted);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 800;
}

.stock-summary-item strong {
    color: var(--text-primary);
    font-size: 0.88rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.stock-summary-item small {
    color: var(--text-secondary);
    font-size: 0.74rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.stock-summary-item-score {
    position: relative;
    overflow: hidden;
    border-color: rgba(96, 165, 250, 0.26);
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.16), transparent 44%),
        linear-gradient(180deg, rgba(17, 29, 49, 0.92), rgba(12, 20, 35, 0.88));
    box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.05);
}

.stock-summary-item-score.tone-buy {
    border-color: rgba(52, 211, 153, 0.32);
    background:
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.18), transparent 46%),
        linear-gradient(180deg, rgba(11, 28, 38, 0.96), rgba(11, 22, 33, 0.9));
}

.stock-summary-item-score.tone-sell {
    border-color: rgba(248, 113, 113, 0.3);
    background:
        radial-gradient(circle at top right, rgba(239, 68, 68, 0.16), transparent 46%),
        linear-gradient(180deg, rgba(28, 16, 24, 0.9), rgba(20, 16, 26, 0.84));
}

.stock-summary-item-score.tone-hold {
    border-color: rgba(251, 191, 36, 0.26);
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 46%),
        linear-gradient(180deg, rgba(24, 24, 33, 0.92), rgba(16, 18, 28, 0.84));
}

.stock-score-hero {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.stock-score-primary {
    margin: 0;
    font-size: 2rem;
    line-height: 0.98;
    font-weight: 900;
    letter-spacing: -0.05em;
    color: var(--text-primary);
}

.stock-score-primary.buy {
    color: var(--accent-buy);
}

.stock-score-primary.sell {
    color: var(--accent-sell);
}

.stock-score-primary.hold {
    color: var(--accent-hold);
}

.stock-score-grade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0.2rem 0.56rem;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.18);
    background: rgba(96, 165, 250, 0.08);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stock-score-grade.buy {
    color: var(--accent-buy);
    border-color: rgba(16, 185, 129, 0.26);
    background: rgba(16, 185, 129, 0.1);
}

.stock-score-grade.sell {
    color: var(--accent-sell);
    border-color: rgba(239, 68, 68, 0.24);
    background: rgba(239, 68, 68, 0.1);
}

.stock-score-grade.hold {
    color: var(--accent-hold);
    border-color: rgba(245, 158, 11, 0.24);
    background: rgba(245, 158, 11, 0.09);
}

.stock-score-scale {
    position: relative;
    margin: 0.18rem 0 0.16rem;
    height: 18px;
}

.stock-score-scale-track,
.stock-score-scale-neutral,
.stock-score-scale-marker {
    position: absolute;
}

.stock-score-scale-track {
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(248, 113, 113, 0.8), rgba(245, 158, 11, 0.72) 50%, rgba(52, 211, 153, 0.82));
    opacity: 0.8;
}

.stock-score-scale-neutral {
    left: 40%;
    width: 20%;
    top: 50%;
    height: 10px;
    transform: translateY(-50%);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.42);
}

.stock-score-scale-marker {
    top: 50%;
    width: 14px;
    height: 14px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    border: 2px solid rgba(226, 232, 240, 0.95);
    background: #dbeafe;
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.4);
}

.stock-score-scale-marker.buy {
    background: var(--accent-buy);
}

.stock-score-scale-marker.sell {
    background: var(--accent-sell);
}

.stock-score-scale-marker.hold {
    background: var(--accent-hold);
}

.listing-quick-facts {
    display: none;
}

.stock-insights-grid {
    gap: 1rem;
}

.stock-insight-card {
    padding: 1rem;
}

.stock-detail-actions {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin: 0.82rem 0 1.15rem;
}

.stock-decision-actions {
    margin: 0.78rem 0 0;
}

.stock-decision-actions .btn-primary,
.stock-decision-actions .btn-secondary {
    min-width: 172px;
}

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

.stock-fact-card {
    border: 1px solid rgba(51, 89, 127, 0.28);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.7rem 0.75rem;
}

.stock-fact-card span {
    display: block;
    color: var(--text-muted);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 800;
}

.stock-fact-card strong {
    display: block;
    margin-top: 0.22rem;
    color: var(--text-primary);
    font-size: 0.92rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.portfolio-priority-banner,
.public-portfolio-priority {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.7rem;
    align-items: start;
    padding: 0.82rem 0.92rem;
    margin: 0 0 0.82rem;
    border-radius: 14px;
    border: 1px solid rgba(51, 89, 127, 0.34);
    background: linear-gradient(180deg, rgba(11, 21, 35, 0.9), rgba(9, 17, 29, 0.96));
    box-shadow: none;
}

.portfolio-priority-banner.tone-good,
.public-portfolio-priority.tone-good {
    border-color: rgba(16, 185, 129, 0.3);
}

.portfolio-priority-banner.tone-warn,
.public-portfolio-priority.tone-warn {
    border-color: rgba(245, 158, 11, 0.28);
}

.portfolio-priority-banner.tone-risk,
.public-portfolio-priority.tone-risk {
    border-color: rgba(239, 68, 68, 0.28);
}

.portfolio-priority-copy,
.public-portfolio-priority-copy {
    min-width: 0;
}

.portfolio-priority-eyebrow,
.public-portfolio-priority-eyebrow {
    display: inline-block;
    margin: 0 0 0.22rem;
    color: var(--text-muted);
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.portfolio-priority-copy h3,
.public-portfolio-priority-copy h3 {
    margin: 0;
    font-size: 0.96rem;
    color: var(--text-primary);
}

.portfolio-priority-copy p,
.public-portfolio-priority-copy p {
    margin: 0.22rem 0 0;
    color: var(--text-secondary);
    line-height: 1.42;
    max-width: 52rem;
    font-size: 0.86rem;
}

.portfolio-priority-meta,
.public-portfolio-priority-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.38rem;
    padding-top: 0.08rem;
}

.portfolio-priority-chip,
.public-portfolio-priority-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0.24rem 0.58rem;
    border-radius: 999px;
    border: 1px solid rgba(51, 89, 127, 0.34);
    background: rgba(255,255,255,0.03);
    color: var(--text-primary);
    font-size: 0.72rem;
    font-weight: 650;
}

.dividend-toggle-wrap {
    margin-top: 0.75rem;
}

.split-header .btn-primary,
.split-header form .btn-primary {
    white-space: nowrap;
}

.profile-page .profile-container {
    max-width: 760px;
    margin: 1.35rem auto 2rem;
}

.public-portfolio-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.92fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.public-portfolio-hero-main,
.public-portfolio-follow-panel {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(42, 91, 138, 0.34);
    background:
        radial-gradient(circle at top right, rgba(32, 195, 255, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(11, 20, 34, 0.98), rgba(8, 15, 27, 0.98));
    box-shadow: 0 20px 46px rgba(2, 6, 23, 0.28);
}

.public-portfolio-hero-main {
    padding: 1.4rem;
}

.public-portfolio-follow-panel {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.8rem;
    padding: 1.15rem;
}

.public-portfolio-hero-kicker,
.public-portfolio-follow-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #78b7ff;
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.public-portfolio-hero-kicker::before,
.public-portfolio-follow-kicker::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #45d6ff, #3b82f6);
    box-shadow: 0 0 16px rgba(69, 214, 255, 0.42);
}

.public-portfolio-hero-copy h1 {
    margin: 0.4rem 0 0;
    font-size: clamp(2.1rem, 4vw, 3.35rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.public-portfolio-hero-copy .subtitle {
    margin: 0.6rem 0 0;
    color: rgba(215, 227, 243, 0.9);
    font-size: 1rem;
}

.public-portfolio-performance-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 0.85rem;
    margin-top: 0.95rem;
}

.public-portfolio-return-card,
.public-portfolio-hero-fact {
    border-radius: 20px;
    border: 1px solid rgba(57, 105, 152, 0.28);
    background: rgba(8, 17, 31, 0.68);
}

.public-portfolio-return-card {
    padding: 1rem 1.05rem 0.95rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.35rem;
}

.public-portfolio-return-label {
    color: rgba(145, 176, 214, 0.9);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.public-portfolio-return-value {
    display: block;
    font-size: clamp(2.5rem, 4vw, 4rem);
    line-height: 0.92;
    letter-spacing: -0.05em;
    margin: 0.35rem 0 0.15rem;
}

.public-portfolio-return-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

.public-portfolio-return-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(77, 124, 170, 0.3);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.76rem;
    font-weight: 800;
}

.public-portfolio-return-note {
    color: rgba(198, 213, 232, 0.84);
    font-size: 0.82rem;
}

.public-portfolio-hero-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.public-portfolio-hero-fact {
    min-height: 96px;
    padding: 0.82rem 0.9rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.35rem;
}

.public-portfolio-hero-fact span {
    color: rgba(145, 176, 214, 0.86);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.public-portfolio-hero-fact strong {
    font-size: clamp(1.3rem, 2.1vw, 1.85rem);
    line-height: 1;
    color: var(--text-primary);
}

.public-portfolio-follow-panel h2 {
    margin: 0;
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.public-portfolio-owner-block {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.9rem;
    align-items: center;
}

.public-portfolio-owner-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    border: 1px solid rgba(81, 132, 183, 0.34);
    background:
        radial-gradient(circle at 30% 30%, rgba(69, 214, 255, 0.28), transparent 52%),
        linear-gradient(135deg, rgba(17, 34, 58, 0.98), rgba(9, 18, 30, 0.98));
    color: #eef8ff;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.public-portfolio-owner-copy {
    min-width: 0;
}

.public-portfolio-owner-copy p {
    margin: 0.2rem 0 0;
    color: rgba(189, 205, 226, 0.78);
    font-size: 0.88rem;
    line-height: 1.45;
}

.public-portfolio-follow-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.public-portfolio-page .public-follow-form,
.public-portfolio-page .public-follow-form .btn-primary,
.public-portfolio-follow-panel > .btn-primary {
    width: 100%;
}

.public-portfolio-follow-stat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0.32rem 0.68rem;
    border-radius: 999px;
    border: 1px solid rgba(61, 103, 146, 0.32);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(220, 230, 244, 0.92);
    font-size: 0.77rem;
    font-weight: 700;
}

.public-portfolio-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
    margin-top: 0.85rem;
}

.public-portfolio-header-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0.32rem 0.66rem;
    border-radius: 999px;
    border: 1px solid rgba(51, 89, 127, 0.34);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-size: 0.73rem;
    font-weight: 700;
}

.public-portfolio-page .top-stats {
    gap: 0.9rem;
    margin-bottom: 0.9rem;
}

.portfolio-page .portfolio-toolbar,
.public-portfolio-page .directory-header.split-header,
.stock-detail-page .stock-detail-header {
    gap: 0.9rem;
}

.public-portfolio-page .table-container,
.public-portfolio-page .chart-container {
    margin-top: 0.9rem;
}

.stock-detail-page .related-sector-section {
    margin-top: 1.35rem;
    padding-top: 1rem;
}

.stock-detail-page .related-sector-title {
    margin: 0 0 0.85rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.profile-page .profile-section,
.legal-page .legal-card {
    padding: 1.2rem;
}

.profile-page .profile-section h2,
.legal-page .legal-card h1 {
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.profile-page .form-group {
    margin-bottom: 0.9rem;
}

.profile-page .form-group label {
    display: block;
    margin-bottom: 0.38rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
}

.profile-page .checkbox-group {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    border: 1px solid rgba(51, 89, 127, 0.38);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.68rem 0.76rem;
    color: var(--text-secondary);
}

.profile-page input[readonly] {
    opacity: 0.82;
    cursor: not-allowed;
}

.profile-page .btn-save,
.profile-page .btn-delete {
    width: 100%;
}

.profile-header {
    margin-bottom: 1rem;
}

.profile-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.profile-summary-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(51, 89, 127, 0.34);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-size: 0.76rem;
    font-weight: 700;
}

.profile-section-note {
    margin: 0.25rem 0 0.9rem;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.5;
}

.profile-inline-help {
    display: block;
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.45;
}

.profile-page .delete-section {
    border-color: rgba(239, 68, 68, 0.3) !important;
    background: linear-gradient(180deg, rgba(73, 22, 22, 0.42), rgba(34, 13, 13, 0.48)) !important;
}

.profile-page .delete-help-text {
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.5;
}

.profile-page .alert {
    padding: 0.82rem 0.9rem;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.26);
    color: #c9f7df;
    margin-bottom: 0.85rem;
}

.legal-intro {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
}

.legal-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 28px;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(120, 179, 255, 0.28);
    background: rgba(120, 179, 255, 0.1);
    color: #dce8f8;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.legal-summary {
    margin: 0;
    color: var(--text-secondary);
    max-width: 52rem;
    line-height: 1.6;
}

.main-footer {
    margin-top: 4rem !important;
    padding: 3.2rem 0 2rem !important;
    background: #05101c !important;
    border-top: 1px solid rgba(51, 89, 127, 0.28);
}

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

.f-col {
    padding: 1.2rem;
    border-radius: 18px;
    border: 1px solid rgba(51, 89, 127, 0.28);
    background: rgba(10, 19, 31, 0.82);
}

.disclaimer-box {
    margin-top: 1rem;
    padding: 1rem 1.15rem;
    border-radius: 16px;
    border: 1px solid rgba(51, 89, 127, 0.28);
    background: rgba(10, 19, 31, 0.72);
}

@media (max-width: 900px) {
    header {
        position: sticky;
        top: 0;
    }

    .header-inner {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto auto !important;
        min-height: 64px !important;
        gap: 0.6rem !important;
        padding: 0 0.85rem !important;
    }

    .mobile-top-actions {
        display: inline-flex;
        justify-self: end;
        gap: 0.45rem !important;
        margin-right: 0 !important;
    }

    .mobile-menu-toggle,
    .mobile-auth-shortcut,
    .mobile-lang-shortcut {
        backdrop-filter: none !important;
        box-shadow: none !important;
    }

    .mobile-menu-toggle {
        width: 42px;
        height: 42px;
        border-radius: 12px !important;
        border: 1px solid rgba(51, 89, 127, 0.44) !important;
        background: rgba(12, 24, 39, 0.96) !important;
    }

    .main-nav {
        width: min(92vw, 340px) !important;
        max-width: min(92vw, 340px) !important;
        margin: 0 !important;
        padding: 0.95rem 0.9rem 1rem !important;
        background: linear-gradient(180deg, #08121f 0%, #0d1b2e 100%) !important;
        border-left: 1px solid rgba(103, 136, 176, 0.42) !important;
        box-shadow: -22px 0 46px rgba(0, 0, 0, 0.42) !important;
        color: #f8fbff !important;
        backdrop-filter: none !important;
        clip-path: none !important;
        opacity: 1 !important;
        transform: translateX(100%) !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transition: transform 0.22s ease, visibility 0s linear 0.22s !important;
    }

    .main-nav.active {
        transform: translateX(0) !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transition: transform 0.22s ease !important;
    }

    .mobile-nav-overlay {
        background: rgba(3, 10, 18, 0.62) !important;
        backdrop-filter: none !important;
    }

    .nav-mobile-head {
        position: static !important;
        background: transparent !important;
        padding-top: 0 !important;
        margin: 0 0 0.6rem !important;
    }

    .nav-mobile-title {
        color: #f8fbff !important;
        font-weight: 800 !important;
        letter-spacing: 0.12em !important;
    }

    .nav-mobile-section-label {
        color: #9fb6d2 !important;
    }

    .nav-mobile-close {
        color: #e9f2fb !important;
        border-color: rgba(116, 149, 190, 0.34) !important;
        background: rgba(255, 255, 255, 0.04) !important;
    }

    .nav-mobile-close:hover {
        color: #ffffff !important;
        border-color: rgba(160, 196, 255, 0.56) !important;
        background: rgba(120, 179, 255, 0.12) !important;
    }

    .nav-mobile-auth .nav-mobile-auth-btn {
        background: #edf4fc !important;
        border-color: #d7e6f6 !important;
        color: #081321 !important;
        font-weight: 800 !important;
    }

    .nav-mobile-auth .nav-mobile-auth-btn:hover {
        background: #ffffff !important;
        border-color: #ffffff !important;
        color: #081321 !important;
    }

    .nav-link {
        width: 100%;
        min-height: 48px !important;
        justify-content: flex-start;
        border-radius: 14px !important;
        background: rgba(255, 255, 255, 0.045) !important;
        border: 1px solid rgba(103, 136, 176, 0.26) !important;
        color: #e6eef8 !important;
    }

    .nav-link-text {
        color: inherit !important;
        font-weight: 700 !important;
    }

    .nav-link-icon {
        color: #9fc8ff !important;
    }

    .nav-link:hover {
        color: #ffffff !important;
        background: rgba(120, 179, 255, 0.12) !important;
        border-color: rgba(120, 179, 255, 0.38) !important;
    }

    .nav-link.active {
        color: #ffffff !important;
        background: linear-gradient(180deg, rgba(120, 179, 255, 0.18), rgba(120, 179, 255, 0.1)) !important;
        border-color: rgba(120, 179, 255, 0.52) !important;
    }

    .nav-link.active .nav-link-icon {
        color: #ffffff !important;
    }

    .nav-utils,
    .nav-mobile-auth,
    .header-stock-search,
    .lang-switcher {
        width: 100%;
    }

    .header-stock-search input {
        background: rgba(6, 15, 26, 0.96) !important;
        border-color: rgba(103, 136, 176, 0.32) !important;
        color: #f8fbff !important;
    }

    .header-stock-search input::placeholder {
        color: #93a9c4 !important;
        opacity: 1;
    }

    .header-search-icon {
        color: #9fb6d2 !important;
    }

    .lang-switcher {
        border-color: rgba(103, 136, 176, 0.32) !important;
        background: rgba(255, 255, 255, 0.05) !important;
    }

    .lang-switcher .divider {
        color: #6f88a8 !important;
    }

    .lang-switcher a {
        color: #d5e2f1 !important;
    }

    .lang-switcher a.active {
        color: #081321 !important;
        background: #edf4fc !important;
        box-shadow: none !important;
    }

    .mobile-dock,
    .mobile-dock.is-authenticated,
    .mobile-dock.is-guest {
        left: 0.75rem !important;
        right: 0.75rem !important;
        bottom: max(0.75rem, env(safe-area-inset-bottom)) !important;
        padding: 0.32rem !important;
        border-radius: 16px !important;
        border: 1px solid rgba(51, 89, 127, 0.38) !important;
        background: rgba(8, 18, 31, 0.98) !important;
        box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28) !important;
        backdrop-filter: none !important;
    }

    .mobile-dock-link {
        min-height: 56px !important;
        border-radius: 12px !important;
        padding: 0.34rem 0.2rem !important;
    }

    .directory-header.split-header,
    .home-v2-hero,
    .home-v2-conversion,
    .home-v2-sections,
    .home-v2-trust-list,
    .home-v2-focus-grid,
    .profile-header-meta,
    .home-v2-conversion-metrics,
    .stock-decision-hero,
    .stock-signal-summary,
    .entry-conversion-metrics,
    .stock-trust-stats,
    .stock-insights-grid,
    .footer-grid {
        grid-template-columns: 1fr !important;
        display: grid;
    }

    .directory-header,
    .home-v2-hero,
    .home-v2-conversion,
    .home-v2-block,
    .entry-conversion,
    .stock-insight-card,
    .table-container,
    .chart-container,
    .profile-page .profile-section,
    .legal-page .legal-card {
        padding: 1rem !important;
        border-radius: 16px !important;
    }

    .home-v2-actions,
    .entry-conversion-actions,
    .stock-detail-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.6rem !important;
    }

    .public-portfolio-header-meta {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem;
    }

    .home-v2-actions .btn-primary,
    .home-v2-actions .btn-secondary,
    .entry-conversion-actions .btn-primary,
    .entry-conversion-actions .btn-secondary,
    .split-header .btn-primary,
    .split-header form .btn-primary {
        width: 100%;
        min-width: 0;
    }

    .directory-header .subtitle,
    .home-v2-subtitle,
    .home-v2-note,
    .entry-conversion-copy p,
    .public-portfolio-page .directory-header .subtitle,
    .stock-detail-page .directory-header .subtitle {
        font-size: 0.9rem;
    }

    .companies-page .letter-filter {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        -webkit-overflow-scrolling: touch;
    }

    .companies-page .letter-chip {
        flex: 0 0 auto;
    }

    .market-table,
    .market-table tbody,
    .market-table tr,
    .social-table,
    .social-table tbody,
    .social-table tr,
    .public-holdings-table,
    .public-holdings-table tbody,
    .public-holdings-table tr {
        display: block;
        width: 100%;
    }

    .market-table thead,
    .social-table thead,
    .public-holdings-table thead {
        display: none;
    }

    .market-table tr,
    .social-table tr,
    .public-holdings-table tr {
        margin-bottom: 0.75rem;
        border: 1px solid rgba(51, 89, 127, 0.3);
        border-radius: 16px;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.02);
    }

    .market-table td,
    .social-table td,
    .public-holdings-table td {
        display: grid !important;
        grid-template-columns: minmax(84px, 104px) minmax(0, 1fr) !important;
        gap: 0.24rem 0.75rem !important;
        align-items: start !important;
        padding: 0.8rem 0.9rem !important;
        border-bottom: 1px solid rgba(51, 89, 127, 0.2) !important;
        text-align: left !important;
    }

    .market-table td:last-child,
    .social-table td:last-child,
    .public-holdings-table td:last-child {
        border-bottom: 0 !important;
    }

    .market-table td::before,
    .social-table td::before,
    .public-holdings-table td::before {
        content: attr(data-label);
        color: var(--text-muted) !important;
        font-size: 0.68rem !important;
        font-weight: 800 !important;
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }

    .market-table td .cell-value,
    .social-table td .cell-value,
    .public-holdings-table td .cell-value {
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.45rem;
        min-width: 0;
    }

    .market-table td.text-right .cell-value,
    .social-table td.text-right .cell-value,
    .public-holdings-table td.text-right .cell-value,
    .public-holdings-table td.text-right > *:not(::before) {
        justify-content: flex-end !important;
        text-align: right;
        margin-left: auto;
    }

    .social-actions {
        justify-content: flex-start;
    }

    .holding-decision-line {
        margin-top: 0.45rem;
    }

    .holding-decision-line .signal-badge,
    .holding-decision-line .holding-return-chip {
        min-height: 30px;
        font-size: 0.74rem;
    }

    .listing-quick-facts {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.4rem;
        margin-top: 0.6rem;
    }

    .totals-mode-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .totals-mode-label {
        padding-right: 0;
    }

    .totals-mode-btn {
        flex: 1;
        min-height: 40px;
        padding: 0.44rem 0.5rem;
        font-size: 0.8rem;
    }

    .holding-dividend-cell {
        min-width: 0;
    }

    .holding-dividend-summary {
        align-items: flex-start;
    }

    .holding-quick-facts {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
        margin-top: 0.7rem;
    }

    .portfolio-priority-banner,
    .public-portfolio-priority {
        grid-template-columns: 1fr;
        padding: 0.95rem;
    }

    .portfolio-priority-meta,
    .public-portfolio-priority-meta {
        justify-content: flex-start;
    }

    .listing-quick-fact {
        display: flex;
        flex-direction: column;
        gap: 0.12rem;
        min-width: 0;
        padding: 0.42rem 0.48rem;
        border-radius: 9px;
        border: 1px solid rgba(51, 89, 127, 0.24);
        background: rgba(255, 255, 255, 0.03);
    }

    .listing-quick-fact-label {
        color: var(--text-muted);
        font-size: 0.6rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        font-weight: 800;
        line-height: 1.2;
    }

    .listing-quick-fact-value {
        color: var(--text-primary);
        font-size: 0.78rem;
        font-weight: 700;
        line-height: 1.3;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .market-directory-page .market-cell-signal,
    .market-directory-page .market-cell-score,
    .market-directory-page .market-cell-price,
    .companies-page .company-cell-sector,
    .social-page .social-cell-holdings,
    .social-page .social-cell-followers,
    .social-page .social-cell-return {
        display: none !important;
    }

    .market-directory-page .market-table td.name-cell .company-name,
    .companies-page .market-table td.name-cell .company-name {
        display: block;
    }

    .social-page .social-table td:first-child strong {
        display: block;
    }

    .stock-facts-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stock-trust-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .profile-page .profile-container {
        margin: 1rem auto 1.5rem;
    }
}

@media (max-width: 640px) {
    .directory-header h1,
    .stock-detail-page .directory-header h1,
    .portfolio-page .directory-header h1,
    .public-portfolio-page .directory-header h1 {
        font-size: clamp(1.55rem, 8vw, 2rem) !important;
    }

    .market-table td,
    .social-table td,
    .public-holdings-table td {
        grid-template-columns: minmax(72px, 90px) minmax(0, 1fr) !important;
        padding: 0.72rem 0.78rem !important;
    }

    .listing-quick-facts,
    .stock-facts-grid,
    .holding-quick-facts {
        grid-template-columns: 1fr !important;
    }

    .public-portfolio-header-meta {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        gap: 0.75rem;
    }
}

@media (max-width: 900px) {
    .companies-page .market-table td:first-child strong,
    .social-page .social-table td:first-child strong {
        font-size: 0.98rem;
        line-height: 1.25;
    }

    .companies-page .market-table td.name-cell,
    .social-page .social-table td:first-child {
        padding-top: 0.8rem !important;
        padding-bottom: 0.8rem !important;
    }

    .companies-page .listing-quick-facts,
    .social-page .listing-quick-facts {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem;
        margin-top: 0.55rem;
    }

    .companies-page .listing-quick-fact,
    .social-page .listing-quick-fact {
        padding: 0.34rem 0.42rem;
        border-radius: 10px;
    }

    .companies-page .listing-quick-fact-label,
    .social-page .listing-quick-fact-label {
        font-size: 0.62rem;
    }

    .companies-page .listing-quick-fact-value,
    .social-page .listing-quick-fact-value {
        font-size: 0.8rem;
        line-height: 1.3;
    }

    .social-page .portfolio-risk-label {
        display: inline-flex;
        align-items: center;
        margin-top: 0.4rem;
        margin-bottom: 0.15rem;
    }

    .social-page .social-actions-cell {
        padding-top: 0.55rem !important;
        border-top: 1px solid rgba(92, 116, 147, 0.18);
    }

    .social-page .social-actions {
        gap: 0.4rem;
    }
}

@media (max-width: 640px) {
    .companies-page .listing-quick-facts,
    .social-page .listing-quick-facts {
        grid-template-columns: 1fr 1fr !important;
    }

    .companies-page .listing-quick-fact,
    .social-page .listing-quick-fact {
        min-height: 0;
    }

    .social-page .social-actions-cell {
        padding-top: 0.6rem !important;
    }
}

@media (max-width: 900px) {
    .stock-detail-page {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding-left: max(0.9rem, env(safe-area-inset-left));
        padding-right: max(0.9rem, env(safe-area-inset-right));
        overflow-x: clip;
    }

    .stock-detail-page > * {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .stock-detail-page .directory-header,
    .stock-detail-page .stock-detail-header,
    .stock-detail-page .stock-decision-hero,
    .stock-detail-page .stock-decision-copy,
    .stock-detail-page .stock-quote-line,
    .stock-detail-page .stock-detail-actions,
    .stock-detail-page .stock-chart-panel,
    .stock-detail-page .stock-insights-grid,
    .stock-detail-page .stock-mobile-details,
    .stock-detail-page .related-sector-section,
    .stock-detail-page .related-stock-grid,
    .stock-detail-page .related-stock-grid .stock-card-link,
    .stock-detail-page .related-stock-grid .stock-card {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .stock-detail-page .stock-detail-header {
        display: grid;
        gap: 0.72rem;
        overflow-x: clip;
    }

    .stock-detail-page .stock-decision-hero {
        grid-template-columns: minmax(0, 1fr);
        order: 1;
        gap: 0.55rem;
    }

    .stock-detail-page .stock-decision-actions {
        order: 2;
        margin: 0;
    }

    .stock-decision-note {
        margin: 0 0 0.95rem;
        font-size: 0.84rem;
    }

    .stock-detail-page .stock-signal-summary {
        order: 3;
        margin-top: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .stock-detail-page .stock-summary-item {
        padding: 0.72rem 0.78rem;
        border-radius: 12px;
        gap: 0.18rem;
    }

    .stock-detail-page .stock-summary-item-score {
        gap: 0.3rem;
    }

    .stock-detail-page .stock-score-primary {
        font-size: 1.56rem;
    }

    .stock-detail-page .stock-score-grade {
        min-height: 24px;
        padding: 0.16rem 0.48rem;
        font-size: 0.72rem;
    }

    .stock-detail-page .stock-score-scale {
        margin: 0.1rem 0 0.04rem;
        height: 16px;
    }

    .stock-detail-page .stock-summary-item:last-child {
        grid-column: 1 / -1;
    }

    .stock-detail-page .stock-summary-item span {
        font-size: 0.64rem;
    }

    .stock-detail-page .stock-summary-item strong {
        font-size: 0.88rem;
        line-height: 1.32;
    }

    .stock-detail-page .stock-summary-item small {
        font-size: 0.72rem;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }

    .stock-detail-page .stock-insights-grid {
        margin-top: 0.6rem;
    }

    .stock-detail-page .stock-quote-line {
        align-items: flex-start;
        gap: 0.38rem 0.62rem;
    }

    .stock-detail-page .quote-price,
    .stock-detail-page .quote-change,
    .stock-detail-page .quote-meta {
        overflow-wrap: anywhere;
    }

    .stock-detail-page .stock-detail-actions .btn-primary,
    .stock-detail-page .stock-detail-actions .btn-secondary {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }

    .stock-detail-page .stock-detail-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 0.6rem !important;
    }

    .stock-detail-page .stock-detail-actions > * {
        width: 100%;
        min-width: 0;
    }

    .market-intent-grid {
        grid-template-columns: 1fr;
    }

    .market-intent-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .stock-detail-page .related-stock-grid .stock-card-link {
        display: block;
    }

    .stock-detail-page .related-stock-grid .card-header,
    .stock-detail-page .related-stock-grid .card-footer,
    .stock-detail-page .related-stock-grid .metric,
    .stock-detail-page .related-stock-grid .rank,
    .stock-detail-page .related-stock-grid .value {
        min-width: 0;
    }

    .stock-detail-page .related-stock-grid .rank,
    .stock-detail-page .related-stock-grid .metric .value {
        overflow-wrap: anywhere;
    }

    .stock-detail-page .projection-bar-price,
    .stock-detail-page .projection-bar-range,
    .stock-detail-page .stock-chart-stat strong {
        overflow-wrap: anywhere;
    }

    .stock-detail-page .dividend-history-panel {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Shared shell width: keep every public page on the same desktop measure */
:root {
    --site-shell-max-width: 1240px;
}

.container,
.header-inner {
    max-width: var(--site-shell-max-width) !important;
}

.home-page .home-v2-hero,
.home-page .home-v2-conversion,
.home-page .home-v2-sections,
.market-directory-page .directory-header,
.market-directory-page .entry-conversion,
.market-directory-page .table-container,
.companies-page .directory-header,
.companies-page .entry-conversion,
.companies-page .table-container,
.social-page .directory-header,
.social-page .entry-conversion,
.social-page .table-container,
.social-page .social-table-container,
.public-portfolio-page .directory-header,
.public-portfolio-page .top-stats,
.public-portfolio-page .chart-container,
.public-portfolio-page .public-holdings-container,
.public-portfolio-page .portfolio-income-section,
.stock-detail-page .directory-header,
.stock-detail-page .stock-insights-grid,
.stock-detail-page .related-stock-grid,
.portfolio-page .directory-header,
.portfolio-page .portfolio-layout,
.portfolio-page .portfolio-toolbar,
.portfolio-page .top-stats,
.portfolio-page .estimate-section,
.portfolio-page .optimizer-section,
.portfolio-page .charts-grid,
.portfolio-page .holdings-container,
.portfolio-page .export-section,
.portfolio-page .import-section,
.portfolio-page .portfolio-income-section,
.profile-page .profile-container,
.legal-page .legal-card {
    width: 100% !important;
    max-width: var(--site-shell-max-width) !important;
    box-sizing: border-box;
    margin-left: auto !important;
    margin-right: auto !important;
}

.profile-page .profile-container {
    margin-top: 1.35rem;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .home-page .home-v2-hero,
    .home-page .home-v2-conversion,
    .home-page .home-v2-sections,
    .market-directory-page .directory-header,
    .market-directory-page .entry-conversion,
    .market-directory-page .table-container,
    .companies-page .directory-header,
    .companies-page .entry-conversion,
    .companies-page .table-container,
    .social-page .directory-header,
    .social-page .entry-conversion,
    .social-page .table-container,
    .social-page .social-table-container,
    .public-portfolio-page .directory-header,
    .public-portfolio-page .top-stats,
    .public-portfolio-page .chart-container,
    .public-portfolio-page .public-holdings-container,
    .public-portfolio-page .portfolio-income-section,
    .stock-detail-page .directory-header,
    .stock-detail-page .stock-insights-grid,
    .stock-detail-page .related-stock-grid,
    .portfolio-page .directory-header,
    .portfolio-page .portfolio-layout,
    .portfolio-page .portfolio-toolbar,
    .portfolio-page .top-stats,
    .portfolio-page .estimate-section,
    .portfolio-page .optimizer-section,
    .portfolio-page .charts-grid,
    .portfolio-page .holdings-container,
    .portfolio-page .export-section,
    .portfolio-page .import-section,
    .portfolio-page .portfolio-income-section,
    .profile-page .profile-container,
    .legal-page .legal-card {
        max-width: 100% !important;
    }
}

/* Final panel normalization: keep portfolio, public portfolio, footer, and utility pages on one rhythm */
.portfolio-page .top-stats,
.public-portfolio-page .top-stats {
    align-items: stretch;
}

.portfolio-page .top-stats-primary,
.portfolio-page .top-stats-secondary,
.public-portfolio-page .top-stats-primary,
.public-portfolio-page .top-stats-secondary {
    display: grid;
    gap: 0.75rem;
}

.portfolio-page .top-stats-primary,
.public-portfolio-page .top-stats-primary {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.portfolio-page .top-stats-secondary,
.public-portfolio-page .top-stats-secondary {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    margin-top: 0.75rem;
}

.portfolio-page .eval-panel,
.portfolio-page .value-panel,
.public-portfolio-page .eval-panel,
.public-portfolio-page .value-panel {
    min-height: 0;
    min-width: 0;
    padding: 1.18rem !important;
    border-radius: 18px !important;
    text-align: left !important;
    overflow: hidden;
}

.portfolio-page .eval-panel,
.public-portfolio-page .eval-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.22rem;
}

.portfolio-page .value-panel,
.public-portfolio-page .value-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.22rem;
}

.portfolio-page .eval-score,
.public-portfolio-page .eval-score {
    display: block;
    line-height: 1;
    margin: 0.15rem 0;
}

.portfolio-page .eval-score-row {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.portfolio-page .eval-score-delta {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.48rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
}

.portfolio-page .eval-score-delta.is-up {
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.24);
}

.portfolio-page .eval-score-delta.is-down {
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.24);
}

.portfolio-page .eval-score-delta.is-flat {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.24);
}

.portfolio-page .eval-score-delta-meta {
    margin-top: 0.05rem;
    color: #7ea0c9;
    font-size: 0.72rem;
}

.portfolio-page .value-amount,
.public-portfolio-page .value-amount {
    display: block;
    line-height: 1.05;
    margin: 0.15rem 0;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.portfolio-page .eval-status,
.portfolio-page .value-meta-note,
.portfolio-page .detail-chip-row,
.portfolio-page .detail-chip,
.portfolio-page .summary-card .meta,
.portfolio-page .summary-card .label,
.portfolio-page .summary-card .value,
.portfolio-page .eval-panel p,
.portfolio-page .value-panel p {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.portfolio-page .portfolio-toolbar,
.public-portfolio-page .directory-header.split-header {
    margin-bottom: 1rem;
}

.portfolio-page .portfolio-toolbar,
.portfolio-page .estimate-section,
.portfolio-page .optimizer-suggestions,
.portfolio-page .chart-container,
.portfolio-page .holdings-container,
.portfolio-page .export-section,
.portfolio-page .import-section,
.portfolio-page .portfolio-income-section,
.public-portfolio-page .portfolio-income-section,
.public-portfolio-page .public-holdings-container,
.public-portfolio-page .chart-container {
    margin-top: 1rem;
}

.portfolio-page .portfolio-income-section,
.public-portfolio-page .portfolio-income-section {
    padding: 0;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.portfolio-page .dividend-summary-grid,
.public-portfolio-page .dividend-summary-grid {
    gap: 0.75rem;
}

.portfolio-page .dividend-summary-card,
.public-portfolio-page .dividend-summary-card {
    min-height: 132px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    padding: 1rem 1.05rem !important;
    border-radius: 16px !important;
}

.portfolio-page .dividend-event-list,
.portfolio-page .dividend-history-dropdown,
.public-portfolio-page .dividend-event-list,
.public-portfolio-page .dividend-history-dropdown {
    margin-top: 0.75rem;
    border-radius: 16px !important;
}

.portfolio-page .chart-container,
.public-portfolio-page .chart-container {
    padding: 1.1rem !important;
}

.portfolio-page .is-secondary-stat {
    min-height: 0;
    padding: 0.92rem 1rem !important;
    border-radius: 15px !important;
    background: rgba(8, 16, 29, 0.48) !important;
}

.portfolio-page .is-secondary-stat .value-amount {
    font-size: 1.22rem;
}

.portfolio-page .is-secondary-stat .value-meta-note {
    font-size: 0.76rem;
}

.portfolio-page .holdings-container,
.public-portfolio-page .public-holdings-container {
    overflow: hidden;
}

.portfolio-page .sidebar h3,
.portfolio-page .optimizer-title,
.portfolio-page .estimate-title,
.portfolio-page .chart-title,
.portfolio-page .export-title,
.public-portfolio-page .panel-eyebrow,
.public-portfolio-page .stat-eyebrow {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 800;
}

.main-footer {
    margin-top: 3.2rem !important;
    padding: 2.8rem 0 1.8rem !important;
}

.footer-grid {
    gap: 0.9rem;
}

.f-col {
    padding: 1rem 1.05rem;
    min-height: 100%;
}

.f-col h4 {
    margin-bottom: 0.9rem;
    font-size: 0.92rem;
    letter-spacing: -0.01em;
}

.f-col p,
.f-col a,
.disclaimer-box {
    font-size: 0.82rem;
    line-height: 1.55;
}

.f-col ul,
.f-col nav,
.f-col .footer-links {
    display: grid;
    gap: 0.45rem;
}

.disclaimer-box {
    margin-top: 0.9rem;
    padding: 0.9rem 1rem;
}

.legal-page .legal-card,
.unsubscribe-page .unsubscribe-card,
.profile-page .profile-section {
    padding: 1.15rem !important;
}

.legal-page .legal-card section {
    padding-top: 0.9rem;
    margin-top: 0.9rem;
}

.legal-page .legal-card p,
.unsubscribe-page .unsubscribe-card p,
.profile-page .profile-section p {
    line-height: 1.58;
}

@media (max-width: 900px) {
    .portfolio-page .eval-panel,
    .portfolio-page .value-panel,
    .public-portfolio-page .eval-panel,
    .public-portfolio-page .value-panel {
        min-height: 0;
        padding: 1rem !important;
    }

    .portfolio-page .dividend-summary-card,
    .public-portfolio-page .dividend-summary-card {
        min-height: 0;
    }

    .main-footer {
        margin-top: 2.4rem !important;
        padding: 2.1rem 0 1.35rem !important;
    }

    .f-col,
    .disclaimer-box {
        padding: 0.95rem 1rem;
    }
}

/* Portfolio page shared structure */
.portfolio-page .portfolio-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.portfolio-page .content,
.portfolio-page .portfolio-main {
    min-width: 0;
    width: 100%;
}

body.portfolio-ajax-loading .portfolio-page {
    cursor: progress;
}

body.portfolio-ajax-loading .portfolio-page .content,
body.portfolio-ajax-loading .portfolio-page .portfolio-main {
    opacity: 0.58;
    transition: opacity 0.16s ease;
}

.portfolio-page .sidebar {
    background: rgba(8, 16, 30, 0.34);
    border-radius: 14px;
    padding: 1rem;
    border: 1px solid rgba(92, 116, 147, 0.32);
    align-self: start;
    position: sticky;
    top: 88px;
}

/* === Sidebar header === */
.portfolio-page .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.78rem;
    padding: 0 0.1rem;
}

.portfolio-page .sidebar-label {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.portfolio-page .sidebar-count {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 0.1rem 0.38rem;
    border-radius: 999px;
    border: 1px solid rgba(100, 116, 139, 0.18);
    line-height: 1.4;
}

/* === Portfolio nav item === */
.portfolio-page .p-nav-item {
    display: block;
    padding: 0.62rem 0.78rem 0.62rem 0.86rem;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.34rem;
    border: 1px solid rgba(92, 116, 147, 0.2);
    border-left: 2px solid rgba(92, 116, 147, 0.2);
    background: rgba(255,255,255,0.016);
}

.portfolio-page .p-nav-item:hover {
    background: rgba(255,255,255,0.032);
    border-color: rgba(92, 116, 147, 0.38);
    border-left-color: rgba(92, 116, 147, 0.38);
}

.portfolio-page .p-nav-item.active {
    background: rgba(57, 194, 255, 0.07);
    border-color: rgba(57, 194, 255, 0.18);
    border-left-color: rgba(57, 194, 255, 0.65);
}

/* Portfolio name line */
.portfolio-page .p-nav-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portfolio-page .p-nav-item.active .p-nav-name {
    color: #cceeff;
}

/* Meta row: risk + tax badges */
.portfolio-page .p-nav-meta {
    display: flex;
    align-items: center;
    gap: 0.26rem;
    flex-wrap: wrap;
    margin-top: 0.3rem;
}

.portfolio-page .p-risk-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.08rem 0.36rem;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    border: 1px solid rgba(100, 116, 139, 0.22);
    background: rgba(255,255,255,0.03);
    color: var(--text-muted);
    line-height: 1.4;
}

.portfolio-page .p-risk-badge.risk-low {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.26);
    color: #6ee7b7;
}

.portfolio-page .p-risk-badge.risk-medium {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.26);
    color: #fcd34d;
}

.portfolio-page .p-risk-badge.risk-high {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.26);
    color: #fca5a5;
}

.portfolio-page .p-tax-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.08rem 0.36rem;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(100, 116, 139, 0.18);
    color: var(--text-muted);
    line-height: 1.4;
}

/* Create portfolio button */
.portfolio-page .create-p-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.36rem;
    width: 100%;
    padding: 0.62rem;
    margin-top: 0.62rem;
    background: transparent;
    border: 1px dashed rgba(57, 194, 255, 0.18);
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.76rem;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    line-height: 1;
    opacity: 0.72;
    transition: opacity 0.12s, border-color 0.12s, background 0.12s, color 0.12s;
}

.portfolio-page .create-p-plus {
    font-size: 1rem;
    font-weight: 300;
    line-height: 1;
    opacity: 0.55;
}

.portfolio-page .create-p-btn:hover {
    opacity: 1;
    border-color: rgba(57, 194, 255, 0.42);
    background: rgba(57, 194, 255, 0.05);
    color: rgba(57, 194, 255, 0.88);
}

.portfolio-page .top-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.72rem;
    margin-bottom: 0.78rem;
}

.portfolio-page .eval-panel,
.portfolio-page .value-panel {
    background: linear-gradient(180deg, rgba(12, 23, 38, 0.94), rgba(9, 17, 29, 0.98));
    border: 1px solid rgba(60, 88, 118, 0.36);
    box-shadow: none;
}

.portfolio-page .eval-status {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    margin: 0 0 0.22rem;
}

.portfolio-page .value-amount {
    font-size: 1.58rem;
    font-weight: 800;
    color: var(--text-primary);
}

.portfolio-page .estimate-section {
    margin: 0 0 0.72rem;
    background: rgba(255,255,255,0.01);
    border: 1px solid rgba(92, 116, 147, 0.28);
    border-radius: 11px;
    padding: 0.64rem;
}

.portfolio-page .estimate-header {
    margin: 0 0 0.52rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.52rem;
}

.portfolio-page .estimate-title {
    margin: 0;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.portfolio-page .estimate-note {
    margin: 0;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.portfolio-page .estimate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.45rem;
}

.portfolio-page .estimate-card {
    border: 1px solid rgba(92, 116, 147, 0.28);
    border-left: 2px solid rgba(127, 148, 177, 0.56);
    border-radius: 8px;
    padding: 0.42rem 0.5rem;
    background: rgba(255,255,255,0.005);
}

.portfolio-page .estimate-card .label {
    display: block;
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.055em;
    margin-bottom: 0.18rem;
}

.portfolio-page .estimate-card .pct {
    display: block;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.portfolio-page .estimate-card .val {
    display: block;
    margin-top: 0.08rem;
    font-size: 0.71rem;
    color: var(--text-secondary);
}

.portfolio-page .estimate-card .cov {
    display: block;
    margin-top: 0.05rem;
    font-size: 0.64rem;
    color: var(--text-muted);
}

.portfolio-page .estimate-card.buy { border-left-color: rgba(16,185,129,0.68); }
.portfolio-page .estimate-card.sell { border-left-color: rgba(239,68,68,0.65); }
.portfolio-page .estimate-card.hold { border-left-color: rgba(245,158,11,0.65); }
.portfolio-page .estimate-card.buy .pct { color: #10b981; }
.portfolio-page .estimate-card.sell .pct { color: #ef4444; }
.portfolio-page .estimate-card.hold .pct { color: #f59e0b; }

.portfolio-page .optimizer-section {
    margin: 0 0 0.8rem;
}

.portfolio-page .holdings-container {
    margin-top: 0.9rem;
    border: 1px solid rgba(60, 88, 118, 0.28);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(10, 18, 30, 0.84), rgba(8, 14, 24, 0.92));
}

.portfolio-page .holdings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.88rem 1rem 0.76rem;
    border-bottom: 1px solid rgba(60, 88, 118, 0.24);
}

.portfolio-page .holdings-header-copy {
    min-width: 0;
}

.portfolio-page .holdings-header-copy h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.portfolio-page .holdings-header-copy p {
    display: none;
    margin: 0.2rem 0 0;
    color: var(--text-secondary);
    font-size: 0.74rem;
    line-height: 1.4;
}

.portfolio-page .holdings-header-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.9rem;
    min-height: 1.8rem;
    padding: 0.14rem 0.52rem;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.24);
    background: rgba(96, 165, 250, 0.08);
    color: #dce8f8;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}

.portfolio-page .holdings-header-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    flex-wrap: wrap;
}

.portfolio-page .holdings-header-chip.tone-warn {
    text-decoration: none;
    border-color: rgba(245, 158, 11, 0.34);
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.portfolio-page .holdings-header-chip.tone-warn:hover {
    filter: brightness(1.06);
}

.portfolio-page .optimizer-title {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 0.58rem;
}

.portfolio-page .optimizer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.5rem;
}

.portfolio-page .optimizer-card {
    border: 1px solid rgba(92, 116, 147, 0.28);
    border-left: 2px solid rgba(127, 148, 177, 0.56);
    border-radius: 8px;
    padding: 0.46rem 0.56rem;
    background: rgba(255,255,255,0.005);
}

.portfolio-page .optimizer-card .label {
    display: block;
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.055em;
    margin-bottom: 0.2rem;
}

.portfolio-page .optimizer-card .value {
    display: block;
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.portfolio-page .optimizer-card .detail {
    display: block;
    font-size: 0.68rem;
    color: var(--text-secondary);
    margin-top: 0.16rem;
}

.portfolio-page .optimizer-card.good { border-left-color: rgba(16,185,129,0.7); }
.portfolio-page .optimizer-card.warn { border-left-color: rgba(245,158,11,0.66); }
.portfolio-page .optimizer-card.risk { border-left-color: rgba(239,68,68,0.66); }
.portfolio-page .optimizer-card.good .value { color: #10b981; }
.portfolio-page .optimizer-card.warn .value { color: #f59e0b; }
.portfolio-page .optimizer-card.risk .value { color: #ef4444; }

.portfolio-page .optimizer-suggestions {
    margin-top: 0.56rem;
    border: 1px solid rgba(92,116,147,0.3);
    border-radius: 8px;
    background: rgba(255,255,255,0.005);
    padding: 0.52rem 0.58rem;
}

.portfolio-page .optimizer-suggestions h4 {
    margin: 0 0 0.34rem;
    font-size: 0.67rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.portfolio-page .optimizer-suggestions ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.portfolio-page .optimizer-suggestions li {
    margin: 0;
    padding: 0.34rem 0;
    color: var(--text-secondary);
    font-size: 0.78rem;
    border-top: 1px dashed rgba(127,148,177,0.26);
}

.portfolio-page .optimizer-suggestions li:first-child {
    border-top: 0;
    padding-top: 0;
}

.portfolio-page .optimizer-suggestions li strong {
    color: var(--text-primary);
    font-weight: 700;
}

.portfolio-page .optimizer-suggestions li.tone-good {
    border-left: 2px solid rgba(16, 185, 129, 0.66);
    padding-left: 0.55rem;
}

.portfolio-page .optimizer-suggestions li.tone-warn {
    border-left: 2px solid rgba(245, 158, 11, 0.66);
    padding-left: 0.55rem;
}

.portfolio-page .optimizer-suggestions li.tone-risk {
    border-left: 2px solid rgba(239, 68, 68, 0.66);
    padding-left: 0.55rem;
}

.portfolio-page .optimizer-suggestion-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 0.42rem;
    padding: 0.12rem 0.38rem;
    border-radius: 999px;
    border: 1px solid rgba(57, 194, 255, 0.28);
    background: rgba(57, 194, 255, 0.09);
    color: #d8ecff;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portfolio-page .tax-value-panel .value-amount {
    font-size: 1.18rem;
}

.portfolio-page .tax-value-note {
    color: var(--text-primary);
}

.portfolio-page .top-stats-primary .value-panel .value-meta-note,
.portfolio-page .top-stats-primary .eval-panel p:last-child,
.public-portfolio-page .top-stats-primary .value-panel .value-meta-note,
.public-portfolio-page .top-stats-primary .eval-panel p:last-child,
.portfolio-page .top-stats-secondary .value-panel .value-meta-note {
    line-height: 1.24;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.portfolio-page .top-stats-primary .tax-value-panel .value-meta-note,
.portfolio-page .top-stats-secondary .tax-value-panel .value-meta-note {
    margin-top: 0.18rem;
}

.portfolio-page .top-stats-secondary .detail-chip-row {
    margin-top: 0.28rem;
    gap: 0.22rem;
}

.portfolio-page .top-stats-secondary .detail-chip {
    padding: 0.12rem 0.34rem;
    font-size: 0.62rem;
    border-radius: 999px;
}

.portfolio-page .top-stats-secondary .detail-chip-link {
    text-decoration: none;
}

.portfolio-tax-page .portfolio-toolbar {
    margin-bottom: 1rem;
}

.portfolio-tax-page .evaluator-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.portfolio-tax-page .accounting-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 1rem;
}

.portfolio-tax-page .summary-card,
.portfolio-tax-page .detail-card {
    min-height: 0;
}

.portfolio-tax-page .summary-card {
    padding: 0.86rem 0.94rem;
}

.portfolio-tax-page .summary-card .value {
    font-size: 1.12rem;
}

.portfolio-tax-page .summary-card .meta {
    line-height: 1.32;
}

.portfolio-tax-page .summary-card .meta:empty {
    display: none;
}

.portfolio-tax-page .detail-card {
    padding: 1rem 1.05rem;
}

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

.portfolio-tax-page .accounting-entry-note,
.portfolio-tax-page .field-action {
    grid-column: 1 / -1;
}

.portfolio-tax-page .field-action {
    display: flex;
    justify-content: flex-start;
}

.portfolio-tax-page .field-action .btn-primary {
    min-height: 46px;
}

.portfolio-tax-page .detail-list {
    margin-top: 0.5rem;
}

.portfolio-tax-page .detail-chip-row {
    margin-top: 0.2rem;
}

.portfolio-tax-page .detail-card .subtitle {
    margin-top: 0.42rem;
    font-size: 0.76rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.portfolio-tax-page .detail-card .detail-chip-row + .subtitle {
    margin-top: 0.5rem;
}

.portfolio-tax-page .evaluator-history-section,
.portfolio-tax-page .evaluator-holdings-section {
    margin-top: 1rem;
}

.portfolio-tax-page .table-container {
    margin-top: 0.75rem;
}

.portfolio-tax-page .audit-holdings-stack {
    margin-top: 0.75rem;
}

.portfolio-evaluator-page .evaluator-detail-grid,
.portfolio-evaluator-run-page .evaluator-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.82rem;
}

.portfolio-evaluator-page .detail-card,
.portfolio-evaluator-run-page .detail-card,
.portfolio-evaluator-page .audit-holding-card,
.portfolio-evaluator-run-page .audit-holding-card {
    min-width: 0;
    overflow: hidden;
}

.portfolio-evaluator-page .detail-card,
.portfolio-evaluator-run-page .detail-card {
    padding: 0.92rem 0.98rem;
}

.portfolio-evaluator-page .detail-list-compact,
.portfolio-evaluator-run-page .detail-list-compact {
    margin-top: 0.32rem;
}

.portfolio-evaluator-page .detail-list-compact li,
.portfolio-evaluator-run-page .detail-list-compact li {
    font-size: 0.78rem;
    line-height: 1.42;
}

.portfolio-evaluator-page .evaluator-steps-section,
.portfolio-evaluator-page .evaluator-holdings-section,
.portfolio-evaluator-page .evaluator-history-section,
.portfolio-evaluator-page .evaluator-delta-section,
.portfolio-evaluator-page .evaluator-tax-section,
.portfolio-evaluator-run-page .evaluator-holdings-section,
.portfolio-evaluator-run-page .evaluator-history-section,
.portfolio-evaluator-run-page .evaluator-delta-section,
.portfolio-evaluator-run-page .evaluator-tax-section {
    margin-top: 0.9rem;
}

.portfolio-evaluator-page .split-header,
.portfolio-evaluator-run-page .split-header {
    margin-bottom: 0.72rem;
}

.portfolio-evaluator-page .audit-holdings-stack,
.portfolio-evaluator-run-page .audit-holdings-stack {
    gap: 0.82rem;
}

.portfolio-evaluator-page .audit-holding-card,
.portfolio-evaluator-run-page .audit-holding-card {
    padding: 0.92rem 0.98rem;
}

.portfolio-evaluator-page .audit-holding-header,
.portfolio-evaluator-run-page .audit-holding-header {
    align-items: flex-start;
    gap: 0.82rem;
}

.portfolio-evaluator-page .audit-holding-header > div,
.portfolio-evaluator-run-page .audit-holding-header > div {
    min-width: 0;
}

.portfolio-evaluator-page .audit-holding-meta,
.portfolio-evaluator-run-page .audit-holding-meta {
    justify-content: flex-end;
}

.portfolio-evaluator-page .audit-step-list,
.portfolio-evaluator-run-page .audit-step-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.72rem;
}

.portfolio-evaluator-page .audit-step-row,
.portfolio-evaluator-run-page .audit-step-row {
    min-width: 0;
}

.portfolio-evaluator-page .audit-step-row-wide,
.portfolio-evaluator-run-page .audit-step-row-wide {
    grid-column: 1 / -1;
}

.portfolio-evaluator-page .audit-step-row-value,
.portfolio-evaluator-page .audit-step-row-detail,
.portfolio-evaluator-run-page .audit-step-row-value,
.portfolio-evaluator-run-page .audit-step-row-detail {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.portfolio-evaluator-page .audit-step-row-detail,
.portfolio-evaluator-run-page .audit-step-row-detail {
    line-height: 1.45;
}

.portfolio-evaluator-page .audit-step-inline-meta,
.portfolio-evaluator-run-page .audit-step-inline-meta {
    margin-top: 0.42rem;
}

.detail-chip.detail-chip-quiet {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(110, 133, 166, 0.28);
    color: var(--text-secondary);
}

.portfolio-evaluator-page .table-container,
.portfolio-evaluator-run-page .table-container {
    overflow-x: auto;
}

.portfolio-evaluator-page .market-table,
.portfolio-evaluator-run-page .market-table {
    width: 100%;
    min-width: 860px;
}

.portfolio-page .charts-grid {
    display: grid;
    grid-template-columns: 1fr 1.55fr;
    align-items: stretch;
    gap: 0.7rem;
    margin-bottom: 0.9rem;
}

.portfolio-page .chart-container {
    background: linear-gradient(180deg, rgba(14, 26, 42, 0.96), rgba(10, 19, 31, 0.98));
    border: 1px solid rgba(51, 89, 127, 0.38);
}

.portfolio-page .sector-chart-container {
    display: flex;
    flex-direction: column;
}

.portfolio-page .sector-chart-container .chart-canvas-wrap {
    flex: 1 1 auto;
    min-height: 250px;
    height: auto;
}

.portfolio-page .chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.62rem;
}

.portfolio-page .chart-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.portfolio-page .chart-title {
    font-size: 0.62rem;
    color: var(--text-muted);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.portfolio-page .chart-range-pills {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.38rem;
}

.portfolio-page .chart-flow-pills {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.38rem;
}

.portfolio-page .chart-range-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0.38rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(226, 232, 240, 0.82);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
}

.portfolio-page .chart-range-pill:hover {
    border-color: rgba(56, 189, 248, 0.22);
    color: #f8fdff;
    transform: translateY(-1px);
}

.portfolio-page .chart-range-pill.is-active {
    border-color: rgba(56, 189, 248, 0.34);
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.16), rgba(56, 189, 248, 0.08));
    color: #d9f6ff;
}

.portfolio-page .chart-canvas-wrap {
    height: 200px;
}

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

.portfolio-page .sector-insight-block {
    margin-top: 0.82rem;
    padding-top: 0.72rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.portfolio-page .sector-insight-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: rgba(148, 163, 184, 0.78);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portfolio-page .sector-insight-head strong {
    color: #e5f6ff;
    font-size: 0.82rem;
    letter-spacing: 0;
}

.portfolio-page .sector-insight-block p {
    margin: 0.48rem 0 0.64rem;
    color: rgba(203, 213, 225, 0.82);
    font-size: 0.78rem;
    line-height: 1.45;
}

.portfolio-page .sector-insight-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
}

.portfolio-page .sector-insight-grid span {
    min-width: 0;
    padding: 0.52rem 0.56rem;
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.24);
}

.portfolio-page .sector-insight-grid small,
.portfolio-page .sector-insight-grid strong {
    display: block;
    min-width: 0;
}

.portfolio-page .sector-insight-grid small {
    margin-bottom: 0.22rem;
    color: rgba(148, 163, 184, 0.72);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
}

.portfolio-page .sector-insight-grid strong {
    overflow-wrap: anywhere;
    color: rgba(226, 232, 240, 0.9);
    font-size: 0.72rem;
}

.portfolio-page .sector-insight-block.tone-risk .sector-insight-head strong {
    color: #fca5a5;
}

.portfolio-page .sector-insight-block.tone-warn .sector-insight-head strong {
    color: #fbbf24;
}

.portfolio-page .sector-insight-block.tone-good .sector-insight-head strong {
    color: #86efac;
}

.portfolio-page .chart-subpanel {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.portfolio-page .chart-subpanel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.48rem;
    color: rgba(148, 163, 184, 0.72);
    font-size: 0.72rem;
}

.portfolio-page .chart-subpanel-title {
    margin: 0;
    color: rgba(226, 232, 240, 0.88);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portfolio-page .chart-canvas-wrap-compact {
    height: 145px;
}

.portfolio-page .add-stock-grid {
    display: grid;
    grid-template-columns: 84px minmax(220px, 2fr) minmax(148px, 1.15fr) 118px 112px 112px 92px auto;
    gap: 0.48rem;
    background: rgba(12, 23, 38, 0.94);
    padding: 0.62rem;
    border-radius: 12px;
    border: 1px solid rgba(51, 89, 127, 0.28);
    margin: 0 0 0.62rem;
    align-items: end;
}

.portfolio-page .portfolio-input-guide {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.64rem 0.72rem;
    border: 1px solid rgba(57, 194, 255, 0.16);
    border-radius: 10px;
    background: rgba(8, 18, 35, 0.62);
}

.portfolio-page .portfolio-input-guide strong {
    color: var(--text-primary);
    font-size: 0.82rem;
    line-height: 1.25;
}

.portfolio-page .portfolio-input-guide span {
    color: rgba(203, 213, 225, 0.74);
    font-size: 0.76rem;
    line-height: 1.45;
}

.portfolio-page .add-stock-grid .form-group label {
    display: block;
    font-size: 0.58rem;
    color: var(--text-muted);
    margin-bottom: 0.18rem;
    text-transform: uppercase;
    font-weight: 700;
}

.portfolio-page .add-stock-grid .ticker-field {
    position: relative;
}

.portfolio-page .add-stock-grid input,
.portfolio-page .add-stock-grid select {
    width: 100%;
    background: var(--bg-root);
    border: 1px solid rgba(74, 95, 129, 0.58);
    color: white;
    padding: 0.46rem 0.56rem;
    border-radius: 8px;
    font-size: 0.8rem;
}

.portfolio-page .add-stock-grid .ticker-suggestions {
    top: 100%;
    left: 0;
    right: 0;
}

.portfolio-page .add-stock-grid .trade-tax-account-group {
    min-width: 0;
}

.portfolio-page .add-stock-grid .trade-assignment-status {
    margin-top: 0.32rem;
    padding: 0.34rem 0.46rem;
    border-radius: 9px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.42rem;
    align-items: center;
}

.portfolio-page .add-stock-grid .trade-assignment-status .assignment-status-copy strong {
    font-size: 0.69rem;
}

.portfolio-page .add-stock-grid .trade-assignment-status .assignment-status-copy span {
    font-size: 0.64rem;
    line-height: 1.3;
}

.portfolio-page .add-stock-grid .trade-assignment-status a {
    font-size: 0.66rem;
    white-space: nowrap;
}

.portfolio-page .add-stock-grid .trade-submit-group {
    align-self: end;
}

.portfolio-page .add-stock-grid .trade-submit-group .btn-primary {
    width: 100%;
    min-height: 38px;
    padding: 0.46rem 0.72rem;
    font-size: 0.78rem;
}

.portfolio-page .holding-row {
    cursor: pointer;
    transition: background 0.2s;
}

.portfolio-page .holding-row:hover {
    background: var(--bg-card-hover) !important;
}

.portfolio-page .tx-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.portfolio-page .tx-log-toolbar {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    gap: 0.7rem;
    align-items: center;
    margin-bottom: 0.72rem;
    padding-bottom: 0.72rem;
    border-bottom: 1px solid rgba(74, 95, 129, 0.2);
}

.portfolio-page .tx-log-filter {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    min-width: 0;
}

.portfolio-page .tx-log-filter label {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.portfolio-page .tx-log-filter select {
    min-height: 38px;
    font-size: 0.82rem;
}

.portfolio-page .tx-log-summary {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.portfolio-page .tx-log-count,
.portfolio-page .tx-log-unassigned {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.28rem 0.56rem;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

.portfolio-page .tx-log-unassigned {
    border-color: rgba(245, 158, 11, 0.34);
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.08);
}

.portfolio-page .tx-log-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.28rem 0.56rem;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

.portfolio-page .tx-log-status.good {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.08);
    color: #6ee7b7;
}

.portfolio-page .tx-log-status.warn {
    border-color: rgba(245, 158, 11, 0.34);
    background: rgba(245, 158, 11, 0.08);
    color: #fbbf24;
}

.portfolio-page .tx-bulk-assign-form {
    margin-top: 0.7rem;
    padding: 0.72rem 0.8rem;
    border-radius: 10px;
    border: 1px solid rgba(245, 158, 11, 0.16);
    background: rgba(245, 158, 11, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.portfolio-page .tx-bulk-assign-copy {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    flex: 1 1 260px;
    min-width: 240px;
}

.portfolio-page .tx-bulk-assign-copy strong {
    color: var(--text-primary);
    font-size: 0.84rem;
}

.portfolio-page .tx-bulk-assign-copy span {
    color: var(--text-secondary);
    font-size: 0.76rem;
}

.portfolio-page .tx-bulk-assign-controls {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.portfolio-page .tx-bulk-assign-controls select {
    width: auto;
    min-width: 160px;
}

.portfolio-page .tx-table-shell {
    overflow-x: auto;
}

.portfolio-page .tx-table th {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-align: left;
    padding: 0.42rem 0.45rem;
}

.portfolio-page .tx-table td {
    padding: 0.58rem 0.45rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.82rem;
}

.portfolio-page .tx-empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 1rem 0.5rem;
}

.portfolio-page .tx-action-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(74, 95, 129, 0.22);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.28rem 0.55rem;
    font-size: 0.74rem;
    border-radius: 999px;
}

.portfolio-page .tx-inline-form {
    display: inline;
}

.portfolio-page .tx-remove-btn {
    background: transparent;
    border: none;
    color: #ef4444;
    cursor: pointer;
    margin-left: 8px;
    padding: 0;
    font-size: 0.92rem;
    line-height: 1;
}

.portfolio-page .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 10, 18, 0.78);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: none;
}

.portfolio-page .modal-content {
    background: #0c1728;
    padding: 1.05rem;
    border-radius: 12px;
    width: 560px;
    border: 1px solid rgba(51, 89, 127, 0.26);
    max-height: min(90vh, calc(100vh - 2rem));
    overflow-y: auto;
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.18);
}

.portfolio-page .modal-content.modal-sm { width: min(92vw, 420px); }
.portfolio-page .modal-content.modal-md { width: min(92vw, 560px); }
.portfolio-page .modal-content.modal-lg { width: min(95vw, 760px); }
.portfolio-page .modal-content.modal-front { z-index: 1100; }

.portfolio-page .modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.58rem;
    gap: 0.55rem;
}

.portfolio-page .modal-head.modal-head-wide {
    margin-bottom: 0.78rem;
}

.portfolio-page .modal-head h2 {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.2;
}

.portfolio-page .modal-close-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(74, 95, 129, 0.2);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.3rem;
    min-width: 32px;
    min-height: 32px;
    border-radius: 999px;
}

.portfolio-page .modal-form select,
.portfolio-page .modal-form input {
    width: 100%;
    background: var(--bg-root);
    border: 1px solid var(--border-active);
    color: #fff;
    padding: 0.56rem 0.66rem;
    border-radius: 8px;
    box-sizing: border-box;
    min-height: 40px;
    font-size: 0.84rem;
}

.portfolio-page .modal-form .form-group {
    margin-bottom: 0.52rem;
}

.portfolio-page .modal-form .form-group label {
    display: block;
    margin-bottom: 0.18rem;
    font-size: 0.64rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.portfolio-page .modal-actions {
    display: flex;
    gap: 0.45rem;
    margin-top: 0.72rem;
}

.portfolio-page .modal-actions .btn-secondary,
.portfolio-page .modal-actions .btn-primary {
    flex: 1;
}

.portfolio-page .modal-form-grid-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.52rem 0.62rem;
}

.portfolio-page .modal-form-grid-fields .form-group {
    margin-bottom: 0;
}

.portfolio-page .modal-helper-note {
    margin: -0.28rem 0 0.72rem;
    color: rgba(203, 213, 225, 0.76);
    font-size: 0.8rem;
    line-height: 1.5;
}

.portfolio-page .modal-form .form-group.form-group-full {
    margin-top: 0.18rem;
}

.portfolio-page .tx-log-modal-shell {
    width: min(94vw, 720px);
}

.portfolio-page .edit-tx-modal-shell {
    width: min(92vw, 500px);
}

.portfolio-page .sell-tx-modal-shell {
    width: min(92vw, 500px);
}

.portfolio-page .modal-inline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.72rem;
}

.portfolio-page .modal-inline-meta .detail-chip strong {
    color: var(--text-primary);
    font-weight: 700;
}

.portfolio-page .portfolio-create-modal {
    width: min(94vw, 680px);
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(84, 109, 145, 0.22);
    background: linear-gradient(180deg, rgba(13, 24, 41, 0.98) 0%, rgba(8, 15, 28, 0.98) 100%);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.42);
}

.portfolio-page .post-create-import-modal-shell {
    width: min(92vw, 500px);
    padding: 1.05rem;
    border-radius: 18px;
    border: 1px solid rgba(84, 109, 145, 0.22);
    background: linear-gradient(180deg, rgba(13, 24, 41, 0.98) 0%, rgba(8, 15, 28, 0.98) 100%);
    box-shadow: 0 26px 56px rgba(0, 0, 0, 0.42);
}

.portfolio-page .post-create-import-copy {
    display: grid;
    gap: 0.22rem;
}

.portfolio-page .post-create-import-copy .modal-kicker,
.portfolio-page .post-create-import-copy .modal-subtitle {
    display: block;
}

.portfolio-page .post-create-import-copy .modal-kicker {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.portfolio-page .post-create-import-copy .modal-subtitle {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text-muted);
}

.portfolio-page .post-create-import-modal-shell .modal-head {
    align-items: flex-start;
    padding-bottom: 0.8rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid rgba(71, 91, 122, 0.4);
}

.portfolio-page .post-create-import-modal-shell .modal-head h2 {
    font-size: 1.3rem;
    line-height: 1.15;
}

.portfolio-page .post-create-import-actions {
    margin-top: 0;
}

.portfolio-page .post-create-import-highlights {
    display: grid;
    gap: 0.55rem;
    margin-bottom: 0.85rem;
}

.portfolio-page .post-create-import-highlight {
    padding: 0.75rem 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(71, 91, 122, 0.34);
    background: rgba(255, 255, 255, 0.03);
}

.portfolio-page .post-create-import-highlight strong,
.portfolio-page .post-create-import-highlight span {
    display: block;
}

.portfolio-page .post-create-import-highlight strong {
    color: var(--text-primary);
    font-size: 0.86rem;
    margin-bottom: 0.18rem;
}

.portfolio-page .post-create-import-highlight span {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.5;
}

.portfolio-page .post-create-import-brokers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.9rem;
}

.portfolio-page .post-create-import-broker {
    display: block;
    padding: 0.85rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(84, 109, 145, 0.24);
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.portfolio-page .post-create-import-broker:hover {
    border-color: rgba(57, 194, 255, 0.48);
    background: rgba(57, 194, 255, 0.08);
    transform: translateY(-1px);
}

.portfolio-page .post-create-import-broker strong,
.portfolio-page .post-create-import-broker span {
    display: block;
}

.portfolio-page .post-create-import-broker strong {
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.18rem;
}

.portfolio-page .post-create-import-broker span {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.45;
}

.portfolio-page .post-create-import-actions .btn-primary,
.portfolio-page .post-create-import-actions .btn-secondary {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.portfolio-page .post-create-import-actions .btn-secondary {
    flex: 0 1 auto;
    min-width: 150px;
}

.portfolio-page .modal-kicker {
    display: none;
}

.portfolio-page .modal-subtitle {
    display: none;
}

.portfolio-page .portfolio-create-modal .modal-head {
    align-items: center;
    padding-bottom: 0.7rem;
    margin-bottom: 0.75rem;
}

.portfolio-page .portfolio-create-modal .modal-head h2 {
    margin: 0;
    font-size: 1.18rem;
    line-height: 1.2;
}

.portfolio-page .portfolio-create-wizard {
    display: grid;
    gap: 0.78rem;
}

.portfolio-page .portfolio-wizard-progress-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    border: 1px solid rgba(120, 146, 181, 0.24);
    background: rgba(11, 22, 39, 0.84);
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    flex: 0 0 auto;
}

.portfolio-page .portfolio-wizard-progress-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.38rem;
    justify-content: center;
}

.portfolio-page .portfolio-wizard-progress-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    padding: 0.34rem 0.5rem;
    border-radius: 999px;
    color: var(--text-secondary);
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    border: 1px solid rgba(84, 109, 145, 0.18);
    background: rgba(255, 255, 255, 0.025);
}

.portfolio-page .portfolio-wizard-progress-step.is-active {
    border-color: rgba(56, 189, 248, 0.26);
    background: rgba(56, 189, 248, 0.1);
    color: #f8fafc;
}

.portfolio-page .portfolio-wizard-progress-step.is-complete {
    color: #dbeafe;
}

.portfolio-page .portfolio-wizard-progress-step.is-active .portfolio-wizard-progress-index,
.portfolio-page .portfolio-wizard-progress-step.is-complete .portfolio-wizard-progress-index {
    color: #e0f2fe;
    border-color: rgba(56, 189, 248, 0.3);
    background: linear-gradient(180deg, rgba(15, 43, 68, 0.96) 0%, rgba(10, 30, 49, 0.98) 100%);
}

.portfolio-page .portfolio-wizard-progress-label {
    display: none;
}

.portfolio-page .portfolio-wizard-main {
    min-width: 0;
    padding: 0.95rem;
    border-radius: 16px;
    border: 1px solid rgba(84, 109, 145, 0.22);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.portfolio-page .portfolio-wizard-step-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.28rem 0.52rem;
    border-radius: 999px;
    border: 1px solid rgba(84, 109, 145, 0.22);
    background: rgba(255, 255, 255, 0.035);
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-bottom: 0.72rem;
}

.portfolio-page .portfolio-wizard-panel {
    display: grid;
    gap: 0.7rem;
    min-height: 160px;
    align-content: start;
}

.portfolio-page .portfolio-wizard-section-head h3 {
    margin: 0;
    font-size: 1.02rem;
    color: #f8fafc;
    letter-spacing: -0.01em;
}

.portfolio-page .portfolio-wizard-section-head p {
    display: none;
}

.portfolio-page .portfolio-wizard-option-grid {
    display: grid;
    gap: 0.62rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portfolio-page .portfolio-wizard-option-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portfolio-page .portfolio-wizard-choice {
    position: relative;
}

.portfolio-page .portfolio-wizard-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.portfolio-page .portfolio-wizard-option {
    display: grid;
    place-items: center;
    text-align: center;
    min-height: 82px;
    padding: 0.8rem 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(77, 104, 140, 0.28);
    background: rgba(11, 22, 39, 0.72);
    cursor: pointer;
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.portfolio-page .portfolio-wizard-option:hover {
    border-color: rgba(96, 165, 250, 0.38);
}

.portfolio-page .portfolio-wizard-option strong {
    color: #f8fafc;
    font-size: 0.9rem;
    letter-spacing: 0;
}

.portfolio-page .portfolio-wizard-choice input:checked + .portfolio-wizard-option {
    border-color: rgba(56, 189, 248, 0.72);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.22);
    background: rgba(17, 40, 66, 0.94);
}

.portfolio-page .portfolio-wizard-actions {
    margin-top: 0.15rem;
}

.portfolio-page .portfolio-wizard-name-field {
    max-width: none;
}

.portfolio-page .portfolio-wizard-name-field input {
    min-height: 64px;
    padding: 0 1rem;
    font-size: 1.08rem;
    font-weight: 600;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: #f8fafc;
    color: #0f172a;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
}

.portfolio-page .portfolio-wizard-name-field input::placeholder {
    color: #64748b;
}

.portfolio-page #create-portfolio-form button[type="submit"][hidden],
.portfolio-page #create-portfolio-form button[type="button"][hidden] {
    display: none !important;
}

.portfolio-page .export-section {
    background: rgba(9, 18, 31, 0.18);
    padding: 0.56rem 0.64rem;
    border-radius: 9px;
    border: 1px solid rgba(74, 95, 129, 0.14);
    margin-top: 0.66rem;
}

.portfolio-page .export-title {
    font-size: 0.62rem;
    color: rgba(148, 163, 184, 0.78);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
}

.portfolio-page .export-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.portfolio-page .export-format-group {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem;
    border-radius: 999px;
    background: rgba(12, 24, 39, 0.84);
    border: 1px solid rgba(51, 89, 127, 0.3);
}

.portfolio-page .export-format-option {
    position: relative;
    cursor: pointer;
}

.portfolio-page .export-format-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.portfolio-page .export-format-option span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    min-height: 34px;
    padding: 0.3rem 0.72rem;
    border-radius: 999px;
    color: rgba(226, 232, 240, 0.88);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: background 0.15s ease, color 0.15s ease;
}

.portfolio-page .export-format-option input:checked + span {
    background: linear-gradient(180deg, #edf4fc 0%, #d7e6f6 100%);
    color: #081321;
}

.portfolio-page .export-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.38rem;
    align-items: center;
    margin-top: 0.48rem;
}

.portfolio-page .export-custom-range {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0.44rem;
    align-items: end;
    margin-top: 0.56rem;
    border-top: 1px solid rgba(74, 95, 129, 0.26);
    padding-top: 0.62rem;
}

.portfolio-page .export-field {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
}

.portfolio-page .export-field-label {
    font-size: 0.62rem;
    color: rgba(148, 163, 184, 0.76);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.portfolio-page .export-input {
    background: var(--bg-root);
    border: 1px solid var(--border-active);
    color: #fff;
    padding: 0.32rem 0.42rem;
    border-radius: 7px;
    font-size: 0.7rem;
}

.portfolio-page .export-custom-btn {
    padding: 0.36rem 0.68rem;
    font-size: 0.7rem;
}

.portfolio-page .import-section {
    background: rgba(9, 18, 31, 0.18);
    padding: 0.56rem 0.64rem;
    border-radius: 9px;
    border: 1px solid rgba(74, 95, 129, 0.14);
    margin: 0.56rem 0 0.72rem;
}

.portfolio-page .import-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
    list-style: none;
    font-size: 0.68rem;
    color: var(--text-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.portfolio-page .import-summary::-webkit-details-marker { display: none; }
.portfolio-page .import-summary::after { content: "+"; color: var(--text-secondary); font-size: 1rem; line-height: 1; }
.portfolio-page .import-collapsible[open] .import-summary::after { content: "-"; }

.portfolio-page .import-body {
    margin-top: 0.34rem;
}

.portfolio-page .import-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(132px, 0.8fr) auto auto;
    gap: 0.38rem;
    align-items: center;
}

.portfolio-page .import-grid input[type="file"] {
    width: 100%;
    background: var(--bg-root);
    border: 1px solid var(--border-active);
    color: white;
    padding: 0.38rem 0.48rem;
    border-radius: 8px;
    font-size: 0.74rem;
}

.portfolio-page .import-grid .import-tax-account {
    min-height: 36px;
    font-size: 0.74rem;
}

.portfolio-page .import-grid .import-assignment-status {
    grid-column: 1 / -1;
    margin: 0;
    padding: 0.34rem 0.46rem;
    border-radius: 9px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.42rem;
    align-items: center;
}

.portfolio-page .import-grid .import-assignment-status .assignment-status-copy strong {
    font-size: 0.69rem;
}

.portfolio-page .import-grid .import-assignment-status .assignment-status-copy span {
    font-size: 0.64rem;
    line-height: 1.3;
}

.portfolio-page .import-grid .import-assignment-status a {
    font-size: 0.66rem;
    white-space: nowrap;
}

.portfolio-page .import-replace {
    color: var(--text-secondary);
    font-size: 0.68rem;
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    white-space: nowrap;
}

.portfolio-page .portfolio-settings .field-help,
.portfolio-page .move-modal-current {
    display: none;
}

.portfolio-page .portfolio-alert {
    border-radius: 10px;
    padding: 0.72rem 0.85rem;
    margin: 0 0 1rem;
    font-size: 0.9rem;
    border: 1px solid;
}

.portfolio-page .portfolio-alert.is-success {
    background: rgba(16,185,129,0.14);
    border-color: rgba(16,185,129,0.38);
    color: #d1fae5;
}

.portfolio-page .portfolio-alert.is-error {
    background: rgba(239,68,68,0.14);
    border-color: rgba(239,68,68,0.38);
    color: #fecaca;
}

.portfolio-page .portfolio-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.64rem;
    margin: 0 0 0.62rem;
    padding-bottom: 0.28rem;
    border-bottom: 1px solid rgba(92, 116, 147, 0.24);
}

.portfolio-page .portfolio-context {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.portfolio-page .portfolio-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.98rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portfolio-page .portfolio-meta {
    display: flex;
    align-items: center;
    gap: 0.36rem;
    flex-wrap: wrap;
}

.portfolio-page .portfolio-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 0.14rem 0.44rem;
    font-size: 0.66rem;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.03);
}

.portfolio-page .toolbar-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.portfolio-page .currency-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.portfolio-page .currency-form select {
    min-height: 32px;
    padding: 0.22rem 1.9rem 0.22rem 0.58rem;
    font-size: 0.72rem;
    border-radius: 999px;
    background-position: right 0.62rem center;
}

.portfolio-page .settings-open-btn {
    min-height: 32px;
    padding: 0.24rem 0.62rem;
    font-size: 0.72rem;
}

.portfolio-page .portfolio-chip-link {
    text-decoration: none;
    color: var(--text-primary);
}

.portfolio-page .portfolio-chip.tone-good {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
}

.portfolio-page .portfolio-chip.tone-warn,
.portfolio-page .portfolio-chip-link.tone-warn {
    border-color: rgba(245, 158, 11, 0.34);
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.portfolio-page .portfolio-chip.tone-good:hover,
.portfolio-page .portfolio-chip.tone-warn:hover,
.portfolio-page .portfolio-chip-link.tone-warn:hover {
    filter: brightness(1.06);
}

.portfolio-page .toolbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.portfolio-page .settings-open-btn {
    padding: 0.42rem 0.68rem;
    font-size: 0.76rem;
    white-space: nowrap;
    min-height: 38px;
}

.portfolio-page .currency-form {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid rgba(74, 95, 129, 0.44);
    border-radius: 9px;
    padding: 0.4rem 0.5rem;
    background: rgba(255,255,255,0.02);
}

.portfolio-page .currency-form label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.portfolio-page .currency-form select {
    min-width: 110px;
    background: var(--bg-root);
    border: 1px solid rgba(74, 95, 129, 0.58);
    color: #fff;
    border-radius: 6px;
    padding: 0.28rem 0.42rem;
    font-size: 0.8rem;
}

.portfolio-page .portfolio-settings {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.portfolio-page .portfolio-settings-modal-shell {
    width: min(94vw, 680px);
    padding: 1.2rem 1.2rem 1.15rem;
    border-radius: 18px;
    border: 1px solid rgba(84, 109, 145, 0.24);
    background: linear-gradient(180deg, rgba(15, 28, 47, 0.98) 0%, rgba(8, 17, 31, 0.98) 100%);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.38);
}

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

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

.portfolio-page .portfolio-settings .field.field-full {
    grid-column: 1 / -1;
}

.portfolio-page .portfolio-settings .field label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.36rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.portfolio-page .portfolio-settings input,
.portfolio-page .portfolio-settings select {
    width: 100%;
    background: rgba(8, 15, 28, 0.94);
    border: 1px solid rgba(90, 118, 155, 0.34);
    color: #fff;
    padding: 0.78rem 0.88rem;
    border-radius: 12px;
    font-size: 0.96rem;
    min-height: 48px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.portfolio-page .portfolio-settings input:focus,
.portfolio-page .portfolio-settings select:focus {
    outline: none;
    border-color: rgba(92, 188, 255, 0.72);
    box-shadow: 0 0 0 3px rgba(92, 188, 255, 0.16);
}

.portfolio-page .portfolio-settings select option {
    color: #111827;
    background: #ffffff;
}

.portfolio-page .portfolio-settings-head-copy {
    display: grid;
    gap: 0.2rem;
}

.portfolio-page .portfolio-settings-head-copy .modal-kicker,
.portfolio-page .portfolio-settings-head-copy .modal-subtitle {
    display: block;
}

.portfolio-page .portfolio-settings-head-copy .modal-kicker {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.portfolio-page .portfolio-settings-head-copy .modal-subtitle {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.portfolio-page .portfolio-settings-modal-shell .modal-head {
    align-items: flex-start;
    padding-bottom: 0.95rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(71, 91, 122, 0.42);
    position: relative;
}

.portfolio-page .portfolio-settings-modal-shell .modal-head h2 {
    font-size: 1.5rem;
    line-height: 1.12;
}

.portfolio-page .portfolio-settings-modal-shell .modal-close-btn {
    margin-left: auto;
    flex: 0 0 auto;
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.portfolio-page .portfolio-settings-section {
    grid-column: 1 / -1;
    padding: 1rem;
    border-radius: 16px;
    background: rgba(13, 24, 41, 0.82);
    border: 1px solid rgba(71, 91, 122, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.portfolio-page .portfolio-settings-section-head {
    margin-bottom: 0.95rem;
}

.portfolio-page .portfolio-settings-section-head h3 {
    margin: 0 0 0.22rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.portfolio-page .portfolio-settings-section-head p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.portfolio-page .portfolio-settings-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 1rem;
}

.portfolio-page .portfolio-settings .field-help {
    margin: 0.42rem 0 0;
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.portfolio-page .portfolio-settings .field-action {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 0.6rem;
    flex-wrap: wrap;
    grid-column: 1 / -1;
}

.portfolio-page .portfolio-settings .field-action .btn-primary {
    min-height: 48px;
    padding: 0.75rem 1.15rem;
    white-space: nowrap;
}

.portfolio-page .portfolio-settings .field-action .btn-secondary {
    min-height: 48px;
    padding: 0.75rem 1.15rem;
}

.portfolio-page .portfolio-empty-state {
    padding: 1.55rem 1.15rem;
    border-radius: 20px;
    border: 1px solid rgba(55, 171, 255, 0.18);
    background:
        linear-gradient(180deg, rgba(15, 31, 52, 0.94), rgba(9, 20, 35, 0.98)),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.14), transparent 46%);
    box-shadow: 0 16px 34px rgba(3, 10, 24, 0.2);
}

.portfolio-page .portfolio-empty-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0.32rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(55, 171, 255, 0.22);
    background: rgba(10, 22, 37, 0.72);
    color: #8dd3ff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portfolio-page .portfolio-empty-state h2 {
    margin: 0.7rem 0 0.42rem;
    color: #f8fbff;
    font-size: clamp(1.45rem, 2.7vw, 2.05rem);
}

.portfolio-page .portfolio-empty-state > p {
    margin: 0;
    max-width: 64ch;
    color: #9bb4d4;
    line-height: 1.6;
}

.portfolio-page .portfolio-empty-actions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.portfolio-page .portfolio-empty-cta {
    margin-top: 0;
}

.portfolio-page .portfolio-empty-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.72rem;
}

.portfolio-page .portfolio-empty-card {
    padding: 0.82rem 0.88rem;
    border-radius: 14px;
    border: 1px solid rgba(74, 95, 129, 0.28);
    background: rgba(10, 22, 37, 0.76);
}

.portfolio-page .portfolio-empty-card strong {
    display: block;
    margin-bottom: 0.36rem;
    color: #f8fbff;
    font-size: 0.84rem;
}

.portfolio-page .portfolio-empty-card p {
    margin: 0;
    color: #9bb4d4;
    font-size: 0.8rem;
    line-height: 1.52;
}

.portfolio-page .portfolio-empty-state--reports + .portfolio-empty-state {
    display: none;
}

.portfolio-page .p-risk-meta {
    font-size: 0.6rem;
    color: var(--text-muted);
    display: none; /* replaced by p-nav-meta / p-risk-badge */
}

.portfolio-page .value-currency-inline {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.portfolio-page .value-inline-change {
    display: inline-block;
    margin-left: 0.45rem;
    font-size: 0.62em;
    font-weight: 600;
    color: currentColor;
    opacity: 0.9;
    white-space: nowrap;
}

.portfolio-page .value-meta-note {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.portfolio-page .portfolio-income-section {
    margin: 0 0 0.82rem;
}

.portfolio-page .dividend-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.58rem;
}

.portfolio-page .dividend-summary-card .label {
    display: block;
    font-size: 0.66rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.26rem;
}

.portfolio-page .dividend-summary-card .value {
    display: block;
    font-size: 1.34rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.18;
}

.portfolio-page .dividend-summary-card .meta {
    display: block;
    margin-top: 0.18rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.38;
}

.portfolio-page .dividend-summary-card .meta:empty {
    display: none;
}

.portfolio-page .dividend-event-title {
    margin: 0;
    padding: 0.72rem 0.84rem 0.4rem;
    font-size: 0.69rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.portfolio-page .dividend-event-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    padding: 0.72rem 0.84rem;
    border-top: 1px solid rgba(92, 116, 147, 0.22);
}

.portfolio-page .dividend-event-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.portfolio-page .dividend-event-copy strong {
    font-size: 0.86rem;
    color: var(--text-primary);
}

.portfolio-page .dividend-event-copy span {
    font-size: 0.76rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.portfolio-page .dividend-event-amount {
    flex: 0 0 auto;
    text-align: right;
}

.portfolio-page .dividend-event-amount strong {
    display: block;
    font-size: 0.86rem;
    color: var(--text-primary);
}

.portfolio-page .dividend-event-amount span {
    display: block;
    margin-top: 0.16rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.portfolio-page .dividend-event-amount span:empty {
    display: none;
}

.portfolio-page .dividend-history-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.78rem 0.84rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
}

.portfolio-page .dividend-history-summary::-webkit-details-marker { display: none; }
.portfolio-page .dividend-history-summary::after { content: "+"; color: var(--text-secondary); font-size: 1rem; line-height: 1; }
.portfolio-page .dividend-history-dropdown[open] .dividend-history-summary::after { content: "-"; }
.portfolio-page .dividend-history-panel { border-top: 1px solid rgba(92, 116, 147, 0.22); }

.portfolio-page .ticker-line {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.portfolio-page .holding-native-currency {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.35rem;
    padding: 0.08rem 0.34rem;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.portfolio-page .holding-account-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.08rem 0.4rem;
    border-radius: 999px;
    border: 1px solid rgba(138, 155, 168, 0.28);
    background: rgba(138, 155, 168, 0.1);
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.portfolio-page .holding-account-chip.tone-warn {
    border-color: rgba(245, 158, 11, 0.34);
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.portfolio-page .holding-account-chip.tone-good {
    border-color: rgba(16, 185, 129, 0.32);
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
}

.portfolio-page .holding-subline {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.28rem;
    margin-top: 0.22rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.portfolio-page .holding-id-row {
    display: flex;
    align-items: center;
    gap: 0.28rem;
    flex-wrap: wrap;
}

.portfolio-page .holding-id-row .holding-native-currency {
    margin-left: 0;
}

.portfolio-page .holding-company-name {
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.portfolio-page .holding-sector-tag {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-muted);
    opacity: 0.75;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.portfolio-page .holding-sector-tag::before {
    content: '·';
    margin-right: 0.22rem;
    opacity: 0.5;
}

.portfolio-page .holding-tax-row {
    display: flex;
    align-items: center;
    gap: 0.32rem;
    flex-wrap: wrap;
}

.holding-day-divider {
    color: var(--text-muted);
    opacity: 0.4;
    font-size: 0.72rem;
    line-height: 1;
    margin: 0 0.05rem;
}

.portfolio-page .holding-metric {
    font-variant-numeric: tabular-nums;
}

.portfolio-page .metric-value,
.portfolio-page .metric-pl {
    font-weight: 800;
}

.portfolio-page .flag-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.portfolio-page .flag-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.portfolio-page .flag-fallback {
    display: none;
    font-size: 0.52rem;
    line-height: 1;
    color: var(--text-muted);
    font-weight: 700;
}

.portfolio-page .action-stack {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.portfolio-page .action-btn {
    min-height: 30px;
}

.portfolio-page .sell-btn { border-color: rgba(239,68,68,0.35); }
.portfolio-page .move-open-btn { border-color: rgba(56,189,248,0.42); }
.portfolio-page .history-btn { border-color: rgba(120, 143, 172, 0.24); }

.portfolio-page .move-modal-current {
    margin: 0 0 0.75rem;
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.portfolio-page .move-modal-current strong {
    color: var(--text-primary);
}

.portfolio-page #move-holding-target { min-height: 44px; }
.portfolio-page .move-modal-submit { width: 100%; min-height: 44px; }
.portfolio-page .holdings-container { margin-bottom: 1rem; }
.portfolio-page .history-btn { white-space: nowrap; }
.portfolio-page .action-stack {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.26rem;
    flex-wrap: wrap;
}

.public-portfolio-page .eval-score {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--accent-buy);
    line-height: 1;
    margin: 0.15rem 0;
}

.public-portfolio-page .portfolio-income-section {
    margin: 0 0 2rem;
}

.public-portfolio-page .dividend-summary-card .label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    font-weight: 700;
}

.public-portfolio-page .dividend-summary-card .value {
    display: block;
    font-size: 1.32rem;
    font-weight: 800;
    color: var(--text-primary);
}

.public-portfolio-page .dividend-summary-card .meta {
    display: block;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.public-portfolio-page .dividend-event-title {
    margin: 0;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-subtle);
}

.public-portfolio-page .dividend-event-row {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.public-portfolio-page .dividend-event-row:first-of-type {
    border-top: 0;
}

.public-portfolio-page .dividend-event-copy {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.public-portfolio-page .dividend-event-copy span {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.public-portfolio-page .dividend-event-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
}

.public-portfolio-page .dividend-event-amount span {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.public-portfolio-page .dividend-history-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-primary);
}

.public-portfolio-page .dividend-history-summary::-webkit-details-marker { display: none; }
.public-portfolio-page .dividend-history-summary::after { content: "+"; color: var(--text-secondary); font-size: 1rem; line-height: 1; }
.public-portfolio-page .dividend-history-dropdown[open] .dividend-history-summary::after { content: "-"; }
.public-portfolio-page .dividend-history-panel { border-top: 1px solid var(--border-subtle); }

.public-portfolio-page .directory-header.split-header {
    align-items: flex-end;
}

.public-portfolio-page .value-amount.public-value-amount {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--text-primary);
    margin: 0.35rem 0;
}

.public-portfolio-page .public-portfolio-header-chip.is-privacy {
    border-color: rgba(129, 140, 248, 0.34);
    background: rgba(76, 95, 167, 0.16);
    color: #d6ddff;
}

.public-portfolio-page .public-portfolio-privacy-note {
    margin: 0.7rem 0 0;
    max-width: 56rem;
    color: rgba(202, 214, 232, 0.86);
    font-size: 0.92rem;
    line-height: 1.6;
}

.public-portfolio-page .chart-wrap-centered {
    max-height: 250px;
    display: flex;
    justify-content: center;
}

.public-portfolio-page .holding-name.compact {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.public-portfolio-page .holding-dividend-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.16rem;
}

.public-portfolio-page .holding-dividend-next {
    color: rgba(194, 207, 226, 0.8);
    font-size: 0.73rem;
}

.public-portfolio-page .holding-dividend-next.forecast {
    color: rgba(141, 169, 205, 0.76);
}

.public-portfolio-page .holding-dividend-next.declared {
    color: rgba(123, 245, 191, 0.88);
}

@media (max-width: 900px) {
    .public-portfolio-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .public-portfolio-hero-main,
    .public-portfolio-follow-panel {
        padding: 1rem;
        border-radius: 20px;
    }

    .public-portfolio-performance-grid,
    .public-portfolio-hero-facts {
        grid-template-columns: minmax(0, 1fr);
    }

    .public-portfolio-hero-fact {
        min-height: 0;
    }

    .public-portfolio-page .directory-header.split-header {
        align-items: stretch;
    }

    .public-portfolio-page .dividend-event-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .public-portfolio-page .dividend-event-amount {
        align-items: flex-start;
    }

    .public-portfolio-page .public-holdings-table td.metric-weight,
    .public-portfolio-page .public-holdings-table td.metric-day,
    .public-portfolio-page .public-holdings-table td.metric-pl {
        display: none !important;
    }
}

@media (max-width: 900px) {
    .portfolio-page {
        padding-top: 0.85rem;
        padding-bottom: 1rem;
    }

    .portfolio-page .portfolio-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 0.85rem;
    }

    .portfolio-page .sidebar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
        overflow: visible;
        padding: 0.72rem;
        border: 1px solid rgba(74, 95, 129, 0.28);
        border-radius: 12px;
        background: rgba(8, 14, 26, 0.44);
        margin-bottom: 0.1rem;
        scrollbar-width: auto;
        position: static !important;
        top: auto !important;
        z-index: auto !important;
        align-self: auto;
    }

    .portfolio-page .sidebar::-webkit-scrollbar { display: none; }
    .portfolio-page .sidebar-header { display: flex; }

    .portfolio-page .p-nav-item {
        width: 100%;
        min-width: 0;
        margin: 0;
        padding: 0.6rem 0.72rem 0.6rem 0.78rem;
        border: 1px solid rgba(74, 95, 129, 0.38);
        border-left: 2px solid rgba(74, 95, 129, 0.38);
        border-radius: 9px;
        background: rgba(10, 18, 34, 0.88);
        min-height: 58px;
        box-sizing: border-box;
    }

    .portfolio-page .p-nav-item.active {
        background: rgba(18, 36, 64, 0.95);
        border-color: rgba(57, 194, 255, 0.22);
        border-left-color: rgba(57, 194, 255, 0.65);
    }

    .portfolio-page .p-nav-name {
        font-size: 0.82rem;
    }

    .portfolio-page .create-p-btn {
        width: 100%;
        min-width: 0;
        margin-top: 0;
        padding: 0.6rem 0.72rem;
        border-radius: 9px;
        background: rgba(10, 18, 34, 0.72);
        font-size: 0.76rem;
        min-height: 58px;
        box-sizing: border-box;
        flex-direction: row;
        gap: 0.36rem;
        justify-content: center;
        border-style: dashed;
    }

    .portfolio-page .portfolio-toolbar {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 0.72rem;
        border: 1px solid rgba(74,95,129,0.28);
        border-radius: 12px;
        background: rgba(8,14,26,0.34);
        padding: 0.72rem;
    }

    .portfolio-page .portfolio-context { gap: 0.34rem; }
    .portfolio-page .portfolio-title { white-space: normal; line-height: 1.2; }
    .portfolio-page .portfolio-meta { gap: 0.38rem; }
    .portfolio-page .portfolio-chip { min-height: 28px; padding: 0.24rem 0.55rem; }

    .portfolio-page .toolbar-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.48rem;
    }

    .portfolio-page .settings-open-btn { min-height: 44px; font-size: 0.84rem; }

    .portfolio-page .currency-form {
        width: 100%;
        justify-content: space-between;
        padding: 0.52rem 0.58rem;
    }

    .portfolio-page .currency-form label { font-size: 0.68rem; }

    .portfolio-page .currency-form select {
        flex: 1;
        min-height: 44px;
        font-size: 0.86rem;
    }

    .portfolio-page .top-stats {
        gap: 0.52rem;
        margin-bottom: 0.62rem;
        border: 0;
        border-radius: 0;
        background: transparent;
        padding: 0;
    }

    .portfolio-page .top-stats-primary,
    .portfolio-page .top-stats-secondary,
    .public-portfolio-page .top-stats-primary,
    .public-portfolio-page .top-stats-secondary {
        grid-template-columns: 1fr;
        gap: 0.52rem;
        margin-top: 0;
    }

    .portfolio-page .dividend-summary-grid { grid-template-columns: 1fr; gap: 0.5rem; }
    .portfolio-page .dividend-summary-card { padding: 0.72rem 0.76rem; border-radius: 10px; }
    .portfolio-page .dividend-summary-card .value { font-size: 1.18rem; }
    .portfolio-page .dividend-event-row { padding: 0.68rem 0.74rem; align-items: flex-start; }
    .portfolio-page .dividend-event-copy strong { font-size: 0.82rem; }

    .portfolio-page .dividend-event-copy span,
    .portfolio-page .dividend-event-amount span { font-size: 0.72rem; }

    .portfolio-page .dividend-event-amount strong { font-size: 0.82rem; }

    .portfolio-page .eval-panel,
    .portfolio-page .value-panel {
        border: 1px solid rgba(74, 95, 129, 0.3);
        border-radius: 10px;
        background: rgba(10, 18, 33, 0.34);
        box-shadow: none;
        text-align: left;
        padding: 0.68rem 0.74rem;
    }

    .portfolio-page .eval-panel { display: block; }
    .portfolio-page .eval-panel .eval-status { margin-bottom: 0.22rem; font-size: 0.66rem; }
    .portfolio-page .eval-score-row { gap: 0.4rem; }
    .portfolio-page .eval-score { font-size: 1.82rem; margin: 0 0 0.24rem; }
    .portfolio-page .eval-score-delta { font-size: 0.7rem; }
    .portfolio-page .value-panel { align-items: flex-start; }
    .portfolio-page .value-amount { font-size: 1.34rem; margin: 0.16rem 0 0.08rem; }
    .portfolio-page .value-meta-note { font-size: 0.79rem; line-height: 1.42; }
    .portfolio-page .is-secondary-stat { padding: 0.62rem 0.7rem !important; }
    .portfolio-page .is-secondary-stat .value-amount { font-size: 1.08rem; }
    .portfolio-page .is-secondary-stat .detail-chip-row { gap: 0.3rem; }

    .portfolio-page .chart-container { padding: 0.84rem; border-radius: 12px; }
    .portfolio-page .estimate-header { flex-direction: column; align-items: flex-start; gap: 0.2rem; }

    .portfolio-page .estimate-section {
        margin: 0 0 0.8rem;
        border-radius: 10px;
        padding: 0.58rem;
    }

    .portfolio-page .estimate-grid { grid-template-columns: 1fr; gap: 0.42rem; }
    .portfolio-page .estimate-card { border-radius: 8px; padding: 0.42rem 0.48rem; background: transparent; border-left-width: 2px; }
    .portfolio-page .estimate-card .label { font-size: 0.65rem; }
    .portfolio-page .estimate-card .pct { font-size: 0.96rem; }
    .portfolio-page .estimate-card .val { font-size: 0.76rem; }
    .portfolio-page .estimate-card .cov { font-size: 0.68rem; }

    .portfolio-page .optimizer-section { margin: 0 0 0.85rem; }
    .portfolio-page .optimizer-title { margin: 0 0 0.55rem; }
    .portfolio-page .optimizer-grid { grid-template-columns: 1fr; gap: 0.45rem; }
    .portfolio-page .optimizer-card { border-radius: 8px; padding: 0.44rem 0.5rem; background: transparent; border-left-width: 2px; }
    .portfolio-page .optimizer-card .label { font-size: 0.65rem; }
    .portfolio-page .optimizer-card .value { font-size: 0.93rem; }
    .portfolio-page .optimizer-card .detail { font-size: 0.74rem; line-height: 1.4; }

    .portfolio-page .optimizer-suggestions {
        margin-top: 0.55rem;
        padding: 0.52rem 0.58rem;
        border-radius: 8px;
    }

    .portfolio-page .optimizer-suggestions ul {
        list-style: none;
        padding-left: 0;
    }

    .portfolio-page .optimizer-suggestions li {
        margin: 0.3rem 0;
        padding-left: 0;
        line-height: 1.46;
        font-size: 0.8rem;
    }

    .portfolio-page .optimizer-suggestions li.tone-good,
    .portfolio-page .optimizer-suggestions li.tone-warn,
    .portfolio-page .optimizer-suggestions li.tone-risk {
        padding-left: 0.48rem;
    }

    .portfolio-tax-page .accounting-summary-grid,
    .portfolio-tax-page .evaluator-detail-grid,
    .portfolio-tax-page .accounting-entry-form {
        grid-template-columns: 1fr;
    }

    .portfolio-evaluator-page .evaluator-detail-grid,
    .portfolio-evaluator-run-page .evaluator-detail-grid,
    .portfolio-evaluator-page .audit-step-list,
    .portfolio-evaluator-run-page .audit-step-list {
        grid-template-columns: 1fr;
    }

    .portfolio-evaluator-page .audit-holding-card,
    .portfolio-evaluator-run-page .audit-holding-card,
    .portfolio-evaluator-page .detail-card,
    .portfolio-evaluator-run-page .detail-card {
        padding: 0.84rem 0.88rem;
        border-radius: 14px;
    }

    .portfolio-evaluator-page .audit-holding-meta,
    .portfolio-evaluator-run-page .audit-holding-meta {
        justify-content: flex-start;
    }

    .portfolio-tax-page .summary-card,
    .portfolio-tax-page .detail-card {
        padding: 0.82rem 0.86rem;
        border-radius: 12px;
    }

    .portfolio-tax-page .summary-card .value {
        font-size: 1.1rem;
    }

    .portfolio-tax-page .field-action .btn-primary {
        width: 100%;
    }

    .portfolio-page .charts-grid { grid-template-columns: 1fr; gap: 0.65rem; margin-bottom: 0.85rem; }
    .portfolio-page .charts-grid .chart-container { border-radius: 10px; border-color: rgba(74,95,129,0.3); background: rgba(10,18,33,0.42); }
    .portfolio-page .chart-header { align-items: flex-start; flex-direction: column; }
    .portfolio-page .chart-controls { width: 100%; justify-content: flex-start; }
    .portfolio-page .chart-title { font-size: 0.68rem; }
    .portfolio-page .chart-range-pills,
    .portfolio-page .chart-flow-pills { width: 100%; }
    .portfolio-page .chart-canvas-wrap { height: 170px; }
    .portfolio-page .sector-chart-container .chart-canvas-wrap { flex: none; min-height: 0; height: 170px; }
    .portfolio-page .chart-canvas-wrap-compact { height: 132px; }
    .portfolio-page .chart-subpanel-header { align-items: flex-start; flex-direction: column; gap: 0.18rem; }
    .portfolio-page .portfolio-settings { grid-template-columns: 1fr; gap: 0.75rem; }
    .portfolio-page .portfolio-settings input,
    .portfolio-page .portfolio-settings select { min-height: 44px; font-size: 0.96rem; }

    .portfolio-page .portfolio-settings .field-action {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

    .portfolio-page .portfolio-settings .field-action .btn-primary,
    .portfolio-page .portfolio-settings .field-action .btn-secondary { min-height: 46px; width: 100%; }

    .portfolio-page .add-stock-grid { grid-template-columns: 1fr; padding: 0.9rem; gap: 0.65rem; margin-bottom: 1rem; border-radius: 12px; }
    .portfolio-page .portfolio-input-guide { align-items: flex-start; flex-direction: column; gap: 0.26rem; }
    .portfolio-page .add-stock-grid .form-group label { font-size: 0.78rem; color: var(--text-secondary); }
    .portfolio-page .add-stock-grid input,
    .portfolio-page .add-stock-grid select { min-height: 44px; font-size: 0.98rem; }
    .portfolio-page .add-stock-grid .trade-assignment-status {
        grid-template-columns: 1fr;
        gap: 0.24rem;
    }

    .portfolio-page .add-stock-grid .trade-assignment-status a {
        white-space: normal;
    }

    .portfolio-page .add-stock-grid .trade-submit-group .btn-primary { width: 100%; min-height: 46px; }

    .portfolio-page .export-section {
        margin-top: 0.82rem;
        padding: 0.68rem;
        border-radius: 9px;
        border-color: rgba(74,95,129,0.26);
        background: transparent;
    }

    .portfolio-page .export-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
        gap: 0.5rem;
    }

    .portfolio-page .btn-export {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        min-height: 42px;
        padding: 0.56rem 0.6rem;
        font-size: 0.82rem;
        border-radius: 10px;
    }

    .portfolio-page .import-section {
        margin: 0.62rem 0 0.92rem;
        padding: 0.64rem 0.68rem;
        border-radius: 9px;
        border-color: rgba(74,95,129,0.26);
        background: transparent;
    }

    .portfolio-page .import-summary { font-size: 0.8rem; }
    .portfolio-page .tx-log-toolbar { grid-template-columns: 1fr; justify-items: stretch; }
    .portfolio-page .tx-log-summary { justify-content: flex-start; }
    .portfolio-page .modal-form-grid-fields { grid-template-columns: 1fr; }
    .portfolio-page .portfolio-settings.portfolio-settings-grid { grid-template-columns: 1fr; }
    .portfolio-page .portfolio-settings-fields { grid-template-columns: 1fr; gap: 0.75rem; }
    .portfolio-page .portfolio-settings-section { padding: 0.86rem; border-radius: 14px; }
    .portfolio-page .portfolio-settings-modal-shell .modal-head h2 { font-size: 1.2rem; }
    .portfolio-page .import-body p { margin-bottom: 0.56rem; font-size: 0.83rem; line-height: 1.42; }
    .portfolio-page .import-grid { grid-template-columns: 1fr; }
    .portfolio-page .import-grid .import-assignment-status {
        grid-template-columns: 1fr;
        gap: 0.24rem;
    }
    .portfolio-page .import-grid .import-assignment-status a { white-space: normal; }
    .portfolio-page .import-replace { white-space: normal; justify-content: flex-start; }
    .portfolio-page .import-grid input[type="file"] { min-height: 44px; font-size: 0.9rem; }
    .portfolio-page .import-grid .btn-primary { width: 100%; min-height: 44px; }

    .portfolio-page .export-grid > div {
        margin-left: 0 !important;
        border-left: 0 !important;
        padding-left: 0 !important;
        width: 100%;
        display: grid !important;
        grid-template-columns: 1fr 1fr auto;
        gap: 0.5rem;
    }

    .portfolio-page .export-grid > div input { min-height: 42px; font-size: 0.88rem !important; }
    .portfolio-page .export-grid > div button { min-height: 42px; padding: 0.55rem 0.75rem !important; font-size: 0.82rem !important; }
    .portfolio-page .modal-content { width: min(94vw, 760px) !important; padding: 0.9rem; border-radius: 12px; max-height: calc(100vh - 1rem); margin: 0.5rem; }
    .portfolio-page .modal-head { position: sticky; top: -0.9rem; z-index: 2; padding: 0 0 0.64rem; margin-bottom: 0.68rem; background: linear-gradient(180deg, rgba(16, 27, 49, 0.98) 0%, rgba(16, 27, 49, 0.92) 100%); }
    .portfolio-page .modal-head.modal-head-wide { margin-bottom: 0.82rem; }
    .portfolio-page .tx-log-toolbar,
    .portfolio-page .tx-bulk-assign-form,
    .portfolio-page .tx-bulk-assign-controls { align-items: stretch; }
    .portfolio-page .tx-log-filter,
    .portfolio-page .tx-bulk-assign-copy,
    .portfolio-page .tx-bulk-assign-controls,
    .portfolio-page .tx-bulk-assign-controls select { width: 100%; min-width: 0; }
    .portfolio-page .modal-form .form-group { margin-bottom: 0.58rem; }
    .portfolio-page .modal-form .form-group:last-of-type { margin-bottom: 0; }
    .portfolio-page .portfolio-create-modal { width: min(96vw, 640px); }
    .portfolio-page .portfolio-wizard-main { padding: 1rem; }
    .portfolio-page .portfolio-wizard-option-grid,
    .portfolio-page .portfolio-wizard-option-grid-three { grid-template-columns: 1fr; }
    .portfolio-page .portfolio-wizard-option { min-height: 84px; }
    .portfolio-page .portfolio-wizard-actions { flex-wrap: wrap; }
    .portfolio-page .portfolio-wizard-actions .btn-primary,
    .portfolio-page .portfolio-wizard-actions .btn-secondary { min-width: calc(50% - 0.5rem); }
    .portfolio-page .portfolio-wizard-progress-step { padding: 0.32rem 0.48rem; }
    .portfolio-page .portfolio-wizard-progress-label { font-size: 0.71rem; }
    .portfolio-page .portfolio-wizard-name-field input { min-height: 60px; font-size: 1rem; }

    .portfolio-page .holdings-container {
        border: 1px solid rgba(74,95,129,0.32);
        background: rgba(8,14,26,0.4);
        margin: 0 0 0.72rem;
        overflow: hidden;
        border-radius: 10px;
    }

    .portfolio-page .holdings-table,
    .portfolio-page .holdings-table tbody,
    .portfolio-page .holdings-table tr { display: block; width: 100%; }

    .portfolio-page .holdings-table thead { display: none; }

    .portfolio-page .holdings-table tr {
        display: flex;
        flex-direction: column;
        margin-bottom: 0;
        border: 0;
        border-bottom: 1px solid rgba(74, 95, 129, 0.32);
        border-radius: 0;
        background: transparent;
        overflow: hidden;
        box-shadow: none;
    }

    .portfolio-page .holdings-table tr:last-child { border-bottom: 0; }

    .portfolio-page .holdings-table tr.holding-support-row {
        display: block;
        border-top: 0;
        border-bottom: 1px solid rgba(74, 95, 129, 0.22);
        background: rgba(255,255,255,0.015);
    }

    .portfolio-page .holdings-table td {
        display: flex !important;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.62rem;
        width: auto !important;
        box-sizing: border-box;
        padding: 0.58rem 0.68rem !important;
        border-bottom: 1px solid rgba(74,95,129,0.24);
        text-align: left !important;
        grid-template-columns: unset !important;
    }

    .portfolio-page .holdings-table td::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-size: 0.66rem;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        font-weight: 700;
        flex: 0 0 auto;
        padding-top: 0.14rem;
        min-width: 0;
    }

    .portfolio-page .holdings-table td > * {
        margin-left: auto;
        text-align: right;
        min-width: 0;
    }

    .portfolio-page .holdings-table td:first-child {
        display: block !important;
        padding: 0.74rem !important;
        border-bottom: 1px solid rgba(74,95,129,0.26);
        background: rgba(255,255,255,0.01);
    }

    .portfolio-page .holdings-table td:first-child::before { display: none !important; }
    .portfolio-page .holdings-table td:first-child > * { margin-left: 0; text-align: left; }
    .portfolio-page .holding-subline { font-size: 0.75rem; line-height: 1.36; gap: 0.36rem; }
    .portfolio-page .holding-native-currency { font-size: 0.66rem; }
    .portfolio-page .holdings-table td.holding-metric { font-size: 0.94rem; font-weight: 700; }

    .portfolio-page .holdings-table td.metric-value,
    .portfolio-page .holdings-table td.metric-pl { font-size: 0.98rem; }

    .portfolio-page .holdings-table td:last-child { border-bottom: 0; }
    .portfolio-page .holdings-table td.holding-support-cell {
        display: block !important;
        width: 100%;
        padding: 0.72rem 0.74rem 0.82rem !important;
        border-bottom: 0;
    }
    .portfolio-page .holdings-table td.holding-support-cell::before { display: none; content: none; }
    .portfolio-page .holdings-table td:first-child { order: 1; }
    .portfolio-page .holdings-table td.metric-value { order: 2; background: transparent; border-left: 0; }
    .portfolio-page .holdings-table td.metric-pl { order: 3; border-left: 0; background: transparent; }
    .portfolio-page .holdings-table td.metric-pl.buy { border-left: 0; background: transparent; }
    .portfolio-page .holdings-table td.metric-pl.sell { border-left: 0; background: transparent; }
    .portfolio-page .holdings-table td.holding-dividend-cell { order: 4; }

    .portfolio-page .holdings-table td.metric-amount,
    .portfolio-page .holdings-table td.metric-avg,
    .portfolio-page .holdings-table td.metric-price { display: none; }

    .portfolio-page .holdings-table td.holding-actions-cell { order: 5; }
    .portfolio-page .holding-row { cursor: default; }
    .portfolio-page .holdings-table td.holding-actions-cell::before { display: none; }
    .portfolio-page .holdings-table td.holding-actions-cell { padding-top: 0.5rem; border-top: 1px solid rgba(74,95,129,0.22); }
    .portfolio-page .holdings-table td.holding-actions-cell > * { margin-left: 0; text-align: left; }
    .portfolio-page .holdings-table td.holding-dividend-cell { align-items: flex-start; }
    .portfolio-page .holdings-table td.holding-dividend-cell > * { margin-left: 0; text-align: left; }
    .portfolio-page .holding-tax-strip { margin-top: 0.5rem; }
    .portfolio-page .holding-tax-chip { font-size: 0.66rem; padding: 0.2rem 0.48rem; min-height: 1.58rem; }
    .portfolio-page .holding-tax-note { font-size: 0.72rem; }
    .portfolio-page .holding-sector-strip { margin-top: 0.46rem; }
    .portfolio-page .holding-sector-chip { font-size: 0.66rem; padding: 0.2rem 0.48rem; min-height: 1.58rem; }
    .portfolio-page .holding-sector-note { font-size: 0.72rem; }
    .portfolio-page .holding-replacement-strip { margin-top: 0.45rem; }
    .portfolio-page .holding-replacement-chip { font-size: 0.66rem; padding: 0.2rem 0.48rem; min-height: 1.58rem; }
    .portfolio-page .holding-replacement-note { font-size: 0.72rem; }
    .portfolio-page .holding-support-grid { grid-template-columns: 1fr; gap: 0.5rem; }
    .portfolio-page .holding-support-panel { padding: 0.62rem 0.66rem; }

    .portfolio-page .action-stack {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.42rem;
        align-items: stretch;
        justify-items: stretch;
    }

    .portfolio-page .action-stack .badge-mini,
    .portfolio-page .action-stack .action-btn {
        width: 100%;
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-size: 0.78rem;
        border-radius: 8px;
        border: 1px solid rgba(74,95,129,0.34);
        background: rgba(255,255,255,0.01);
        color: var(--text-secondary);
    }

    .portfolio-page .action-stack .history-btn { color: #e2ebf9; }
    .portfolio-page .action-stack .sell-btn { color: #fca5a5; border-color: rgba(239,68,68,0.34); }
    .portfolio-page .action-stack .move-open-btn { color: #bae6fd; border-color: rgba(56,189,248,0.34); }
    .portfolio-page .history-btn { grid-column: 1 / -1; }

    /* === Mobile: show quick-facts strip inside main cell === */
    .portfolio-page .holding-quick-facts {
        display: flex !important;
        align-items: center;
        flex-wrap: wrap;
        gap: 0;
        margin-top: 0.48rem;
        padding-top: 0.42rem;
        border-top: 1px solid rgba(51, 89, 127, 0.2);
    }
    .portfolio-page .holding-quick-fact {
        display: inline-flex;
        align-items: center;
        gap: 0.2rem;
        padding: 0 0.55rem 0 0;
        border: none;
        background: transparent;
        border-radius: 0;
    }
    .portfolio-page .holding-quick-fact + .holding-quick-fact {
        padding-left: 0.55rem;
        border-left: 1px solid rgba(51, 89, 127, 0.28);
    }
    .portfolio-page .holding-quick-fact-label {
        font-size: 0.58rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--text-muted);
        white-space: nowrap;
    }
    .portfolio-page .holding-quick-fact-value {
        font-size: 0.72rem;
        font-weight: 700;
        color: var(--text-secondary);
    }

    /* === Mobile: tax toggle touch targets === */
    .portfolio-page .holding-tax-toggle .htb {
        height: 26px;
        font-size: 0.63rem;
        padding: 0 0.55rem;
    }

    /* === Mobile: holding-id-row + holding-tax-row sizing === */
    .portfolio-page .holding-id-row {
        gap: 0.24rem;
        flex-wrap: wrap;
    }
    .portfolio-page .holding-company-name {
        font-size: 0.74rem;
    }
    .portfolio-page .holding-sector-tag {
        font-size: 0.62rem;
    }
    .portfolio-page .holding-tax-row {
        gap: 0.28rem;
        margin-top: 0.02rem;
    }

    /* === Mobile: decision line chips slightly larger === */
    .portfolio-page .holding-decision-line {
        gap: 0.32rem;
        margin-top: 0.52rem;
    }
    .portfolio-page .holding-decision-line .signal-badge,
    .portfolio-page .holding-decision-line .holding-return-chip {
        font-size: 0.72rem;
    }

    /* === Mobile: hsp panel adjustments === */
    .portfolio-page .hsp-head {
        flex-wrap: wrap;
        gap: 0.28rem;
    }
    .portfolio-page .hsp-type-tag {
        font-size: 0.57rem;
        padding-right: 0.36rem;
    }
    .portfolio-page .hsp-primary-text {
        font-size: 0.72rem;
    }
    .portfolio-page .hsp-amount {
        font-size: 0.7rem;
    }
    .portfolio-page .hsp-chips {
        margin-top: 0.24rem;
        gap: 0.2rem;
    }
    .portfolio-page .hsp-detail-row {
        margin-top: 0.22rem;
        font-size: 0.66rem;
    }
    .portfolio-page .hsp-notes {
        margin-top: 0.22rem;
        font-size: 0.66rem;
    }

    .portfolio-page .export-custom-range {
        grid-column: 1 / -1;
        margin-left: 0;
        border-left: 0;
        padding-left: 0;
        display: grid;
        grid-template-columns: 1fr 1fr auto;
        width: 100%;
    }

    .portfolio-page .export-input { min-height: 42px; box-sizing: border-box; }
    .portfolio-page .export-custom-btn { min-height: 42px; }

    .portfolio-page .modal-actions {
        flex-direction: column;
        gap: 0.65rem;
    }
}

/* Tablet: value + P/L side-by-side */
@media (min-width: 480px) and (max-width: 900px) {
    .portfolio-page .holdings-table tr.holding-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .portfolio-page .holdings-table tr.holding-row td:first-child,
    .portfolio-page .holdings-table tr.holding-row td.holding-dividend-cell,
    .portfolio-page .holdings-table tr.holding-row td.holding-actions-cell {
        grid-column: 1 / -1;
    }
    .portfolio-page .holdings-table tr.holding-row td.metric-value {
        grid-column: 1;
        border-right: 1px solid rgba(74, 95, 129, 0.18);
    }
    .portfolio-page .holdings-table tr.holding-row td.metric-pl {
        grid-column: 2;
    }
}

@media (max-width: 640px) {
    .portfolio-page { padding-top: 0.7rem; }
    .portfolio-page .portfolio-toolbar { padding: 0.64rem; }
    .portfolio-page .currency-form { flex-direction: column; align-items: stretch; gap: 0.35rem; }
    .portfolio-page .currency-form label { font-size: 0.66rem; }
    .portfolio-page .export-grid { grid-template-columns: 1fr; }
    .portfolio-page .export-custom-range { grid-template-columns: 1fr; }
    .portfolio-page .estimate-grid { grid-template-columns: 1fr; }
    .portfolio-page .dividend-event-row { flex-direction: column; gap: 0.35rem; }
    .portfolio-page .dividend-event-amount { text-align: left; }
    .portfolio-page .holdings-table td { padding: 0.56rem 0.58rem; }
    .portfolio-page .holdings-table td::before { font-size: 0.62rem; }
    .portfolio-page .holdings-table td.holding-actions-cell { padding-top: 0.6rem; }
    /* Hide next-dividend event detail on small screens — too dense */
    .portfolio-page .holding-dividend-next { display: none; }
    .portfolio-page .import-grid input[type="file"] { font-size: 0.86rem; }
}

@media (max-width: 430px) {
    .portfolio-page .p-nav-item { padding: 0.58rem 0.66rem 0.58rem 0.72rem; }
    .portfolio-page .p-nav-name { font-size: 0.78rem; }
    .portfolio-page .top-stats { padding: 0; }
    .portfolio-page .eval-panel { display: block; }

    .portfolio-page .eval-panel,
    .portfolio-page .value-panel { padding: 0.58rem 0.64rem; }

    .portfolio-page .charts-grid { gap: 0.58rem; }
    .portfolio-page .chart-container { padding: 0.76rem; }
    .portfolio-page .chart-canvas-wrap { height: 146px; }
    .portfolio-page .chart-canvas-wrap-compact { height: 118px; }

    .portfolio-page .export-section,
    .portfolio-page .import-section { padding: 0.64rem; border-radius: 9px; }

    .portfolio-page .eval-score { font-size: 1.66rem; }
    .portfolio-page .value-amount { font-size: 1.22rem; }
    .portfolio-page .portfolio-title { font-size: 0.98rem; }
    .portfolio-page .holding-subline { font-size: 0.72rem; }
    .portfolio-page .portfolio-chip { font-size: 0.64rem; }

    /* Holdings: tighten main cell padding */
    .portfolio-page .holdings-table td:first-child { padding: 0.64rem 0.62rem; }

    /* Holdings: hide sector tag if it makes the id-row wrap badly */
    .portfolio-page .holding-sector-tag { display: none; }

    /* Holdings: compact quick-facts */
    .portfolio-page .holding-quick-fact-value { font-size: 0.68rem; }
    .portfolio-page .holding-quick-fact-label { font-size: 0.56rem; }
    .portfolio-page .holding-quick-fact + .holding-quick-fact { padding-left: 0.44rem; }
    .portfolio-page .holding-quick-fact { padding-right: 0.44rem; }

    /* Holdings: dividend cell — just the paid total, hide expected 12m */
    .portfolio-page .holding-dividend-meta:last-of-type { display: none; }

    .portfolio-page .portfolio-settings input,
    .portfolio-page .portfolio-settings select,
    .portfolio-page .add-stock-grid input,
    .portfolio-page .add-stock-grid select {
        min-height: 42px;
        padding: 0.58rem;
    }

    .portfolio-page .add-stock-grid .trade-submit-group .btn-primary,
    .portfolio-page .portfolio-settings .field-action .btn-primary { min-height: 44px; }

    .portfolio-page .btn-export { min-height: 40px; padding: 0.55rem 0.64rem; font-size: 0.79rem; }
    .portfolio-page .export-grid > div { grid-template-columns: 1fr; gap: 0.42rem; }
    .portfolio-page .export-custom-btn { width: 100%; }
    .portfolio-page .modal-content { width: 95vw !important; padding: 0.72rem; margin: 0.35rem; }
    .portfolio-page .modal-head { top: -0.72rem; }
    .portfolio-page .action-stack { grid-template-columns: 1fr; }
}

/* ── Portfolio mobile: sidebar AI section hidden, holdings layout fixed ── */
@media (max-width: 900px) {
    /* Hide AI agent cards on mobile — sidebar is a compact horizontal scroller;
       the tall agent section breaks the layout by stretching the sidebar height */
    .sidebar-agents-section {
        display: none !important;
    }

    /* Hide the dividend column on mobile — too dense, not actionable on small screens */
    .portfolio-page .holdings-table td.holding-dividend-cell,
    .portfolio-page .holdings-table th.th-dividend {
        display: none !important;
    }

    /* High-specificity override for the holdings table cells.
       The table has class="market-table holdings-table", so using both class names
       gives 3 classes (> 2 classes on the generic rules) — wins even with !important. */
    .portfolio-page .holdings-table.market-table td {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        gap: 0.62rem !important;
        padding: 0.58rem 0.68rem !important;
        box-sizing: border-box !important;
        text-align: left !important;
        grid-template-columns: unset !important;
        width: 100% !important;
    }
    .portfolio-page .holdings-table.market-table td::before {
        flex: 0 0 auto !important;
        min-width: 4.8rem !important;
        font-size: 0.63rem !important;
        letter-spacing: 0.06em !important;
        text-transform: uppercase !important;
        font-weight: 700 !important;
        color: var(--text-muted) !important;
        padding-top: 0.14rem !important;
    }
    .portfolio-page .holdings-table.market-table td > * {
        margin-left: auto !important;
        text-align: right !important;
        min-width: 0 !important;
    }
    .portfolio-page .holdings-table.market-table td:first-child {
        display: block !important;
        padding: 0.74rem !important;
        border-bottom: 1px solid rgba(74,95,129,0.26) !important;
    }
    .portfolio-page .holdings-table.market-table td:first-child::before {
        display: none !important;
    }
    .portfolio-page .holdings-table.market-table td:first-child > * {
        margin-left: 0 !important;
        text-align: left !important;
    }
    /* Hide the 3 numeric metric columns — already handled by quick-facts on desktop */
    .portfolio-page .holdings-table.market-table td.metric-amount,
    .portfolio-page .holdings-table.market-table td.metric-avg,
    .portfolio-page .holdings-table.market-table td.metric-price {
        display: none !important;
    }
    /* Support rows span full width */
    .portfolio-page .holdings-table.market-table td.holding-support-cell {
        display: block !important;
        width: 100% !important;
    }
}

@media (max-width: 900px) {
    header {
        border-bottom-color: rgba(51, 89, 127, 0.26) !important;
    }

    .header-inner {
        min-height: 60px !important;
        gap: 0.5rem !important;
        padding: 0 0.72rem !important;
    }

    .mobile-top-actions {
        gap: 0.32rem !important;
    }

    .mobile-menu-toggle,
    .mobile-auth-shortcut,
    .mobile-lang-shortcut {
        min-height: 40px !important;
    }

    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
        border-radius: 11px !important;
    }

    .stock-detail-page .stock-insight-card {
        padding: 0.72rem !important;
        border-radius: 11px !important;
    }

    .stock-detail-page .stock-insight-card h2 {
        font-size: 0.84rem;
        margin-bottom: 0.42rem;
    }

    .stock-detail-page .insight-meta {
        margin: 0.08rem 0 0.42rem;
        font-size: 0.72rem;
        line-height: 1.4;
    }

    .stock-detail-page .score-matrix {
        gap: 0.28rem;
    }

    .stock-detail-page .score-head {
        font-size: 0.6rem;
    }

    .stock-detail-page .score-label {
        font-size: 0.72rem;
    }

    .stock-detail-page .score-cell {
        padding: 0.32rem 0.28rem;
        font-size: 0.74rem;
    }

    .stock-detail-page .projection-grid {
        gap: 0.36rem;
    }

    .stock-detail-page .projection-row {
        padding: 0.42rem 0.5rem;
        gap: 0.12rem 0.5rem;
    }

    .stock-detail-page .projection-label {
        font-size: 0.71rem;
    }

    .stock-detail-page .projection-price {
        font-size: 0.8rem;
    }

    .stock-detail-page .projection-meta,
    .stock-detail-page .projection-range {
        font-size: 0.68rem;
        line-height: 1.32;
    }

    .stock-detail-page .dividend-summary-grid,
    .stock-detail-page .dividend-metrics {
        gap: 0.34rem;
    }

    .stock-detail-page .metric-box {
        padding: 0.4rem 0.42rem;
        border-radius: 9px;
    }

    .stock-detail-page .metric-box span {
        font-size: 0.64rem;
    }

    .stock-detail-page .metric-box strong {
        font-size: 0.82rem;
    }

    .stock-detail-page .insight-kv {
        padding: 0.32rem 0;
        font-size: 0.78rem;
        gap: 0.5rem;
    }

    .stock-detail-page .dividend-toggle-wrap {
        margin-top: 0.62rem;
    }

    .stock-detail-page .stock-facts-grid {
        gap: 0.38rem;
    }

    .stock-detail-page .stock-fact-card {
        padding: 0.58rem 0.62rem;
        border-radius: 10px;
    }

    .stock-detail-page .related-sector-section {
        margin-top: 1rem;
        padding-top: 0.8rem;
    }
}

@media (max-width: 640px) {
    .stock-detail-page {
        padding-left: max(0.82rem, env(safe-area-inset-left));
        padding-right: max(0.82rem, env(safe-area-inset-right));
    }

    .header-inner {
        min-height: 58px !important;
        padding: 0 0.64rem !important;
    }

    .logo {
        font-size: 0.98rem !important;
    }

    .beta-tag {
        font-size: 0.54rem;
        padding: 0.12rem 0.3rem;
    }

    .mobile-auth-shortcut,
    .mobile-lang-shortcut {
        min-width: 0;
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }

    .stock-detail-page .stock-signal-summary {
        grid-template-columns: 1fr;
    }

    .stock-detail-page .stock-summary-item:last-child {
        grid-column: auto;
    }

    .stock-detail-page .directory-header.stock-detail-header {
        gap: 0.62rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .stock-detail-page .stock-decision-copy {
        gap: 0.34rem;
    }

    .stock-detail-page .stock-decision-kicker,
    .stock-detail-page .stock-decision-pill {
        max-width: 100%;
    }

    .stock-detail-page .stock-decision-title {
        font-size: 0.92rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .stock-detail-page .stock-quote-line {
        margin-top: 0.28rem;
    }

    .stock-detail-page .quote-price {
        font-size: 1.42rem;
        line-height: 1.12;
    }

    .stock-detail-page .quote-change {
        font-size: 0.84rem;
        line-height: 1.28;
    }

    .stock-detail-page .quote-meta {
        width: 100%;
        font-size: 0.7rem;
        line-height: 1.4;
    }

    .stock-detail-page .stock-detail-actions {
        margin-top: 0.5rem;
        gap: 0.5rem !important;
    }

    .stock-detail-page .stock-summary-item {
        padding: 0.72rem 0.78rem;
        gap: 0.18rem;
    }

    .stock-detail-page .stock-score-primary {
        font-size: 1.38rem;
    }

    .stock-detail-page .stock-score-grade {
        min-height: 22px;
        padding: 0.14rem 0.42rem;
        font-size: 0.68rem;
    }

    .stock-detail-page .stock-score-scale-marker {
        width: 12px;
        height: 12px;
    }

    .stock-detail-page .stock-summary-item strong {
        font-size: 0.86rem;
        line-height: 1.3;
    }

    .stock-detail-page .stock-summary-item small {
        font-size: 0.72rem;
        line-height: 1.38;
    }

    .stock-detail-page .score-matrix {
        grid-template-columns: 0.9fr repeat(3, minmax(0, 1fr));
        gap: 0.26rem;
    }

    .stock-detail-page .score-head {
        font-size: 0.58rem;
        letter-spacing: 0.04em;
    }

    .stock-detail-page .score-label {
        font-size: 0.7rem;
    }

    .stock-detail-page .projection-bar-card {
        min-width: 142px;
        padding: 0.56rem 0.5rem 0.5rem;
    }

    .stock-detail-page .projection-bar-stage {
        height: 74px;
    }

    .stock-detail-page .projection-bar-price {
        font-size: 0.8rem;
        line-height: 1.2;
    }

    .stock-detail-page .projection-bar-range {
        font-size: 0.58rem;
        line-height: 1.24;
    }

    .stock-detail-page .projection-bar-pct {
        font-size: 0.74rem;
    }

    .stock-detail-page .projection-bar-label {
        font-size: 0.66rem;
    }

    .stock-detail-page .dividend-history-table {
        min-width: 360px;
    }

    .stock-detail-page .stock-mobile-summary {
        padding: 0.72rem 0.74rem;
        font-size: 0.78rem;
    }

    .stock-detail-page .stock-mobile-details .stock-insight-card-collapsible {
        padding: 0 0.74rem 0.74rem !important;
    }

    .stock-detail-page .related-sector-section {
        margin-top: 0.72rem;
        padding-top: 0.6rem;
    }

    .stock-detail-page .related-sector-title {
        margin-bottom: 0.42rem;
    }

    .stock-detail-page .related-stock-grid {
        gap: 0.36rem;
    }

    .stock-detail-page .related-stock-grid .stock-card {
        padding: 0.72rem 0.74rem;
        border-radius: 10px;
    }

    .stock-detail-page .related-stock-grid .ticker,
    .stock-detail-page .related-stock-grid .rank {
        font-size: 0.68rem;
    }

    .stock-detail-page .related-stock-grid .name {
        font-size: 0.86rem;
    }

    .stock-detail-page .related-stock-grid .signal-badge {
        font-size: 0.66rem;
        padding: 0.16rem 0.54rem;
    }

    .stock-detail-page .related-stock-grid .card-footer {
        padding-top: 0.5rem;
    }

    .stock-detail-page .related-stock-grid .metric .value {
        font-size: 0.86rem;
    }
}

.stock-mobile-details {
    display: block;
    margin: 0;
}

.stock-mobile-summary {
    display: none;
}

.stock-mobile-details > summary::-webkit-details-marker {
    display: none;
}

.stock-mobile-details .stock-insight-card-collapsible {
    margin: 0;
}

@media (max-width: 900px) {
    .stock-detail-page .stock-mobile-details {
        border: 1px solid rgba(92, 116, 147, 0.36);
        border-radius: 12px;
        background: rgba(8, 14, 26, 0.54);
        overflow: hidden;
    }

    .stock-detail-page .stock-mobile-summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        list-style: none;
        cursor: pointer;
        padding: 0.78rem 0.82rem;
        color: var(--text-primary);
        font-size: 0.82rem;
        font-weight: 800;
        letter-spacing: -0.01em;
    }

    .stock-detail-page .stock-mobile-summary::after {
        content: "+";
        color: var(--text-secondary);
        font-size: 1rem;
        line-height: 1;
    }

    .stock-detail-page .stock-mobile-details[open] > .stock-mobile-summary::after {
        content: "-";
    }

    .stock-detail-page .stock-mobile-details .stock-insight-card-collapsible {
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 0.82rem 0.82rem !important;
    }

    .stock-detail-page .stock-mobile-details .stock-insight-card-collapsible h2 {
        display: none;
    }
}

.mobile-collapse-details {
    display: block;
    margin: 0;
}

.mobile-collapse-summary {
    display: none;
}

.mobile-collapse-details > summary::-webkit-details-marker {
    display: none;
}

@media (max-width: 900px) {
    .public-portfolio-page .public-mobile-details {
        border: 1px solid rgba(92, 116, 147, 0.36);
        border-radius: 12px;
        background: rgba(8, 14, 26, 0.54);
        overflow: hidden;
        margin-top: 0.9rem;
    }

    .public-portfolio-page .public-mobile-summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        list-style: none;
        cursor: pointer;
        padding: 0.78rem 0.82rem;
        color: var(--text-primary);
        font-size: 0.82rem;
        font-weight: 800;
        letter-spacing: -0.01em;
    }

    .public-portfolio-page .public-mobile-summary::after {
        content: "+";
        color: var(--text-secondary);
        font-size: 1rem;
        line-height: 1;
    }

    .public-portfolio-page .public-mobile-details[open] > .public-mobile-summary::after {
        content: "-";
    }

    .public-portfolio-page .public-mobile-details > .portfolio-income-section,
    .public-portfolio-page .public-mobile-details > .chart-container {
        margin-top: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .public-portfolio-page .public-mobile-details > .portfolio-income-section {
        padding: 0 0.82rem 0.82rem !important;
    }

    .public-portfolio-page .public-mobile-details > .chart-container {
        padding: 0.2rem 0.82rem 0.82rem !important;
    }
}

@media (max-width: 900px) {
    .portfolio-page .portfolio-mobile-details {
        border: 1px solid rgba(92, 116, 147, 0.36);
        border-radius: 12px;
        background: rgba(8, 14, 26, 0.54);
        overflow: hidden;
        margin-top: 0.9rem;
    }

    .portfolio-page .portfolio-mobile-summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        list-style: none;
        cursor: pointer;
        padding: 0.78rem 0.82rem;
        color: var(--text-primary);
        font-size: 0.82rem;
        font-weight: 800;
        letter-spacing: -0.01em;
    }

    .portfolio-page .portfolio-mobile-summary::after {
        content: "+";
        color: var(--text-secondary);
        font-size: 1rem;
        line-height: 1;
    }

    .portfolio-page .portfolio-mobile-details[open] > .portfolio-mobile-summary::after {
        content: "-";
    }

    .portfolio-page .portfolio-mobile-details > .portfolio-income-section,
    .portfolio-page .portfolio-mobile-details > .estimate-section,
    .portfolio-page .portfolio-mobile-details > .optimizer-section,
    .portfolio-page .portfolio-mobile-details > .charts-grid,
    .portfolio-page .portfolio-mobile-details > .export-section {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .portfolio-page .portfolio-mobile-details > .portfolio-income-section,
    .portfolio-page .portfolio-mobile-details > .estimate-section,
    .portfolio-page .portfolio-mobile-details > .optimizer-section,
    .portfolio-page .portfolio-mobile-details > .export-section {
        padding: 0 0.82rem 0.82rem !important;
    }

    .portfolio-page .portfolio-mobile-details > .charts-grid {
        padding: 0.2rem 0.82rem 0.82rem !important;
    }

    .portfolio-page .portfolio-mobile-details > .charts-grid .chart-container {
        border-radius: 10px;
    }
}

@media (max-width: 900px) {
    .header-inner {
        min-height: 54px !important;
        gap: 0.4rem !important;
        padding: 0 0.56rem !important;
    }

    .logo {
        font-size: 0.96rem !important;
        letter-spacing: 0.08em !important;
    }

    .beta-tag {
        padding: 0.08rem 0.3rem !important;
        font-size: 0.54rem !important;
    }

    .mobile-top-actions {
        gap: 0.24rem !important;
    }

    .mobile-menu-toggle,
    .mobile-auth-shortcut,
    .mobile-lang-shortcut {
        min-height: 36px !important;
        border-radius: 10px !important;
    }

    .mobile-menu-toggle {
        width: 36px !important;
        height: 36px !important;
    }

    .mobile-auth-shortcut {
        width: 36px;
        min-width: 36px !important;
        padding: 0 !important;
    }

    .mobile-shortcut-icon {
        width: 17px;
        height: 17px;
        stroke: currentColor;
        stroke-width: 1.9;
        fill: none;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .mobile-lang-shortcut {
        min-width: 38px !important;
        padding: 0 0.44rem !important;
        font-size: 0.68rem !important;
    }

    .main-nav {
        width: min(90vw, 320px) !important;
        max-width: min(90vw, 320px) !important;
        padding: 0.78rem 0.78rem 0.9rem !important;
    }

    .nav-mobile-head {
        margin: 0 0 0.45rem !important;
    }

    .nav-mobile-auth {
        margin-bottom: 0.62rem !important;
        gap: 0.45rem !important;
    }

    .nav-mobile-auth .nav-mobile-auth-btn {
        min-height: 42px !important;
        font-size: 0.81rem !important;
    }

    .nav-links {
        gap: 0.42rem !important;
    }

    .nav-link {
        min-height: 44px !important;
        padding: 0.62rem 0.72rem !important;
        border-radius: 12px !important;
    }

    .nav-link-text {
        font-size: 0.84rem !important;
    }

    .nav-link-icon {
        width: 18px !important;
        height: 18px !important;
    }

    .nav-utils {
        gap: 0.58rem !important;
    }

    .header-stock-search input {
        min-height: 42px !important;
        font-size: 0.88rem !important;
    }

    .lang-switcher a {
        min-height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .header-inner {
        min-height: 52px !important;
        padding: 0 0.5rem !important;
    }

    .logo {
        font-size: 0.9rem !important;
    }

    .mobile-menu-toggle,
    .mobile-auth-shortcut,
    .mobile-lang-shortcut {
        min-height: 34px !important;
    }

    .mobile-menu-toggle,
    .mobile-auth-shortcut {
        width: 34px !important;
        min-width: 34px !important;
    }

    .mobile-lang-shortcut {
        min-width: 36px !important;
    }

    .main-nav {
        width: min(92vw, 300px) !important;
    }
}

@media (min-width: 901px) {
    .header-inner {
        min-height: 66px !important;
        gap: 0.75rem !important;
        padding: 0 clamp(0.95rem, 1.8vw, 1.35rem) !important;
    }

    .logo {
        font-size: 1rem !important;
    }

    .main-nav {
        margin-left: 1.35rem !important;
    }

    .nav-links {
        gap: 0.38rem !important;
    }

    .nav-link {
        min-height: 38px;
        padding: 0.48rem 0.76rem;
    }

    .header-stock-search {
        width: min(228px, 29vw) !important;
    }

    .header-stock-search input {
        min-height: 42px !important;
    }

    .nav-btn,
    .btn-primary,
    .btn-secondary,
    .btn-export {
        min-height: 42px;
        padding: 0.6rem 0.9rem;
    }

    .nav-btn-icon {
        width: 42px;
        min-width: 42px;
    }

    .directory-header,
    .home-v2-hero,
    .home-v2-conversion,
    .home-v2-block,
    .entry-conversion {
        padding: 1.2rem 1.3rem;
    }

    .directory-header > * + * {
        margin-top: 0.55rem;
    }

    .directory-header h1,
    .stock-detail-page .directory-header h1,
    .portfolio-page .directory-header h1,
    .public-portfolio-page .directory-header h1 {
        font-size: clamp(1.65rem, 2.5vw, 2.35rem) !important;
    }

    .directory-header .subtitle,
    .public-portfolio-page .directory-header .subtitle,
    .stock-detail-page .directory-header .subtitle {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .stock-detail-page .stock-detail-header {
        padding-bottom: 0.7rem;
        gap: 0.72rem;
    }

    .stock-detail-page .stock-decision-hero {
        gap: 0.85rem;
    }

    .stock-detail-page .stock-decision-copy {
        gap: 0.4rem;
    }

    .stock-detail-page .stock-signal-summary {
        gap: 0.62rem;
        margin-top: 0.8rem;
    }

    .stock-detail-page .stock-summary-item {
        padding: 0.82rem 0.9rem;
    }

    .stock-detail-page .stock-insights-grid {
        gap: 0.8rem;
    }

    .stock-detail-page .stock-insight-card {
        padding: 1rem;
    }

    .stock-detail-page .stock-detail-actions {
        margin: 0.8rem 0 0;
        gap: 0.62rem;
    }

    .stock-detail-page .related-sector-section {
        margin-top: 1rem;
        padding-top: 0.8rem;
    }

    .portfolio-page .portfolio-toolbar,
    .public-portfolio-page .directory-header.split-header {
        gap: 0.72rem;
        margin-bottom: 0.8rem;
    }

    .portfolio-page .top-stats,
    .public-portfolio-page .top-stats {
        gap: 0.75rem;
        margin-bottom: 0.8rem;
    }

    .portfolio-page .top-stats-primary,
    .public-portfolio-page .top-stats-primary {
        grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
    }

    .portfolio-page .top-stats-secondary,
    .public-portfolio-page .top-stats-secondary {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        margin-top: 0.65rem;
    }

    .portfolio-page .eval-panel,
    .portfolio-page .value-panel,
    .public-portfolio-page .eval-panel,
    .public-portfolio-page .value-panel {
        min-height: 0;
        padding: 1.15rem !important;
    }

    .portfolio-priority-banner,
    .public-portfolio-priority {
        gap: 0.62rem;
        padding: 0.76rem 0.86rem;
        margin: 0 0 0.72rem;
    }

    .portfolio-priority-copy p,
    .public-portfolio-priority-copy p {
        margin-top: 0.18rem;
    }

    .portfolio-priority-meta,
    .public-portfolio-priority-meta,
    .public-portfolio-header-meta {
        gap: 0.34rem;
    }

    .portfolio-priority-chip,
    .public-portfolio-priority-chip,
    .public-portfolio-header-chip,
    .portfolio-chip {
        min-height: 28px;
        padding: 0.24rem 0.54rem;
        font-size: 0.71rem;
    }

    .portfolio-page .portfolio-toolbar,
    .portfolio-page .estimate-section,
    .portfolio-page .optimizer-section,
    .portfolio-page .charts-grid,
    .portfolio-page .holdings-container,
    .portfolio-page .export-section,
    .portfolio-page .import-section,
    .portfolio-page .portfolio-income-section,
    .public-portfolio-page .portfolio-income-section,
    .public-portfolio-page .public-holdings-container,
    .public-portfolio-page .chart-container {
        margin-top: 0.8rem;
    }

    .portfolio-page .chart-container,
    .public-portfolio-page .chart-container {
        padding: 1rem !important;
    }

    .portfolio-page .dividend-summary-grid,
    .public-portfolio-page .dividend-summary-grid {
        gap: 0.62rem;
    }

    .portfolio-page .dividend-summary-card,
    .public-portfolio-page .dividend-summary-card {
        min-height: 120px;
        padding: 0.9rem 0.95rem !important;
    }

    .portfolio-page .dividend-event-list,
    .portfolio-page .dividend-history-dropdown,
    .public-portfolio-page .dividend-event-list,
    .public-portfolio-page .dividend-history-dropdown {
        margin-top: 0.62rem;
    }
}

/* Final evaluator layout override: keep audit sections readable and stop inherited multi-column card density from collapsing long content. */
.portfolio-evaluator-page .evaluator-holdings-section .audit-holding-header,
.portfolio-evaluator-run-page .evaluator-holdings-section .audit-holding-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 0.7rem !important;
}

.portfolio-evaluator-page .evaluator-holdings-section .audit-holding-meta,
.portfolio-evaluator-run-page .evaluator-holdings-section .audit-holding-meta,
.portfolio-evaluator-page .evaluator-holdings-section .detail-chip-row,
.portfolio-evaluator-run-page .evaluator-holdings-section .detail-chip-row {
    justify-content: flex-start !important;
    align-items: flex-start !important;
}

.portfolio-evaluator-page .evaluator-holdings-section .audit-step-list,
.portfolio-evaluator-run-page .evaluator-holdings-section .audit-step-list {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.68rem !important;
}

.portfolio-evaluator-page .evaluator-holdings-section .audit-step-row,
.portfolio-evaluator-run-page .evaluator-holdings-section .audit-step-row {
    grid-column: auto !important;
    min-width: 0 !important;
    width: 100% !important;
    padding: 0.8rem 0.85rem !important;
}

.portfolio-evaluator-page .evaluator-holdings-section .audit-step-row-title,
.portfolio-evaluator-page .evaluator-holdings-section .audit-step-row-value,
.portfolio-evaluator-page .evaluator-holdings-section .audit-step-row-detail,
.portfolio-evaluator-run-page .evaluator-holdings-section .audit-step-row-title,
.portfolio-evaluator-run-page .evaluator-holdings-section .audit-step-row-value,
.portfolio-evaluator-run-page .evaluator-holdings-section .audit-step-row-detail {
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

.portfolio-evaluator-page .evaluator-holdings-section .audit-step-row-candidates .audit-step-inline-meta,
.portfolio-evaluator-run-page .evaluator-holdings-section .audit-step-row-candidates .audit-step-inline-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
}

.portfolio-evaluator-page .evaluator-holdings-section .audit-step-row-candidates .audit-step-row-detail,
.portfolio-evaluator-run-page .evaluator-holdings-section .audit-step-row-candidates .audit-step-row-detail {
    line-height: 1.55 !important;
}

@media (max-width: 900px) {
    .portfolio-evaluator-page .evaluator-detail-grid,
    .portfolio-evaluator-run-page .evaluator-detail-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .portfolio-evaluator-page .evaluator-holdings-section .audit-holding-card,
    .portfolio-evaluator-run-page .evaluator-holdings-section .audit-holding-card {
        padding: 0.82rem 0.84rem !important;
    }
}

/* Final main portfolio holdings override: keep the ticker cell readable and stop support strips from collapsing the table. */
@media (min-width: 901px) {
    .portfolio-page .holdings-table {
        table-layout: fixed;
    }

    .portfolio-page .holdings-container {
        border-color: rgba(60, 88, 118, 0.26);
    }

    .portfolio-page .holdings-header {
        padding: 0.95rem 1.05rem 0.8rem;
    }

    .portfolio-page .holding-row.has-support > td {
        border-bottom: 0;
    }

    .portfolio-page .holding-support-row td.holding-support-cell {
        padding: 0.12rem 0.92rem 0.72rem;
        border-bottom: 1px solid rgba(51, 89, 127, 0.22);
        background: rgba(255,255,255,0.01);
    }

    .portfolio-page .holding-support-row:last-child td.holding-support-cell {
        border-bottom: 0;
    }

    .portfolio-page .holdings-table th,
    .portfolio-page .holdings-table td {
        vertical-align: top;
    }

    .portfolio-page .holdings-table td.holding-main-cell {
        width: 27%;
        min-width: 0;
    }

    .portfolio-page .holdings-table td.holding-dividend-cell {
        width: 10.8rem;
    }

    .portfolio-page .holdings-table td.metric-amount,
    .portfolio-page .holdings-table td.metric-avg,
    .portfolio-page .holdings-table td.metric-price {
        width: 6.2rem;
        white-space: nowrap;
    }

    .portfolio-page .holdings-table td.metric-value,
    .portfolio-page .holdings-table td.metric-pl {
        width: 8.1rem;
        white-space: nowrap;
    }

    .portfolio-page .holdings-table td.holding-actions-cell {
        width: 7.9rem;
    }

    .portfolio-page .holding-support-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.95rem;
        align-items: start;
    }

    .portfolio-page .holding-support-panel {
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        min-height: 0;
    }

    .portfolio-page .holding-support-panel + .holding-support-panel {
        padding-left: 0.95rem;
        border-left: 1px solid rgba(60, 88, 118, 0.22);
    }

    .portfolio-page .holding-support-label {
        margin-bottom: 0.22rem;
        font-size: 0.55rem;
        letter-spacing: 0.1em;
    }

    .portfolio-page .holding-tax-chip,
    .portfolio-page .holding-sector-chip,
    .portfolio-page .holding-replacement-chip {
        min-height: 1.34rem;
        padding: 0.1rem 0.38rem;
        font-size: 0.61rem;
    }

    .portfolio-page .holding-main-cell > * {
        max-width: 100%;
        min-width: 0;
    }

    .portfolio-page .holding-support-cell::before {
        display: none !important;
        content: none !important;
    }

    .portfolio-page .ticker-line {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .portfolio-page .holding-subline,
    .portfolio-page .holding-tax-note,
    .portfolio-page .holding-sector-note,
    .portfolio-page .holding-replacement-note {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .portfolio-page .holding-tax-strip,
    .portfolio-page .holding-sector-strip,
    .portfolio-page .holding-replacement-strip {
        max-width: 100%;
    }

    .portfolio-page .holding-replacement-note,
    .portfolio-page .holding-sector-note,
    .portfolio-page .holding-tax-note {
        font-size: 0.7rem;
        line-height: 1.34;
    }

    .portfolio-page .holding-dividend-summary {
        align-items: flex-end;
    }

    .portfolio-page .action-stack {
        justify-content: flex-end;
        align-items: flex-start;
        gap: 0.38rem;
    }
}

@media (max-width: 900px) {
    .portfolio-page .holdings-header {
        padding: 0.78rem 0.8rem 0.68rem;
        align-items: center;
    }

    .portfolio-page .holdings-header-copy h3 {
        font-size: 0.84rem;
    }

    .portfolio-page .holdings-table td.holding-main-cell {
        display: block !important;
        padding: 0.78rem 0.74rem !important;
    }

    .portfolio-page .holding-main-cell > * {
        max-width: 100%;
        min-width: 0;
    }

    .portfolio-page .holding-tax-note,
    .portfolio-page .holding-sector-note,
    .portfolio-page .holding-replacement-note,
    .portfolio-page .holding-subline {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .portfolio-page .holding-tax-strip,
    .portfolio-page .holding-sector-strip,
    .portfolio-page .holding-replacement-strip {
        gap: 0.3rem;
    }
}

.model-portfolio-page {
    --model-cyan: var(--mp-chart-primary);
    --model-rose: var(--mp-chart-benchmark);
    --model-gold: #fbbf24;
    --model-surface: rgba(10, 18, 33, 0.72);
    --model-surface-strong: rgba(13, 22, 38, 0.9);
    --model-border: rgba(116, 142, 178, 0.16);
}

.model-portfolio-page .directory-header {
    align-items: flex-start;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) auto;
    gap: 18px;
    padding: 24px;
    margin: 1rem 0 1.15rem;
    border: 1px solid rgba(110, 142, 184, 0.28);
    border-radius: 26px;
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.12) 0%, rgba(56, 189, 248, 0) 34%),
        linear-gradient(145deg, rgba(8, 16, 30, 0.96), rgba(6, 12, 23, 0.92));
    box-shadow: 0 20px 38px rgba(0, 0, 0, 0.26);
}

.model-portfolio-page .directory-header {
    position: relative;
    overflow: hidden;
}

.model-portfolio-page .directory-header::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    border-radius: 26px 0 0 26px;
    background: linear-gradient(180deg, var(--model-cyan), var(--model-rose));
}

.model-portfolio-page .directory-header h1 {
    margin-bottom: 0.45rem;
    font-size: clamp(1.9rem, 3.8vw, 2.7rem);
    letter-spacing: -0.025em;
}

.model-portfolio-header-main {
    display: grid;
    gap: 0.8rem;
}

.model-portfolio-header-main > .model-portfolio-header-eyebrow:not(.model-portfolio-header-eyebrow-clean) {
    display: none;
}

.model-portfolio-header-eyebrow {
    color: rgba(184, 222, 255, 0.78);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.model-portfolio-page .directory-header p {
    max-width: 60ch;
    color: rgba(226, 232, 240, 0.8);
}

.model-portfolio-header-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
}

.model-portfolio-header-fact {
    padding: 0.8rem 0.9rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.04);
    display: grid;
    gap: 0.3rem;
}

.model-portfolio-header-fact span {
    color: rgba(184, 202, 224, 0.72);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.model-portfolio-header-fact strong {
    color: #f8fafc;
    font-size: 0.96rem;
    line-height: 1.35;
}

.model-portfolio-page .directory-header-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.model-portfolio-page .model-portfolio-currency-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
    border: 1px solid rgba(74, 95, 129, 0.44);
    border-radius: 999px;
    padding: 0.22rem 0.42rem;
    background: rgba(255, 255, 255, 0.03);
}

.model-portfolio-page .model-portfolio-currency-form select {
    min-width: 88px;
    min-height: 32px;
    border: 0;
    background: transparent;
    color: #f8fafc;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0 1.25rem 0 0.2rem;
}

.model-portfolio-page .model-portfolio-currency-form select:focus {
    outline: none;
}

.model-portfolio-page .model-portfolio-currency-form select option {
    color: #111827;
    background: #ffffff;
}

.model-portfolio-quick-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 1rem;
    padding: 0.82rem 0.95rem;
    position: sticky;
    top: 84px;
    z-index: 18;
    border: 1px solid rgba(116, 142, 178, 0.18);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(12, 19, 33, 0.94), rgba(10, 17, 29, 0.88));
    backdrop-filter: blur(12px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
}

.model-portfolio-quick-nav-label {
    color: rgba(226, 232, 240, 0.62);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-right: 2px;
}

.model-portfolio-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(280px, 0.92fr));
    gap: 18px;
    margin: 0 0 1.15rem;
}

.model-portfolio-tab-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.95fr);
    gap: 18px;
    align-items: start;
    margin: 0 0 1.15rem;
    padding: 20px 22px;
    border: 1px solid rgba(116, 142, 178, 0.18);
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.08) 0%, rgba(56, 189, 248, 0) 34%),
        linear-gradient(165deg, rgba(13, 22, 38, 0.92), rgba(9, 15, 28, 0.84));
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.14);
}

.model-portfolio-tab-hero-accounting {
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.06) 0%, rgba(56, 189, 248, 0) 30%),
        linear-gradient(165deg, rgba(13, 22, 38, 0.9), rgba(9, 15, 28, 0.82));
}

.model-portfolio-tab-hero-evaluator {
    background:
        radial-gradient(circle at top right, rgba(244, 114, 182, 0.09) 0%, rgba(244, 114, 182, 0) 34%),
        linear-gradient(165deg, rgba(13, 22, 38, 0.92), rgba(9, 15, 28, 0.84));
}

.model-portfolio-tab-hero-slim {
    grid-template-columns: 1fr;
}

.model-portfolio-tab-hero-facts-compact {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.model-portfolio-tab-hero-main {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.model-portfolio-tab-hero-caption {
    color: rgba(184, 202, 224, 0.72);
    font-size: 0.84rem;
    line-height: 1.45;
}

.model-portfolio-tab-hero-kicker {
    color: rgba(184, 222, 255, 0.8);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.model-portfolio-tab-hero h2 {
    margin: 0;
    font-size: clamp(1.25rem, 2.4vw, 1.7rem);
    letter-spacing: -0.03em;
}

.model-portfolio-tab-hero p {
    margin: 0;
    max-width: 56ch;
    color: rgba(226, 232, 240, 0.76);
    font-size: 0.96rem;
    line-height: 1.55;
}

.model-portfolio-tab-hero-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.model-portfolio-tab-hero-fact {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.model-portfolio-tab-hero-fact span {
    color: rgba(226, 232, 240, 0.58);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.model-portfolio-tab-hero-fact strong {
    color: #f8fafc;
    font-size: 1.02rem;
    line-height: 1.35;
}

.model-portfolio-tab-hero-fact strong.is-positive {
    color: #34d399;
}

.model-portfolio-tab-hero-fact strong.is-negative {
    color: #f87171;
}

.model-portfolio-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
    gap: 18px;
    margin: 0 0 1.15rem;
}

.model-portfolio-dashboard-side {
    display: grid;
    gap: 16px;
    align-self: start;
}

.model-portfolio-dashboard-performance,
.model-portfolio-dashboard-card {
    min-width: 0;
}

.model-portfolio-dashboard-grid > :only-child {
    grid-column: 1 / -1;
}

.model-portfolio-performance-summary-hero {
    margin: 0 0 6px;
}

.model-portfolio-performance-summary-hero .model-portfolio-kpi {
    min-height: 118px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
}

.model-portfolio-performance-summary-hero .model-portfolio-kpi label {
    margin-bottom: 0;
    color: rgba(191, 219, 254, 0.74);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.model-portfolio-performance-summary-hero .model-portfolio-kpi strong {
    font-size: clamp(1.35rem, 2vw, 1.9rem);
    line-height: 1.08;
}

.model-portfolio-chart-shell-hero {
    min-height: 100%;
}

.model-portfolio-dashboard-list {
    display: grid;
    gap: 10px;
}

.model-portfolio-dashboard-card .portfolio-holdings-header {
    align-items: end;
    gap: 12px;
    margin-bottom: 4px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.model-portfolio-dashboard-card .portfolio-holdings-header h2 {
    font-size: 1.02rem;
    letter-spacing: -0.02em;
}

.model-portfolio-dashboard-card .portfolio-holdings-meta {
    margin-top: 4px;
}

.model-portfolio-dashboard-header-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0.34rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.22);
    background: rgba(56, 189, 248, 0.08);
    color: #d9f6ff;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.model-portfolio-dashboard-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.model-portfolio-dashboard-item:first-child {
    padding-top: 12px;
}

.model-portfolio-dashboard-item:last-child {
    padding-bottom: 12px;
}

.model-portfolio-dashboard-rank {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.24);
    background: rgba(56, 189, 248, 0.08);
    color: #d6f4ff;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.model-portfolio-dashboard-item-main {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.model-portfolio-dashboard-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.model-portfolio-dashboard-item-main .ticker-with-logo {
    font-size: 0.98rem;
}

.model-portfolio-dashboard-item-main .model-portfolio-muted {
    line-height: 1.35;
}

.model-portfolio-dashboard-weight {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0.25rem 0.62rem;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.22);
    color: #dff6ff;
    font-size: 0.76rem;
    font-weight: 800;
    font-size: 0.84rem;
}

.model-portfolio-dashboard-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.model-portfolio-dashboard-item-metrics {
    display: grid;
    justify-items: end;
    gap: 4px;
    text-align: right;
}

.model-portfolio-dashboard-item-metrics strong {
    color: #f8fafc;
    font-size: 1rem;
}

.model-portfolio-dashboard-item-metrics span {
    color: rgba(148, 163, 184, 0.92);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.model-portfolio-sector-visual {
    display: grid;
    grid-template-columns: minmax(0, 142px) minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    margin: 0 0 14px;
}

.model-portfolio-sector-ring-shell {
    position: relative;
    width: 132px;
    height: 132px;
    margin: 0 auto;
}

.model-portfolio-sector-ring {
    width: 132px;
    height: 132px;
    transform: rotate(-90deg);
}

.model-portfolio-sector-ring-track,
.model-portfolio-sector-ring-segment {
    fill: none;
    stroke-width: 14;
}

.model-portfolio-sector-ring-track {
    stroke: rgba(148, 163, 184, 0.16);
}

.model-portfolio-sector-ring-segment {
    stroke-linecap: butt;
}

.model-portfolio-sector-ring-center {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 4px;
    text-align: center;
    padding: 18px;
}

.model-portfolio-sector-ring-center strong {
    color: #f8fafc;
    font-size: 1.28rem;
    line-height: 1;
}

.model-portfolio-sector-ring-center span {
    color: rgba(226, 232, 240, 0.74);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.35;
}

.model-portfolio-sector-legend {
    display: grid;
    gap: 8px;
}

.model-portfolio-sector-legend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.model-portfolio-sector-legend-label {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(226, 232, 240, 0.84);
    font-size: 0.83rem;
    font-weight: 700;
}

.model-portfolio-sector-legend-row strong {
    color: #f8fafc;
    font-size: 0.84rem;
}

.model-portfolio-sector-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex: 0 0 10px;
    background: var(--sector-dot, #94a3b8);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

@media (max-width: 720px) {
    .model-portfolio-tab-hero-facts {
        grid-template-columns: 1fr;
    }

    .model-portfolio-performance-summary-hero .model-portfolio-kpi {
        min-height: 104px;
        padding: 14px 12px;
    }

    .model-portfolio-performance-summary-hero .model-portfolio-kpi strong {
        font-size: 1.5rem;
    }

    .model-portfolio-dashboard-card .portfolio-holdings-header {
        align-items: start;
    }

    .model-portfolio-dashboard-header-badge {
        white-space: normal;
    }

    .model-portfolio-dashboard-item {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    .model-portfolio-dashboard-item-metrics {
        grid-column: 2;
        justify-items: start;
        text-align: left;
    }

    .model-portfolio-dashboard-item-header {
        align-items: flex-start;
    }

    .model-portfolio-sector-visual {
        grid-template-columns: 1fr;
    }

    .model-portfolio-sector-ring-shell {
        width: 120px;
        height: 120px;
    }

    .model-portfolio-sector-ring {
        width: 120px;
        height: 120px;
    }
}

.model-portfolio-overview-card {
    min-width: 0;
}

.model-portfolio-overview-card-primary {
    gap: 16px;
}

.model-portfolio-overview-card-secondary,
.model-portfolio-overview-card-tertiary {
    min-height: 100%;
}

.model-portfolio-overview-card-secondary,
.model-portfolio-overview-card-tertiary {
    gap: 14px;
}

.model-portfolio-overview-value {
    color: #f8fafc;
    font-size: clamp(2.2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 0.95;
}

.model-portfolio-overview-value-return.is-positive {
    color: #34d399;
}

.model-portfolio-overview-value-return.is-negative {
    color: #f87171;
}

.model-portfolio-overview-subtitle {
    color: rgba(226, 232, 240, 0.74);
    font-size: 0.92rem;
    line-height: 1.45;
}

.model-portfolio-overview-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.model-portfolio-overview-stat-grid-compact .model-portfolio-overview-stat strong {
    font-size: 0.94rem;
}

.model-portfolio-overview-stat {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.12);
    display: grid;
    gap: 4px;
}

.model-portfolio-overview-stat span {
    color: rgba(226, 232, 240, 0.58);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.model-portfolio-overview-stat strong {
    color: #f8fafc;
    font-size: 1rem;
    line-height: 1.25;
}

.model-portfolio-overview-list,
.model-portfolio-overview-note-list {
    display: grid;
    gap: 10px;
}

.model-portfolio-overview-note-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.model-portfolio-overview-moves {
    display: grid;
    gap: 10px;
}

.model-portfolio-overview-move-card {
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.03);
}

.model-portfolio-overview-move-card.is-added {
    border-color: rgba(52, 211, 153, 0.22);
    background: rgba(6, 78, 59, 0.12);
}

.model-portfolio-overview-move-card.is-removed {
    border-color: rgba(248, 113, 113, 0.22);
    background: rgba(127, 29, 29, 0.12);
}

.model-portfolio-overview-move-label {
    color: rgba(226, 232, 240, 0.68);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.model-portfolio-overview-move-tickers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.model-portfolio-overview-move-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(8, 14, 26, 0.58);
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: #f8fafc;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
}

.model-portfolio-overview-list-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.model-portfolio-overview-list-row:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.model-portfolio-overview-list-row span {
    color: rgba(226, 232, 240, 0.64);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.model-portfolio-overview-list-row strong {
    color: #f8fafc;
    font-size: 0.92rem;
    line-height: 1.4;
    text-align: right;
}

.model-portfolio-overview-note {
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.03);
    display: grid;
    gap: 6px;
}

.model-portfolio-overview-note strong {
    color: #f8fafc;
    font-size: 0.9rem;
}

.model-portfolio-overview-note p {
    margin: 0;
    color: rgba(226, 232, 240, 0.74);
    font-size: 0.84rem;
    line-height: 1.45;
}

.model-portfolio-overview-note.tone-risk {
    border-color: rgba(248, 113, 113, 0.24);
    background: rgba(127, 29, 29, 0.12);
}

.model-portfolio-overview-note.tone-watch {
    border-color: rgba(251, 191, 36, 0.24);
    background: rgba(120, 83, 12, 0.12);
}

.model-portfolio-definition-grid-tight {
    gap: 12px 14px;
}

.model-portfolio-profile-chip-row {
    margin-top: -2px;
}

.model-portfolio-overview-grid > .model-portfolio-hero-side {
    display: none;
}

.model-portfolio-overview-grid > .model-portfolio-overview-legacy {
    display: none;
}

.model-portfolio-action-rail,
.model-portfolio-snapshot-grid-compact {
    display: none;
}

.model-portfolio-hero-grid + .model-portfolio-action-rail {
    display: none;
}

.model-portfolio-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.9fr);
    gap: 16px;
    margin: 0 0 1.15rem;
}

.model-portfolio-hero-main,
.model-portfolio-hero-side,
.model-portfolio-snapshot-grid {
    display: grid;
    gap: 14px;
}

.model-portfolio-hero-side {
    align-self: start;
    position: sticky;
    top: 84px;
}

.model-portfolio-hero-main .top-stats,
.model-portfolio-hero-main .model-portfolio-follow-suggestions,
.model-portfolio-hero-side .top-stats,
.model-portfolio-hero-side .model-portfolio-status-grid,
.model-portfolio-hero-side .model-portfolio-alert-rail {
    margin: 0;
}

.model-portfolio-page .model-portfolio-hero-main .top-stats-primary .top-stat-card {
    min-height: 166px;
    padding: 1.35rem 1.15rem;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.55rem;
}

.model-portfolio-page .model-portfolio-hero-main .top-stats-primary .top-stat-card label {
    color: rgba(191, 219, 254, 0.72);
    font-size: 0.74rem;
    letter-spacing: 0.1em;
}

.model-portfolio-page .model-portfolio-hero-main .top-stats-primary .top-stat-card strong {
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    line-height: 1;
    letter-spacing: -0.05em;
}

.model-portfolio-page .model-portfolio-hero-main .top-stats-primary .top-stat-card.top-stat-card-insight {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    gap: 0.72rem;
}

.model-portfolio-page .model-portfolio-hero-main .top-stats-primary .top-stat-card.top-stat-card-insight::before {
    content: "";
    position: absolute;
    inset: auto -18% -24% auto;
    width: 180px;
    height: 180px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.2), rgba(56, 189, 248, 0));
    filter: blur(10px);
    opacity: 0.9;
    transform: translate3d(0, 0, 0) scale(0.92);
    animation: modelPortfolioHeroGlow 7.5s ease-in-out infinite;
    z-index: 0;
}

.model-portfolio-page .model-portfolio-hero-main .top-stats-primary .top-stat-card.top-stat-card-insight::after {
    content: "";
    position: absolute;
    inset: -35% auto auto -30%;
    width: 78%;
    height: 210%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
    opacity: 0;
    transform: rotate(18deg) translate3d(0, 0, 0);
    animation: modelPortfolioHeroSweep 8.8s ease-in-out infinite;
    z-index: 0;
}

.model-portfolio-page .model-portfolio-hero-main .top-stats-primary .top-stat-card.top-stat-card-insight > * {
    position: relative;
    z-index: 1;
}

.model-portfolio-page .model-portfolio-hero-main .top-stats-primary .top-stat-card.top-stat-card-insight label {
    margin-bottom: 0;
}

.model-portfolio-page .top-stat-card-insight .top-stat-value {
    display: block;
    max-width: 100%;
    font-size: clamp(1.9rem, 2.9vw, 3rem);
    line-height: 0.92;
    letter-spacing: -0.04em;
    overflow-wrap: normal;
}

.model-portfolio-page .top-stat-card-insight strong.is-text {
    max-width: 100%;
    font-size: clamp(1.1rem, 1.7vw, 1.5rem);
    line-height: 1.12;
    letter-spacing: -0.04em;
    overflow-wrap: break-word;
}

.model-portfolio-page .top-stat-card-insight .top-stat-meta {
    margin: 0;
    color: rgba(226, 232, 240, 0.7);
    font-size: 0.92rem;
    line-height: 1.45;
}

.model-portfolio-page .top-stat-card-insight.tone-return {
    border-color: rgba(52, 211, 153, 0.22);
    background:
        radial-gradient(circle at top right, rgba(52, 211, 153, 0.1), transparent 42%),
        linear-gradient(180deg, rgba(11, 22, 33, 0.9), rgba(9, 15, 28, 0.84));
}

.model-portfolio-page .top-stat-card-insight.tone-return::before {
    background: radial-gradient(circle, rgba(52, 211, 153, 0.24), rgba(52, 211, 153, 0));
}

.model-portfolio-page .top-stat-card-insight.tone-return .top-stat-value {
    color: #36d399;
    text-shadow: 0 0 18px rgba(54, 211, 153, 0.14);
}

.model-portfolio-page .top-stat-card-insight.tone-alpha {
    border-color: rgba(56, 189, 248, 0.24);
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.1), transparent 42%),
        linear-gradient(180deg, rgba(11, 22, 33, 0.9), rgba(9, 15, 28, 0.84));
}

.model-portfolio-page .top-stat-card-insight.tone-alpha::before {
    background: radial-gradient(circle, rgba(56, 189, 248, 0.24), rgba(56, 189, 248, 0));
}

.model-portfolio-page .top-stat-card-insight.tone-alpha .top-stat-value {
    color: #67d8ff;
    text-shadow: 0 0 18px rgba(103, 216, 255, 0.14);
}

.model-portfolio-page .top-stat-card-insight.tone-fit,
.model-portfolio-page .top-stat-card-insight.tone-latest {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
        linear-gradient(180deg, rgba(11, 22, 33, 0.9), rgba(9, 15, 28, 0.84));
}

.model-portfolio-page .top-stat-card-insight.tone-fit::before {
    background: radial-gradient(circle, rgba(244, 114, 182, 0.18), rgba(244, 114, 182, 0));
}

.model-portfolio-page .top-stat-card-insight.tone-alpha::after {
    animation-delay: 1.3s;
}

.model-portfolio-page .top-stat-card-insight.tone-fit::after {
    animation-delay: 2.6s;
}

.model-portfolio-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.model-portfolio-hero-actions .btn-secondary {
    min-width: 0;
}

.model-portfolio-run-page .directory-header {
    grid-template-columns: minmax(0, 1fr) minmax(280px, max-content);
}

.model-portfolio-run-page .directory-header > *,
.model-portfolio-run-page .model-portfolio-header-main,
.model-portfolio-run-page .directory-header-meta,
.model-portfolio-run-page .model-portfolio-hero-main,
.model-portfolio-run-page .model-portfolio-hero-side,
.model-portfolio-run-page .top-stats-primary,
.model-portfolio-run-page .top-stats-secondary,
.model-portfolio-run-page .model-portfolio-follow-suggestions,
.model-portfolio-run-page .model-portfolio-status-grid {
    min-width: 0;
}

.model-portfolio-run-page .directory-header-meta {
    align-content: flex-start;
    max-width: 100%;
}

.model-portfolio-run-page .model-portfolio-header-main h1,
.model-portfolio-run-page .model-portfolio-header-main p,
.model-portfolio-run-page .model-portfolio-follow-suggestion p {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.model-portfolio-run-page .model-portfolio-hero-main .top-stats-primary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.model-portfolio-run-page .model-portfolio-hero-main .top-stats-primary .top-stat-card,
.model-portfolio-run-page .model-portfolio-hero-side .top-stats-secondary .top-stat-card {
    min-width: 0;
}

.model-portfolio-run-page .model-portfolio-hero-main .top-stats-primary .top-stat-card {
    min-height: 152px;
}

.model-portfolio-run-page .model-portfolio-hero-main .top-stats-primary .top-stat-card strong {
    max-width: 100%;
    font-size: clamp(1.82rem, 2.4vw, 2.75rem);
    line-height: 1.04;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.model-portfolio-run-page .model-portfolio-hero-side .top-stats-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
}

.model-portfolio-run-page .model-portfolio-hero-side .top-stats-secondary .top-stat-card {
    justify-content: center;
}

.model-portfolio-run-page .model-portfolio-hero-side .top-stats-secondary .top-stat-card strong {
    max-width: 100%;
    font-size: clamp(1.22rem, 1.45vw, 1.7rem);
    line-height: 1.12;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.model-portfolio-run-context {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) auto;
    gap: 16px;
    align-items: center;
    margin: 0 0 1rem;
    padding: 16px 18px;
    border: 1px solid rgba(68, 116, 176, 0.28);
    border-radius: 22px;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.1), rgba(56, 189, 248, 0) 30%),
        linear-gradient(165deg, rgba(10, 18, 32, 0.92), rgba(8, 14, 25, 0.88));
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.14);
}

.model-portfolio-run-context-main {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.model-portfolio-run-context-main strong,
.model-portfolio-run-context-main p {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.model-portfolio-run-context-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.28);
    background: rgba(14, 31, 52, 0.72);
    color: rgba(185, 225, 255, 0.9);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.model-portfolio-run-context-main p {
    margin: 0;
    color: var(--text-secondary);
}

.model-portfolio-run-context-actions,
.model-portfolio-run-timeline-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.model-portfolio-run-context-actions {
    justify-content: flex-end;
}

.model-portfolio-run-timeline {
    display: grid;
    gap: 10px;
    margin: 0 0 1rem;
}

.model-portfolio-run-timeline-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.model-portfolio-section-anchor {
    display: block;
    position: relative;
    top: -84px;
    visibility: hidden;
}

.model-portfolio-catalog-head {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.95fr);
    gap: 16px;
    align-items: end;
}

.model-portfolio-section-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 8px;
    color: rgba(184, 222, 255, 0.86);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.model-portfolio-catalog-head h2 {
    margin: 0;
    color: #f8fafc;
    font-size: clamp(1.3rem, 2.2vw, 1.72rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.model-portfolio-catalog-head p {
    margin: 0;
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.94rem;
    line-height: 1.55;
}

.model-portfolio-action-rail {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    margin: 0;
}

.model-portfolio-action-card {
    position: relative;
    overflow: hidden;
    display: grid;
    align-content: start;
    gap: 12px;
    min-height: 100%;
    padding: 20px 22px;
    border: 1px solid rgba(104, 130, 166, 0.18);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
        linear-gradient(165deg, rgba(13, 22, 38, 0.92), rgba(9, 15, 28, 0.86));
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.18);
}

.model-portfolio-action-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
}

.model-portfolio-action-card::after {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.9), rgba(244, 114, 182, 0.86));
    opacity: 0.95;
}

.model-portfolio-action-card.is-primary,
.model-portfolio-action-card.tone-alpha,
.model-portfolio-action-card.tone-return,
.model-portfolio-action-card.tone-low-risk {
    border-color: rgba(56, 189, 248, 0.22);
}

.model-portfolio-action-card.is-primary,
.model-portfolio-action-card.tone-return {
    background:
        radial-gradient(circle at top right, rgba(52, 211, 153, 0.12) 0%, rgba(52, 211, 153, 0) 34%),
        linear-gradient(165deg, rgba(13, 24, 42, 0.95), rgba(9, 15, 28, 0.88));
}

.model-portfolio-action-card.tone-alpha {
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.13) 0%, rgba(56, 189, 248, 0) 36%),
        linear-gradient(165deg, rgba(12, 22, 39, 0.94), rgba(9, 15, 28, 0.86));
}

.model-portfolio-action-card.tone-low-risk {
    background:
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0) 34%),
        linear-gradient(165deg, rgba(11, 21, 36, 0.94), rgba(9, 15, 28, 0.86));
}

.model-portfolio-action-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.model-portfolio-action-eyebrow {
    color: rgba(184, 222, 255, 0.78);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.model-portfolio-action-card h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.22rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.model-portfolio-action-tag,
.model-portfolio-action-pill,
.model-portfolio-catalog-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0.35rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(241, 245, 249, 0.9);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
}

.model-portfolio-action-tag.is-today {
    border-color: rgba(52, 211, 153, 0.25);
    background: rgba(6, 95, 70, 0.22);
    color: #dcfce7;
}

.model-portfolio-action-tag.is-recent {
    border-color: rgba(56, 189, 248, 0.24);
    background: rgba(8, 47, 73, 0.28);
    color: #d9f6ff;
}

.model-portfolio-action-tag.is-earlier {
    border-color: rgba(251, 191, 36, 0.22);
    background: rgba(120, 83, 12, 0.16);
    color: #fff1bf;
}

.model-portfolio-action-metric {
    display: grid;
    gap: 5px;
    padding: 14px 15px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(8, 14, 26, 0.44);
}

.model-portfolio-action-metric span {
    color: rgba(191, 219, 254, 0.76);
    font-size: 0.71rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.model-portfolio-action-metric strong {
    color: #f8fafc;
    font-size: clamp(1.7rem, 2vw, 2.3rem);
    line-height: 0.96;
    letter-spacing: -0.05em;
}

.model-portfolio-action-card.tone-return .model-portfolio-action-metric strong {
    color: #34d399;
}

.model-portfolio-action-card.tone-alpha .model-portfolio-action-metric strong {
    color: #67d8ff;
}

.model-portfolio-action-meta,
.model-portfolio-catalog-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.model-portfolio-action-pill.is-benchmark,
.model-portfolio-catalog-badge:last-child {
    border-color: rgba(244, 114, 182, 0.18);
    background: rgba(244, 114, 182, 0.08);
    color: rgba(253, 242, 248, 0.94);
}

.model-portfolio-action-card p {
    margin: 0;
    color: rgba(226, 232, 240, 0.76);
    font-size: 0.92rem;
    line-height: 1.55;
}

.model-portfolio-action-card .model-portfolio-card-actions {
    margin-top: auto;
    padding-top: 8px;
}

.model-portfolio-action-card .btn-primary,
.model-portfolio-action-card .btn-secondary {
    width: fit-content;
}

.model-portfolio-catalog-head {
    margin: 0 0 1rem;
    padding: 18px 20px;
    border: 1px solid rgba(90, 116, 148, 0.18);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
        linear-gradient(165deg, rgba(10, 18, 31, 0.88), rgba(8, 14, 25, 0.84));
    box-shadow: 0 18px 38px rgba(2, 8, 23, 0.14);
}

.model-portfolio-catalog-badge {
    border-color: rgba(56, 189, 248, 0.18);
    background: rgba(56, 189, 248, 0.08);
    color: #d9f6ff;
}

.model-portfolio-follow-suggestions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 1rem;
}

.model-portfolio-follow-suggestion {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.model-portfolio-follow-suggestion strong {
    display: block;
    margin-bottom: 6px;
    color: #f8fafc;
    font-size: 0.95rem;
}

.model-portfolio-follow-suggestion p {
    margin: 0;
    color: rgba(226, 232, 240, 0.76);
    font-size: 0.88rem;
    line-height: 1.5;
}

.model-portfolio-follow-suggestion.tone-risk {
    border-color: rgba(248, 113, 113, 0.24);
    background: rgba(127, 29, 29, 0.12);
}

.model-portfolio-follow-suggestion.tone-watch {
    border-color: rgba(251, 191, 36, 0.24);
    background: rgba(120, 83, 12, 0.12);
}

.model-portfolio-alert-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 1rem;
}

.model-portfolio-alert {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.model-portfolio-alert strong {
    display: block;
    margin-bottom: 6px;
    color: #f8fafc;
    font-size: 0.94rem;
}

.model-portfolio-alert p {
    margin: 0;
    color: rgba(226, 232, 240, 0.76);
    font-size: 0.86rem;
    line-height: 1.48;
}

.model-portfolio-alert.tone-risk {
    border-color: rgba(248, 113, 113, 0.24);
    background: rgba(127, 29, 29, 0.12);
}

.model-portfolio-alert.tone-watch {
    border-color: rgba(251, 191, 36, 0.24);
    background: rgba(120, 83, 12, 0.12);
}

.model-portfolio-allocation-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.model-portfolio-activity-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.model-portfolio-activity-item {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
    display: grid;
    gap: 8px;
}

.model-portfolio-activity-item strong {
    color: #f8fafc;
    font-size: 0.98rem;
}

.model-portfolio-activity-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.model-portfolio-filter-row {
    display: grid;
    gap: 10px;
    margin: 0 0 14px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.model-portfolio-filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.model-portfolio-filter-label {
    color: rgba(226, 232, 240, 0.68);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.model-portfolio-filter-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.5rem 0.92rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(226, 232, 240, 0.82);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 700;
    transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
}

.model-portfolio-filter-pill:hover {
    border-color: rgba(56, 189, 248, 0.22);
    color: #f8fdff;
    transform: translateY(-1px);
}

.model-portfolio-filter-pill.is-active {
    border-color: rgba(56, 189, 248, 0.34);
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.16), rgba(56, 189, 248, 0.08));
    color: #d9f6ff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.model-portfolio-timeline {
    display: grid;
    gap: 12px;
}

.model-portfolio-timeline-item {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.03);
}

.model-portfolio-timeline-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.model-portfolio-bar-list {
    display: grid;
    gap: 12px;
    padding-top: 2px;
}

.model-portfolio-bar-row {
    display: grid;
    gap: 6px;
}

.model-portfolio-bar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: rgba(241, 245, 249, 0.86);
    font-size: 0.88rem;
}

.model-portfolio-bar-head strong {
    color: #f8fafc;
    font-size: 0.84rem;
}

.model-portfolio-bar-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    overflow: hidden;
}

.model-portfolio-bar-track span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.88), rgba(14, 165, 233, 0.96));
}

.model-portfolio-follow-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 1rem;
}

.model-portfolio-follow-grid-tight {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr) minmax(0, 0.9fr);
    margin-bottom: 0;
}

.model-portfolio-follow-grid-streamlined {
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
    align-items: start;
    margin-top: 0.1rem;
}

.model-portfolio-activity-strip-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.model-portfolio-activity-strip-compact .model-portfolio-activity-item {
    padding: 12px 13px;
    gap: 7px;
}

.model-portfolio-side-stack {
    display: grid;
    gap: 16px;
}

.model-portfolio-change-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.model-portfolio-change-card {
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(56, 189, 248, 0.18);
    background: rgba(255, 255, 255, 0.03);
    display: grid;
    gap: 10px;
}

.model-portfolio-change-card.is-removed {
    border-color: rgba(248, 113, 113, 0.18);
}

.model-portfolio-change-title {
    color: #f8fafc;
    font-size: 0.86rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.model-portfolio-change-list {
    display: grid;
    gap: 8px;
}

.model-portfolio-change-item {
    display: grid;
    gap: 2px;
}

.model-portfolio-change-item .ticker-with-logo {
    font-size: 0.94rem;
}

.model-portfolio-change-item .model-portfolio-muted {
    font-size: 0.8rem;
}

.model-portfolio-snapshot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.model-portfolio-snapshot-grid-compact {
    margin-top: -0.15rem;
}

.model-portfolio-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.85rem;
    margin: 0 0 1.15rem;
}

.model-portfolio-status-card {
    border: 1px solid rgba(92, 116, 147, 0.26);
    background: linear-gradient(180deg, rgba(10, 18, 33, 0.82), rgba(8, 14, 26, 0.72));
    border-radius: 16px;
    padding: 0.95rem 1rem;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
}

.model-portfolio-status-card label {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8ea7c4;
    margin-bottom: 0.45rem;
}

.model-portfolio-status-card strong {
    display: block;
    font-size: 1.2rem;
    line-height: 1.2;
    color: #f4f8fd;
    margin-bottom: 0.28rem;
}

.model-portfolio-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px;
    border: 1px solid rgba(116, 142, 178, 0.18);
    border-radius: 20px;
    background: linear-gradient(165deg, rgba(13, 22, 38, 0.9), rgba(9, 15, 28, 0.82));
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.16);
    position: relative;
    overflow: hidden;
}

.model-portfolio-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0));
}

.model-portfolio-panel-accent {
    border-color: rgba(56, 189, 248, 0.28);
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.12) 0%, rgba(56, 189, 248, 0) 36%),
        linear-gradient(165deg, rgba(13, 24, 42, 0.94), rgba(9, 15, 28, 0.88));
}

.model-portfolio-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.model-portfolio-panel-head h2 {
    margin: 0;
    font-size: 1.02rem;
}

.model-portfolio-panel-head p,
.model-portfolio-panel-note {
    margin: 0;
    color: rgba(226, 232, 240, 0.7);
    font-size: 0.88rem;
    line-height: 1.5;
}

.model-portfolio-panel-note {
    display: grid;
    gap: 6px;
}

.model-portfolio-guide-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
}

.model-portfolio-guide-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px 13px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255, 255, 255, 0.03);
}

.model-portfolio-guide-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.24);
    background: rgba(56, 189, 248, 0.12);
    color: #d9f6ff;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.model-portfolio-guide-item strong {
    display: block;
    margin-bottom: 4px;
    color: #f8fafc;
    font-size: 0.96rem;
}

.model-portfolio-guide-item p {
    margin: 0;
    color: rgba(226, 232, 240, 0.74);
    font-size: 0.88rem;
    line-height: 1.5;
}

.model-portfolio-hero-side .model-portfolio-panel {
    overflow: hidden;
}

.model-portfolio-hero-side .model-portfolio-panel::before {
    content: "";
    position: absolute;
    inset: -12% -10% auto auto;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.14), rgba(56, 189, 248, 0));
    filter: blur(12px);
    opacity: 0.9;
    animation: modelPortfolioGuideHalo 8.5s ease-in-out infinite;
    pointer-events: none;
}

.model-portfolio-hero-side .model-portfolio-panel::after {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: auto, 70px 70px, 70px 70px;
    animation: modelPortfolioGuideGrid 11s linear infinite;
}

@keyframes modelPortfolioHeroGlow {
    0%,
    100% {
        opacity: 0.58;
        transform: translate3d(0, 0, 0) scale(0.9);
    }
    50% {
        opacity: 1;
        transform: translate3d(-8px, -10px, 0) scale(1.06);
    }
}

@keyframes modelPortfolioHeroSweep {
    0%,
    100% {
        opacity: 0;
        transform: rotate(18deg) translate3d(-18%, 0, 0);
    }
    18% {
        opacity: 0;
    }
    45% {
        opacity: 0.82;
    }
    62% {
        opacity: 0;
        transform: rotate(18deg) translate3d(160%, 0, 0);
    }
}

@keyframes modelPortfolioGuideHalo {
    0%,
    100% {
        opacity: 0.48;
        transform: translate3d(0, 0, 0) scale(0.92);
    }
    50% {
        opacity: 0.9;
        transform: translate3d(-10px, 8px, 0) scale(1.05);
    }
}

@keyframes modelPortfolioGuideGrid {
    0% {
        background-position: 0 0, 0 0, 0 0;
    }
    100% {
        background-position: 0 0, 70px 0, 0 70px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .model-portfolio-page .model-portfolio-hero-main .top-stats-primary .top-stat-card.top-stat-card-insight::before,
    .model-portfolio-page .model-portfolio-hero-main .top-stats-primary .top-stat-card.top-stat-card-insight::after,
    .model-portfolio-hero-side .model-portfolio-panel::before,
    .model-portfolio-hero-side .model-portfolio-panel::after {
        animation: none !important;
    }
}

.model-portfolio-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.model-portfolio-kpi {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.model-portfolio-kpi label {
    display: block;
    margin-bottom: 4px;
    color: rgba(226, 232, 240, 0.58);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.model-portfolio-kpi strong {
    color: #f8fafc;
    font-size: 1.08rem;
}

.model-portfolio-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.model-portfolio-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.34rem 0.62rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(241, 245, 249, 0.88);
    font-size: 0.77rem;
    font-weight: 700;
}

.model-portfolio-chip-neutral {
    border-color: rgba(56, 189, 248, 0.25);
    color: #d6f4ff;
}

.model-portfolio-chip-risk {
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(127, 29, 29, 0.18);
    color: #ffe5e5;
}

.model-portfolio-chip-watch {
    border-color: rgba(251, 191, 36, 0.32);
    background: rgba(120, 83, 12, 0.18);
    color: #fff4d6;
}

.model-portfolio-chip-soft {
    color: rgba(226, 232, 240, 0.82);
}

.model-portfolio-signal-list {
    display: grid;
    gap: 10px;
}

.model-portfolio-signal-item {
    padding: 12px 13px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.03);
    display: grid;
    gap: 8px;
}

.model-portfolio-signal-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.model-portfolio-signal-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.model-portfolio-signal-identity > div {
    min-width: 0;
}

.model-portfolio-signal-identity strong,
.model-portfolio-signal-identity .model-portfolio-muted {
    display: block;
}

.model-portfolio-signal-top strong {
    color: #f8fafc;
    font-size: 1rem;
}

.model-portfolio-signal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.82rem;
}

.model-portfolio-signal-note {
    color: rgba(241, 245, 249, 0.82);
    font-size: 0.84rem;
    line-height: 1.42;
}

.model-portfolio-table-flags {
    margin-top: 8px;
}

.model-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 22px;
    align-items: start;
}

.model-portfolio-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
        linear-gradient(165deg, rgba(11, 19, 34, 0.96), rgba(9, 15, 28, 0.92));
    border: 1px solid rgba(104, 130, 166, 0.18);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
    box-shadow: 0 20px 38px rgba(2, 8, 23, 0.16);
    container-type: inline-size;
    container-name: model-portfolio-card;
}

.model-portfolio-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--model-cyan), var(--model-rose));
    opacity: 0.92;
}

.model-portfolio-card::after {
    content: "";
    position: absolute;
    inset: auto -14% -26% auto;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.1), rgba(56, 189, 248, 0));
    filter: blur(16px);
    opacity: 0.85;
    pointer-events: none;
}

.model-portfolio-card.is-risk-low::before {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.92), rgba(56, 189, 248, 0.86));
}

.model-portfolio-card.is-risk-high::before {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.92), rgba(244, 114, 182, 0.86));
}

.model-portfolio-card:hover {
    transform: translateY(-4px);
    border-color: rgba(56, 189, 248, 0.26);
    box-shadow: 0 24px 42px rgba(0, 0, 0, 0.22);
}

.model-portfolio-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.11);
}

.model-portfolio-card-head-main {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.model-portfolio-card-status-stack {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    max-width: 42%;
}

.model-portfolio-card-head h2 {
    margin: 0;
    font-size: 1.26rem;
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.model-portfolio-card-head a {
    color: #f8fafc;
    text-decoration: none;
}

.model-portfolio-card-head a:hover {
    color: #d6f4ff;
}

.model-portfolio-card-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
}

.model-portfolio-card-text,
.model-portfolio-card-meta,
.model-portfolio-muted {
    color: rgba(226, 232, 240, 0.7);
    font-size: 0.92rem;
    line-height: 1.45;
}

.model-portfolio-card-text,
.model-portfolio-card-meta {
    margin: 0;
}

.model-portfolio-card-kicker {
    color: rgba(184, 222, 255, 0.78);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.model-portfolio-card-benchmark {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 0.34rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(168, 179, 193, 0.28);
    background: rgba(168, 179, 193, 0.1);
    color: rgba(252, 231, 243, 0.92);
}

.model-portfolio-card-benchmark-label {
    color: var(--mp-chart-benchmark);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.model-portfolio-card-benchmark strong {
    color: #fdf2f8;
    font-size: 0.88rem;
    letter-spacing: -0.02em;
}

.model-portfolio-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.model-portfolio-card .holding-fact-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.4rem 0.74rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(241, 245, 249, 0.92);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
}

.model-portfolio-card-body-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.model-portfolio-card-story,
.model-portfolio-card-preview {
    height: 100%;
    align-content: start;
    padding: 14px 15px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255, 255, 255, 0.035);
}

.model-portfolio-card-story {
    display: grid;
    gap: 8px;
}

.model-portfolio-card-story-label,
.model-portfolio-card-preview label {
    color: rgba(191, 219, 254, 0.72);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.model-portfolio-card-fit {
    margin: 0;
    color: rgba(232, 240, 250, 0.9);
    font-size: 0.92rem;
    line-height: 1.55;
}

.model-portfolio-freshness-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0.26rem 0.68rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.035);
    color: rgba(241, 245, 249, 0.88);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.model-portfolio-freshness-badge.is-today {
    border-color: rgba(52, 211, 153, 0.25);
    background: rgba(6, 95, 70, 0.22);
    color: #dcfce7;
}

.model-portfolio-freshness-badge.is-recent {
    border-color: rgba(56, 189, 248, 0.24);
    background: rgba(8, 47, 73, 0.28);
    color: #d9f6ff;
}

.model-portfolio-freshness-badge.is-earlier {
    border-color: rgba(251, 191, 36, 0.22);
    background: rgba(120, 83, 12, 0.16);
    color: #fff1bf;
}

.model-portfolio-card-preview {
    display: grid;
    gap: 10px;
}

.model-portfolio-ticker-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.model-portfolio-ticker-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.4rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.16);
    background: rgba(56, 189, 248, 0.08);
    color: #e0f2fe;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.model-portfolio-card-performance {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(170px, 0.9fr);
    gap: 12px;
    align-items: stretch;
    min-width: 0;
}

.model-portfolio-card-performance-main {
    padding: 18px 18px;
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 58%),
        linear-gradient(160deg, rgba(20, 34, 58, 0.98), rgba(9, 17, 30, 0.92));
    border: 1px solid rgba(56, 189, 248, 0.18);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.model-portfolio-card-performance-main label {
    color: rgba(191, 219, 254, 0.72);
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.model-portfolio-card-performance-main strong {
    display: block;
    width: 100%;
    max-width: 100%;
    font-size: clamp(1.45rem, 8cqw, 2.45rem);
    line-height: 0.95;
    letter-spacing: -0.05em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.model-portfolio-card .metric-buy {
    color: #36d399;
}

.model-portfolio-card .metric-sell {
    color: #fb7185;
}

.model-portfolio-card .metric-hold {
    color: #f8fafc;
}

.model-portfolio-card-performance-note {
    margin: 0;
    color: rgba(226, 232, 240, 0.74);
    font-size: 0.9rem;
    line-height: 1.45;
}

.model-portfolio-card-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    min-width: 0;
}

.model-portfolio-card-summary > div {
    padding: 13px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.036);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.model-portfolio-card-summary label {
    display: block;
    margin-bottom: 4px;
    color: rgba(226, 232, 240, 0.58);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.model-portfolio-card-summary strong {
    color: #f8fafc;
    font-size: 1.04rem;
}

@container model-portfolio-card (max-width: 300px) {
    .model-portfolio-card-performance {
        grid-template-columns: 1fr;
    }

    .model-portfolio-card-performance-main strong {
        font-size: clamp(1.85rem, 10cqw, 2.45rem);
    }

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

.model-portfolio-mini-chart-panel {
    padding: 14px 14px 12px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(8, 15, 28, 0.92), rgba(8, 15, 28, 0.76));
    border: 1px solid rgba(51, 89, 127, 0.22);
    overflow: hidden;
}

.model-portfolio-mini-chart {
    min-height: 132px;
}

.model-portfolio-mini-chart-svg {
    display: block;
    width: 100%;
    height: auto;
}

.model-portfolio-mini-chart-empty {
    min-height: 132px;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(12, 22, 40, 0.8), rgba(12, 22, 40, 0.44)),
        repeating-linear-gradient(180deg, transparent, transparent 22px, rgba(148, 163, 184, 0.05) 22px, rgba(148, 163, 184, 0.05) 23px);
}

.model-portfolio-mini-chart-legend {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: rgba(226, 232, 240, 0.7);
    font-size: 0.78rem;
}

.model-portfolio-mini-chart-key {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.model-portfolio-mini-chart-meta {
    margin-top: 8px;
    color: rgba(226, 232, 240, 0.58);
    font-size: 0.74rem;
    line-height: 1.45;
}

.model-portfolio-mini-chart-swatch {
    width: 18px;
    height: 3px;
    border-radius: 999px;
    background: var(--mp-chart-primary);
}

.model-portfolio-mini-chart-swatch.is-benchmark {
    background: var(--mp-chart-benchmark);
    box-shadow: none;
}

.model-portfolio-card-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.model-portfolio-card-stats > div {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.model-portfolio-card-stats label {
    display: block;
    margin-bottom: 4px;
    color: rgba(226, 232, 240, 0.58);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.model-portfolio-card-stats strong {
    color: #f8fafc;
    font-size: 1rem;
}

.model-portfolio-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.model-portfolio-card-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.model-portfolio-card-footer .model-portfolio-card-actions {
    width: 100%;
    justify-content: flex-end;
}

.model-portfolio-card-footer .btn-primary {
    min-width: 172px;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0.88rem 1.25rem;
    border-radius: 14px;
    border: 1px solid rgba(110, 155, 210, 0.24);
    background:
        linear-gradient(180deg, rgba(23, 37, 63, 0.96), rgba(12, 22, 40, 0.98)),
        radial-gradient(circle at top, rgba(56, 189, 248, 0.1), transparent 58%);
    color: #eff6ff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 14px 26px rgba(2, 8, 23, 0.22);
    letter-spacing: -0.01em;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.model-portfolio-card-footer .btn-primary::after {
    content: "→";
    font-size: 0.98rem;
    line-height: 1;
    color: rgba(191, 219, 254, 0.92);
    transform: translateX(0);
    transition: transform 160ms ease, color 160ms ease;
}

.model-portfolio-card-footer .btn-primary:hover {
    border-color: rgba(103, 216, 255, 0.34);
    background:
        linear-gradient(180deg, rgba(27, 44, 74, 0.98), rgba(13, 24, 43, 1)),
        radial-gradient(circle at top, rgba(56, 189, 248, 0.14), transparent 58%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 16px 30px rgba(2, 8, 23, 0.28);
    transform: translateY(-1px);
    opacity: 1;
}

.model-portfolio-card-footer .btn-primary:hover::after {
    color: #d9f6ff;
    transform: translateX(2px);
}

.model-portfolio-card .is-benchmark-chip {
    border-color: rgba(168, 179, 193, 0.28);
    background: rgba(168, 179, 193, 0.1);
    color: #e2e8f0;
}

.model-portfolio-holdings-table td.holding-note-cell,
.model-portfolio-ledger-table td.ledger-note-cell {
    min-width: 220px;
}

.model-portfolio-accounting-statement-table td,
.model-portfolio-accounting-statement-table th {
    font-variant-numeric: tabular-nums;
}

.model-portfolio-accounting-statement-table td.amount-positive {
    color: #34d399;
}

.model-portfolio-accounting-statement-table td.amount-negative {
    color: #f87171;
}

.model-portfolio-accounting-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin-top: 2px;
    padding: 8px 11px;
    border-radius: 999px;
    font-size: 0.83rem;
    font-weight: 700;
    line-height: 1.35;
}

.model-portfolio-accounting-status.is-warn {
    color: #fde68a;
    border: 1px solid rgba(251, 191, 36, 0.28);
    background: rgba(251, 191, 36, 0.11);
}

.model-portfolio-panel-actions {
    margin-top: auto;
    justify-content: space-between;
}

.model-portfolio-accounting-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin: 0;
}

.model-portfolio-definition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 18px;
    color: rgba(226, 232, 240, 0.82);
    font-size: 0.92rem;
    line-height: 1.45;
}

.model-portfolio-definition-grid strong {
    color: rgba(248, 250, 252, 0.92);
}

.model-portfolio-performance-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.model-portfolio-performance-item {
    display: block;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.52);
    color: inherit;
    text-decoration: none;
    transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.model-portfolio-performance-item:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.24);
    background: rgba(15, 23, 42, 0.66);
}

.model-portfolio-performance-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.model-portfolio-performance-top strong {
    color: #f8fafc;
}

.model-portfolio-performance-meta,
.model-portfolio-note-cell {
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.88rem;
    line-height: 1.4;
}

.model-portfolio-inline-meta {
    margin-top: 4px;
    color: rgba(148, 163, 184, 0.88);
    font-size: 0.8rem;
    line-height: 1.35;
}

.model-portfolio-holdings-summary {
    margin: 0 0 12px;
}

.model-portfolio-chart-shell {
    display: grid;
    gap: 10px;
}

.model-portfolio-performance-summary {
    margin: 0 0 14px;
}

.model-portfolio-chart {
    display: block;
    width: 100%;
    height: auto;
    color: var(--mp-chart-primary);
    overflow: visible;
}

.model-portfolio-chart-axis {
    stroke: var(--mp-chart-axis);
    stroke-width: 1;
}

.model-portfolio-chart-benchmark {
    stroke: var(--mp-chart-benchmark);
}

.model-portfolio-chart-benchmark-dot {
    fill: var(--mp-chart-benchmark);
}

.model-portfolio-chart-dot {
    fill: var(--mp-chart-primary);
    stroke: var(--mp-chart-point-stroke);
    stroke-width: 1.2;
}

.model-portfolio-chart-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.88rem;
}

.model-portfolio-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 12px;
}

.model-portfolio-chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    border: 1px solid rgba(116, 142, 178, 0.18);
    border-radius: 999px;
    background: rgba(10, 18, 33, 0.56);
    color: rgba(226, 232, 240, 0.92);
    font-size: 0.84rem;
    line-height: 1;
}

.model-portfolio-chart-legend-line {
    display: inline-block;
    width: 22px;
    height: 0;
    border-top: 3px solid var(--mp-chart-primary);
    border-radius: 999px;
}

.model-portfolio-chart-legend-line.is-benchmark {
    border-top-color: var(--mp-chart-benchmark);
}

.model-portfolio-disclosure {
    margin: 0 0 1rem;
    border: 1px solid rgba(116, 142, 178, 0.16);
    border-radius: 18px;
    background: rgba(10, 18, 33, 0.72);
    overflow: hidden;
}

.model-portfolio-disclosure summary {
    list-style: none;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    cursor: pointer;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
}

.model-portfolio-disclosure summary::-webkit-details-marker {
    display: none;
}

.model-portfolio-disclosure summary::after {
    content: '+';
    color: rgba(226, 232, 240, 0.72);
    font-size: 1.1rem;
    line-height: 1;
}

.model-portfolio-disclosure[open] summary::after {
    content: '-';
}

.model-portfolio-disclosure[open] summary {
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.model-portfolio-disclosure summary span:first-child {
    color: #f8fafc;
    font-weight: 700;
}

.model-portfolio-disclosure-body {
    padding: 0 18px 18px;
}

.model-portfolio-disclosure-group {
    display: grid;
    gap: 12px;
    margin: 0 0 1rem;
}

.model-portfolio-overview-history-group {
    margin-top: -2px;
}

.model-portfolio-disclosure-group .model-portfolio-disclosure {
    margin: 0;
}

.model-portfolio-primary-disclosure {
    margin: 0 0 1rem;
}

.model-portfolio-page .portfolio-holdings-shell {
    position: relative;
    display: grid;
    gap: 16px;
    padding: 20px 20px 18px 22px;
    border: 1px solid rgba(116, 142, 178, 0.16);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(11, 18, 31, 0.86), rgba(9, 14, 25, 0.78));
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.15);
}

.model-portfolio-page .portfolio-holdings-shell::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 22px 0 0 22px;
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.74), rgba(56, 189, 248, 0));
}

.model-portfolio-page .portfolio-holdings-header {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 0 0 14px 2px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.model-portfolio-page .portfolio-holdings-header > div {
    min-width: 0;
}

.model-portfolio-page .portfolio-holdings-header .text-link {
    flex: 0 0 auto;
    margin-top: 2px;
}

.model-portfolio-page .portfolio-holdings-meta {
    margin-top: 4px;
    color: rgba(226, 232, 240, 0.72);
    line-height: 1.45;
}

.model-portfolio-page .market-table td {
    vertical-align: top;
}

.model-portfolio-page .market-table td.text-right {
    text-align: right;
}

.model-portfolio-dashboard-performance .model-portfolio-kpi-grid {
    margin-top: 2px;
}

.model-portfolio-dashboard-performance .model-portfolio-chart-shell {
    gap: 14px;
}

.model-portfolio-chart-meta {
    padding-top: 2px;
}

.model-portfolio-dashboard-card {
    align-content: start;
}

.model-portfolio-dashboard-card .portfolio-holdings-header {
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .model-portfolio-page .directory-header {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .model-portfolio-page .directory-header-meta {
        justify-content: flex-start;
    }

    .model-portfolio-quick-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .model-portfolio-quick-nav::-webkit-scrollbar {
        display: none;
    }

    .model-portfolio-quick-nav .model-portfolio-filter-pill {
        flex: 0 0 auto;
    }

    .model-portfolio-overview-grid {
        grid-template-columns: 1fr;
    }

    .model-portfolio-tab-hero {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .model-portfolio-tab-hero-facts-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .model-portfolio-page .portfolio-holdings-shell {
        padding: 18px 18px 16px 20px;
    }

    .model-portfolio-quick-nav {
        top: 72px;
        padding: 0.78rem 0.82rem;
    }

    .model-portfolio-overview-note-list {
        grid-template-columns: 1fr;
    }

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

    .model-portfolio-overview-stat-grid,
    .model-portfolio-kpi-grid {
        grid-template-columns: 1fr;
    }

    .model-portfolio-accounting-grid {
        grid-template-columns: 1fr;
    }

    .model-portfolio-page .portfolio-holdings-header {
        gap: 10px;
    }

    .model-portfolio-page .market-table tr {
        border-radius: 18px;
        background: linear-gradient(180deg, rgba(15, 23, 42, 0.66), rgba(10, 18, 33, 0.86));
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
    }

    .model-portfolio-page .market-table td.ticker-cell {
        grid-template-columns: 1fr !important;
        gap: 0.35rem !important;
    }

    .model-portfolio-page .market-table td.ticker-cell .ticker-with-logo {
        align-items: center;
        gap: 0.55rem;
    }

    .model-portfolio-page .market-table td.ticker-cell .model-portfolio-muted {
        font-size: 0.85rem;
    }

    .model-portfolio-page .market-table td.text-right {
        grid-template-columns: minmax(88px, 98px) minmax(0, 1fr) !important;
    }

    .model-portfolio-card-actions {
        width: 100%;
    }

    .model-portfolio-card-actions .btn-secondary,
    .model-portfolio-card-actions .btn-primary {
        flex: 1 1 auto;
        justify-content: center;
    }

    .model-portfolio-follow-suggestions {
        grid-template-columns: 1fr;
    }

    .model-portfolio-alert-rail,
    .model-portfolio-allocation-grid {
        grid-template-columns: 1fr;
    }

    .model-portfolio-follow-grid {
        grid-template-columns: 1fr;
    }

    .model-portfolio-follow-grid-tight {
        grid-template-columns: 1fr;
    }

    .model-portfolio-follow-grid-streamlined {
        grid-template-columns: 1fr;
    }

    .model-portfolio-change-grid {
        grid-template-columns: 1fr;
    }

    .model-portfolio-activity-strip-compact {
        grid-template-columns: 1fr;
    }

    .model-portfolio-action-rail {
        grid-template-columns: 1fr;
    }

    .model-portfolio-hero-grid,
    .model-portfolio-snapshot-grid {
        grid-template-columns: 1fr;
    }

    .model-portfolio-catalog-head,
    .model-portfolio-card-body-grid {
        grid-template-columns: 1fr;
    }

    .model-portfolio-hero-side {
        position: static;
    }

    .model-portfolio-status-grid {
        grid-template-columns: 1fr;
    }

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

    .model-portfolio-card-performance {
        grid-template-columns: 1fr;
    }

    .model-portfolio-page .model-portfolio-hero-main .top-stats-primary .top-stat-card {
        min-height: 140px;
        padding: 1rem 0.95rem;
    }

    .model-portfolio-page .model-portfolio-hero-main .top-stats-primary .top-stat-card strong {
        font-size: clamp(1.95rem, 8vw, 2.6rem);
    }

    .model-portfolio-page .model-portfolio-hero-main .top-stats-primary .top-stat-card.top-stat-card-insight {
        min-height: 156px;
    }

    .model-portfolio-page .top-stat-card-insight strong.is-text {
        font-size: 1.02rem;
    }

    .model-portfolio-filter-row {
        padding: 12px 13px;
    }

    .model-portfolio-catalog-head {
        padding: 16px;
    }

    .model-portfolio-guide-item {
        padding: 11px 12px;
    }

    .model-portfolio-card-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .model-portfolio-card-footer .model-portfolio-card-actions {
        width: 100%;
        justify-content: space-between;
    }

    .model-portfolio-card-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .model-portfolio-card-status-stack {
        max-width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .model-portfolio-accounting-statement-table .accounting-detail-col {
        display: none !important;
    }

    .model-portfolio-accounting-status {
        width: 100%;
        border-radius: 14px;
    }
}

/* === Portfolio page content structure === */

/* Stats block — wraps toggle + stat cards as one unit */
.portfolio-page .portfolio-stats-block {
    margin-bottom: 0.82rem;
}
.portfolio-page .portfolio-stats-block .top-stats {
    margin-bottom: 0;
}

/* Toggle right-aligned above the stat cards */
.portfolio-page .portfolio-stats-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.52rem;
}
.portfolio-page .portfolio-stats-controls .totals-mode-toggle {
    margin: 0;
}

/* On mobile the toggle fills the full width */
@media (max-width: 900px) {
    .portfolio-page .portfolio-stats-controls {
        justify-content: stretch;
    }
    .portfolio-page .portfolio-stats-controls .totals-mode-toggle {
        width: 100%;
        justify-content: space-between;
    }
}

/* Section labels — visible on desktop as subtle uppercase dividers */
.portfolio-page .portfolio-mobile-summary {
    display: block;
    list-style: none;
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 0.55rem 0 0.38rem;
    border-top: 1px solid rgba(51, 89, 127, 0.2);
    margin-bottom: 0.42rem;
    pointer-events: none;
    cursor: default;
}
.portfolio-page .portfolio-mobile-summary::-webkit-details-marker {
    display: none;
}

/* Mobile — restore full interactive toggle style */
@media (max-width: 900px) {
    .portfolio-page .portfolio-mobile-summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.78rem 0.82rem;
        font-size: 0.82rem;
        font-weight: 800;
        letter-spacing: -0.01em;
        text-transform: none;
        border-top: none;
        margin-bottom: 0;
        color: var(--text-primary);
        pointer-events: auto;
        cursor: pointer;
    }
}

/* === Portfolio page design refresh === */

/* Toolbar card — cyan top accent */
.portfolio-page .portfolio-toolbar {
    border-top: 2px solid rgba(57, 194, 255, 0.22) !important;
}

/* Portfolio title — more prominent */
.portfolio-page .portfolio-title {
    font-size: 1.18rem;
    letter-spacing: -0.03em;
}


/* Primary stat cards — cyan top accent */
.portfolio-page .top-stats-primary .eval-panel,
.portfolio-page .top-stats-primary .value-panel,
.public-portfolio-page .top-stats-primary .eval-panel,
.public-portfolio-page .top-stats-primary .value-panel {
    border-top: 2px solid rgba(57, 194, 255, 0.28) !important;
}

/* Secondary stat cards — quieter top accent */
.portfolio-page .top-stats-secondary .value-panel,
.public-portfolio-page .top-stats-secondary .value-panel {
    border-top: 2px solid rgba(57, 194, 255, 0.13) !important;
}

/* Holdings container — cyan top accent */
.portfolio-page .holdings-container {
    border-top: 2px solid rgba(57, 194, 255, 0.22) !important;
}

/* Holdings table row hover — brand cyan tint */
.portfolio-page .holdings-table tr.holding-row:hover td {
    background: rgba(57, 194, 255, 0.04);
}

/* Totals mode toggle — brand cyan active button */
.totals-mode-btn.is-active {
    background: rgba(57, 194, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(57, 194, 255, 0.25);
    color: #e8f8ff;
}

/* Priority banner — colored left accent per tone */
.portfolio-priority-banner {
    border-left: 3px solid rgba(57, 194, 255, 0.3);
}
.portfolio-priority-banner.tone-good { border-left-color: rgba(16, 185, 129, 0.55); }
.portfolio-priority-banner.tone-warn { border-left-color: rgba(245, 158, 11, 0.55); }
.portfolio-priority-banner.tone-risk { border-left-color: rgba(239, 68, 68, 0.55); }

/* === Profile page design refresh === */

/* Gradient text on profile page h1 */
.profile-page .directory-header h1 {
    background: linear-gradient(125deg, var(--text-primary) 25%, #8eccf5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Cyan top accent on section cards */
.profile-page .profile-section {
    border-top: 2px solid rgba(57, 194, 255, 0.28) !important;
}

/* Delete section retains red top accent */
.profile-page .delete-section {
    border-top: 2px solid rgba(239, 68, 68, 0.45) !important;
}

.profile-page--ai .profile-container {
    max-width: 1160px;
}

/* Status chip (first) gets cyan tint */
.profile-summary-chip:first-child {
    border-color: rgba(57, 194, 255, 0.38);
    background: rgba(57, 194, 255, 0.07);
    color: #a8dff7;
}

.profile-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.profile-dashboard-card {
    min-width: 0;
    padding: 0.95rem 1rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(74, 111, 167, 0.18);
    background: rgba(255,255,255,0.03);
}

.profile-dashboard-card span {
    display: block;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.profile-dashboard-card strong {
    display: block;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.25;
}

.profile-dashboard-card em {
    display: block;
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.74rem;
    line-height: 1.45;
    font-style: normal;
}

.profile-details {
    border-top: 1px solid rgba(74, 111, 167, 0.14);
    padding-top: 0.7rem;
}

.profile-details > summary {
    cursor: pointer;
    color: rgba(57, 194, 255, 0.92);
    font-weight: 700;
    list-style: none;
}

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

.home-v2-block--full {
    grid-column: 1 / -1;
}

.home-v2-block--full .home-v2-block-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.home-v2-block--full .home-v2-list-item {
    margin: 0;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(74, 111, 167, 0.18);
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
}

@media (max-width: 900px) {
    .home-v2-block--full .home-v2-block-list {
        grid-template-columns: 1fr;
    }
}

.profile-stock-ai-section {
    background:
        radial-gradient(circle at top right, rgba(57, 194, 255, 0.07), transparent 30%),
        linear-gradient(180deg, rgba(13, 26, 46, 0.96) 0%, rgba(8, 16, 30, 0.98) 100%);
}

.profile-stock-ai-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.95rem;
}

.profile-stock-ai-kicker {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.58rem;
    border-radius: 999px;
    border: 1px solid rgba(57, 194, 255, 0.24);
    background: rgba(57, 194, 255, 0.08);
    color: rgba(57, 194, 255, 0.92);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.55rem;
}

.profile-stock-ai-market-link {
    white-space: nowrap;
}

.profile-stock-ai-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.profile-stock-ai-summary-card {
    min-width: 0;
    padding: 0.82rem 0.88rem 0.8rem;
    border-radius: 13px;
    border: 1px solid rgba(74, 111, 167, 0.18);
    background: rgba(255,255,255,0.03);
}

.profile-stock-ai-summary-card span,
.profile-stock-ai-card-metrics span,
.profile-stock-ai-search span {
    display: block;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.profile-portfolio-hub {
    background:
        radial-gradient(circle at top left, rgba(57, 194, 255, 0.07), transparent 32%),
        linear-gradient(180deg, rgba(13, 26, 46, 0.96) 0%, rgba(8, 16, 30, 0.98) 100%);
}

.profile-portfolio-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.profile-portfolio-kicker,
.home-v2-resume-kicker {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.58rem;
    border-radius: 999px;
    border: 1px solid rgba(57, 194, 255, 0.24);
    background: rgba(57, 194, 255, 0.08);
    color: rgba(57, 194, 255, 0.92);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.7rem;
}

.profile-portfolio-link {
    white-space: nowrap;
}

.profile-portfolio-empty,
.home-v2-resume-empty {
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(74, 111, 167, 0.18);
    background: rgba(255,255,255,0.03);
}

.profile-portfolio-empty strong,
.home-v2-resume-empty strong {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 800;
}

.profile-portfolio-empty p,
.home-v2-resume-empty p {
    margin: 0 0 1rem;
    color: var(--text-muted);
}

.profile-portfolio-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.profile-portfolio-summary-card,
.home-v2-resume-side-card {
    min-width: 0;
    padding: 0.82rem 0.88rem 0.8rem;
    border-radius: 14px;
    border: 1px solid rgba(74, 111, 167, 0.18);
    background: rgba(255,255,255,0.03);
}

.profile-portfolio-summary-card span,
.home-v2-resume-side-card span {
    display: block;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.profile-portfolio-summary-card strong,
.home-v2-resume-side-card strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.25;
}

.profile-portfolio-summary-card em,
.home-v2-resume-side-card em {
    display: block;
    margin-top: 0.28rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.4;
    font-style: normal;
}

.profile-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.profile-portfolio-grid-head,
.home-v2-resume-list-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.8rem;
    margin: 0 0 0.55rem;
}

.profile-portfolio-grid-head span,
.home-v2-resume-list-head span {
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.profile-portfolio-grid-head em,
.home-v2-resume-list-head em {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-style: normal;
    line-height: 1.45;
}

.profile-portfolio-card,
.home-v2-resume-primary,
.home-v2-resume-side {
    min-width: 0;
    padding: 0.88rem 0.95rem;
    border-radius: 15px;
    border: 1px solid rgba(74, 111, 167, 0.18);
    background: rgba(255,255,255,0.03);
}

.profile-portfolio-card {
    display: flex;
    flex-direction: column;
}

.profile-portfolio-card:first-child {
    grid-column: span 2;
    background:
        radial-gradient(circle at top left, rgba(57, 194, 255, 0.07), transparent 34%),
        rgba(255,255,255,0.03);
}

.profile-portfolio-card.is-missing,
.home-v2-resume-primary.tone-missing {
    border-color: rgba(239, 68, 68, 0.22);
}

.profile-portfolio-card.is-due,
.home-v2-resume-primary.tone-due {
    border-color: rgba(245, 158, 11, 0.22);
}

.profile-portfolio-card.is-fresh,
.home-v2-resume-primary.tone-fresh {
    border-color: rgba(16, 185, 129, 0.18);
}

.profile-portfolio-card-top,
.home-v2-resume-primary-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.profile-portfolio-card h3,
.home-v2-resume-primary h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.98rem;
    font-weight: 800;
}

.profile-portfolio-card p,
.home-v2-resume-primary p {
    margin: 0.28rem 0 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.home-v2-resume-prompt {
    margin-bottom: 0.75rem;
    padding: 0.78rem 0.82rem;
    border-radius: 13px;
    border: 1px solid rgba(74, 111, 167, 0.18);
    background: rgba(255,255,255,0.03);
}

.home-v2-resume-prompt strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 800;
}

.home-v2-resume-prompt p {
    margin: 0.28rem 0 0;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.45;
}

.home-v2-resume-prompt.tone-good {
    border-color: rgba(58, 177, 110, 0.22);
    background: rgba(16, 39, 31, 0.48);
}

.home-v2-resume-prompt.tone-warn {
    border-color: rgba(208, 158, 53, 0.22);
    background: rgba(43, 33, 15, 0.42);
}

.home-v2-resume-prompt.tone-risk {
    border-color: rgba(199, 89, 89, 0.22);
    background: rgba(43, 20, 20, 0.42);
}

.profile-portfolio-score,
.home-v2-resume-score {
    display: inline-flex;
    align-items: center;
    padding: 0.32rem 0.58rem;
    border-radius: 999px;
    border: 1px solid rgba(57, 194, 255, 0.22);
    background: rgba(57, 194, 255, 0.08);
    color: #c5f0ff;
    font-size: 0.76rem;
    font-weight: 800;
    white-space: nowrap;
}

.profile-portfolio-chip-row,
.home-v2-resume-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
}

.profile-portfolio-review-state.is-good {
    border-color: rgba(16, 185, 129, 0.22);
    background: rgba(16, 185, 129, 0.1);
    color: #97efc5;
}

.profile-portfolio-review-state.is-warn {
    border-color: rgba(245, 158, 11, 0.22);
    background: rgba(245, 158, 11, 0.1);
    color: #ffd88a;
}

.profile-portfolio-review-state.is-risk {
    border-color: rgba(239, 68, 68, 0.22);
    background: rgba(239, 68, 68, 0.1);
    color: #ffb0b6;
}

.profile-portfolio-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: auto;
}

.profile-portfolio-actions .btn-primary,
.profile-portfolio-actions .btn-secondary {
    flex: 1 1 180px;
    justify-content: center;
}

.profile-portfolio-more {
    margin: 0.72rem 0 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.home-v2-resume {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 20px;
    border: 1px solid rgba(57, 194, 255, 0.14);
    background:
        radial-gradient(circle at top left, rgba(57, 194, 255, 0.07), transparent 35%),
        linear-gradient(180deg, rgba(13, 26, 46, 0.96) 0%, rgba(8, 16, 30, 0.98) 100%);
}

.home-v2-resume-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.85rem;
}

.home-v2-resume-head h2 {
    margin: 0 0 0.24rem;
}

.home-v2-resume-head p {
    margin: 0;
    max-width: 760px;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.home-v2-resume-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(290px, 0.9fr);
    gap: 0.85rem;
}

.home-v2-resume-side {
    display: grid;
    gap: 0.7rem;
}

.home-v2-resume-side-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.home-v2-resume-list {
    display: grid;
    gap: 0.55rem;
}

.home-v2-resume-row {
    display: block;
    padding: 0.68rem 0.74rem;
    border-radius: 13px;
    border: 1px solid rgba(74, 111, 167, 0.18);
    background: rgba(255,255,255,0.02);
    text-decoration: none;
}

.home-v2-resume-row.is-missing {
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.06);
}

.home-v2-resume-row.is-due {
    border-color: rgba(245, 158, 11, 0.2);
    background: rgba(245, 158, 11, 0.06);
}

.home-v2-resume-row.is-fresh {
    border-color: rgba(16, 185, 129, 0.16);
}

.home-v2-resume-row strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 800;
}

.home-v2-resume-row span {
    display: block;
    margin-top: 0.22rem;
    color: var(--text-muted);
    font-size: 0.74rem;
}

@media (max-width: 980px) {
    .profile-portfolio-summary-grid,
    .profile-portfolio-grid,
    .home-v2-resume-grid,
    .home-v2-resume-side-metrics {
        grid-template-columns: 1fr;
    }

    .profile-portfolio-card:first-child {
        grid-column: auto;
    }
}

@media (max-width: 720px) {
    .profile-portfolio-grid-head,
    .home-v2-resume-list-head,
    .profile-portfolio-head,
    .home-v2-resume-head,
    .profile-portfolio-card-top,
    .home-v2-resume-primary-top {
        flex-direction: column;
    }

    .profile-portfolio-link,
    .home-v2-resume-head .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

.profile-stock-ai-summary-card strong,
.profile-stock-ai-card-metrics strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.94rem;
    font-weight: 800;
    line-height: 1.25;
}

.profile-stock-ai-summary-card em {
    display: block;
    margin-top: 0.28rem;
    color: var(--text-muted);
    font-size: 0.71rem;
    line-height: 1.4;
    font-style: normal;
}

.profile-stock-ai-layout {
    display: grid;
    grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.45fr);
    gap: 0.82rem;
    align-items: start;
}

.profile-stock-ai-rail-card,
.profile-stock-ai-card,
.profile-stock-ai-empty {
    border-radius: 14px;
    border: 1px solid rgba(74, 111, 167, 0.18);
    background: rgba(255,255,255,0.03);
}

.profile-stock-ai-rail-card {
    padding: 0.88rem;
}

.profile-stock-ai-rail-head,
.profile-stock-ai-archive-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.profile-stock-ai-rail-head h3,
.profile-stock-ai-archive-head h3,
.profile-stock-ai-empty h3 {
    margin: 0;
}

.profile-stock-ai-rail-head span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.8rem;
    min-height: 1.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: rgba(57, 194, 255, 0.1);
    color: rgba(57, 194, 255, 0.92);
    font-size: 0.75rem;
    font-weight: 800;
}

.profile-stock-ai-recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 0.72rem;
}

.profile-stock-ai-recent-item {
    display: block;
    padding: 0.74rem 0.8rem;
    border-radius: 11px;
    border: 1px solid rgba(74, 111, 167, 0.16);
    background: rgba(5, 12, 23, 0.34);
    text-decoration: none;
}

.profile-stock-ai-recent-top,
.profile-stock-ai-card-top,
.profile-stock-ai-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.6rem;
}

.profile-stock-ai-recent-top strong,
.profile-stock-ai-card-ticker {
    color: #7fdcff;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.profile-stock-ai-recent-top span,
.profile-stock-ai-card-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    font-size: 0.64rem;
    font-weight: 700;
}

.profile-stock-ai-recent-name {
    margin-top: 0.18rem;
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 700;
}

.profile-stock-ai-recent-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    margin-top: 0.34rem;
    color: var(--text-muted);
    font-size: 0.71rem;
}

.profile-stock-ai-archive-head {
    margin-bottom: 0.72rem;
}

.profile-stock-ai-archive-head p {
    margin: 0.2rem 0 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.45;
}

.profile-stock-ai-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.6rem;
}

.profile-stock-ai-search {
    min-width: 220px;
}

.profile-stock-ai-search input {
    width: 100%;
    padding: 0.64rem 0.78rem;
    border-radius: 11px;
    border: 1px solid rgba(74, 111, 167, 0.22);
    background: rgba(5, 12, 23, 0.4);
    color: var(--text-primary);
}

.profile-stock-ai-sort {
    min-width: 170px;
}

.profile-stock-ai-sort span {
    display: block;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.profile-stock-ai-sort select {
    width: 100%;
    min-height: 39px;
    border-radius: 11px;
    border: 1px solid rgba(74, 111, 167, 0.22);
    background: rgba(5, 12, 23, 0.4);
    color: var(--text-primary);
    padding: 0 0.78rem;
}

.profile-stock-ai-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.profile-stock-ai-card {
    padding: 0.88rem;
}

.profile-stock-ai-card h4 {
    margin: 0.14rem 0 0;
    color: var(--text-primary);
    font-size: 0.94rem;
}

.profile-stock-ai-card-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin: 0.75rem 0;
}

.profile-stock-ai-card-metrics div {
    min-width: 0;
    padding: 0.66rem 0.74rem;
    border-radius: 11px;
    border: 1px solid rgba(74, 111, 167, 0.14);
    background: rgba(5, 12, 23, 0.28);
}

.profile-stock-ai-card-foot {
    border-top: 1px solid rgba(74, 111, 167, 0.16);
    padding-top: 0.66rem;
}

.profile-stock-ai-card-foot-meta {
    display: flex;
    flex-direction: column;
    gap: 0.24rem;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.profile-stock-ai-card-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.profile-stock-ai-card-actions .btn-secondary {
    min-height: 37px;
}

.profile-stock-ai-empty {
    padding: 1rem;
    text-align: left;
}

.profile-stock-ai-empty p,
.profile-stock-ai-no-results {
    color: var(--text-secondary);
}

.profile-stock-ai-no-results {
    margin-top: 0.8rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px dashed rgba(74, 111, 167, 0.22);
}

@media (max-width: 980px) {
    .profile-dashboard-grid,
    .profile-stock-ai-summary-grid,
    .profile-stock-ai-card-grid,
    .profile-stock-ai-layout {
        grid-template-columns: 1fr;
    }

    .profile-stock-ai-archive-head,
    .profile-stock-ai-head,
    .profile-stock-ai-card-foot {
        flex-direction: column;
    }

    .profile-stock-ai-search {
        min-width: 0;
        width: 100%;
    }

    .profile-stock-ai-toolbar {
        width: 100%;
    }

    .profile-stock-ai-card-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 700px) {
    .profile-page--ai .profile-container {
        max-width: 100%;
    }

    .profile-stock-ai-summary-grid,
    .profile-stock-ai-card-metrics {
        grid-template-columns: 1fr;
    }

    .profile-stock-ai-card,
    .profile-stock-ai-rail-card,
    .profile-stock-ai-empty {
        padding: 0.9rem;
    }
}

/* btn-save hover */
@media (hover: hover) {
    .profile-page .btn-save:hover {
        background: linear-gradient(180deg, #f4f9ff 0%, #e4eef8 100%) !important;
        box-shadow: 0 2px 14px rgba(57, 194, 255, 0.14) !important;
    }
}

/* === Portfolio repetition fixes === */

/* estimate-note now lives directly in estimate-section (no .estimate-header wrapper) */
.portfolio-page .estimate-note {
    margin-bottom: 0.52rem;
}

/* Optimizer section: grid starts right after the section label — add small top breathing room */
.portfolio-page .optimizer-section > .optimizer-grid:first-child {
    margin-top: 0.1rem;
}

/* === Dividends tab === */

/* Overview strip — compact summary + link in the portfolio overview */
.portfolio-page .portfolio-dividend-overview-strip {
    margin: 0.9rem 0 0.6rem;
    padding: 0.72rem 0.9rem;
    background: rgba(8, 18, 38, 0.44);
    border: 1px solid rgba(51, 89, 127, 0.22);
    border-top: 2px solid rgba(57, 194, 255, 0.18);
    border-radius: 11px;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.portfolio-page .portfolio-dividend-overview-strip .dividend-summary-grid {
    flex: 1 1 0;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.portfolio-page .portfolio-dividend-overview-strip .dividend-summary-card {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.portfolio-page .portfolio-dividend-overview-strip .dividend-summary-card .label {
    font-size: 0.63rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portfolio-page .portfolio-dividend-overview-strip .dividend-summary-card .value {
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--text-primary);
}

.portfolio-page .dividend-overview-link {
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(57, 194, 255, 0.85);
    text-decoration: none;
    white-space: nowrap;
    padding: 0.3rem 0.6rem;
    border: 1px solid rgba(57, 194, 255, 0.22);
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

@media (hover: hover) {
    .portfolio-page .dividend-overview-link:hover {
        background: rgba(57, 194, 255, 0.08);
        color: #d6f2ff;
    }
}

@media (max-width: 700px) {
    .portfolio-page .portfolio-dividend-overview-strip {
        flex-direction: column;
        align-items: stretch;
        gap: 0.72rem;
    }
    .portfolio-page .portfolio-dividend-overview-strip .dividend-summary-grid {
        grid-template-columns: 1fr;
    }
    .portfolio-page .dividend-overview-link {
        text-align: center;
    }
}

/* Dividends page */
.portfolio-dividends-page .top-stats {
    margin: 0.5rem 0 1rem;
}

.portfolio-dividends-page .top-stats .value-panel {
    border-top: 2px solid rgba(57, 194, 255, 0.28) !important;
}

.portfolio-dividends-page .dividend-insight-board {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(300px, 0.95fr);
    gap: 1rem;
    margin: 0.5rem 0 1.15rem;
}

.portfolio-dividends-page .dividend-insight-panel {
    padding: 1rem 1.05rem;
    border: 1px solid rgba(51, 89, 127, 0.22);
    border-radius: 16px;
    background:
        radial-gradient(circle at top right, rgba(57, 194, 255, 0.09), transparent 34%),
        linear-gradient(180deg, rgba(9, 18, 34, 0.94), rgba(7, 15, 28, 0.96));
    box-shadow: 0 16px 36px rgba(2, 8, 23, 0.16);
}

.portfolio-dividends-page .dividend-board-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.portfolio-dividends-page .dividend-board-copy {
    min-width: 0;
}

.portfolio-dividends-page .dividend-board-kicker {
    display: inline-flex;
    margin-bottom: 0.28rem;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8eb6d8;
}

.portfolio-dividends-page .dividend-board-copy h3 {
    margin: 0;
    font-size: 1.02rem;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: #eef5ff;
}

.portfolio-dividends-page .dividend-board-total {
    margin-top: 0.28rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 850;
    letter-spacing: -0.04em;
    color: #f8fbff;
}

.portfolio-dividends-page .dividend-board-total span {
    font-size: 0.68em;
    color: #a7c0db;
}

.portfolio-dividends-page .dividend-board-metrics {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
}

.portfolio-dividends-page .dividend-board-metric {
    min-width: 132px;
    padding-left: 0.7rem;
    border-left: 4px solid rgba(57, 194, 255, 0.26);
}

.portfolio-dividends-page .dividend-board-metric strong {
    display: block;
    font-size: 1rem;
    line-height: 1.15;
    color: #f4f8ff;
}

.portfolio-dividends-page .dividend-board-metric span {
    display: block;
    margin-top: 0.16rem;
    font-size: 0.72rem;
    color: #a8bed5;
}

.portfolio-dividends-page .dividend-board-metric.tone-paid {
    border-left-color: #3d68ff;
}

.portfolio-dividends-page .dividend-board-metric.tone-upcoming {
    border-left-color: rgba(197, 210, 255, 0.92);
}

.portfolio-dividends-page .dividend-year-chart {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    gap: 0.9rem;
    align-items: end;
    min-height: 320px;
    padding-top: 0.35rem;
}

.portfolio-dividends-page .dividend-year-column {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.portfolio-dividends-page .dividend-year-total {
    font-size: 0.98rem;
    font-weight: 800;
    text-align: center;
    color: #eef5ff;
}

.portfolio-dividends-page .dividend-year-bars {
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-start;
    height: 250px;
    border-radius: 14px 14px 10px 10px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
        repeating-linear-gradient(
            to top,
            rgba(148, 163, 184, 0.14) 0,
            rgba(148, 163, 184, 0.14) 1px,
            transparent 1px,
            transparent 20%
        );
    overflow: hidden;
}

.portfolio-dividends-page .dividend-year-bar {
    display: block;
    width: 100%;
}

.portfolio-dividends-page .dividend-year-bar-paid {
    background: linear-gradient(180deg, #4a72ff, #345ce4);
}

.portfolio-dividends-page .dividend-year-bar-upcoming {
    background: linear-gradient(180deg, rgba(213, 223, 255, 0.98), rgba(179, 196, 255, 0.9));
}

.portfolio-dividends-page .dividend-year-label {
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
    color: #b3c8de;
}

.portfolio-dividends-page .dividend-ranking-toggle {
    display: inline-flex;
    gap: 0.42rem;
    padding: 0.24rem;
    margin: 0.35rem 0 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
}

.portfolio-dividends-page .dividend-ranking-tab {
    min-height: 32px;
    padding: 0.38rem 0.72rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #d4deeb;
    font-size: 0.72rem;
    font-weight: 750;
    cursor: pointer;
}

.portfolio-dividends-page .dividend-ranking-tab.is-active {
    background: #ffffff;
    color: #08111f;
}

.portfolio-dividends-page .dividend-ranking-list {
    display: none;
    gap: 0.44rem;
}

.portfolio-dividends-page .dividend-ranking-list.is-active {
    display: grid;
}

.portfolio-dividends-page .dividend-ranking-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.6rem;
    min-height: 44px;
    padding: 0.66rem 0.78rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.portfolio-dividends-page .dividend-ranking-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: 14px;
    background: linear-gradient(90deg, rgba(73, 114, 255, 0.22), rgba(73, 114, 255, 0.12));
}

.portfolio-dividends-page .dividend-ranking-bar-upcoming {
    background: linear-gradient(90deg, rgba(203, 215, 255, 0.22), rgba(203, 215, 255, 0.1));
}

.portfolio-dividends-page .dividend-ranking-main,
.portfolio-dividends-page .dividend-ranking-value {
    position: relative;
    z-index: 1;
}

.portfolio-dividends-page .dividend-ranking-main {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.12rem;
}

.portfolio-dividends-page .dividend-ranking-main .ticker-with-logo {
    min-width: 0;
    font-size: 0.78rem;
    gap: 0.42rem;
}

.portfolio-dividends-page .dividend-ranking-main .ticker-with-logo span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portfolio-dividends-page .dividend-ranking-main .stock-logo {
    width: 1.05rem;
    height: 1.05rem;
}

.portfolio-dividends-page .dividend-ranking-name {
    min-width: 0;
    font-size: 0.7rem;
    color: #d7e5f4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.82;
}

.portfolio-dividends-page .dividend-ranking-value {
    font-size: 0.76rem;
    color: #eff6ff;
    white-space: nowrap;
}

@media (max-width: 960px) {
    .portfolio-dividends-page .dividend-insight-board {
        grid-template-columns: 1fr;
    }

    .portfolio-dividends-page .dividend-board-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .portfolio-dividends-page .dividend-board-metrics {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .portfolio-dividends-page .dividend-insight-panel {
        padding: 0.88rem;
        border-radius: 14px;
    }

    .portfolio-dividends-page .dividend-board-total {
        font-size: 1.45rem;
    }

    .portfolio-dividends-page .dividend-board-metrics {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .portfolio-dividends-page .dividend-board-metric {
        min-width: 0;
    }

    .portfolio-dividends-page .dividend-year-chart {
        grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
        gap: 0.6rem;
        min-height: 240px;
    }

    .portfolio-dividends-page .dividend-year-bars {
        height: 180px;
    }

    .portfolio-dividends-page .dividend-ranking-toggle {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .portfolio-dividends-page .dividend-ranking-tab {
        width: 100%;
        justify-content: center;
    }

    .portfolio-dividends-page .dividend-ranking-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .portfolio-dividends-page .dividend-ranking-value {
        padding-left: 2.1rem;
    }
}

.dividends-section-block {
    margin: 0 0 1.4rem;
    padding: 0.9rem 1rem;
    background: var(--bg-card);
    border: 1px solid rgba(51, 89, 127, 0.22);
    border-radius: 12px;
}

.dividends-section-heading {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 0.82rem;
}

.dividends-empty-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

.dividends-holdings-table .holding-subline {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* Priority banner: give it a cleaner look as a "featured action" callout */
.portfolio-page .portfolio-priority-banner {
    background: rgba(8, 18, 38, 0.55);
}
.portfolio-page .portfolio-priority-banner.tone-good {
    background: rgba(4, 30, 20, 0.45);
}
.portfolio-page .portfolio-priority-banner.tone-warn {
    background: rgba(30, 20, 4, 0.45);
}
.portfolio-page .portfolio-priority-banner.tone-risk {
    background: rgba(30, 6, 6, 0.42);
}

/* === Portfolio overview visual improvements === */

/* Health score eval-panel — color-coded by portfolio status */
.portfolio-page .eval-panel.tone-good {
    border-top-color: rgba(16, 185, 129, 0.55) !important;
}
.portfolio-page .eval-panel.tone-good .eval-score {
    color: #34d399;
}
.portfolio-page .eval-panel.tone-warn {
    border-top-color: rgba(245, 158, 11, 0.55) !important;
}
.portfolio-page .eval-panel.tone-warn .eval-score {
    color: #fbbf24;
}
.portfolio-page .eval-panel.tone-risk {
    border-top-color: rgba(239, 68, 68, 0.55) !important;
}
.portfolio-page .eval-panel.tone-risk .eval-score {
    color: #f87171;
}

/* Secondary stats — visually lighter than primary to create hierarchy */
.portfolio-page .top-stats-secondary .value-panel {
    padding: 0.82rem 1rem !important;
}
.portfolio-page .top-stats-secondary .value-amount {
    font-size: 1.1rem !important;
}
.portfolio-page .top-stats-secondary .eval-status {
    font-size: 0.63rem;
    opacity: 0.82;
}

/* Data quality warning banner — visually distinct from the action priority banner */
.portfolio-page .portfolio-priority-banner.tone-warn.data-quality-banner,
.portfolio-page .portfolio-priority-banner.tone-risk.data-quality-banner {
    border-left-width: 2px;
    border-left-style: dashed;
    opacity: 0.9;
}

/* Section ordering visual rhythm — charts now first in bottom section */
.portfolio-page .charts-grid {
    margin-top: 0;
}

/* Dividend overview strip — tighter, more inline look */
.portfolio-page .portfolio-dividend-overview-strip {
    margin-top: 0.5rem;
}

/* ======================================================
   Holdings table — Spacious card rows
   ====================================================== */

/* Stronger row hover — applies to all screen sizes */
.portfolio-page .holdings-table tr.holding-row:hover td {
    background: rgba(57, 194, 255, 0.03) !important;
}

/* Non-mobile improvements: spacing, hierarchy, legibility */
@media (min-width: 769px) {
    /* 1. More vertical breathing room on all cells */
    .portfolio-page .holdings-table td {
        padding-top: 1.1rem;
        padding-bottom: 1.1rem;
    }

    /* 2. Main cell: aligned padding + min-width so ticker/name never crushes */
    .portfolio-page .holding-main-cell {
        padding-top: 1.1rem;
        padding-bottom: 1.1rem;
        min-width: 185px;
    }

    /* 3. Ticker: a touch more presence */
    .portfolio-page .ticker-line {
        font-size: 1.0rem;
    }

    /* 4. Company subline: more air below ticker */
    .portfolio-page .holding-subline {
        margin-top: 0.3rem;
        gap: 0.3rem;
        line-height: 1.4;
    }
    .portfolio-page .holding-company-name {
        font-size: 0.73rem;
    }
    .portfolio-page .holding-sector-tag {
        font-size: 0.63rem;
    }

    /* 5. Decision chips: clear separation from the subline */
    .portfolio-page .holding-decision-line {
        margin-top: 0.66rem;
        gap: 0.4rem;
    }

    /* 6. Key value columns: more legible */
    .portfolio-page .holdings-table td.metric-value,
    .portfolio-page .holdings-table td.metric-pl {
        font-size: 0.9rem !important;
    }
}

/* Desktop-only: action stack vertical layout + support row visual merge */
@media (min-width: 901px) {
    /* 7. Action stack: stacked vertically — cleaner and narrower column */
    .portfolio-page .action-stack {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.28rem;
        min-width: 66px;
    }
    .portfolio-page .action-stack .badge-mini,
    .portfolio-page .action-stack .action-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        text-align: center;
        min-height: 30px;
    }

    /* 8. Support row: reduce top gap so it reads as part of the holding above */
    .portfolio-page .holdings-table tr.holding-support-row > td.holding-support-cell {
        padding-top: 0 !important;
        padding-bottom: 0.95rem !important;
    }

    /* 9. Support row follows the holding-row hover tint */
    .portfolio-page .holdings-table tr.holding-row:hover + tr.holding-support-row > td {
        background: rgba(57, 194, 255, 0.03) !important;
    }

    /* ======================================================
       Holdings: 5-column layout (embed amount/avg/price as quick-facts)
       ====================================================== */

    /* Hide the 3 standalone columns — data now lives in quick-facts inside main cell */
    .portfolio-page .holdings-table th.th-metric-amount,
    .portfolio-page .holdings-table th.th-metric-avg,
    .portfolio-page .holdings-table th.th-metric-price,
    .portfolio-page .holdings-table td.metric-amount,
    .portfolio-page .holdings-table td.metric-avg,
    .portfolio-page .holdings-table td.metric-price {
        display: none !important;
    }

    /* Show quick-facts mini-cards inside the main cell on desktop */
    .portfolio-page .holding-quick-facts {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.42rem;
        margin-top: 0.64rem;
    }

    /* Redistribute column widths across the now-5-column layout */
    .portfolio-page .holdings-table td.holding-main-cell {
        width: 38%;
        min-width: 0;
    }
    .portfolio-page .holdings-table td.holding-dividend-cell {
        width: 10rem;
    }
    .portfolio-page .holdings-table td.metric-value {
        width: 10rem;
    }
    .portfolio-page .holdings-table td.metric-pl {
        width: 10.5rem;
    }
    .portfolio-page .holdings-table td.holding-actions-cell {
        width: 7rem;
    }

    /* Signal left-border accent — inset shadow avoids border-collapse interference */
    .portfolio-page .holdings-table tr.holding-row.signal-buy > td:first-child {
        box-shadow: inset 3px 0 0 rgba(16, 185, 129, 0.52);
    }
    .portfolio-page .holdings-table tr.holding-row.signal-sell > td:first-child {
        box-shadow: inset 3px 0 0 rgba(239, 68, 68, 0.52);
    }
    .portfolio-page .holdings-table tr.holding-row.signal-hold > td:first-child {
        box-shadow: inset 3px 0 0 rgba(245, 158, 11, 0.42);
    }

    /* Signal accent continues faintly on the support row */
    .portfolio-page .holdings-table tr.holding-row.signal-buy + tr.holding-support-row > td:first-child {
        box-shadow: inset 3px 0 0 rgba(16, 185, 129, 0.22);
    }
    .portfolio-page .holdings-table tr.holding-row.signal-sell + tr.holding-support-row > td:first-child {
        box-shadow: inset 3px 0 0 rgba(239, 68, 68, 0.22);
    }
    .portfolio-page .holdings-table tr.holding-row.signal-hold + tr.holding-support-row > td:first-child {
        box-shadow: inset 3px 0 0 rgba(245, 158, 11, 0.18);
    }
}

/* ==========================================================
   HOLDINGS TABLE — DEFINITIVE PROFESSIONAL LAYOUT
   Supersedes all previous holdings table rules.
   ========================================================== */

/* ---- All screens: table fills its container ---- */
.portfolio-page .holdings-table {
    table-layout: fixed !important;
    width: 100% !important;
}

/* ---- Desktop 901px+: clean 5-column layout ---- */
@media (min-width: 901px) {

    /* Vertical alignment: middle — rows look balanced not top-heavy */
    .portfolio-page .holdings-table th,
    .portfolio-page .holdings-table td {
        vertical-align: middle !important;
    }

    /* Keep support rows top-aligned (they're content blocks) */
    .portfolio-page .holdings-table tr.holding-support-row td {
        vertical-align: top !important;
    }

    /* Hide the 3 standalone numeric columns */
    .portfolio-page .holdings-table th.th-metric-amount,
    .portfolio-page .holdings-table th.th-metric-avg,
    .portfolio-page .holdings-table th.th-metric-price,
    .portfolio-page .holdings-table td.metric-amount,
    .portfolio-page .holdings-table td.metric-avg,
    .portfolio-page .holdings-table td.metric-price {
        display: none !important;
    }

    /* --------------------------------------------------
       5-column percentage widths — always sum to 100%.
       Set on both th class (drives table-layout: fixed)
       and td class (fallback for remaining browsers).
       Hidden columns (th-metric-*) contribute 0 width.
    -------------------------------------------------- */
    .portfolio-page .holdings-table th.th-main,
    .portfolio-page .holdings-table td.holding-main-cell {
        width: 42% !important;
    }
    .portfolio-page .holdings-table th.th-dividend,
    .portfolio-page .holdings-table td.holding-dividend-cell {
        width: 14% !important;
    }
    .portfolio-page .holdings-table th.th-value,
    .portfolio-page .holdings-table td.metric-value {
        width: 13% !important;
    }
    .portfolio-page .holdings-table th.th-pl,
    .portfolio-page .holdings-table td.metric-pl {
        width: 20% !important;
    }
    .portfolio-page .holdings-table th.th-actions,
    .portfolio-page .holdings-table td.holding-actions-cell {
        width: 11% !important;
    }
    /* Total: 42 + 14 + 13 + 20 + 11 = 100% */

    /* Numeric cells: never wrap */
    .portfolio-page .holdings-table td.metric-value,
    .portfolio-page .holdings-table td.metric-pl {
        white-space: nowrap !important;
    }

    /* Quick-facts: compact single-line strip (replaces the card grid) */
    .portfolio-page .holding-quick-facts {
        display: flex !important;
        align-items: center;
        flex-wrap: wrap;
        gap: 0;
        margin-top: 0.42rem;
    }
    .portfolio-page .holding-quick-fact {
        display: inline-flex;
        align-items: center;
        gap: 0.22rem;
        padding: 0 0.6rem 0 0;
        border: none;
        background: transparent;
        border-radius: 0;
    }
    .portfolio-page .holding-quick-fact + .holding-quick-fact {
        padding-left: 0.6rem;
        border-left: 1px solid rgba(51, 89, 127, 0.3);
    }
    .portfolio-page .holding-quick-fact-label {
        font-size: 0.61rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted);
        white-space: nowrap;
    }
    .portfolio-page .holding-quick-fact-value {
        font-size: 0.74rem;
        font-weight: 700;
        color: var(--text-secondary);
        white-space: nowrap;
    }
    .portfolio-page .holding-quick-fact-yield .holding-quick-fact-value {
        color: rgba(57, 194, 255, 0.88);
    }

    /* Action stack: clean vertical column */
    .portfolio-page .action-stack {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.22rem !important;
        width: 100%;
    }
    .portfolio-page .action-stack .badge-mini,
    .portfolio-page .action-stack .action-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 100% !important;
        min-height: 28px !important;
        text-align: center;
        font-size: 0.64rem !important;
        white-space: nowrap;
    }

    /* Dividend cell: left-aligned on desktop */
    .portfolio-page .holdings-table td.holding-dividend-cell {
        text-align: left !important;
    }
    .portfolio-page .holding-dividend-summary {
        align-items: flex-start !important;
    }

    /* Signal left-border accents */
    .portfolio-page .holdings-table tr.holding-row.signal-buy > td:first-child {
        box-shadow: inset 3px 0 0 rgba(16, 185, 129, 0.55) !important;
    }
    .portfolio-page .holdings-table tr.holding-row.signal-sell > td:first-child {
        box-shadow: inset 3px 0 0 rgba(239, 68, 68, 0.55) !important;
    }
    .portfolio-page .holdings-table tr.holding-row.signal-hold > td:first-child {
        box-shadow: inset 3px 0 0 rgba(245, 158, 11, 0.45) !important;
    }
    .portfolio-page .holdings-table tr.holding-row.signal-buy + tr.holding-support-row > td:first-child {
        box-shadow: inset 3px 0 0 rgba(16, 185, 129, 0.22) !important;
    }
    .portfolio-page .holdings-table tr.holding-row.signal-sell + tr.holding-support-row > td:first-child {
        box-shadow: inset 3px 0 0 rgba(239, 68, 68, 0.22) !important;
    }
    .portfolio-page .holdings-table tr.holding-row.signal-hold + tr.holding-support-row > td:first-child {
        box-shadow: inset 3px 0 0 rgba(245, 158, 11, 0.18) !important;
    }
}

/* === Per-holding tax type toggle buttons === */
.holding-tax-toggle {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    border: 1px solid rgba(51, 89, 127, 0.28);
    border-radius: 4px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.45);
    margin-left: 0.25rem;
    flex-shrink: 0;
}
.holding-tax-toggle .htb {
    display: inline-flex;
    align-items: center;
    padding: 0 0.48rem;
    height: 18px;
    font-size: 0.59rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--text-muted, #64748b);
    transition: background 0.12s ease, color 0.12s ease;
    white-space: nowrap;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.holding-tax-toggle .htb + .htb {
    border-left: 1px solid rgba(51, 89, 127, 0.28);
}
.holding-tax-toggle .htb:hover {
    background: rgba(59, 130, 246, 0.09);
    color: var(--text-secondary, #94a3b8);
}
.holding-tax-toggle .htb.active {
    background: rgba(16, 185, 129, 0.16);
    color: rgb(16, 185, 129);
}
.holding-tax-toggle.htb-loading {
    opacity: 0.55;
    pointer-events: none;
    animation: htb-pulse 0.9s ease-in-out infinite alternate;
}
@keyframes htb-pulse {
    from { opacity: 0.55; }
    to   { opacity: 0.28; }
}

/* ==========================================================
   PORTFOLIO PAGE — PROFESSIONAL POLISH
   ========================================================== */

/* --- Toolbar: card header on desktop --- */
@media (min-width: 769px) {
    .portfolio-page .portfolio-toolbar {
        background: rgba(8, 18, 38, 0.46) !important;
        border: 1px solid rgba(51, 89, 127, 0.22) !important;
        border-top: 2px solid rgba(57, 194, 255, 0.28) !important;
        border-radius: 14px !important;
        padding: 0.88rem 1.04rem !important;
        margin-bottom: 1.1rem !important;
    }
}

/* --- Portfolio title: subtle gradient text --- */
.portfolio-page .portfolio-title {
    background: linear-gradient(100deg, #dce8f4 20%, #7fcbee 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* --- P/L value-amounts in stat panels: green/red --- */
.portfolio-page .value-panel .value-amount.buy { color: #34d399 !important; }
.portfolio-page .value-panel .value-amount.sell { color: #f87171 !important; }

/* --- Chart containers: cyan top accent to match stat cards --- */
.portfolio-page .chart-container {
    border-top: 2px solid rgba(57, 194, 255, 0.18) !important;
}

/* --- Optimizer cards: more visible base background --- */
.portfolio-page .optimizer-card {
    background: rgba(8, 16, 30, 0.52) !important;
}

/* --- Estimate cards: more visible base background --- */
.portfolio-page .estimate-card {
    background: rgba(8, 16, 30, 0.52) !important;
}

/* --- Estimate section: cyan top accent --- */
.portfolio-page .estimate-section {
    border-top: 2px solid rgba(57, 194, 255, 0.18) !important;
    background: rgba(8, 16, 30, 0.38) !important;
}

/* --- Optimizer suggestions: cyan top accent wrapper --- */
.portfolio-page .optimizer-suggestions {
    border-top: 2px solid rgba(57, 194, 255, 0.14) !important;
    background: rgba(8, 16, 30, 0.42) !important;
}

/* --- Section labels on desktop: slightly more readable --- */
.portfolio-page .portfolio-mobile-summary {
    font-size: 0.64rem;
    color: rgba(148, 163, 184, 0.72);
    padding-top: 0.62rem;
    letter-spacing: 0.11em;
}

/* --- Priority banner: sharper copy title --- */
.portfolio-page .portfolio-priority-banner .portfolio-priority-copy h3 {
    font-size: 1.0rem;
    letter-spacing: -0.02em;
}

/* --- Priority banner chips: more refined --- */
.portfolio-page .portfolio-priority-chip {
    font-size: 0.67rem;
    padding: 0.22rem 0.52rem;
}

/* --- Dividend overview strip: cyan top accent --- */
.portfolio-page .portfolio-dividend-overview-strip {
    border-top: 2px solid rgba(57, 194, 255, 0.18) !important;
}

/* --- Totals mode toggle: compact on desktop --- */
@media (min-width: 769px) {
    .portfolio-page .portfolio-stats-controls .totals-mode-toggle {
        padding: 0.22rem;
        border-radius: 8px;
    }
    .portfolio-page .portfolio-stats-controls .totals-mode-btn {
        min-height: 28px;
        padding: 0.2rem 0.64rem;
        font-size: 0.7rem;
        border-radius: 6px;
    }
    .portfolio-page .portfolio-stats-controls .totals-mode-label {
        font-size: 0.62rem;
    }
}

/* --- Stat panel eval-score: large prominent number --- */
@media (min-width: 901px) {
    .portfolio-page .eval-score {
        font-size: 2.2rem;
        font-weight: 900;
        letter-spacing: -0.03em;
    }
    .portfolio-page .top-stats-primary .value-amount {
        font-size: 1.72rem;
        letter-spacing: -0.025em;
    }
}

/* --- Optimizer section wrapper on desktop: card feel --- */
@media (min-width: 769px) {
    .portfolio-page .optimizer-section {
        padding: 0.72rem 0.82rem;
        background: rgba(8, 16, 30, 0.32);
        border: 1px solid rgba(51, 89, 127, 0.24);
        border-top: 2px solid rgba(57, 194, 255, 0.16);
        border-radius: 12px;
    }
    .portfolio-page .optimizer-section > .optimizer-grid:first-child {
        margin-top: 0.42rem;
    }
    .portfolio-page .optimizer-suggestions {
        margin-top: 0.72rem;
        border-top: 1px solid rgba(51, 89, 127, 0.22) !important;
        border-left: 0 !important;
        border-right: 0 !important;
        border-bottom: 0 !important;
        background: transparent !important;
        padding: 0.52rem 0 0 !important;
        border-radius: 0 !important;
    }
}

/* ==========================================================
   UX & INTERACTION POLISH
   ========================================================== */

/* --- Portfolio alerts: stronger, more readable --- */
.portfolio-page .portfolio-alert {
    padding: 0.78rem 1rem;
    border-left: 3px solid;
    border-radius: 10px;
    font-size: 0.86rem;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
}
.portfolio-page .portfolio-alert.is-success {
    background: rgba(16, 185, 129, 0.14) !important;
    border-color: rgba(16, 185, 129, 0.65) !important;
    border-left-color: rgba(16, 185, 129, 0.75) !important;
    color: #a7f3d0 !important;
}
.portfolio-page .portfolio-alert.is-error {
    background: rgba(239, 68, 68, 0.14) !important;
    border-color: rgba(239, 68, 68, 0.55) !important;
    border-left-color: rgba(239, 68, 68, 0.75) !important;
    color: #fecaca !important;
}
.portfolio-page .portfolio-alert::before {
    font-size: 1rem;
    line-height: 1.2;
    flex-shrink: 0;
}
.portfolio-page .portfolio-alert.is-success::before { content: "✓"; color: #34d399; }
.portfolio-page .portfolio-alert.is-error::before   { content: "✕"; color: #f87171; }

.portfolio-page .portfolio-post-import-card {
    margin-top: 0.9rem;
    padding: 1.1rem 1.15rem;
    border-radius: 18px;
    border: 1px solid rgba(55, 171, 255, 0.22);
    background:
        linear-gradient(180deg, rgba(20, 35, 57, 0.96), rgba(12, 24, 40, 0.98)),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 45%);
    box-shadow: 0 18px 34px rgba(3, 10, 24, 0.24);
}
.portfolio-page .portfolio-post-import-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}
.portfolio-page .portfolio-post-import-kicker,
.portfolio-page .portfolio-post-import-source {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.28rem 0.66rem;
    border-radius: 999px;
    border: 1px solid rgba(55, 171, 255, 0.24);
    background: rgba(15, 31, 52, 0.85);
    color: #8dd3ff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.portfolio-page .portfolio-post-import-head h2 {
    margin: 0.68rem 0 0.38rem;
    font-size: 1.2rem;
    color: #f8fbff;
}
.portfolio-page .portfolio-post-import-head p {
    margin: 0;
    max-width: 62ch;
    color: #9bb4d4;
    line-height: 1.58;
}
.portfolio-page .portfolio-post-import-stats {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}
.portfolio-page .portfolio-post-import-stat,
.portfolio-page .portfolio-post-import-panel {
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    border: 1px solid rgba(74, 95, 129, 0.28);
    background: rgba(10, 22, 37, 0.76);
}
.portfolio-page .portfolio-post-import-stat-label {
    display: block;
    margin-bottom: 0.42rem;
    color: #7ea0c9;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.portfolio-page .portfolio-post-import-stat-value {
    display: block;
    color: #f8fbff;
    font-size: 1.16rem;
    font-weight: 800;
}
.portfolio-page .portfolio-post-import-grid {
    margin-top: 0.85rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}
.portfolio-page .portfolio-post-import-panel strong {
    display: block;
    margin-bottom: 0.42rem;
    color: #f8fbff;
    font-size: 0.86rem;
}
.portfolio-page .portfolio-post-import-panel p,
.portfolio-page .portfolio-post-import-meta {
    margin: 0;
    color: #9bb4d4;
    line-height: 1.58;
    font-size: 0.84rem;
}
.portfolio-page .portfolio-post-import-meta {
    margin-top: 0.75rem;
}
.portfolio-page .portfolio-post-import-actions {
    margin-top: 0.95rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.72rem;
}
.portfolio-page .portfolio-post-import-actions .btn-primary,
.portfolio-page .portfolio-post-import-actions .btn-secondary {
    min-width: 180px;
}

/* --- Modal close button: clearer target --- */
.portfolio-page .modal-close-btn {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(74, 95, 129, 0.32) !important;
    border-radius: 8px !important;
    color: var(--text-secondary) !important;
    transition: background 0.14s, color 0.14s !important;
}
@media (hover: hover) {
    .portfolio-page .modal-close-btn:hover {
        background: rgba(239, 68, 68, 0.14) !important;
        border-color: rgba(239, 68, 68, 0.4) !important;
        color: #fca5a5 !important;
    }
}

/* --- Field help text: visible and readable --- */
.portfolio-page .portfolio-settings .field-help {
    display: block !important;
    margin-top: 0.32rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.4;
    font-style: italic;
}

/* --- Holdings empty state --- */
.portfolio-page .holdings-empty-cell {
    text-align: center;
    padding: 2.8rem 1rem !important;
}
.portfolio-page .holdings-empty-inner {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.portfolio-page .holdings-empty-icon {
    font-size: 1.8rem;
    opacity: 0.28;
}
.portfolio-page .holdings-empty-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0;
}
.portfolio-page .holdings-empty-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

/* --- Add-stock-grid: desktop card treatment --- */
@media (min-width: 769px) {
    .portfolio-page .add-stock-grid {
        background: rgba(8, 16, 30, 0.44) !important;
        border: 1px solid rgba(51, 89, 127, 0.24) !important;
        border-top: 2px solid rgba(57, 194, 255, 0.16) !important;
        border-radius: 12px !important;
    }
    .portfolio-page .add-stock-grid .form-group label {
        color: rgba(148, 163, 184, 0.82);
        font-size: 0.6rem;
        letter-spacing: 0.07em;
        text-transform: uppercase;
        font-weight: 700;
    }
}

/* --- Import section: collapse toggle indicator on desktop --- */
.portfolio-page .portfolio-utility-block.mobile-collapse-details.portfolio-mobile-details {
    border-top: 1px solid rgba(51, 89, 127, 0.18);
    margin-top: 0.72rem;
    padding-top: 0.6rem;
}

/* --- Holdings header: polish the count badge --- */
.portfolio-page .holdings-header-chip {
    background: rgba(57, 194, 255, 0.08) !important;
    border-color: rgba(57, 194, 255, 0.2) !important;
    color: rgba(186, 230, 253, 0.9) !important;
}

/* --- Action buttons: disabled state more obvious --- */
.portfolio-page .action-stack button:disabled,
.portfolio-page .action-stack a[disabled] {
    opacity: 0.28 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* --- Move modal: "no targets" message --- */
.portfolio-page .move-modal-no-targets {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.52rem 0.2rem;
    line-height: 1.5;
}
.portfolio-page .move-modal-no-targets a {
    color: rgba(57, 194, 255, 0.85);
    text-decoration: none;
    font-weight: 600;
}

/* --- Section nav: aria-current visual reinforcement --- */
.portfolio-page .portfolio-section-link[aria-current="page"] {
    color: #d6f2ff;
    border-bottom-color: rgba(57, 194, 255, 0.75);
    font-weight: 700;
}

/* --- Export section: card treatment + hide duplicate title on desktop --- */
@media (min-width: 769px) {
    .portfolio-page .export-section {
        background: rgba(8, 16, 30, 0.38) !important;
        border: 1px solid rgba(51, 89, 127, 0.24) !important;
        border-top: 2px solid rgba(57, 194, 255, 0.14) !important;
    }
    .portfolio-page .portfolio-utility-block .export-title {
        display: none;
    }
}

/* --- Holdings table header: subtle sticky look on desktop --- */
@media (min-width: 901px) {
    .portfolio-page .holdings-table thead th {
        background: rgba(8, 16, 30, 0.72) !important;
        border-bottom: 1px solid rgba(57, 194, 255, 0.14) !important;
        font-size: 0.65rem;
        letter-spacing: 0.1em;
        color: rgba(148, 163, 184, 0.7);
    }
}

/* --- Holdings container header: cyan accent border --- */
.portfolio-page .holdings-container {
    border-top: 2px solid rgba(57, 194, 255, 0.22) !important;
}
.portfolio-page .holdings-header {
    background: rgba(8, 16, 30, 0.42);
    border-bottom-color: rgba(57, 194, 255, 0.1) !important;
}
.portfolio-page .holdings-header-copy h3 {
    font-size: 0.9rem;
    letter-spacing: -0.01em;
}

/* --- Holding row: slightly more breathing room between rows on desktop --- */
@media (min-width: 901px) {
    .portfolio-page .holdings-table tr.holding-row + tr.holding-row > td {
        border-top: 1px solid rgba(51, 89, 127, 0.1);
    }
}

/* --- Stat panel: subtle inner glow on eval-score number --- */
.portfolio-page .eval-panel.tone-good { background: linear-gradient(180deg, rgba(6, 30, 22, 0.92), rgba(8, 18, 29, 0.97)) !important; }
.portfolio-page .eval-panel.tone-warn { background: linear-gradient(180deg, rgba(26, 20, 6, 0.92), rgba(8, 18, 29, 0.97)) !important; }
.portfolio-page .eval-panel.tone-risk { background: linear-gradient(180deg, rgba(28, 8, 8, 0.9), rgba(8, 18, 29, 0.97)) !important; }

/* ============================================
   EVALUATOR PAGE — DESIGN & LAYOUT POLISH
   ============================================ */

/* --- Section card treatment on desktop --- */
@media (min-width: 769px) {
    .portfolio-evaluator-page .evaluator-steps-section,
    .portfolio-evaluator-page .evaluator-tax-section,
    .portfolio-evaluator-page .evaluator-delta-section,
    .portfolio-evaluator-page .evaluator-holdings-section,
    .portfolio-evaluator-page .evaluator-history-section,
    .portfolio-evaluator-run-page .evaluator-steps-section,
    .portfolio-evaluator-run-page .evaluator-holdings-section,
    .portfolio-evaluator-run-page .evaluator-history-section,
    .portfolio-evaluator-run-page .evaluator-delta-section {
        background: rgba(8, 16, 30, 0.38);
        border: 1px solid rgba(51, 89, 127, 0.22);
        border-top: 2px solid rgba(57, 194, 255, 0.18);
        border-radius: 14px;
        padding: 1.1rem 1.2rem;
    }
    .portfolio-evaluator-page .evaluator-detail-grid,
    .portfolio-evaluator-run-page .evaluator-detail-grid {
        background: rgba(8, 16, 30, 0.38);
        border: 1px solid rgba(51, 89, 127, 0.22);
        border-top: 2px solid rgba(57, 194, 255, 0.13);
        border-radius: 14px;
        padding: 1.1rem 1.2rem;
    }
}

/* --- evaluator-step-card: tone backgrounds + colored top border --- */
.evaluator-step-card.tone-good {
    background: linear-gradient(160deg, rgba(16, 39, 31, 0.85), rgba(11, 21, 34, 0.96));
    border-top: 2px solid rgba(58, 177, 110, 0.5) !important;
}
.evaluator-step-card.tone-warn {
    background: linear-gradient(160deg, rgba(43, 33, 15, 0.85), rgba(11, 21, 34, 0.96));
    border-top: 2px solid rgba(208, 158, 53, 0.5) !important;
}
.evaluator-step-card.tone-risk {
    background: linear-gradient(160deg, rgba(43, 20, 20, 0.85), rgba(11, 21, 34, 0.96));
    border-top: 2px solid rgba(199, 89, 89, 0.5) !important;
}

/* --- audit-holding-card: tone backgrounds --- */
.audit-holding-card.tone-good { background: linear-gradient(160deg, rgba(16, 39, 31, 0.82), rgba(11, 21, 34, 0.96)); }
.audit-holding-card.tone-warn { background: linear-gradient(160deg, rgba(43, 33, 15, 0.82), rgba(11, 21, 34, 0.96)); }
.audit-holding-card.tone-risk { background: linear-gradient(160deg, rgba(43, 20, 20, 0.82), rgba(11, 21, 34, 0.96)); }

/* --- evaluator-step-value: larger + bolder on evaluator pages --- */
.portfolio-evaluator-page .evaluator-step-value,
.portfolio-evaluator-run-page .evaluator-step-value {
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* --- Split-header h3: left border accent on evaluator pages --- */
.portfolio-evaluator-page .split-header h3,
.portfolio-evaluator-run-page .split-header h3 {
    padding-left: 0.6rem;
    border-left: 3px solid rgba(57, 194, 255, 0.5);
    line-height: 1.3;
}

/* --- Health score card: larger primary number --- */
.portfolio-evaluator-page .top-stats-primary .summary-card:first-child .value,
.portfolio-evaluator-run-page .top-stats-primary .summary-card:first-child .value {
    font-size: 1.9rem;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.portfolio-evaluator-page .portfolio-evaluator-start-panel {
    display: grid;
    grid-template-columns: minmax(14rem, 0.75fr) minmax(0, 1.6fr);
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid rgba(129, 174, 223, 0.16);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(11, 21, 36, 0.96), rgba(9, 18, 31, 0.92));
}

.portfolio-evaluator-page .portfolio-evaluator-start-panel.tone-good {
    border-color: rgba(52, 211, 153, 0.26);
}

.portfolio-evaluator-page .portfolio-evaluator-start-panel.tone-warn {
    border-color: rgba(251, 191, 36, 0.26);
}

.portfolio-evaluator-page .portfolio-evaluator-start-panel.tone-risk {
    border-color: rgba(248, 113, 113, 0.28);
}

.portfolio-evaluator-page .portfolio-evaluator-start-copy {
    display: grid;
    align-content: start;
    gap: 0.35rem;
}

.portfolio-evaluator-page .portfolio-evaluator-start-copy span,
.portfolio-evaluator-page .portfolio-evaluator-start-item span {
    color: rgba(139, 209, 255, 0.92);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portfolio-evaluator-page .portfolio-evaluator-start-copy h3 {
    margin: 0;
    color: #f8fbff;
    font-size: 1.18rem;
}

.portfolio-evaluator-page .portfolio-evaluator-start-copy p,
.portfolio-evaluator-page .portfolio-evaluator-start-item small {
    margin: 0;
    color: rgba(203, 213, 225, 0.78);
    line-height: 1.55;
}

.portfolio-evaluator-page .portfolio-evaluator-start-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.portfolio-evaluator-page .portfolio-evaluator-start-item {
    display: grid;
    align-content: start;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid rgba(129, 174, 223, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.portfolio-evaluator-page .portfolio-evaluator-start-item strong {
    color: #f8fbff;
    font-size: 1rem;
    line-height: 1.35;
}

.portfolio-evaluator-page .portfolio-evaluator-start-item a {
    width: fit-content;
    color: #9bdcff;
    font-size: 0.82rem;
    font-weight: 800;
}

.portfolio-evaluator-page .portfolio-evaluator-evidence-panel {
    margin: 1rem 0;
    border: 1px solid rgba(129, 174, 223, 0.14);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.025);
}

.portfolio-evaluator-page .portfolio-evaluator-evidence-panel > summary {
    display: grid;
    gap: 0.25rem;
    padding: 0.95rem 1rem;
    cursor: pointer;
    list-style: none;
}

.portfolio-evaluator-page .portfolio-evaluator-evidence-panel > summary::-webkit-details-marker {
    display: none;
}

.portfolio-evaluator-page .portfolio-evaluator-evidence-panel > summary::after {
    content: "+";
    position: absolute;
    right: 1rem;
    top: 1rem;
    color: rgba(139, 209, 255, 0.95);
    font-weight: 900;
}

.portfolio-evaluator-page .portfolio-evaluator-evidence-panel[open] > summary::after {
    content: "-";
}

.portfolio-evaluator-page .portfolio-evaluator-evidence-panel > summary {
    position: relative;
    padding-right: 2.4rem;
}

.portfolio-evaluator-page .portfolio-evaluator-evidence-panel > summary span {
    color: rgba(139, 209, 255, 0.92);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portfolio-evaluator-page .portfolio-evaluator-evidence-panel > summary strong {
    color: #f8fbff;
    font-size: 1rem;
}

.portfolio-evaluator-page .portfolio-evaluator-evidence-panel > summary small {
    max-width: 60rem;
    color: rgba(203, 213, 225, 0.78);
    line-height: 1.5;
}

.portfolio-evaluator-page .portfolio-evaluator-evidence-panel[open] {
    padding-bottom: 1rem;
}

.portfolio-evaluator-page .portfolio-evaluator-evidence-panel .evaluator-steps-section,
.portfolio-evaluator-page .portfolio-evaluator-evidence-panel .evaluator-detail-grid {
    margin-left: 1rem;
    margin-right: 1rem;
}

@media (max-width: 980px) {
    .portfolio-evaluator-page .portfolio-evaluator-start-panel {
        grid-template-columns: 1fr;
    }

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

    .portfolio-evaluator-page .portfolio-evaluator-evidence-panel .evaluator-steps-section,
    .portfolio-evaluator-page .portfolio-evaluator-evidence-panel .evaluator-detail-grid {
        margin-left: 0.75rem;
        margin-right: 0.75rem;
    }
}

/* --- evaluator-steps-grid: 3 cols on medium desktop (769–1100px) --- */
@media (min-width: 769px) and (max-width: 1100px) {
    .portfolio-evaluator-page .evaluator-steps-section .evaluator-steps-grid,
    .portfolio-evaluator-run-page .evaluator-steps-section .evaluator-steps-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* --- Tax steps grid: cap at 3 columns --- */
.portfolio-evaluator-page .evaluator-tax-section .evaluator-steps-grid,
.portfolio-evaluator-run-page .evaluator-tax-section .evaluator-steps-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) {
    .portfolio-evaluator-page .evaluator-tax-section .evaluator-steps-grid,
    .portfolio-evaluator-run-page .evaluator-tax-section .evaluator-steps-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* --- History table: polished header --- */
.portfolio-evaluator-page .evaluator-history-table th,
.portfolio-evaluator-run-page .evaluator-history-table th {
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.7);
    background: rgba(8, 16, 30, 0.55);
}

/* --- History filter form: inline layout --- */
.portfolio-evaluator-page .history-filter-form,
.portfolio-evaluator-run-page .history-filter-form {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-top: 0.6rem;
}
.portfolio-evaluator-page .history-filter-form label,
.portfolio-evaluator-run-page .history-filter-form label {
    font-size: 0.74rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* --- Delta section: spacing between chip rows --- */
.portfolio-evaluator-page .evaluator-delta-section .detail-chip-row + .detail-chip-row,
.portfolio-evaluator-run-page .evaluator-delta-section .detail-chip-row + .detail-chip-row {
    margin-top: 0.52rem;
}

/* --- Evaluator accounting-summary-grid: add top-accent --- */
@media (min-width: 769px) {
    .portfolio-evaluator-page .accounting-summary-grid,
    .portfolio-evaluator-run-page .accounting-summary-grid {
        padding-top: 0.1rem;
    }
}

/* --- detail-card heading on evaluator page --- */
.portfolio-evaluator-page .evaluator-detail-grid .detail-card h3,
.portfolio-evaluator-run-page .evaluator-detail-grid .detail-card h3 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(148, 163, 184, 0.75);
    margin-bottom: 0.55rem;
    font-weight: 700;
}

/* ============================================
   ACCOUNTING PAGE — DESIGN POLISH
   ============================================ */

/* --- allocation-card: tone gradient backgrounds --- */
.accounting-allocation-card.tone-good {
    background: linear-gradient(160deg, rgba(14, 34, 26, 0.82), rgba(10, 18, 30, 0.96));
}
.accounting-allocation-card.tone-warn {
    background: linear-gradient(160deg, rgba(38, 28, 10, 0.82), rgba(10, 18, 30, 0.96));
}
.accounting-allocation-card.tone-risk {
    background: linear-gradient(160deg, rgba(38, 16, 16, 0.82), rgba(10, 18, 30, 0.96));
}

/* --- Accounting split-header: left accent --- */
.portfolio-accounting-page .split-header h3 {
    padding-left: 0.6rem;
    border-left: 3px solid rgba(57, 194, 255, 0.5);
    line-height: 1.3;
}

/* --- History section: card treatment on desktop --- */
@media (min-width: 769px) {
    .portfolio-accounting-page .accounting-history-section {
        background: rgba(8, 16, 30, 0.38);
        border: 1px solid rgba(51, 89, 127, 0.22);
        border-top: 2px solid rgba(57, 194, 255, 0.18);
        border-radius: 14px;
        padding: 1.1rem 1.2rem;
    }
    .portfolio-accounting-page .accounting-controls {
        background: rgba(8, 16, 30, 0.3);
        border: 1px solid rgba(51, 89, 127, 0.18);
        border-radius: 10px;
        padding: 0.88rem 1rem;
    }
}

/* --- Filter form: 2 cols at 900px --- */
@media (max-width: 900px) and (min-width: 641px) {
    .portfolio-accounting-page .accounting-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* --- Entry panel summary: cyan accent --- */
.accounting-entry-panel > summary {
    color: rgba(57, 194, 255, 0.82);
    font-weight: 600;
    font-size: 0.88rem;
}
.accounting-entry-panel > summary:hover {
    color: rgba(57, 194, 255, 1);
}

/* --- History table header polish --- */
.portfolio-accounting-page .accounting-history-table th {
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.7);
    background: rgba(8, 16, 30, 0.55);
}

/* --- accounting-source-chip: distinct per type --- */
.accounting-source-chip {
    display: inline-flex;
    align-items: center;
    height: 1.45rem;
    padding: 0 0.55rem;
    border-radius: 999px;
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.accounting-source-chip.source-ledger { background: rgba(22, 52, 100, 0.7); color: #93c5fd; border: 1px solid rgba(147,197,253,0.2); }
.accounting-source-chip.source-trade  { background: rgba(14, 50, 36, 0.7); color: #86efac; border: 1px solid rgba(134,239,172,0.2); }
.accounting-source-chip.source-dividend { background: rgba(50, 26, 80, 0.7); color: #c4b5fd; border: 1px solid rgba(196,181,253,0.2); }

/* --- Secondary grid detail card summary polish --- */
.portfolio-accounting-page .accounting-detail-card > summary {
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(168, 196, 224, 0.85);
    letter-spacing: 0.03em;
}
.portfolio-accounting-page .accounting-detail-card > summary:hover {
    color: #d6ecff;
}

/* --- Secondary grid cards: subtle background on desktop --- */
@media (min-width: 769px) {
    .portfolio-accounting-page .accounting-secondary-grid .accounting-detail-card {
        background: rgba(8, 16, 30, 0.32);
        border-color: rgba(51, 89, 127, 0.28);
    }
}

/* ============================================
   TAX PAGE — DESIGN POLISH
   ============================================ */

/* --- Tax split-header: left accent --- */
.portfolio-tax-page .split-header h3 {
    padding-left: 0.6rem;
    border-left: 3px solid rgba(57, 194, 255, 0.5);
    line-height: 1.3;
}

/* --- Tax page history/holdings sections: card treatment on desktop --- */
@media (min-width: 769px) {
    .portfolio-tax-page .evaluator-history-section,
    .portfolio-tax-page .evaluator-holdings-section,
    .portfolio-tax-page .evaluator-tax-section {
        background: rgba(8, 16, 30, 0.38);
        border: 1px solid rgba(51, 89, 127, 0.22);
        border-top: 2px solid rgba(57, 194, 255, 0.18);
        border-radius: 14px;
        padding: 1.1rem 1.2rem;
    }
}

/* --- Tax detail-chip-link: make clickable chips visually distinct --- */
.portfolio-tax-page .detail-chip-row a.detail-chip,
.portfolio-accounting-page .detail-chip-row a.detail-chip {
    border-color: rgba(57, 194, 255, 0.3);
    color: rgba(57, 194, 255, 0.88);
    cursor: pointer;
}
.portfolio-tax-page .detail-chip-row a.detail-chip:hover,
.portfolio-accounting-page .detail-chip-row a.detail-chip:hover {
    background: rgba(57, 194, 255, 0.1);
    border-color: rgba(57, 194, 255, 0.55);
    color: #d6f0ff;
    text-decoration: none;
}

/* --- Tax summary cards: spacing between chip rows --- */
.portfolio-tax-page .summary-card .detail-chip-row + .detail-chip-row {
    margin-top: 0.42rem;
}

/* --- Tax audit step/holding cards: tone backgrounds --- */
.portfolio-tax-page .evaluator-step-card.tone-good,
.portfolio-tax-page .audit-holding-card.tone-good { background: linear-gradient(160deg, rgba(16, 39, 31, 0.82), rgba(11, 21, 34, 0.96)); }
.portfolio-tax-page .evaluator-step-card.tone-warn,
.portfolio-tax-page .audit-holding-card.tone-warn { background: linear-gradient(160deg, rgba(43, 33, 15, 0.82), rgba(11, 21, 34, 0.96)); }
.portfolio-tax-page .evaluator-step-card.tone-risk,
.portfolio-tax-page .audit-holding-card.tone-risk { background: linear-gradient(160deg, rgba(43, 20, 20, 0.82), rgba(11, 21, 34, 0.96)); }

/* ============================================
   GLOBAL — HEADER & NAV POLISH
   ============================================ */

/* --- Logo: subtle gradient text --- */
.logo {
    background: linear-gradient(125deg, #f8fafc 30%, #8ecdf5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* --- beta-tag: cyan pill --- */
.beta-tag {
    border-color: rgba(57, 194, 255, 0.45);
    background: rgba(57, 194, 255, 0.08);
    color: rgba(57, 194, 255, 0.88);
    -webkit-text-fill-color: rgba(57, 194, 255, 0.88);
    font-weight: 800;
    letter-spacing: 0.1em;
}

/* --- Desktop nav links: base + active + hover --- */
@media (min-width: 901px) {
    .nav-link {
        font-size: 0.86rem;
        font-weight: 600;
        color: var(--text-secondary);
        text-decoration: none;
        padding: 0.28rem 0;
        position: relative;
        transition: color 0.12s;
    }
    .nav-link::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: -2px;
        height: 2px;
        background: rgba(57, 194, 255, 0.6);
        border-radius: 2px;
        transform: scaleX(0);
        transition: transform 0.15s ease;
    }
    .nav-link:hover {
        color: var(--text-primary);
    }
    .nav-link:hover::after {
        transform: scaleX(0.6);
    }
    .nav-link.active {
        color: #d6f2ff;
        font-weight: 700;
    }
    .nav-link.active::after {
        transform: scaleX(1);
        background: rgba(57, 194, 255, 0.75);
    }
}

/* --- Header search: cyan glow on focus --- */
.header-stock-search input:focus {
    border-color: rgba(57, 194, 255, 0.45) !important;
    box-shadow: 0 0 0 3px rgba(57, 194, 255, 0.1) !important;
}

/* --- hero: add cyan top accent --- */
.home-v2-hero {
    border-top: 2px solid rgba(57, 194, 255, 0.3);
}

/* ============================================
   GLOBAL — PORTFOLIO PAGE SIDEBAR POLISH
   ============================================ */

/* --- sidebar: subtle gradient bg + accent border --- */
@media (min-width: 769px) {
    .portfolio-page .sidebar {
        background: linear-gradient(180deg, rgba(9, 18, 34, 0.92), rgba(7, 14, 26, 0.96));
        border-right: 1px solid rgba(51, 89, 127, 0.18);
    }
}

/* --- sidebar portfolio count badge --- */
.portfolio-page .sidebar-count {
    background: rgba(57, 194, 255, 0.1);
    border: 1px solid rgba(57, 194, 255, 0.22);
    color: rgba(57, 194, 255, 0.8);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
}


/* ============================================================
   GLOBAL — BUTTON HOVER & INTERACTION POLISH
   ============================================================ */
.btn-primary {
    transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(57, 194, 255, 0.2);
}
.btn-secondary {
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-secondary:hover {
    background: rgba(57, 194, 255, 0.08);
    border-color: rgba(57, 194, 255, 0.38);
    color: #d6f2ff;
}

/* Home hero glow */
.home-v2-hero {
    box-shadow: 0 0 48px rgba(57, 194, 255, 0.08), 0 26px 56px rgba(0, 0, 0, 0.36);
}

/* Hero search-box focus ring */
.search-box:focus-within {
    border-color: rgba(57, 194, 255, 0.45) !important;
    box-shadow: 0 0 0 3px rgba(57, 194, 255, 0.1) !important;
}

/* Stock preview row hover */
.stock-preview-row:hover,
.search-result-item:hover {
    background: rgba(57, 194, 255, 0.06);
}

/* ============================================================
   ACCOUNTING PAGE — TABLE COLOR SEMANTICS & LAYOUT POLISH
   ============================================================ */

/* Debit/credit/balance column colors */
.col-debit   { color: rgba(248, 113, 113, 0.9); }
.col-credit  { color: rgba(52, 211, 153, 0.9); }
.col-positive { color: rgba(52, 211, 153, 0.78); }
.col-negative { color: rgba(248, 113, 113, 0.88); }
.col-muted   { color: rgba(100, 116, 139, 0.5); }

/* Tax breakdown: year group header rows */
.portfolio-accounting-page .accounting-tax-breakdown .accounting-year-group-row td {
    background: rgba(57, 194, 255, 0.06);
    border-top: 1px solid rgba(57, 194, 255, 0.18);
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}
.portfolio-accounting-page .accounting-tax-breakdown {
    margin-bottom: 1rem;
}

/* Table row hover for accounting tables */
.portfolio-accounting-page .accounting-history-table tbody tr:hover,
.portfolio-accounting-page .accounting-secondary-grid table tbody tr:hover {
    background: rgba(57, 194, 255, 0.04);
    transition: background 0.1s;
}

/* Summary grid: 3-col on accounting page desktop to avoid orphan card */
.portfolio-accounting-page .accounting-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
/* 2-col at 640-900px (override the global 1-col rule for accounting) */
@media (max-width: 900px) and (min-width: 640px) {
    .portfolio-accounting-page .accounting-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Cash balance card: primary metric emphasis */
.portfolio-accounting-page .accounting-summary-grid .summary-card:first-child {
    border-top: 2px solid rgba(57, 194, 255, 0.4);
}
.portfolio-accounting-page .accounting-summary-grid .summary-card:first-child .value {
    font-size: 1.6rem;
    font-weight: 800;
}

/* Tone summary cards: colored top border */
.portfolio-accounting-page .accounting-summary-grid .summary-card.tone-good {
    border-top: 2px solid rgba(58, 177, 110, 0.5);
}
.portfolio-accounting-page .accounting-summary-grid .summary-card.tone-warn {
    border-top: 2px solid rgba(208, 158, 53, 0.5);
}
.portfolio-accounting-page .accounting-summary-grid .summary-card.tone-risk {
    border-top: 2px solid rgba(199, 89, 89, 0.5);
}

/* Allocation card: colored top border */
.accounting-allocation-card.tone-good { border-top: 2px solid rgba(58, 177, 110, 0.5); }
.accounting-allocation-card.tone-warn { border-top: 2px solid rgba(208, 158, 53, 0.5); }
.accounting-allocation-card.tone-risk { border-top: 2px solid rgba(199, 89, 89, 0.5); }

/* Entry panel open-state: top accent + separator under summary */
.accounting-entry-panel[open] {
    border-top: 2px solid rgba(57, 194, 255, 0.35);
}
.accounting-entry-panel[open] > summary {
    border-bottom: 1px solid rgba(51, 89, 127, 0.22);
}

/* Disclosure indicator on summary elements */
.accounting-entry-panel > summary::before,
.accounting-detail-card > summary::before {
    content: "▶";
    display: inline-block;
    margin-right: 0.45rem;
    font-size: 0.65rem;
    opacity: 0.55;
    transition: transform 0.18s;
    transform: rotate(0deg);
}
.accounting-entry-panel[open] > summary::before,
.accounting-detail-card[open] > summary::before {
    transform: rotate(90deg);
    opacity: 0.85;
}

/* Filter form: align submit button inline on desktop */
@media (min-width: 901px) {
    .portfolio-accounting-page .accounting-filter-form {
        grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
        align-items: end;
    }
    .portfolio-accounting-page .accounting-filter-form button[type="submit"] {
        min-height: 2.8rem;
        white-space: nowrap;
    }
}

/* Allocation kicker: subtle badge */
.allocation-kicker {
    display: inline-block;
    background: rgba(57, 194, 255, 0.08);
    border: 1px solid rgba(57, 194, 255, 0.18);
    border-radius: 6px;
    padding: 0.16rem 0.5rem;
    color: rgba(57, 194, 255, 0.72);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}
.accounting-allocation-card.tone-risk .allocation-kicker {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.22);
    color: rgba(248, 113, 113, 0.82);
}

/* Delete button: danger style */
.accounting-row-actions .btn-inline[type="submit"] {
    color: rgba(248, 113, 113, 0.75);
    border-color: rgba(239, 68, 68, 0.22);
}
.accounting-row-actions .btn-inline[type="submit"]:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.4);
    color: rgba(248, 113, 113, 1);
}

/* ============================================================
   EVALUATOR PAGE — COLLAPSIBLE HOLDINGS & COMPACT STEPS
   ============================================================ */

/* --- Holding cards as <details> --- */
details.audit-holding-card {
    overflow: hidden;
}
details.audit-holding-card > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    padding: 0.92rem 0.98rem;
    display: block;
}
details.audit-holding-card > summary::-webkit-details-marker,
details.audit-holding-card > summary::marker {
    display: none;
}
/* Disclosure arrow on the holding header right side */
details.audit-holding-card > summary .audit-holding-header::after {
    content: "▾";
    display: inline-block;
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 0.5rem;
    font-size: 0.7rem;
    color: rgba(148, 163, 184, 0.45);
    transition: transform 0.15s;
    align-self: center;
}
details.audit-holding-card[open] > summary .audit-holding-header::after {
    transform: rotate(180deg);
    color: rgba(148, 163, 184, 0.7);
}
/* Open state: separator under summary */
details.audit-holding-card[open] > summary {
    border-bottom: 1px solid rgba(51, 89, 127, 0.22);
}
/* Content padding */
details.audit-holding-card > .audit-step-list {
    padding: 0.82rem 0.98rem 0.92rem;
    margin-top: 0;
}
details.audit-holding-card > .audit-holding-factors {
    padding: 0.5rem 0.98rem 0.92rem;
    margin-top: 0;
    border-top: 1px solid rgba(51, 89, 127, 0.15);
}

/* Tone top border on holding cards */
.audit-holding-card.tone-good {
    border-top: 2px solid rgba(58, 177, 110, 0.5) !important;
}
.audit-holding-card.tone-warn {
    border-top: 2px solid rgba(208, 158, 53, 0.5) !important;
}
.audit-holding-card.tone-risk {
    border-top: 2px solid rgba(199, 89, 89, 0.5) !important;
}

/* --- Compact horizontal audit-step-row on evaluator pages --- */
.portfolio-evaluator-page .audit-step-row,
.portfolio-evaluator-run-page .audit-step-row {
    display: grid;
    grid-template-columns: 7rem 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.65rem;
    row-gap: 0.1rem;
    align-items: start;
}
.portfolio-evaluator-page .audit-step-row-title,
.portfolio-evaluator-run-page .audit-step-row-title {
    grid-row: 1 / 3;
    grid-column: 1;
    font-size: 0.67rem;
    letter-spacing: 0.06em;
    padding-top: 0.1rem;
    padding-right: 0.55rem;
    border-right: 1px solid rgba(51, 89, 127, 0.22);
    line-height: 1.35;
    color: rgba(100, 116, 139, 0.88);
    align-self: start;
}
.portfolio-evaluator-page .audit-step-row-value,
.portfolio-evaluator-run-page .audit-step-row-value {
    grid-row: 1;
    grid-column: 2;
    margin-top: 0;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.portfolio-evaluator-page .audit-step-row-detail,
.portfolio-evaluator-run-page .audit-step-row-detail {
    grid-row: 2;
    grid-column: 2;
    margin-top: 0;
    font-size: 0.78rem;
    color: rgba(100, 116, 139, 0.88);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

/* Full-width row spans all step-list columns (fix class alias) */
.portfolio-evaluator-page .audit-step-row-wide,
.portfolio-evaluator-page .audit-step-row-full,
.portfolio-evaluator-run-page .audit-step-row-wide,
.portfolio-evaluator-run-page .audit-step-row-full {
    grid-column: 1 / -1;
    grid-template-columns: 7rem 1fr;
}

/* Tone coloring on step rows */
.portfolio-evaluator-page .audit-step-row.tone-good .audit-step-row-value,
.portfolio-evaluator-run-page .audit-step-row.tone-good .audit-step-row-value {
    color: rgba(52, 211, 153, 0.92);
}
.portfolio-evaluator-page .audit-step-row.tone-warn .audit-step-row-value,
.portfolio-evaluator-run-page .audit-step-row.tone-warn .audit-step-row-value {
    color: rgba(251, 191, 36, 0.92);
}
.portfolio-evaluator-page .audit-step-row.tone-risk .audit-step-row-value,
.portfolio-evaluator-run-page .audit-step-row.tone-risk .audit-step-row-value {
    color: rgba(248, 113, 113, 0.92);
}

/* --- Delta groups: visual separation --- */
.delta-group {
    margin-top: 0.85rem;
    padding-top: 0.72rem;
    border-top: 1px solid rgba(51, 89, 127, 0.18);
}
.delta-group:first-of-type {
    margin-top: 0.5rem;
    padding-top: 0;
    border-top: none;
}
.delta-group-label {
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(100, 116, 139, 0.65);
    margin: 0 0 0.45rem;
}
/* Semantic chip variants for delta */
.detail-chip.chip-changed {
    border-color: rgba(57, 194, 255, 0.3);
    color: rgba(57, 194, 255, 0.85);
}
.detail-chip.chip-added {
    border-color: rgba(58, 177, 110, 0.3);
    color: rgba(52, 211, 153, 0.85);
}
.detail-chip.chip-removed {
    border-color: rgba(199, 89, 89, 0.28);
    color: rgba(248, 113, 113, 0.82);
}
.detail-chip.chip-meta {
    opacity: 0.7;
    font-size: 0.72rem;
}

/* --- History table: score color-coding --- */
.score-tone-good { color: rgba(52, 211, 153, 0.9); }
.score-tone-warn { color: rgba(251, 191, 36, 0.9); font-weight: 700; }
.score-tone-risk { color: rgba(248, 113, 113, 0.9); font-weight: 700; }

/* History table row hover */
.portfolio-evaluator-page .evaluator-history-table tbody tr:hover,
.portfolio-evaluator-run-page .evaluator-history-table tbody tr:hover {
    background: rgba(57, 194, 255, 0.04);
}

/* Diff group headings */
.evaluator-diff-group h4 {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(148, 163, 184, 0.65);
    margin: 0 0 0.45rem;
}
.evaluator-diff-group .detail-list li {
    font-size: 0.8rem;
    line-height: 1.55;
}

/* ============================================================
   Evaluator cleanup — Task 4 supporting styles
   ============================================================ */

/* Fix: accounting-summary-grid wraps top-stats-primary/secondary in a
   4-col grid on the evaluator page, crushing the inner auto-fit grids.
   Override to a simple flex column so each stats block takes full width. */
.portfolio-evaluator-page .accounting-summary-grid,
.portfolio-evaluator-run-page .accounting-summary-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Primary stats block: subtle cyan top-border on each card */
.portfolio-evaluator-page .top-stats-primary .summary-card,
.portfolio-evaluator-run-page .top-stats-primary .summary-card {
    border-top: 2px solid rgba(57, 194, 255, 0.22);
}

/* Secondary stats: smaller value font and tighter chips */
.portfolio-evaluator-page .top-stats-secondary .summary-card .value,
.portfolio-evaluator-run-page .top-stats-secondary .summary-card .value {
    font-size: 1.15rem;
    font-weight: 700;
}
.portfolio-evaluator-page .top-stats-secondary .detail-chip-row .detail-chip,
.portfolio-evaluator-run-page .top-stats-secondary .detail-chip-row .detail-chip {
    font-size: 0.72rem;
    min-height: 1.7rem;
    padding: 0.15rem 0.48rem;
}

/* kv-list / kv-row — key-value pairs (score components, etc.) */
.kv-list {
    display: grid;
    gap: 0.3rem;
    margin-top: 0.35rem;
}
.kv-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.78rem;
    padding: 0.12rem 0;
    border-bottom: 1px solid rgba(51, 89, 127, 0.12);
}
.kv-row:last-child {
    border-bottom: none;
}
.kv-label {
    color: rgba(148, 163, 184, 0.75);
    flex-shrink: 0;
}
.kv-value {
    font-weight: 700;
    color: rgba(226, 232, 240, 0.92);
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.kv-value.tone-good { color: rgba(52, 211, 153, 0.9); }
.kv-value.tone-risk { color: rgba(248, 113, 113, 0.9); }

/* chip-row-context: smaller, dimmer contextual metadata chips */
.chip-row-context .detail-chip {
    font-size: 0.71rem;
    min-height: 1.75rem;
    padding: 0.18rem 0.5rem;
    opacity: 0.78;
}

/* sector-detail-chips: slightly smaller chips inside sector backdrop cards */
.sector-detail-chips .detail-chip {
    font-size: 0.73rem;
    min-height: 1.8rem;
}

/* Priority banner tone left-border accents */
.portfolio-priority-banner.tone-good { border-left: 3px solid rgba(58, 177, 110, 0.55); }
.portfolio-priority-banner.tone-warn { border-left: 3px solid rgba(208, 158, 53, 0.55); }
.portfolio-priority-banner.tone-risk { border-left: 3px solid rgba(199, 89, 89, 0.55); }

/* Priority chip hover */
.portfolio-priority-chip:hover {
    background: rgba(57, 194, 255, 0.1);
    border-color: rgba(57, 194, 255, 0.35);
    color: rgba(214, 242, 255, 0.95);
}

/* Tone-colored detail chips (urgency labels, etc.) */
.detail-chip.tone-risk {
    border-color: rgba(199, 89, 89, 0.38);
    color: rgba(248, 113, 113, 0.92);
    background: rgba(239, 68, 68, 0.06);
}
.detail-chip.tone-warn {
    border-color: rgba(208, 158, 53, 0.38);
    color: rgba(251, 191, 36, 0.92);
    background: rgba(245, 158, 11, 0.06);
}
.detail-chip.tone-good {
    border-color: rgba(58, 177, 110, 0.38);
    color: rgba(52, 211, 153, 0.92);
    background: rgba(16, 185, 129, 0.06);
}

/* Dimmed label prefix inside a chip (e.g. "Weight in portfolio: 15.3%") */
.chip-label {
    opacity: 0.65;
    font-size: 0.82em;
    font-weight: 400;
}

/* Secondary score number inside a chip (e.g. urgency score) */
.chip-score {
    opacity: 0.55;
    font-size: 0.8em;
    font-weight: 400;
    margin-left: 0.38em;
}

/* Replacement reason tags row — visible in summary without expanding */
.replacement-reason-chips {
    padding: 0.2rem 0.98rem 0.6rem;
    margin-top: 0;
    gap: 0.3rem;
}
.replacement-reason-chips .detail-chip,
.detail-chip.chip-reason {
    font-size: 0.7rem;
    min-height: 1.6rem;
    padding: 0.1rem 0.42rem;
    background: rgba(57, 194, 255, 0.04);
    border-color: rgba(57, 194, 255, 0.16);
    color: rgba(148, 163, 184, 0.85);
}

/* When a step row has no value, let the detail span both rows */
.portfolio-evaluator-page .audit-step-row-value:empty,
.portfolio-evaluator-run-page .audit-step-row-value:empty {
    display: none;
}
.portfolio-evaluator-page .audit-step-row:has(.audit-step-row-value:empty) .audit-step-row-detail,
.portfolio-evaluator-run-page .audit-step-row:has(.audit-step-row-value:empty) .audit-step-row-detail {
    grid-row: 1 / 3;
    align-self: center;
}

/* evaluator-detail-grid: widen to 3 cols at larger screens */
@media (min-width: 1200px) {
    .portfolio-evaluator-page .evaluator-detail-grid,
    .portfolio-evaluator-run-page .evaluator-detail-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ── Sidebar AI Agent cards ───────────────────────────────────── */
.sidebar-agents-section {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.sidebar-agents-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.25rem 0.25rem;
}
.sidebar-agents-label {
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted, rgba(255,255,255,0.45));
}
.sidebar-agents-soon {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(57,194,255,0.7);
    background: rgba(57,194,255,0.1);
    border: 1px solid rgba(57,194,255,0.2);
    border-radius: 4px;
    padding: 1px 5px;
}
.sidebar-agent-card {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    opacity: 0.72;
    transition: opacity 0.15s;
}
.sidebar-agent-card--cyan  { border-left: 2px solid rgba(57,194,255,0.35); }
.sidebar-agent-card--amber { border-left: 2px solid rgba(251,191,36,0.35); }
.sidebar-agent-card--purple{ border-left: 2px solid rgba(168,85,247,0.35); }
.sidebar-agent-avatar {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
}
.sidebar-agent-avatar--cyan {
    background: radial-gradient(circle at 35% 35%, rgba(57,194,255,0.55), rgba(57,194,255,0.08));
    border: 1px solid rgba(57,194,255,0.3);
}
.sidebar-agent-avatar--amber {
    background: radial-gradient(circle at 35% 35%, rgba(251,191,36,0.55), rgba(251,191,36,0.08));
    border: 1px solid rgba(251,191,36,0.3);
}
.sidebar-agent-avatar--purple {
    background: radial-gradient(circle at 35% 35%, rgba(168,85,247,0.55), rgba(168,85,247,0.08));
    border: 1px solid rgba(168,85,247,0.3);
}
.sidebar-agent-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.sidebar-agent-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary, rgba(255,255,255,0.9));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-agent-role {
    font-size: 0.7rem;
    color: var(--text-muted, rgba(255,255,255,0.45));
    line-height: 1.3;
    margin-bottom: 0.35rem;
}
.sidebar-agent-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.35);
    cursor: not-allowed;
    width: fit-content;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.sidebar-agent-btn:not([disabled]) {
    color: rgba(57,194,255,0.9);
    border-color: rgba(57,194,255,0.35);
    background: rgba(57,194,255,0.08);
    cursor: pointer;
}
.sidebar-agent-btn:not([disabled]):hover {
    background: rgba(57,194,255,0.16);
    border-color: rgba(57,194,255,0.6);
    color: #39c2ff;
}
.sidebar-agent-cost {
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    padding: 0 4px;
}
.sidebar-agent-btn:not([disabled]) .sidebar-agent-cost {
    color: rgba(57,194,255,0.6);
    background: rgba(57,194,255,0.1);
}

.stock-ai-entry-card {
    border-top: 2px solid rgba(57, 194, 255, 0.24);
    background:
        radial-gradient(circle at top right, rgba(57, 194, 255, 0.08), transparent 30%),
        linear-gradient(180deg, rgba(13, 26, 46, 0.96) 0%, rgba(7, 15, 28, 0.98) 100%);
}

.stock-ai-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.78rem;
}

.stock-ai-panel-heading {
    min-width: 0;
}

.stock-ai-panel-kicker {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.54rem;
    border-radius: 999px;
    border: 1px solid rgba(57, 194, 255, 0.24);
    background: rgba(57, 194, 255, 0.08);
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(57, 194, 255, 0.92);
    margin-bottom: 0.52rem;
}

.stock-ai-panel-heading h2 {
    margin: 0 0 0.22rem;
}

.stock-ai-entry-card .sidebar-agents-balance-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.62rem;
    background: rgba(57, 194, 255, 0.12);
    border: 1px solid rgba(57, 194, 255, 0.22);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(57, 194, 255, 0.88);
    text-decoration: none;
}

.stock-ai-command-deck {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
    gap: 0.82rem;
}

.stock-ai-command-main,
.stock-ai-command-side {
    min-width: 0;
}

.stock-ai-command-main {
    padding: 1rem 1rem 0.95rem;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(17, 35, 60, 0.9) 0%, rgba(10, 20, 36, 0.94) 100%);
    border: 1px solid rgba(57, 194, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.stock-ai-command-side {
    padding: 0.88rem;
    border-radius: 16px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(78, 115, 163, 0.18);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stock-ai-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
    margin-bottom: 0.62rem;
}

.stock-ai-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.48rem;
    padding: 0.14rem 0.54rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.stock-ai-badge--cyan {
    border-color: rgba(57, 194, 255, 0.24);
    background: rgba(57, 194, 255, 0.1);
    color: rgba(57, 194, 255, 0.92);
}

.stock-ai-hero-title {
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    font-weight: 800;
    color: #f7fbff;
    letter-spacing: -0.03em;
    margin-bottom: 0.28rem;
}

.stock-ai-hero-subtitle {
    color: #d4e3f7;
    font-size: 0.86rem;
    line-height: 1.58;
    max-width: 64ch;
    margin-bottom: 0.78rem;
}

.stock-ai-status-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.68rem;
    align-items: center;
    padding: 0.72rem 0.8rem;
    border-radius: 14px;
    background: rgba(3, 10, 20, 0.42);
    border: 1px solid rgba(94, 124, 162, 0.16);
    margin-bottom: 0.78rem;
}

.stock-ai-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    padding: 0.42rem 0.62rem;
    border-radius: 999px;
    border: 1px solid rgba(120, 149, 192, 0.22);
    background: rgba(16, 27, 46, 0.8);
    color: #e8f2ff;
    white-space: nowrap;
}

.stock-ai-status-pill strong {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stock-ai-status-pill.is-good {
    border-color: rgba(16, 185, 129, 0.28);
    color: #9ff0c9;
}

.stock-ai-status-pill.is-warn {
    border-color: rgba(245, 158, 11, 0.28);
    color: #ffd890;
}

.stock-ai-status-pill.is-neutral {
    border-color: rgba(57, 194, 255, 0.2);
    color: #b9e9ff;
}

.stock-ai-status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 0.22rem rgba(255,255,255,0.06);
}

.stock-ai-status-copy {
    color: #b8cae2;
    font-size: 0.8rem;
    line-height: 1.52;
}

.stock-ai-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.stock-ai-summary-card {
    min-width: 0;
    padding: 0.74rem 0.78rem;
    border-radius: 13px;
    background: rgba(7, 14, 24, 0.5);
    border: 1px solid rgba(79, 114, 161, 0.16);
}

.stock-ai-summary-card span {
    display: block;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(136, 162, 198, 0.9);
    margin-bottom: 0.42rem;
}

.stock-ai-summary-card strong {
    display: block;
    color: #f7fbff;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.2;
}

.stock-ai-summary-card em {
    display: block;
    margin-top: 0.28rem;
    color: #8ea5c3;
    font-size: 0.7rem;
    font-style: normal;
    line-height: 1.45;
}

.stock-ai-side-note {
    padding: 0.8rem 0.84rem 0.78rem;
    border-radius: 13px;
    background: linear-gradient(180deg, rgba(57, 194, 255, 0.08), rgba(57, 194, 255, 0.03));
    border: 1px solid rgba(57, 194, 255, 0.16);
}

.stock-ai-side-note span {
    display: block;
    margin-bottom: 0.34rem;
    color: #7fdcff;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stock-ai-side-note p {
    margin: 0;
    color: #d4e8ff;
    font-size: 0.8rem;
    line-height: 1.54;
}

.stock-ai-warning {
    margin-bottom: 0.72rem;
    padding: 0.68rem 0.76rem;
    border-radius: 12px;
    border: 1px solid rgba(245, 158, 11, 0.2);
    background: rgba(245, 158, 11, 0.08);
    color: rgba(251, 191, 36, 0.92);
    font-size: 0.78rem;
    line-height: 1.44;
}

.stock-ai-warning a {
    color: rgba(57, 194, 255, 0.95);
    font-weight: 700;
    text-decoration: none;
}

.stock-ai-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.stock-ai-notify-toggle {
    width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #a6b8d1;
    font-size: 0.78rem;
}

.stock-ai-notify-toggle input {
    accent-color: #39c2ff;
}

.stock-ai-actions .btn-primary,
.stock-ai-actions .btn-secondary {
    min-height: 44px;
}

.stock-ai-actions .sidebar-agent-cost {
    margin-left: 0.45rem;
    opacity: 0.9;
}

.stock-ai-inline-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.62rem 0.85rem;
    margin-top: 0.72rem;
}

.stock-ai-inline-links a {
    color: rgba(57, 194, 255, 0.86);
    text-decoration: none;
    font-size: 0.74rem;
    font-weight: 700;
}

#stock-ai-analysis-modal .ai-modal-box {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 20px;
    padding: 2.5rem 2rem 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
}

#stock-ai-analysis-modal .ai-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #475569;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
}

#stock-ai-analysis-modal .ai-modal-spinner {
    position: relative;
    width: 88px;
    height: 88px;
    margin: 0 auto 1.75rem;
}

#stock-ai-analysis-modal .ai-spinner-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
}

#stock-ai-analysis-modal .ai-spinner-ring--1 {
    inset: 0;
    border-top-color: rgba(57,194,255,0.9);
    border-right-color: rgba(57,194,255,0.2);
    animation: ai-spin 1.6s linear infinite;
}

#stock-ai-analysis-modal .ai-spinner-ring--2 {
    inset: 13px;
    border-right-color: rgba(167,139,250,0.85);
    border-bottom-color: rgba(167,139,250,0.15);
    animation: ai-spin 2.2s linear infinite reverse;
}

#stock-ai-analysis-modal .ai-spinner-ring--3 {
    inset: 26px;
    border-bottom-color: rgba(245,158,11,0.8);
    border-left-color: rgba(245,158,11,0.15);
    animation: ai-spin 1.1s linear infinite;
}

#stock-ai-analysis-modal .ai-spinner-core {
    position: absolute;
    inset: 36px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(57,194,255,0.25) 0%, transparent 70%);
    animation: ai-core-pulse 2.4s ease-in-out infinite;
}

#stock-ai-analysis-modal .ai-modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.4rem;
}

#stock-ai-analysis-modal .ai-modal-subtitle {
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 1.25rem;
}

#stock-ai-analysis-modal .ai-modal-phase {
    font-size: 0.78rem;
    color: #39c2ff;
    min-height: 1.2em;
    margin-bottom: 0.5rem;
}

#stock-ai-analysis-modal .ai-modal-timer {
    font-size: 0.72rem;
    color: #334155;
    margin-bottom: 1.5rem;
}

#stock-ai-analysis-modal .ai-modal-dismiss-note {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

#stock-ai-analysis-modal .stock-ai-modal-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

#stock-ai-analysis-modal .stock-ai-modal-actions .btn-secondary {
    min-width: 160px;
}

#stock-ai-analysis-modal .ai-modal-error {
    display: none;
    font-size: 0.82rem;
    color: #fca5a5;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    margin-top: 0.75rem;
    text-align: left;
}

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

@keyframes ai-core-pulse {
    0%,100% { transform: scale(0.8); opacity: 0.4; }
    50% { transform: scale(1.3); opacity: 1; }
}

@media (max-width: 900px) {
    .stock-ai-panel-head {
        flex-direction: column;
        align-items: stretch;
        gap: 0.7rem;
    }

    .stock-ai-entry-card .sidebar-agents-balance-pill {
        align-self: flex-start;
    }

    .stock-ai-command-deck,
    .stock-ai-status-row,
    .stock-ai-summary-grid {
        grid-template-columns: 1fr;
    }

    .stock-ai-command-main,
    .stock-ai-command-side {
        padding: 0.95rem;
    }

    .stock-ai-status-pill {
        justify-content: center;
    }

    .stock-ai-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .stock-ai-actions .btn-primary,
    .stock-ai-actions .btn-secondary {
        width: 100%;
    }

    .stock-ai-notify-toggle {
        align-items: flex-start;
    }

    .stock-ai-inline-links {
        flex-direction: column;
        gap: 0.55rem;
    }

    #stock-ai-analysis-modal .stock-ai-modal-actions .btn-secondary {
        width: 100%;
    }
}

/* ==========================================================
   IMPORT PAGE — broker picker + panels
   ========================================================== */

/* ── Broker picker ─────────────────────────────────────── */
.portfolio-import-page .broker-picker {
    margin: 0.5rem 0 1.1rem;
}

.portfolio-import-page .portfolio-import-toolbar {
    margin-bottom: 0.9rem;
}

.portfolio-import-page .portfolio-import-activation-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.portfolio-import-page .portfolio-import-activation-card {
    padding: 0.95rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(74, 111, 167, 0.18);
    background: rgba(255, 255, 255, 0.03);
}

.portfolio-import-page .portfolio-import-activation-card h3 {
    margin: 0 0 0.28rem;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.portfolio-import-page .portfolio-import-activation-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.55;
}

.portfolio-import-page .portfolio-import-empty-state {
    display: grid;
    gap: 0.7rem;
    max-width: 42rem;
}

.portfolio-import-page .portfolio-empty-kicker {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.portfolio-import-page .portfolio-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.portfolio-import-page .broker-picker-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin: 0 0 0.55rem;
}

.portfolio-import-page .broker-picker-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.portfolio-import-page .broker-card {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    min-width: min(100%, 260px);
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(51, 89, 127, 0.28);
    background: rgba(9, 18, 31, 0.32);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    user-select: none;
}

.portfolio-import-page .broker-card.is-active {
    border-color: rgba(57, 194, 255, 0.55);
    background: rgba(57, 194, 255, 0.08);
    color: rgba(57, 194, 255, 0.95);
    box-shadow: 0 0 0 1px rgba(57, 194, 255, 0.18) inset;
}

.portfolio-import-page .broker-card:hover {
    border-color: rgba(57, 194, 255, 0.38);
    background: rgba(57, 194, 255, 0.06);
    color: var(--text-primary);
}

.portfolio-import-page .broker-card-copy {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.portfolio-import-page .broker-card-name {
    color: inherit;
    font-weight: 800;
}

.portfolio-import-page .broker-card-detail {
    color: rgba(148, 163, 184, 0.84);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.3;
}

.portfolio-import-page .broker-card.is-active .broker-card-detail {
    color: rgba(186, 230, 253, 0.82);
}

.portfolio-import-page .broker-card-check {
    flex-shrink: 0;
    color: rgba(57, 194, 255, 0.9);
}

/* ── Panel layout ──────────────────────────────────────── */
.portfolio-import-page .broker-panel {
    display: block;
}

.portfolio-import-page .broker-panel-cols {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ── Guide card (left) ─────────────────────────────────── */
.portfolio-import-page .broker-guide-card {
    background: var(--bg-card);
    border: 1px solid rgba(51, 89, 127, 0.22);
    border-top: 2px solid rgba(57, 194, 255, 0.18);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

.portfolio-import-page .broker-guide-heading {
    display: flex;
    align-items: center;
    gap: 0.48rem;
    padding: 0.95rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    margin: 0;
}

.portfolio-import-page .broker-guide-heading::-webkit-details-marker {
    display: none;
}

.portfolio-import-page .broker-guide-heading::after {
    content: "+";
    margin-left: auto;
    color: var(--text-muted);
    font-weight: 800;
}

.portfolio-import-page .broker-guide-card[open] .broker-guide-heading {
    border-bottom: 1px solid rgba(51, 89, 127, 0.18);
}

.portfolio-import-page .broker-guide-card[open] .broker-guide-heading::after {
    content: "−";
}

.portfolio-import-page .broker-guide-heading svg {
    flex-shrink: 0;
    color: rgba(57, 194, 255, 0.65);
}

.portfolio-import-page .broker-guide-steps {
    list-style: none;
    margin: 0;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.portfolio-import-page .broker-guide-step {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.portfolio-import-page .broker-step-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(57, 194, 255, 0.13);
    border: 1px solid rgba(57, 194, 255, 0.3);
    color: rgba(57, 194, 255, 0.9);
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.05rem;
}

.portfolio-import-page .broker-step-text {
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.portfolio-import-page .broker-step-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Screenshot sits flush at the bottom of the guide card */
.portfolio-import-page .broker-screenshot-wrap {
    margin: 0 -1.1rem;
    padding: 0;
    border-top: 1px solid rgba(51, 89, 127, 0.18);
}

.portfolio-import-page .broker-screenshot-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0 0 11px 11px;
}

.portfolio-import-page .broker-screenshot-cap {
    font-size: 0.69rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.38rem 0.8rem 0.6rem;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 0 0 11px 11px;
}

/* ── Upload card (right) ───────────────────────────────── */
.portfolio-import-page .broker-upload-card {
    background: var(--bg-card);
    border: 1px solid rgba(51, 89, 127, 0.22);
    border-top: 2px solid rgba(57, 194, 255, 0.28);
    border-radius: 12px;
    padding: 1rem 1.1rem 1.1rem;
}

.portfolio-import-page .broker-upload-head {
    display: flex;
    align-items: center;
    gap: 0.48rem;
    margin-bottom: 1rem;
    color: rgba(57, 194, 255, 0.65);
}

.portfolio-import-page .broker-upload-heading {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.portfolio-import-page .broker-upload-copy {
    margin: -0.35rem 0 0.85rem;
    color: rgba(203, 213, 225, 0.76);
    font-size: 0.8rem;
    line-height: 1.5;
}

.portfolio-import-page .broker-import-summary {
    display: grid;
    gap: 0.58rem;
    margin: 0 0 0.85rem;
    padding: 0.72rem 0.78rem;
    border: 1px solid rgba(91, 124, 166, 0.2);
    border-radius: 10px;
    background: rgba(8, 18, 35, 0.58);
}

.portfolio-import-page .broker-import-summary-row {
    display: grid;
    gap: 0.16rem;
}

.portfolio-import-page .broker-import-summary-row span {
    color: rgba(125, 211, 252, 0.88);
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portfolio-import-page .broker-import-summary-row strong {
    color: var(--text-primary);
    font-size: 0.82rem;
    line-height: 1.35;
}

.portfolio-import-page .broker-import-summary-row p {
    margin: 0;
    color: rgba(203, 213, 225, 0.75);
    font-size: 0.78rem;
    line-height: 1.45;
}

.portfolio-import-page .broker-upload-form {
    display: flex;
    flex-direction: column;
    gap: 0.72rem;
}

/* Drop zone */
.portfolio-import-page .broker-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 1.4rem 1rem;
    border: 2px dashed rgba(57, 194, 255, 0.22);
    border-radius: 10px;
    background: rgba(57, 194, 255, 0.04);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}

.portfolio-import-page .broker-drop-zone:hover,
.portfolio-import-page .broker-drop-zone.is-dragging {
    border-color: rgba(57, 194, 255, 0.5);
    background: rgba(57, 194, 255, 0.09);
}

.portfolio-import-page .broker-drop-zone.has-file {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.06);
}

.portfolio-import-page .broker-drop-icon {
    color: rgba(57, 194, 255, 0.45);
    margin-bottom: 0.15rem;
    transition: color 0.15s;
}

.portfolio-import-page .broker-drop-zone:hover .broker-drop-icon,
.portfolio-import-page .broker-drop-zone.is-dragging .broker-drop-icon {
    color: rgba(57, 194, 255, 0.75);
}

.portfolio-import-page .broker-drop-zone.has-file .broker-drop-icon {
    color: rgba(16, 185, 129, 0.7);
}

.portfolio-import-page .broker-drop-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.portfolio-import-page .broker-drop-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.portfolio-import-page .broker-file-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.portfolio-import-page .broker-filename {
    font-size: 0.76rem;
    color: rgba(16, 185, 129, 0.85);
    margin: -0.3rem 0 0;
    min-height: 1em;
    word-break: break-all;
}

/* Tax account row */
.portfolio-import-page .broker-form-row {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.portfolio-import-page .broker-form-label {
    font-size: 0.69rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.portfolio-import-page .broker-form-select {
    width: 100%;
    min-height: 38px;
    font-size: 0.82rem;
    background: var(--bg-root);
    border: 1px solid var(--border-active);
    color: #fff;
    padding: 0.38rem 0.6rem;
    border-radius: 8px;
}

/* Delete toggle */
.portfolio-import-page .broker-delete-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: 9px;
    border: 1px solid rgba(51, 89, 127, 0.22);
    background: rgba(9, 18, 31, 0.28);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.portfolio-import-page .broker-delete-toggle:hover {
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.04);
}

.portfolio-import-page .broker-delete-toggle input[type="checkbox"] {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    accent-color: #ef4444;
    cursor: pointer;
}

.portfolio-import-page .broker-delete-copy {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    font-size: 0.81rem;
    color: var(--text-secondary);
}

.portfolio-import-page .broker-delete-copy svg {
    flex-shrink: 0;
    color: rgba(239, 68, 68, 0.55);
}

/* Delete warning */
.portfolio-import-page .broker-delete-warn {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-radius: 8px;
    padding: 0.52rem 0.7rem;
}

.portfolio-import-page .broker-delete-warn svg {
    flex-shrink: 0;
    margin-top: 0.05rem;
    color: #f59e0b;
}

/* Submit button */
.portfolio-import-page .broker-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.46rem;
    width: 100%;
    justify-content: center;
    min-height: 42px;
    font-size: 0.88rem;
    font-weight: 700;
    margin-top: 0.2rem;
}

.portfolio-import-page .broker-submit-btn:disabled {
    cursor: wait;
    opacity: 0.72;
}

/* ── Desktop: two-column layout ────────────────────────── */
@media (min-width: 769px) {
    .portfolio-import-page .broker-panel-cols {
        flex-direction: row;
        align-items: flex-start;
    }
    .portfolio-import-page .broker-guide-card {
        flex: 1 1 0;
        min-width: 0;
        order: 2;
    }
    .portfolio-import-page .broker-upload-card {
        flex: 0 0 340px;
        width: 340px;
        order: 1;
    }
}

/* ── View all transactions link ─────────────────────────── */
.portfolio-import-page .broker-view-tx-row {
    margin-top: 1.1rem;
    text-align: right;
}

.portfolio-import-page .broker-view-tx-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.73rem;
    font-weight: 600;
    color: rgba(57, 194, 255, 0.8);
    text-decoration: none;
    transition: color 0.15s;
}
.portfolio-import-page .broker-view-tx-link:hover {
    color: rgba(57, 194, 255, 1);
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .portfolio-import-page .portfolio-import-activation-strip,
    .portfolio-page .post-create-import-brokers,
    .portfolio-page .post-create-import-actions {
        grid-template-columns: 1fr;
    }

    .portfolio-import-page .portfolio-empty-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .portfolio-import-page .broker-drop-zone {
        padding: 1rem 0.75rem;
    }
    .portfolio-import-page .broker-submit-btn {
        min-height: 48px;
    }
    .portfolio-page .portfolio-post-import-head {
        display: grid;
    }
    .portfolio-page .portfolio-post-import-source {
        justify-self: flex-start;
    }
    .portfolio-page .portfolio-post-import-stats,
    .portfolio-page .portfolio-post-import-grid {
        grid-template-columns: 1fr;
    }
    .portfolio-page .portfolio-empty-actions,
    .portfolio-page .portfolio-empty-grid {
        grid-template-columns: 1fr;
    }
    .portfolio-page .portfolio-empty-actions {
        display: grid;
    }
    .portfolio-page .portfolio-empty-state {
        padding: 1.25rem 1rem;
    }
    .portfolio-page .portfolio-post-import-actions .btn-primary,
    .portfolio-page .portfolio-post-import-actions .btn-secondary,
    .portfolio-page .portfolio-empty-actions .btn-primary,
    .portfolio-page .portfolio-empty-actions .btn-secondary {
        width: 100%;
        min-width: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   PORTFOLIO TRANSACTIONS PAGE  (portfolio_transactions.php)
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Page body ──────────────────────────────────────────── */
.portfolio-transactions-page .tx-page-body {
    padding: 0;
}

.portfolio-transactions-page .active-holdings-overview {
    display: grid;
    gap: 0.95rem;
}

.portfolio-transactions-page .active-holdings-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(51, 89, 127, 0.22);
    border-radius: 8px;
    background: var(--bg-card);
}

.portfolio-transactions-page .active-holdings-kicker {
    margin: 0 0 0.25rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(57, 194, 255, 0.85);
}

.portfolio-transactions-page .active-holdings-head h2 {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    line-height: 1.2;
    color: var(--text-primary);
}

.portfolio-transactions-page .active-holdings-head p:not(.active-holdings-kicker):not(.active-holdings-scan-hint) {
    max-width: 720px;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.portfolio-transactions-page .active-holdings-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.portfolio-transactions-page .active-holdings-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.portfolio-transactions-page .active-holdings-summary-card {
    min-width: 0;
    padding: 0.9rem;
    border: 1px solid rgba(51, 89, 127, 0.22);
    border-radius: 8px;
    background: var(--bg-card);
}

.portfolio-transactions-page .active-holdings-summary-card span,
.portfolio-transactions-page .active-holdings-summary-card small {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.portfolio-transactions-page .active-holdings-summary-card strong {
    display: block;
    margin-top: 0.3rem;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.25;
}

.portfolio-transactions-page .active-holdings-summary-card .pos,
.portfolio-transactions-page .active-holdings-table .pos {
    color: #34d399;
}

.portfolio-transactions-page .active-holdings-summary-card .neg,
.portfolio-transactions-page .active-holdings-table .neg {
    color: #f87171;
}

.portfolio-transactions-page .active-holdings-table {
    min-width: 860px;
}

.portfolio-transactions-page .active-holding-security {
    display: grid;
    gap: 0.24rem;
    min-width: 0;
}

.portfolio-transactions-page .active-holding-security > span:nth-child(2) {
    overflow: hidden;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portfolio-transactions-page .active-holding-muted {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.portfolio-transactions-page .active-holdings-empty {
    gap: 0.5rem;
}

.portfolio-transactions-page .active-holdings-empty-title {
    color: var(--text-primary);
    font-weight: 800;
}

@media (max-width: 760px) {
    .portfolio-transactions-page .active-holdings-head {
        display: grid;
    }

    .portfolio-transactions-page .active-holdings-actions {
        justify-content: stretch;
    }

    .portfolio-transactions-page .active-holdings-actions .btn-primary,
    .portfolio-transactions-page .active-holdings-actions .btn-secondary {
        flex: 1 1 100%;
        min-width: 0;
    }

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

    .portfolio-transactions-page .active-holdings-table {
        min-width: 0;
    }
}

/* ── Toolbar ────────────────────────────────────────────── */
.portfolio-transactions-page .tx-history-guide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 0.85rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(57, 194, 255, 0.18);
    border-radius: 12px;
    background: rgba(8, 18, 35, 0.68);
}

.portfolio-transactions-page .tx-history-guide-copy {
    display: grid;
    gap: 0.22rem;
    min-width: 0;
}

.portfolio-transactions-page .tx-history-guide-copy span {
    color: rgba(125, 211, 252, 0.9);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.portfolio-transactions-page .tx-history-guide-copy strong {
    color: var(--text-primary);
    font-size: 0.92rem;
    line-height: 1.25;
}

.portfolio-transactions-page .tx-history-guide-copy p {
    max-width: 760px;
    margin: 0;
    color: rgba(203, 213, 225, 0.76);
    font-size: 0.82rem;
    line-height: 1.5;
}

.portfolio-transactions-page .tx-history-guide-link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.52rem 0.75rem;
    border: 1px solid rgba(57, 194, 255, 0.24);
    border-radius: 9px;
    background: rgba(14, 116, 144, 0.14);
    color: #dff6ff;
    font-size: 0.78rem;
    font-weight: 850;
    text-decoration: none;
}

.portfolio-transactions-page .tx-history-guide-link:hover,
.portfolio-transactions-page .tx-history-guide-link:focus-visible {
    border-color: rgba(57, 194, 255, 0.42);
    background: rgba(14, 116, 144, 0.22);
}

@media (max-width: 700px) {
    .portfolio-transactions-page .tx-history-guide {
        align-items: stretch;
        flex-direction: column;
        padding: 0.82rem;
    }

    .portfolio-transactions-page .tx-history-guide-link {
        width: 100%;
    }
}

.portfolio-transactions-page .tx-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    background: var(--bg-card);
    border: 1px solid rgba(51, 89, 127, 0.22);
    border-radius: 10px;
    margin-bottom: 0.85rem;
}

.portfolio-transactions-page .tx-total-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.portfolio-transactions-page .tx-import-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.73rem;
    font-weight: 600;
    color: rgba(57, 194, 255, 0.85);
    text-decoration: none;
    transition: color 0.15s;
}
.portfolio-transactions-page .tx-import-link:hover {
    color: rgba(57, 194, 255, 1);
}

/* ── Table container ────────────────────────────────────── */
.portfolio-transactions-page .tx-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid rgba(51, 89, 127, 0.22);
    background: var(--bg-card);
    -webkit-overflow-scrolling: touch;
}

/* ── Table ──────────────────────────────────────────────── */
.portfolio-transactions-page .tx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    min-width: 620px;
}

.portfolio-transactions-page .tx-table thead th {
    padding: 0.55rem 0.75rem;
    text-align: left;
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.16);
    border-bottom: 1px solid rgba(51, 89, 127, 0.2);
    white-space: nowrap;
}

.portfolio-transactions-page .tx-table thead th.num,
.portfolio-transactions-page .tx-table td.num {
    text-align: right;
}

.portfolio-transactions-page .tx-table thead th.actions-head {
    text-align: right;
    width: 72px;
}

/* ── Display rows ───────────────────────────────────────── */
.portfolio-transactions-page .tx-display-row td {
    padding: 0.48rem 0.75rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(51, 89, 127, 0.1);
    white-space: nowrap;
    vertical-align: middle;
}

.portfolio-transactions-page .tx-display-row:last-of-type td,
.portfolio-transactions-page tbody tr:last-child td {
    border-bottom: none;
}

.portfolio-transactions-page .tx-display-row:hover td {
    background: rgba(57, 194, 255, 0.04);
}

.portfolio-transactions-page .tx-table td.date-cell {
    color: var(--text-muted);
    font-size: 0.73rem;
    font-variant-numeric: tabular-nums;
}

.portfolio-transactions-page .tx-table td.ticker-cell {
    font-weight: 700;
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
}

.portfolio-transactions-page .tx-security-link {
    color: inherit;
    font-weight: 900;
    text-decoration: none;
}

.portfolio-transactions-page .tx-security-link:hover,
.portfolio-transactions-page .tx-security-link:focus-visible {
    color: #8ddcff;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.portfolio-transactions-page .tx-table td.account-cell {
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

/* ── Type badges ────────────────────────────────────────── */
.portfolio-transactions-page .tx-badge {
    display: inline-block;
    font-size: 0.61rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.12rem 0.45rem;
    border-radius: 4px;
}

.portfolio-transactions-page .tx-badge.buy {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
}

.portfolio-transactions-page .tx-badge.sell {
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
}

/* ── Action buttons ─────────────────────────────────────── */
.portfolio-transactions-page .tx-actions {
    text-align: right;
    white-space: nowrap;
}

.portfolio-transactions-page .tx-delete-form {
    display: inline;
}

.portfolio-transactions-page .tx-btn-edit,
.portfolio-transactions-page .tx-btn-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    transition: background 0.15s, color 0.15s;
    padding: 0;
    vertical-align: middle;
}

.portfolio-transactions-page .tx-btn-edit {
    color: rgba(57, 194, 255, 0.7);
}
.portfolio-transactions-page .tx-btn-edit:hover {
    background: rgba(57, 194, 255, 0.1);
    color: rgba(57, 194, 255, 1);
}

.portfolio-transactions-page .tx-btn-del {
    color: rgba(248, 113, 113, 0.6);
    margin-left: 2px;
}
.portfolio-transactions-page .tx-btn-del:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

/* ── Edit row ───────────────────────────────────────────── */
.portfolio-transactions-page .tx-edit-row .tx-edit-cell {
    padding: 0.7rem 0.75rem;
    background: rgba(57, 194, 255, 0.04);
    border-bottom: 1px solid rgba(57, 194, 255, 0.12);
    border-top: 1px solid rgba(57, 194, 255, 0.12);
}

.portfolio-transactions-page .tx-edit-form {
    width: 100%;
}

.portfolio-transactions-page .tx-edit-grid {
    display: grid;
    grid-template-columns: 130px 90px 1fr 100px 110px 100px 110px auto;
    gap: 0.5rem;
    align-items: end;
}

.portfolio-transactions-page .tx-edit-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.portfolio-transactions-page .tx-edit-field label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    white-space: nowrap;
}

.portfolio-transactions-page .tx-edit-field input,
.portfolio-transactions-page .tx-edit-field select {
    width: 100%;
    padding: 0.35rem 0.5rem;
    font-size: 0.77rem;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(51, 89, 127, 0.35);
    border-radius: 6px;
    color: var(--text-primary);
    transition: border-color 0.15s;
    min-width: 0;
    box-sizing: border-box;
}

.portfolio-transactions-page .tx-edit-field input:focus,
.portfolio-transactions-page .tx-edit-field select:focus {
    outline: none;
    border-color: rgba(57, 194, 255, 0.5);
}

/* ── Edit actions ───────────────────────────────────────── */
.portfolio-transactions-page .tx-edit-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-bottom: 1px;
}

.portfolio-transactions-page .tx-save-btn {
    padding: 0.38rem 0.75rem;
    font-size: 0.73rem;
    white-space: nowrap;
}

.portfolio-transactions-page .tx-cancel-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid rgba(51, 89, 127, 0.3);
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.portfolio-transactions-page .tx-cancel-btn:hover {
    background: rgba(51, 89, 127, 0.12);
    color: var(--text-secondary);
}

/* ── Empty state ────────────────────────────────────────── */
.portfolio-transactions-page .tx-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    padding: 3rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid rgba(51, 89, 127, 0.2);
    border-radius: 10px;
    color: var(--text-muted);
    text-align: center;
}

.portfolio-transactions-page .tx-empty-state svg {
    opacity: 0.35;
    color: rgba(57, 194, 255, 0.6);
}

.portfolio-transactions-page .tx-empty-state p {
    margin: 0;
    font-size: 0.83rem;
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .portfolio-transactions-page .tx-edit-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem;
    }

    .portfolio-transactions-page .tx-edit-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        gap: 0.5rem;
    }

    .portfolio-transactions-page .tx-save-btn,
    .portfolio-transactions-page .tx-cancel-btn {
        flex: 1;
        text-align: center;
    }

    .portfolio-transactions-page .tx-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.45rem;
    }
}

/* ── Filter tags bar ────────────────────────────────────── */
.portfolio-transactions-page .tx-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.portfolio-transactions-page .tx-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.7rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: 20px;
    border: 1px solid rgba(51, 89, 127, 0.28);
    background: rgba(0, 0, 0, 0.18);
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.portfolio-transactions-page .tx-filter-tag:hover {
    background: rgba(57, 194, 255, 0.07);
    border-color: rgba(57, 194, 255, 0.3);
    color: var(--text-secondary);
}

/* Active state — each type gets its own accent colour */
.portfolio-transactions-page .tx-filter-tag.is-active,
.portfolio-transactions-page .tx-filter-tag.all.is-active {
    background: rgba(57, 194, 255, 0.12);
    border-color: rgba(57, 194, 255, 0.45);
    color: rgba(57, 194, 255, 0.95);
}

.portfolio-transactions-page .tx-filter-tag.buy.is-active {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.45);
    color: #34d399;
}

.portfolio-transactions-page .tx-filter-tag.sell.is-active {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.portfolio-transactions-page .tx-filter-tag.dividend.is-active {
    background: rgba(57, 194, 255, 0.1);
    border-color: rgba(57, 194, 255, 0.4);
    color: rgba(57, 194, 255, 0.9);
}

.portfolio-transactions-page .tx-filter-tag.tax.is-active,
.portfolio-transactions-page .tx-filter-tag.fee.is-active {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.portfolio-transactions-page .tx-filter-tag.deposit.is-active {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}

.portfolio-transactions-page .tx-filter-count {
    font-size: 0.62rem;
    font-weight: 800;
    opacity: 0.75;
    font-variant-numeric: tabular-nums;
}

/* ── Sortable headers ───────────────────────────────────── */
.portfolio-transactions-page .tx-table thead th.sortable {
    padding: 0;
}

.portfolio-transactions-page .tx-table thead th.sortable a {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.55rem 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
    white-space: nowrap;
}

.portfolio-transactions-page .tx-table thead th.sortable a:hover {
    color: rgba(57, 194, 255, 0.9);
}

.portfolio-transactions-page .tx-sort-arrow {
    font-size: 0.65rem;
    opacity: 0.4;
    font-style: normal;
}

.portfolio-transactions-page .tx-sort-arrow.active {
    opacity: 1;
    color: rgba(57, 194, 255, 0.9);
}

/* ── Ledger rows ────────────────────────────────────────── */
.portfolio-transactions-page .tx-ledger-row td {
    padding: 0.44rem 0.75rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(51, 89, 127, 0.08);
    white-space: nowrap;
    vertical-align: middle;
    background: rgba(0, 0, 0, 0.08);
}

.portfolio-transactions-page .tx-ledger-row:hover td {
    background: rgba(57, 194, 255, 0.03);
}

.portfolio-transactions-page .tx-table td.security-cell {
    color: var(--text-secondary);
    font-size: 0.78rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portfolio-transactions-page .tx-table td.pos { color: #34d399; }
.portfolio-transactions-page .tx-table td.neg { color: #f87171; }

/* Additional badge types for ledger entries */
.portfolio-transactions-page .tx-badge.dividend {
    background: rgba(57, 194, 255, 0.12);
    color: rgba(57, 194, 255, 0.9);
}

.portfolio-transactions-page .tx-badge.tax {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
}

.portfolio-transactions-page .tx-badge.fee {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.portfolio-transactions-page .tx-badge.deposit {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
}

.portfolio-transactions-page .tx-badge.other {
    background: rgba(100, 116, 139, 0.14);
    color: var(--text-muted);
}

/* ── Stipulated (estimated) dividend rows ───────────────── */
.portfolio-transactions-page .tx-stipulated-row {
    opacity: 0.72;
}
.portfolio-transactions-page .tx-stipulated-mark {
    font-size: 0.7rem;
    color: rgba(245, 158, 11, 0.8);
    font-weight: 600;
    cursor: default;
    margin-left: 0.15em;
}
.portfolio-transactions-page .tx-stipulated-label {
    font-size: 0.65rem;
    color: rgba(245, 158, 11, 0.75);
    font-weight: 500;
    font-style: italic;
}

/* ── Pagination ─────────────────────────────────────────── */
.portfolio-transactions-page .tx-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 0 0.25rem;
}

.portfolio-transactions-page .tx-page-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    font-size: 0.73rem;
    font-weight: 600;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1px solid rgba(51, 89, 127, 0.25);
    color: rgba(57, 194, 255, 0.8);
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.portfolio-transactions-page .tx-page-btn:hover {
    background: rgba(57, 194, 255, 0.07);
    border-color: rgba(57, 194, 255, 0.3);
}

.portfolio-transactions-page .tx-page-btn.is-disabled {
    color: var(--text-muted);
    cursor: default;
    opacity: 0.45;
    pointer-events: none;
}

.portfolio-transactions-page .tx-page-info {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    min-width: 48px;
    text-align: center;
}

/* ================================================================
   COMPREHENSIVE MOBILE OPTIMIZATION — ALL PAGES
   Breakpoints: 900px (tablet), 640px (large mobile), 480px (small mobile)
   ================================================================ */

/* ── Model portfolio: top-stats-primary layout (no .portfolio-page prefix) ── */
.model-portfolio-page .top-stats-primary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

@media (max-width: 1380px) {
    .model-portfolio-hero-grid {
        grid-template-columns: 1fr;
    }

    .model-portfolio-hero-side {
        position: static;
    }

    .model-portfolio-page .top-stats-primary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1500px) {
    .model-portfolio-run-page .directory-header {
        grid-template-columns: 1fr;
    }

    .model-portfolio-run-page .directory-header-meta {
        justify-content: flex-start;
    }

    .model-portfolio-run-page .model-portfolio-hero-grid {
        grid-template-columns: 1fr;
    }

    .model-portfolio-run-page .model-portfolio-hero-side {
        position: static;
    }

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

    .model-portfolio-run-context {
        grid-template-columns: 1fr;
    }

    .model-portfolio-run-context-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 1120px) {
    .model-portfolio-page .top-stats-primary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .model-portfolio-run-page .model-portfolio-hero-side .top-stats-secondary,
    .model-portfolio-run-page .model-portfolio-status-grid,
    .model-portfolio-run-page .model-portfolio-follow-suggestions {
        grid-template-columns: 1fr;
    }
}

/* ── Model portfolio pages — 640px breakpoint ── */
@media (max-width: 640px) {
    /* Action cards: tighter padding */
    .model-portfolio-action-card {
        padding: 14px 16px;
        border-radius: 18px;
        gap: 8px;
    }

    .model-portfolio-catalog-head h2 {
        font-size: 1.12rem;
    }

    .model-portfolio-action-metric strong {
        font-size: 1.8rem;
    }

    /* Alert rail: single column */
    .model-portfolio-alert-rail {
        grid-template-columns: 1fr;
    }

    /* Allocation grid: tighter gap at 640px (already 1-col from 900px rule) */
    .model-portfolio-allocation-grid {
        gap: 10px;
    }

    /* Panel: tighter padding */
    .model-portfolio-panel {
        padding: 0.9rem 1rem;
    }
    .model-portfolio-panel-head h2 {
        font-size: 0.92rem;
    }

    /* Card stats: stay 2-col at 640px (was reduced from 3 at 900px) */
    .model-portfolio-card-stats {
        gap: 8px;
    }
    .model-portfolio-card-stats > div {
        padding: 8px 10px;
    }

    /* Quick nav: tighter gap and font */
    .model-portfolio-quick-nav {
        gap: 0.35rem;
        font-size: 0.72rem;
        margin-bottom: 0.8rem;
    }

    /* Filter row: tighter spacing */
    .model-portfolio-filter-row {
        gap: 0.35rem;
    }
    .model-portfolio-filter-group {
        gap: 0.3rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.15rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .model-portfolio-filter-group::-webkit-scrollbar {
        display: none;
    }

    .model-portfolio-filter-group > * {
        flex: 0 0 auto;
    }

    /* Hero h1 scaling */
    .model-portfolio-page .directory-header h1 {
        font-size: clamp(1.5rem, 6vw, 2rem) !important;
    }

    .model-portfolio-page .directory-header {
        padding: 18px 16px;
        border-radius: 18px;
    }

    .model-portfolio-page .directory-header-meta {
        display: none;
    }

    .model-portfolio-dashboard-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .model-portfolio-dashboard-item-metrics {
        grid-column: 1 / -1;
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        padding-left: 42px;
    }

    .model-portfolio-sector-legend-row,
    .model-portfolio-bar-head {
        font-size: 0.88rem;
    }

    .model-portfolio-holdings-table td.holding-detail-cell,
    .model-portfolio-holdings-table td.holding-note-cell,
    .model-portfolio-ledger-table td.ledger-note-cell,
    .model-portfolio-ledger-table td.ledger-open-cell {
        display: none !important;
    }

    .model-portfolio-ledger-table td.ledger-date-cell,
    .model-portfolio-ledger-table td.ledger-action-cell {
        grid-template-columns: minmax(76px, 88px) minmax(0, 1fr) !important;
    }

    /* Action eyebrow: slightly smaller */
    .model-portfolio-action-eyebrow {
        font-size: 0.67rem;
    }
    .model-portfolio-action-card h2 {
        font-size: 1rem;
    }
    .model-portfolio-action-card p {
        font-size: 0.83rem;
    }
}

/* ── Model portfolio pages — 480px breakpoint ── */
@media (max-width: 480px) {
    /* Card stats: 1 column on very small screens */
    .model-portfolio-card-stats {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    /* Action cards: minimal padding */
    .model-portfolio-action-card {
        padding: 12px 14px;
        border-radius: 14px;
    }
    .model-portfolio-action-card h2 {
        font-size: 0.95rem;
    }

    /* Allocation grid: tighter gap at 480px (already 1-col from 900px rule) */
    .model-portfolio-allocation-grid {
        gap: 8px;
    }

    /* Activity strip: reduce minimum card width */
    .model-portfolio-activity-strip {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 8px;
    }

    /* KPI grid: 1 col */
    .model-portfolio-kpi-grid {
        grid-template-columns: 1fr !important;
    }

    /* Ensure model grid is single column */
    .model-portfolio-grid {
        grid-template-columns: 1fr !important;
    }

    .model-portfolio-card {
        padding: 16px;
        border-radius: 18px;
        gap: 14px;
    }

    .model-portfolio-card-head {
        flex-direction: column;
    }

    .model-portfolio-card-status-stack {
        width: 100%;
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .model-portfolio-card-performance-main {
        padding: 14px 15px;
    }

    .model-portfolio-card-performance-note {
        font-size: 0.84rem;
    }

    .model-portfolio-card-summary {
        grid-template-columns: 1fr;
    }

    .model-portfolio-mini-chart-panel {
        padding: 12px;
    }

    .model-portfolio-page .model-portfolio-currency-form {
        width: 100%;
        justify-content: space-between;
    }

    .model-portfolio-page .model-portfolio-currency-form select {
        width: 100%;
        min-width: 0;
    }

    /* Snapshot grid: 1 col */
    .model-portfolio-snapshot-grid {
        grid-template-columns: 1fr !important;
    }

    /* Hero main grid cells: tighter gap */
    .model-portfolio-hero-main,
    .model-portfolio-hero-side {
        gap: 10px;
    }
}

/* ── Portfolio dividends page — mobile ── */
@media (max-width: 640px) {
    .dividends-section-block {
        padding: 0.72rem 0.8rem;
        border-radius: 10px;
        margin-bottom: 0.9rem;
    }
    .dividends-section-heading {
        font-size: 0.63rem;
        margin-bottom: 0.65rem;
    }
    /* Value amounts in dividends stats: slightly smaller */
    .portfolio-dividends-page .value-amount {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .dividends-section-block {
        padding: 0.6rem 0.7rem;
    }
    .portfolio-dividends-page .value-amount {
        font-size: 1.05rem;
    }
}

/* ── Portfolio AI analysis page — mobile ── */
@media (max-width: 640px) {
    /* Tighter agent card header */
    .portfolio-ai-analysis-page .ai-analysis-section {
        margin-bottom: 1rem;
        border-radius: 9px;
    }
    .portfolio-ai-analysis-page .ai-analysis-agent-header {
        padding: 0.7rem 0.9rem;
        gap: 0.5rem;
    }
    /* Meta row: wrap fully and reduce gap */
    .portfolio-ai-analysis-page .ai-analysis-meta {
        gap: 0.35rem;
        margin-left: 0;
        width: 100%;
    }
    .portfolio-ai-analysis-page .ai-analysis-model {
        font-size: 0.63rem;
    }
    .portfolio-ai-analysis-page .ai-analysis-date,
    .portfolio-ai-analysis-page .ai-analysis-tokens {
        font-size: 0.67rem;
    }
    .portfolio-ai-analysis-page .ai-action-btn {
        font-size: 0.63rem;
        padding: 0.15rem 0.38rem;
        gap: 0.22rem;
    }
    .portfolio-ai-analysis-page .ai-analysis-agent-name {
        font-size: 0.88rem;
    }
    /* History toggle: tighter padding */
    .portfolio-ai-analysis-page .ai-analysis-history-toggle {
        padding: 0.6rem 0.9rem;
        font-size: 0.76rem;
    }
    /* History meta: tighter */
    .portfolio-ai-analysis-page .ai-analysis-history-meta {
        padding: 0.5rem 0.9rem;
        gap: 0.38rem;
    }
}

@media (max-width: 480px) {
    .portfolio-ai-analysis-page .ai-analysis-agent-header {
        padding: 0.6rem 0.72rem;
    }
    .portfolio-ai-analysis-page .ai-analysis-agent-icon {
        width: 28px;
        height: 28px;
        border-radius: 6px;
    }
    .portfolio-ai-analysis-page .ai-analysis-agent-icon svg {
        width: 14px;
        height: 14px;
    }
}

/* ── Portfolio accounting page — mobile ── */
@media (max-width: 640px) {
    /* Export buttons: stack vertically */
    .portfolio-accounting-page .accounting-export-group {
        flex-direction: column;
        gap: 0.42rem;
        width: 100%;
    }
    .portfolio-accounting-page .accounting-export-group .btn-secondary {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    /* Allocation card: compact */
    .accounting-allocation-card {
        padding: 0.82rem 0.9rem;
    }
    .accounting-allocation-card h3 {
        font-size: 0.9rem;
    }
    .accounting-allocation-card p {
        font-size: 0.78rem;
    }
}

/* ── Portfolio evaluator pages — sub-640px refinements ── */
@media (max-width: 640px) {
    /* Compact audit step rows */
    .portfolio-evaluator-page .audit-step-row,
    .portfolio-evaluator-run-page .audit-step-row {
        grid-template-columns: 5rem 1fr;
    }
    .portfolio-evaluator-page .audit-step-row-title,
    .portfolio-evaluator-run-page .audit-step-row-title {
        font-size: 0.61rem;
        padding-right: 0.42rem;
    }
    .portfolio-evaluator-page .audit-step-row-value,
    .portfolio-evaluator-run-page .audit-step-row-value {
        font-size: 0.83rem;
    }
    .portfolio-evaluator-page .audit-step-row-detail,
    .portfolio-evaluator-run-page .audit-step-row-detail {
        font-size: 0.74rem;
    }
    /* Step card: compact padding */
    .evaluator-step-card {
        padding: 0.72rem 0.82rem;
    }
    .evaluator-step-title { font-size: 0.62rem; }
    .evaluator-step-value { font-size: 0.9rem; }
}

/* ── Portfolio import page — 480px refinements ── */
@media (max-width: 480px) {
    .portfolio-import-page .broker-drop-zone {
        padding: 0.9rem 0.65rem;
    }
    .portfolio-import-page .broker-guide-steps {
        gap: 0.5rem;
    }
    .portfolio-import-page .broker-step-text {
        font-size: 0.79rem;
    }
}

/* ── Stocks detail page — 480px refinements ── */
@media (max-width: 480px) {
    /* Facts grid: 1 col on very small screens */
    .stock-detail-page .stock-facts-grid {
        grid-template-columns: 1fr;
    }
    /* Projection grid: reduce gap */
    .stock-detail-page .projection-grid {
        gap: 0.35rem;
    }
    /* Score matrix: slightly smaller font */
    .stock-detail-page .score-matrix {
        font-size: 0.74rem;
    }
}

/* ── General portfolio sub-pages: 480px refinements ── */
@media (max-width: 480px) {
    /* Portfolio title and chips: compact */
    .portfolio-page .portfolio-title {
        font-size: 1.1rem;
    }
    .portfolio-page .portfolio-page-subtitle {
        font-size: 0.76rem;
    }
    .portfolio-page .portfolio-chip {
        font-size: 0.65rem;
        padding: 0.14rem 0.38rem;
        min-height: 24px;
    }
    /* Section nav: smaller text */
    .portfolio-section-link {
        font-size: 0.76rem;
        padding: 0.5rem 0.78rem;
    }
    .portfolio-section-group-label {
        font-size: 0.58rem;
    }
}

/* ── Dividends page: table scroll indicator ── */
@media (max-width: 640px) {
    .portfolio-dividends-page .table-container {
        position: relative;
    }
    .portfolio-dividends-page .table-container::after {
        content: '';
        display: block;
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 24px;
        background: linear-gradient(to right, transparent, rgba(10, 19, 31, 0.85));
        pointer-events: none;
        border-radius: 0 10px 10px 0;
    }
}

/* ── Model portfolio card footer: wrap on 480px ── */
@media (max-width: 480px) {
    .model-portfolio-card-footer {
        flex-wrap: wrap;
        gap: 8px;
    }

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

    .model-portfolio-page .model-portfolio-hero-main .top-stats-primary .top-stat-card {
        min-height: 126px;
        gap: 0.42rem;
    }

    .model-portfolio-card-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .model-portfolio-card-actions .btn-secondary {
        flex: 1;
        text-align: center;
        justify-content: center;
    }

    .model-portfolio-mini-chart {
        min-height: 116px;
    }
}

/* ================================================================
   TOP STAT CARD — base styles (model portfolio pages)
   Used in: model_portfolios.php, model_portfolio.php,
            model_portfolio_compare.php, model_portfolio_transactions.php
   ================================================================ */
.top-stat-card {
    background: rgba(12, 22, 40, 0.78);
    border: 1px solid rgba(51, 89, 127, 0.28);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.top-stat-card label {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
    cursor: default;
}
.top-stat-card strong {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-primary, #f1f5f9);
    letter-spacing: -0.025em;
    line-height: 1.1;
}
.top-stat-card-secondary strong {
    font-size: 1.15rem;
}
@media (max-width: 640px) {
    .top-stat-card {
        padding: 0.72rem 0.9rem;
        border-radius: 10px;
    }
    .top-stat-card strong {
        font-size: 1.25rem;
    }
}
@media (max-width: 480px) {
    .top-stat-card {
        padding: 0.6rem 0.75rem;
        border-radius: 9px;
    }
    .top-stat-card strong {
        font-size: 1.1rem;
    }
    .top-stat-card label {
        font-size: 0.6rem;
    }
}

/* Mobile usability pass for portfolio pages */
@media (max-width: 900px) {
    .portfolio-page .portfolio-sticky-nav {
        top: 76px;
        padding: 0.35rem;
        border-radius: 14px;
        background: rgba(7, 12, 22, 0.92);
        box-shadow: 0 10px 24px rgba(2, 8, 23, 0.18);
    }
}

@media (max-width: 640px) {
    .portfolio-page .portfolio-sticky-nav {
        top: 70px;
    }
}

@media (max-width: 640px) {
    .portfolio-page .content,
    .portfolio-page .portfolio-main {
        min-width: 0;
    }

    .portfolio-page .portfolio-toolbar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.85rem;
    }

    .portfolio-page .portfolio-context {
        min-width: 0;
    }

    .portfolio-page .portfolio-title {
        line-height: 1.1;
    }

    .portfolio-page .portfolio-page-subtitle {
        margin: 0;
    }

    .portfolio-page .portfolio-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .portfolio-page .toolbar-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        align-items: stretch;
    }

    .portfolio-page .toolbar-actions .btn-secondary,
    .portfolio-page .toolbar-actions .settings-open-btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    .portfolio-page .toolbar-actions .currency-form,
    .portfolio-page .toolbar-actions select {
        width: 100%;
    }

    .portfolio-page .toolbar-actions .currency-form {
        grid-column: 1 / -1;
    }

    .portfolio-page .toolbar-actions select {
        min-height: 44px;
    }

    .portfolio-page .portfolio-stats-controls {
        margin-bottom: 0.6rem;
    }

    .portfolio-page .totals-mode-toggle {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.4rem;
        align-items: center;
    }

    .portfolio-page .totals-mode-label {
        width: 100%;
    }

    .portfolio-page .top-stats {
        gap: 0.75rem;
    }

    .portfolio-page .top-stats-primary {
        grid-template-columns: 1fr;
    }

    .portfolio-page .top-stats-secondary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .portfolio-page .top-stats-secondary .sector-value-panel,
    .portfolio-page .top-stats-secondary .replacement-data-panel,
    .portfolio-page .top-stats-secondary .replacement-history-panel {
        display: none;
    }

    .portfolio-page .top-stats-primary .value-panel,
    .portfolio-page .top-stats-primary .eval-panel,
    .portfolio-page .top-stats-secondary .value-panel {
        padding: 0.9rem;
        border-radius: 14px;
    }

    .portfolio-page .top-stats-primary .value-amount,
    .portfolio-page .top-stats-primary .eval-score {
        font-size: clamp(1.25rem, 6vw, 1.75rem);
    }

    .portfolio-page .top-stats-secondary .value-amount {
        font-size: 1.02rem;
    }

    .portfolio-page .top-stats-secondary .value-meta-note {
        min-height: 0;
    }

    .portfolio-page .portfolio-priority-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.95rem;
    }

    .portfolio-page .portfolio-priority-meta {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .portfolio-page .portfolio-priority-chip {
        max-width: 100%;
    }

    .portfolio-page .holdings-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.55rem;
    }

    .portfolio-page .holdings-header-meta {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

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

    .portfolio-page .holding-quick-fact {
        min-width: 0;
    }

    .portfolio-page .holding-tax-row {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .portfolio-page .holding-tax-toggle {
        width: 100%;
        overflow: auto;
        padding-bottom: 0.1rem;
    }

    .portfolio-page .holding-tax-toggle .htb {
        min-height: 36px;
        white-space: nowrap;
    }

    .portfolio-page .holdings-table td.holding-dividend-cell,
    .portfolio-page .holdings-table th.th-dividend,
    .portfolio-page .holdings-table tr.holding-support-row {
        display: none !important;
    }

    .portfolio-page .holdings-table td.holding-actions-cell {
        border-top: 1px solid rgba(74, 95, 129, 0.24);
    }

    .portfolio-page .action-stack {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
        width: 100%;
    }

    .portfolio-page .action-stack .badge-mini,
    .portfolio-page .action-stack .action-btn {
        width: 100%;
        min-height: 40px;
        justify-content: center;
    }

    .portfolio-page .portfolio-mobile-details {
        margin-top: 0.85rem;
    }

    .portfolio-page .portfolio-export-panel {
        padding: 0.9rem;
        border-radius: 14px;
    }

    .portfolio-page .portfolio-export-disclosure summary {
        width: 100%;
    }

    .portfolio-page .portfolio-export-panel .export-header {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
    }

    .portfolio-page .portfolio-export-panel .export-format-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        gap: 0.45rem;
    }

    .portfolio-page .portfolio-export-panel .export-format-option {
        width: 100%;
    }

    .portfolio-page .portfolio-export-panel .export-format-option span {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 40px;
    }

    .portfolio-page .portfolio-export-panel .export-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .portfolio-page .portfolio-export-panel .btn-export {
        min-height: 42px;
    }

    .portfolio-page .portfolio-export-panel .export-custom-range {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .portfolio-transactions-page .tx-toolbar {
        padding: 0.9rem;
        gap: 0.75rem;
    }

    .portfolio-transactions-page .tx-total-count {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    .portfolio-transactions-page .tx-import-link {
        width: 100%;
        justify-content: center;
        padding: 0.72rem 0.85rem;
        border: 1px solid rgba(57, 194, 255, 0.18);
        border-radius: 12px;
        background: rgba(57, 194, 255, 0.06);
    }

    .portfolio-transactions-page .tx-filter-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        margin-bottom: 0.75rem;
        -webkit-overflow-scrolling: touch;
    }

    .portfolio-transactions-page .tx-filter-tag {
        flex: 0 0 auto;
    }

    .portfolio-transactions-page .tx-table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .portfolio-transactions-page .tx-table,
    .portfolio-transactions-page .tx-table tbody,
    .portfolio-transactions-page .tx-table tr {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .portfolio-transactions-page .tx-table thead {
        display: none;
    }

    .portfolio-transactions-page .tx-card-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
        margin: 0 0 0.85rem;
        width: 100%;
        max-width: 100%;
        padding: 0.9rem;
        border: 1px solid rgba(51, 89, 127, 0.22);
        border-radius: 16px;
        box-sizing: border-box;
        background:
            linear-gradient(180deg, rgba(15, 30, 49, 0.92) 0%, rgba(12, 24, 40, 0.98) 100%),
            var(--bg-card);
        box-shadow: 0 14px 28px rgba(2, 8, 23, 0.24);
        overflow: hidden;
    }

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

    .portfolio-transactions-page .tx-card-row td {
        display: block;
        width: auto;
        min-width: 0;
        padding: 0;
        white-space: normal;
        border: 0;
    }

    .portfolio-transactions-page .tx-card-row .tx-meta-cell::before,
    .portfolio-transactions-page .tx-card-row .tx-detail-cell::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.28rem;
        font-size: 0.6rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: rgba(161, 180, 208, 0.76);
    }

    .portfolio-transactions-page .tx-card-row .date-cell {
        grid-column: 1 / -1;
        color: var(--text-primary);
        font-size: 0.83rem;
        font-weight: 600;
    }

    .portfolio-transactions-page .tx-date-mobile {
        display: none;
    }

    .portfolio-transactions-page .tx-card-row .type-cell {
        grid-column: 2;
        text-align: right;
        justify-self: end;
    }

    .portfolio-transactions-page .tx-card-row .type-cell::before {
        text-align: right;
    }

    .portfolio-transactions-page .tx-card-row .security-primary-cell {
        grid-column: 1 / -1;
        padding: 0.1rem 0 0.05rem;
        width: 100%;
        min-width: 0;
        justify-self: stretch;
        max-width: none;
        overflow: visible;
        white-space: normal;
    }

    .portfolio-transactions-page .tx-table .tx-card-row td.security-primary-cell,
    .portfolio-transactions-page .tx-table .tx-card-row td.security-cell.security-primary-cell,
    .portfolio-transactions-page .tx-table .tx-card-row td.ticker-cell.security-primary-cell {
        width: 100%;
        max-width: none;
        overflow: visible;
        white-space: normal;
    }

    .portfolio-transactions-page .tx-card-row--actionable .security-primary-cell {
        grid-column: 1 / -1;
        padding-right: 0;
        position: relative;
    }

    .portfolio-transactions-page .tx-card-row .security-primary-cell::before {
        display: none;
    }

    .portfolio-transactions-page .tx-security-line {
        display: flex;
        align-items: center;
        gap: 0.55rem;
        flex: 1 1 auto;
        min-width: 0;
    }

    .portfolio-transactions-page .tx-security-topline {
        display: block;
        min-width: 0;
        width: 100%;
        max-width: 100%;
        position: relative;
    }

    .portfolio-transactions-page .tx-mobile-inline-actions {
        display: none;
    }

    .portfolio-transactions-page .tx-security-line .tx-security-link {
        font-size: 0.98rem;
        line-height: 1.2;
        letter-spacing: -0.02em;
        color: #f8fbff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .portfolio-transactions-page .tx-card-row .tx-detail-cell {
        padding: 0.72rem 0.78rem;
        border: 1px solid rgba(60, 95, 137, 0.22);
        border-radius: 12px;
        background: rgba(11, 20, 34, 0.82);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
    }

    .portfolio-transactions-page .tx-card-row .tx-detail-cell.num,
    .portfolio-transactions-page .tx-card-row .account-cell {
        text-align: left;
    }

    .portfolio-transactions-page .tx-card-row .tx-detail-cell .tx-stipulated-label {
        color: #f8fbff;
        font-weight: 600;
    }

    .portfolio-transactions-page .tx-card-row .shares-cell,
    .portfolio-transactions-page .tx-card-row .price-cell,
    .portfolio-transactions-page .tx-card-row .commission-cell,
    .portfolio-transactions-page .tx-card-row .account-cell {
        font-size: 0.83rem;
    }

    .portfolio-transactions-page .tx-card-row--ledger .shares-cell,
    .portfolio-transactions-page .tx-card-row--ledger .commission-cell,
    .portfolio-transactions-page .tx-card-row--trade .commission-cell,
    .portfolio-transactions-page .tx-card-row--stipulated .shares-cell,
    .portfolio-transactions-page .tx-card-row--stipulated .commission-cell {
        display: none;
    }

    .portfolio-transactions-page .tx-card-row .tx-actions {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.45rem;
        margin-top: 0.05rem;
        padding-top: 0.15rem;
    }

    .portfolio-transactions-page .tx-card-row--actionable .tx-actions {
        grid-column: 2;
        grid-row: 2;
        align-self: start;
        justify-self: end;
        margin-top: 0;
        padding-top: 0;
        width: auto;
    }

    .portfolio-transactions-page .tx-card-row .tx-actions:empty {
        display: none;
    }

    .portfolio-transactions-page .tx-card-row .tx-actions::before {
        display: none;
    }

    .portfolio-transactions-page .tx-card-row .tx-delete-form {
        margin: 0;
    }

    .portfolio-transactions-page .tx-btn-edit,
    .portfolio-transactions-page .tx-btn-del {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .portfolio-transactions-page .tx-edit-row {
        display: block;
        width: 100%;
        margin: -0.25rem 0 0.85rem;
    }

    .portfolio-transactions-page .tx-edit-row .tx-edit-cell {
        display: block;
        border-radius: 0 0 14px 14px;
        border: 1px solid rgba(57, 194, 255, 0.12);
    }

    .portfolio-transactions-page .tx-edit-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-transactions-page .tx-edit-actions {
        flex-direction: column;
    }

    .portfolio-transactions-page .tx-card-row .date-cell::before,
    .portfolio-transactions-page .tx-card-row .type-cell::before {
        display: none;
    }

    .portfolio-transactions-page .tx-card-row .type-cell {
        display: none;
    }

    .portfolio-transactions-page .tx-date-desktop {
        display: none;
    }

    .portfolio-transactions-page .tx-date-mobile {
        display: inline-flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0.28rem;
        font-size: 0.83rem;
        line-height: 1.3;
        color: #dbe9f8;
    }

    .portfolio-transactions-page .tx-date-prefix {
        color: #eff6ff;
        font-weight: 800;
    }

    .portfolio-transactions-page .tx-date-value {
        color: #9fb7d2;
        font-weight: 600;
    }

    .portfolio-transactions-page .tx-card-row .type-cell {
        align-self: center;
    }

    .portfolio-transactions-page .tx-card-row .type-cell .tx-badge {
        min-height: 24px;
        padding: 0.18rem 0.5rem;
        border-radius: 999px;
    }

    .portfolio-transactions-page .tx-card-row--actionable .tx-mobile-inline-actions {
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.28rem;
        flex: 0 0 auto;
        width: 5.5rem;
        padding-right: 0.35rem;
        box-sizing: border-box;
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
    }

    .portfolio-transactions-page .tx-card-row--actionable .tx-mobile-inline-actions .tx-btn-edit,
    .portfolio-transactions-page .tx-card-row--actionable .tx-mobile-inline-actions .tx-btn-del {
        flex: 0 0 38px;
    }

    .portfolio-transactions-page .tx-card-row--actionable .tx-security-line {
        padding-right: 5.85rem;
        box-sizing: border-box;
    }

    .portfolio-transactions-page .tx-card-row--actionable .tx-actions {
        display: none;
    }

    .portfolio-accounting-page .accounting-summary-grid {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }

    .portfolio-accounting-page .summary-card {
        padding: 0.9rem;
        border-radius: 14px;
    }

    .portfolio-accounting-page .accounting-allocation-card {
        padding: 0.95rem;
        border-radius: 14px;
    }

    .portfolio-accounting-page .accounting-allocation-metrics,
    .portfolio-accounting-page .accounting-allocation-reasons {
        gap: 0.35rem;
    }

    .portfolio-accounting-page .accounting-filter-form {
        grid-template-columns: 1fr 1fr;
        gap: 0.55rem;
    }

    .portfolio-accounting-page .accounting-filter-form button[type="submit"] {
        grid-column: 1 / -1;
        min-height: 44px;
    }

    .portfolio-accounting-page .accounting-export-panel,
    .portfolio-accounting-page .accounting-export-panel summary {
        width: 100%;
    }

    .portfolio-accounting-page .accounting-export-group {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .portfolio-accounting-page .accounting-export-group .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .portfolio-accounting-page .accounting-allocation-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .portfolio-accounting-page .accounting-allocation-actions .btn-secondary,
    .portfolio-accounting-page .accounting-allocation-actions select {
        width: 100%;
        min-height: 42px;
    }

    .portfolio-accounting-page .accounting-entry-form {
        grid-template-columns: 1fr;
    }

    .portfolio-accounting-page .accounting-entry-form .btn-primary,
    .portfolio-accounting-page .accounting-entry-form .btn-secondary {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .portfolio-accounting-page .accounting-row-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .portfolio-accounting-page .accounting-row-actions .btn-inline {
        width: 100%;
        justify-content: center;
    }

    .portfolio-accounting-page .accounting-secondary-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

    .portfolio-accounting-page .accounting-history-section .table-container,
    .portfolio-accounting-page .accounting-secondary-grid .table-container {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .portfolio-accounting-page .accounting-history-table,
    .portfolio-accounting-page .accounting-history-table tbody,
    .portfolio-accounting-page .accounting-history-table tr,
    .portfolio-accounting-page .accounting-secondary-grid .market-table,
    .portfolio-accounting-page .accounting-secondary-grid .market-table tbody,
    .portfolio-accounting-page .accounting-secondary-grid .market-table tr {
        display: block;
        width: 100%;
    }

    .portfolio-accounting-page .accounting-history-table thead,
    .portfolio-accounting-page .accounting-secondary-grid .market-table thead {
        display: none;
    }

    .portfolio-accounting-page .accounting-history-table tr,
    .portfolio-accounting-page .accounting-secondary-grid .market-table tbody tr {
        margin: 0 0 0.75rem;
        border: 1px solid rgba(51, 89, 127, 0.22);
        border-radius: 14px;
        background: var(--bg-card);
        overflow: hidden;
    }

    .portfolio-accounting-page .accounting-history-table td,
    .portfolio-accounting-page .accounting-secondary-grid .market-table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
        width: 100%;
        padding: 0.65rem 0.8rem;
        border-bottom: 1px solid rgba(51, 89, 127, 0.1);
        white-space: normal;
    }

    .portfolio-accounting-page .accounting-history-table td:last-child,
    .portfolio-accounting-page .accounting-secondary-grid .market-table td:last-child {
        border-bottom: 0;
    }

    .portfolio-accounting-page .accounting-history-table td::before,
    .portfolio-accounting-page .accounting-secondary-grid .market-table td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        max-width: 42%;
        font-size: 0.63rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--text-muted);
    }

    .portfolio-accounting-page .accounting-history-table td.accounting-mobile-detail-col {
        display: none;
    }
}

@media (max-width: 480px) {
    .portfolio-page .toolbar-actions {
        grid-template-columns: 1fr;
    }

    .portfolio-page .top-stats-secondary {
        grid-template-columns: 1fr;
    }

    .portfolio-page .holding-quick-facts,
    .portfolio-page .action-stack,
    .portfolio-page .portfolio-export-panel .export-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-transactions-page .tx-display-row td,
    .portfolio-transactions-page .tx-ledger-row td,
    .portfolio-accounting-page .accounting-history-table td,
    .portfolio-accounting-page .accounting-secondary-grid .market-table td {
        flex-direction: column;
        align-items: flex-start;
    }

    .portfolio-transactions-page .tx-display-row td::before,
    .portfolio-transactions-page .tx-ledger-row td::before,
    .portfolio-accounting-page .accounting-history-table td::before,
    .portfolio-accounting-page .accounting-secondary-grid .market-table td::before {
        flex: 0 0 auto;
        max-width: none;
    }

    .portfolio-accounting-page .accounting-filter-form {
        grid-template-columns: 1fr;
    }
}

/* Header language switcher: opposite-language flag */
.lang-flag-icon {
    display: block;
    width: 22px;
    height: auto;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.lang-switcher {
    margin-left: 0.75rem;
    border: 1px solid rgba(71, 100, 139, 0.3);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
    padding: 0.22rem;
}

.lang-switcher .divider {
    display: none;
}

.lang-switcher a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    min-height: 2rem;
    padding: 0.14rem;
    border-radius: 999px;
    background: transparent;
}

.lang-switcher a:hover,
.lang-switcher a:focus-visible {
    background: rgba(57, 194, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(57, 194, 255, 0.28);
}

@media (min-width: 901px) {
    header {
        position: sticky;
        top: 0;
        z-index: 60;
        background:
            linear-gradient(180deg, rgba(5, 13, 24, 0.97) 0%, rgba(8, 18, 31, 0.92) 100%) !important;
        border-bottom: 1px solid rgba(79, 116, 159, 0.22) !important;
        box-shadow:
            0 10px 28px rgba(2, 8, 18, 0.26),
            inset 0 -1px 0 rgba(255, 255, 255, 0.03) !important;
        backdrop-filter: blur(18px) saturate(150%);
    }

    header::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent 0%, rgba(79, 197, 255, 0.22) 18%, rgba(79, 197, 255, 0.08) 82%, transparent 100%);
        pointer-events: none;
    }

    .header-inner {
        max-width: 1320px;
        min-height: 80px !important;
        padding: 0 clamp(1rem, 2vw, 1.6rem) !important;
        gap: 1.1rem;
    }

    .logo {
        position: relative;
        flex: 0 0 auto;
        gap: 0.7rem;
        font-size: 1.14rem !important;
        text-decoration: none;
    }

    .logo-wordmark {
        display: inline-flex;
        align-items: center;
        letter-spacing: -0.05em;
    }

    .beta-tag {
        min-height: auto;
        padding: 0.15rem 0.42rem;
        border-radius: 999px;
        background: rgba(57, 194, 255, 0.08);
        border-color: rgba(57, 194, 255, 0.45);
        color: rgba(57, 194, 255, 0.88);
        -webkit-text-fill-color: rgba(57, 194, 255, 0.88);
        box-shadow: none;
    }

    .main-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        margin-left: 1.4rem;
        min-width: 0;
    }

    .nav-links {
        flex: 0 1 auto;
        gap: 0.28rem;
        padding: 0.34rem;
        border: 1px solid rgba(78, 111, 150, 0.22);
        border-radius: 999px;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 70%),
            rgba(8, 18, 31, 0.64);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.03),
            0 10px 30px rgba(1, 7, 17, 0.16);
        backdrop-filter: blur(12px);
    }

    .nav-link {
        min-height: 42px;
        padding: 0.62rem 0.95rem;
        border-radius: 999px;
        border: 1px solid transparent;
        color: rgba(197, 214, 233, 0.86);
        font-size: 0.86rem;
        font-weight: 700;
        letter-spacing: -0.01em;
        transition:
            color 160ms ease,
            background 160ms ease,
            border-color 160ms ease,
            transform 160ms ease,
            box-shadow 160ms ease;
    }

    .nav-link::after {
        display: none;
    }

    .nav-link:hover,
    .nav-link:focus-visible {
        color: #f7fbff;
        background: rgba(255, 255, 255, 0.045);
        border-color: rgba(108, 153, 203, 0.18);
        transform: translateY(-1px);
    }

    .nav-link.active {
        color: #f8fcff;
        background:
            linear-gradient(180deg, rgba(66, 151, 232, 0.2), rgba(66, 151, 232, 0.1));
        border-color: rgba(106, 182, 255, 0.32);
        box-shadow:
            0 8px 20px rgba(18, 80, 139, 0.16),
            inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .header-action-cluster {
        display: flex;
        align-items: center;
        gap: 0.72rem;
        margin-left: auto;
        flex: 0 1 auto;
        min-width: 0;
    }

    .main-nav,
    .nav-links,
    .nav-utils {
        min-width: 0;
    }

    .nav-utils {
        gap: 0.65rem;
        margin-left: 0;
        padding: 0.34rem;
        border: 1px solid rgba(78, 111, 150, 0.22);
        border-radius: 999px;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 70%),
            rgba(8, 18, 31, 0.64);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.03),
            0 10px 30px rgba(1, 7, 17, 0.14);
    }

    .header-stock-search {
        flex: 1 1 180px;
        min-width: 0;
        width: min(260px, 22vw);
    }

    .header-stock-search input {
        min-height: 42px;
        padding: 0.62rem 0.9rem 0.62rem 2.25rem;
        border-radius: 999px !important;
        border-color: rgba(82, 120, 164, 0.28) !important;
        background: rgba(4, 11, 20, 0.88) !important;
        color: #f2f8ff !important;
        font-size: 0.84rem;
    }

    .header-stock-search input::placeholder {
        color: rgba(167, 189, 214, 0.74);
    }

    .header-search-icon {
        left: 0.82rem;
        color: rgba(151, 179, 208, 0.72);
    }

    .market-status {
        min-height: 42px;
        padding: 0.34rem 0.82rem;
        gap: 0.52rem;
        border-radius: 999px;
        border: 1px solid rgba(86, 124, 168, 0.24);
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 75%),
            rgba(7, 16, 29, 0.84);
        color: #d9ebff;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    }

    @media (max-width: 1240px) {
        .header-inner {
            padding-left: 1rem;
            padding-right: 1rem;
        }

        .main-nav {
            margin-left: 1.1rem;
        }

        .nav-links,
        .nav-utils,
        .header-action-cluster {
            gap: 0.45rem;
        }

        .nav-link {
            padding-left: 0.66rem;
            padding-right: 0.66rem;
        }

        .header-stock-search {
            width: clamp(170px, 18vw, 230px);
        }

        .market-status-text {
            max-width: 92px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
    }

    .market-status-text {
        font-size: 0.84rem;
        font-weight: 700;
        letter-spacing: -0.01em;
    }

    .status-dot {
        width: 8px;
        height: 8px;
        box-shadow:
            0 0 0 6px rgba(16, 185, 129, 0.12),
            0 0 18px rgba(16, 185, 129, 0.32);
    }

    .nav-lang-group {
        display: flex;
        align-items: center;
    }

    .lang-switcher {
        margin-left: 0;
        padding: 0;
        border: none;
        background: transparent;
    }

    .lang-switcher a {
        min-width: 42px;
        min-height: 42px;
        padding: 0.2rem;
        border: 1px solid rgba(86, 124, 168, 0.24);
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 75%),
            rgba(7, 16, 29, 0.84);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    }

    .lang-switcher a:hover,
    .lang-switcher a:focus-visible {
        background:
            linear-gradient(180deg, rgba(79, 197, 255, 0.12), rgba(79, 197, 255, 0.04)),
            rgba(10, 21, 38, 0.96);
        border-color: rgba(94, 176, 255, 0.34);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.05),
            0 8px 20px rgba(8, 69, 126, 0.14);
    }

    .nav-auth {
        margin-left: 0;
    }

    .nav-auth .nav-btn {
        min-height: 42px;
        padding: 0.58rem 0.98rem;
        border-radius: 14px !important;
        border: 1px solid rgba(96, 136, 182, 0.32) !important;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 68%),
            rgba(10, 20, 35, 0.94) !important;
        color: #f3f8ff !important;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.04),
            0 14px 34px rgba(2, 7, 18, 0.18) !important;
        font-size: 0.84rem;
        font-weight: 780;
    }

    .nav-auth .nav-btn:hover,
    .nav-auth .nav-btn:focus-visible {
        border-color: rgba(103, 190, 255, 0.42) !important;
        background:
            linear-gradient(180deg, rgba(79, 197, 255, 0.12), rgba(79, 197, 255, 0.04)),
            rgba(10, 20, 35, 0.98) !important;
        color: #ffffff !important;
    }

    .nav-auth .nav-btn-icon {
        min-width: 48px;
        width: 48px;
        padding: 0 !important;
    }
}

.mobile-lang-shortcut {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.35rem;
    min-height: 2.35rem;
    padding: 0.28rem;
}

.mobile-lang-shortcut .lang-flag-icon {
    width: 20px;
}

@media (max-width: 900px) {
    header {
        z-index: 1001 !important;
    }

    header .header-inner {
        position: relative;
        z-index: 1002 !important;
    }

    .mobile-nav-overlay {
        background: rgba(2, 8, 15, 0.78) !important;
        z-index: 1000 !important;
    }

    .mobile-menu-toggle,
    .mobile-auth-shortcut,
    .mobile-lang-shortcut {
        min-width: 44px !important;
        min-height: 44px !important;
        touch-action: manipulation;
    }

    .mobile-menu-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 5px;
        width: 44px !important;
        height: 44px !important;
        padding: 0 !important;
    }

    .mobile-menu-toggle .bar {
        margin: 0 !important;
    }

    .mobile-menu-toggle.active {
        position: fixed;
        top: calc(0.5rem + env(safe-area-inset-top));
        right: calc(0.5rem + env(safe-area-inset-right));
        z-index: 1004 !important;
        background: rgba(19, 36, 61, 0.98) !important;
        border: 1px solid rgba(171, 201, 238, 0.36) !important;
        box-shadow: 0 12px 28px rgba(2, 8, 18, 0.28);
    }

    .main-nav {
        background: linear-gradient(180deg, #0b1626 0%, #13243d 100%) !important;
        border-left: 1px solid rgba(140, 176, 220, 0.42) !important;
        box-shadow: -26px 0 52px rgba(0, 0, 0, 0.52) !important;
        color: #f8fbff !important;
        z-index: 1003 !important;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        padding-bottom: calc(0.9rem + env(safe-area-inset-bottom)) !important;
        overscroll-behavior: contain;
    }

    .main-nav.active,
    .main-nav.active * {
        opacity: 1 !important;
        filter: none !important;
        text-shadow: none !important;
    }

    .nav-mobile-title,
    .nav-link-text,
    .nav-link,
    .lang-switcher a,
    .header-stock-search input {
        color: #f8fbff !important;
        opacity: 1 !important;
    }

    .nav-mobile-section-label {
        color: #bfd3ea !important;
        opacity: 1 !important;
    }

    .nav-mobile-close {
        width: 44px !important;
        min-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        border-radius: 12px !important;
        color: #ffffff !important;
        background: rgba(255, 255, 255, 0.08) !important;
        border-color: rgba(171, 201, 238, 0.36) !important;
    }

    .nav-link {
        background: rgba(255, 255, 255, 0.08) !important;
        border-color: rgba(120, 156, 199, 0.32) !important;
    }

    .nav-link:hover,
    .nav-link:focus-visible {
        background: rgba(104, 174, 255, 0.18) !important;
        border-color: rgba(133, 190, 255, 0.48) !important;
        color: #ffffff !important;
    }

    .nav-link.active {
        background: linear-gradient(180deg, rgba(104, 174, 255, 0.26), rgba(104, 174, 255, 0.16)) !important;
        border-color: rgba(133, 190, 255, 0.62) !important;
        color: #ffffff !important;
    }

    .nav-link-icon,
    .nav-link.active .nav-link-icon,
    .header-search-icon {
        color: #cfe5ff !important;
        opacity: 1 !important;
    }

    .nav-mobile-auth .nav-mobile-auth-btn {
        background: #ffffff !important;
        border-color: #ffffff !important;
        color: #0b1626 !important;
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset !important;
    }

    .header-stock-search input {
        background: rgba(8, 18, 31, 0.96) !important;
        border-color: rgba(133, 168, 212, 0.38) !important;
    }

    .header-stock-search input::placeholder {
        color: #b7cbe2 !important;
        opacity: 1 !important;
    }

    .lang-switcher {
        background: rgba(255, 255, 255, 0.08) !important;
        border-color: rgba(120, 156, 199, 0.32) !important;
    }

    .nav-utils,
    .nav-links,
    .nav-mobile-auth,
    .nav-lang-group,
    .header-action-cluster {
        color: #f8fbff !important;
    }

    .header-action-cluster {
        display: contents;
    }
}

.social-page .social-overview-card,
.social-page .social-empty-state {
    border: 1px solid rgba(92, 116, 147, 0.28);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(10, 18, 32, 0.92), rgba(14, 25, 43, 0.88));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.social-page .social-overview-card {
    padding: 0.9rem 0.95rem;
}

.social-page .social-overview-card-featured {
    padding: 1.15rem 1.1rem;
}

.social-page .social-overview-label {
    display: block;
    color: #b7cade;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.25;
    text-transform: uppercase;
}

.social-page .social-overview-value {
    display: block;
    margin-top: 0.38rem;
    color: #eef5ff;
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.1;
}

.social-page .social-overview-value-featured {
    font-size: clamp(2.2rem, 3.8vw, 3.2rem);
}

.social-page .social-overview-note {
    margin-top: 0.2rem;
}

.social-page .social-empty-state {
    max-width: 1160px;
    margin: 0 auto 1.4rem;
    padding: 1.2rem 1.1rem;
}

.social-page .social-empty-state h2 {
    font-size: 1.05rem;
    color: #eef5ff;
}

.social-page .social-empty-state p {
    margin: 0.45rem 0 0;
    max-width: 62ch;
    color: #c8d8eb;
    line-height: 1.58;
}

.social-page .social-card-title-group {
    min-width: 0;
}

.social-page .social-card-owner-inline {
    display: none;
}

@media (max-width: 900px) {
    .social-page .directory-header {
        display: grid;
        gap: 0.75rem;
    }

    .social-page .directory-meta {
        margin: 0;
    }

    .social-page .social-overview-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .social-page .social-overview-card-featured {
        min-height: 0;
    }

    .social-page .social-table-container {
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    .social-page .social-table,
    .social-page .social-table tbody {
        display: block;
        width: 100%;
    }

    .social-page .social-table tr.social-row-card {
        display: grid !important;
        gap: 0;
        margin-bottom: 0.9rem;
        border: 1px solid rgba(92, 116, 147, 0.34);
        border-radius: 18px;
        background: linear-gradient(180deg, rgba(10, 18, 32, 0.94), rgba(14, 25, 43, 0.92));
        box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
        overflow: hidden;
    }

    .social-page .social-table td {
        display: block !important;
        padding: 0.9rem 0.95rem !important;
        border-bottom: 1px solid rgba(92, 116, 147, 0.16) !important;
        text-align: left !important;
    }

    .social-page .social-table td::before {
        display: none !important;
        content: none !important;
    }

    .social-page .social-card-primary {
        padding-bottom: 0.82rem !important;
    }

    .social-page .social-card-heading {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .social-page .social-card-title-group {
        display: grid;
        gap: 0.18rem;
    }

    .social-page .social-card-title-group strong {
        display: block;
        color: #eef5ff;
        font-size: 1rem;
        line-height: 1.28;
    }

    .social-page .social-card-owner-inline {
        display: block;
        color: #b8cade;
        font-size: 0.79rem;
        line-height: 1.35;
    }

    .social-page .social-owner-cell,
    .social-page .social-cell-holdings,
    .social-page .social-cell-followers,
    .social-page .social-cell-return {
        display: none !important;
    }

    .social-page .portfolio-risk-label {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        padding: 0.28rem 0.55rem;
        border-radius: 999px;
        border: 1px solid rgba(125, 211, 252, 0.26);
        background: rgba(56, 189, 248, 0.08);
        color: #d8ebff;
        font-size: 0.67rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        line-height: 1;
        white-space: nowrap;
    }

    .social-page .listing-quick-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.48rem !important;
        margin-top: 0.72rem !important;
    }

    .social-page .listing-quick-fact {
        padding: 0.58rem 0.62rem !important;
        border-radius: 12px !important;
        border: 1px solid rgba(92, 116, 147, 0.22) !important;
        background: rgba(7, 14, 26, 0.68) !important;
    }

    .social-page .listing-quick-fact.is-return {
        grid-column: 1 / -1;
    }

    .social-page .listing-quick-fact-label {
        font-size: 0.62rem !important;
    }

    .social-page .listing-quick-fact-value {
        font-size: 0.92rem !important;
        line-height: 1.22 !important;
    }

    .social-page .social-actions-cell {
        display: block !important;
        padding: 0.82rem 0.95rem 0.95rem !important;
        border-top: 1px solid rgba(92, 116, 147, 0.18);
        border-bottom: 0 !important;
        background: rgba(255, 255, 255, 0.02);
    }

    .social-page .social-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
        width: 100%;
    }

    .social-page .social-follow-form {
        display: block;
    }

    .social-page .action-link,
    .social-page .social-follow-form .social-follow-btn {
        width: 100%;
        min-height: 42px;
        padding: 0.62rem 0.72rem;
        border-radius: 12px;
        font-size: 0.82rem;
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 560px) {
    .social-page .social-overview-strip {
        grid-template-columns: 1fr;
    }

    .social-page .social-overview-card:last-child {
        grid-column: auto;
    }

    .social-page .social-card-heading {
        display: grid;
        gap: 0.55rem;
    }

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

.mobile-stock-ticker {
    display: none;
}

.mobile-stock-name {
    display: inline;
}

.listing-quick-fact-note {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.18rem;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.25;
}

.listing-quick-fact-note.buy {
    color: rgba(110, 231, 183, 0.92);
}

.listing-quick-fact-note.sell {
    color: rgba(252, 165, 165, 0.94);
}

.listing-quick-fact-note-secondary {
    color: #8fa8c4;
    font-size: 0.64rem;
    font-weight: 600;
}

.market-price-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.08rem;
}

.market-price-main {
    color: #eef5ff;
    font-weight: 800;
}

.market-price-change {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.market-price-change-pct {
    opacity: 0.78;
    font-weight: 600;
}

.market-price-change.buy {
    color: rgba(110, 231, 183, 0.92);
}

.market-price-change.sell {
    color: rgba(252, 165, 165, 0.94);
}

@media (max-width: 900px) {
    .market-directory-page .mobile-stock-ticker-line {
        display: inline-flex;
    }

    .market-directory-page .table-container,
    .companies-page .table-container {
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    .market-directory-page .market-table,
    .market-directory-page .market-table tbody,
    .companies-page .market-table,
    .companies-page .market-table tbody {
        display: block;
        width: 100%;
    }

    .market-directory-page .market-table tr,
    .companies-page .market-table tr {
        display: block !important;
        margin-bottom: 0.72rem !important;
        padding: 0 !important;
        border: 1px solid rgba(92, 116, 147, 0.34) !important;
        border-radius: 16px !important;
        background: linear-gradient(180deg, rgba(10, 18, 32, 0.94), rgba(14, 25, 43, 0.92)) !important;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
        overflow: hidden;
    }

    .market-directory-page .market-table td,
    .companies-page .market-table td {
        display: block !important;
        padding: 0.8rem 0.82rem !important;
        border-bottom: 1px solid rgba(92, 116, 147, 0.16) !important;
        text-align: left !important;
        background: transparent !important;
    }

    .market-directory-page .market-table td::before,
    .companies-page .market-table td::before {
        display: none !important;
        content: none !important;
    }

    .market-directory-page .market-table td.ticker-cell,
    .market-directory-page .market-table td.market-cell-signal,
    .market-directory-page .market-table td.market-cell-score,
    .market-directory-page .market-table td.market-cell-price,
    .companies-page .market-table td.ticker-cell,
    .companies-page .market-table td.company-cell-sector {
        display: none !important;
    }

    .market-directory-page .market-table td.name-cell,
    .companies-page .market-table td.name-cell {
        display: block !important;
        border-bottom: 0 !important;
        padding: 0.95rem 0.95rem 1rem !important;
    }

    .market-directory-page .market-table td.name-cell .cell-value,
    .companies-page .market-table td.name-cell .cell-value {
        display: grid !important;
        grid-template-columns: 12px minmax(0, 1fr);
        gap: 0.56rem;
        align-items: start;
    }

    .market-directory-page .market-table td.name-cell .sector-square,
    .companies-page .market-table td.name-cell .sector-square {
        width: 10px;
        height: 10px;
        margin-top: 0.26rem;
    }

    .market-directory-page .mobile-stock-card-copy,
    .companies-page .mobile-stock-card-copy {
        display: grid !important;
        gap: 0.14rem;
        min-width: 0;
    }

    .market-directory-page .mobile-stock-ticker,
    .companies-page .mobile-stock-ticker {
        display: block;
        color: #eef5ff;
        font-size: 0.88rem;
        font-weight: 800;
        line-height: 1.08;
        letter-spacing: 0.01em;
    }

    .market-directory-page .mobile-stock-name,
    .companies-page .mobile-stock-name {
        display: block;
        color: #c6d7ea;
        font-size: 0.76rem;
        line-height: 1.26;
    }

    .market-directory-page .listing-quick-facts,
    .companies-page .listing-quick-facts {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.38rem !important;
        margin-top: 0.5rem !important;
    }

    .market-directory-page .listing-quick-fact,
    .companies-page .listing-quick-fact {
        padding: 0.38rem 0.44rem !important;
        border-radius: 11px !important;
        border: 1px solid rgba(92, 116, 147, 0.22) !important;
        background: rgba(7, 14, 26, 0.58) !important;
    }

    .market-directory-page .listing-quick-fact.is-price,
    .companies-page .listing-quick-fact.is-sector {
        grid-column: 1 / -1;
    }

    .market-directory-page .listing-quick-fact-label,
    .companies-page .listing-quick-fact-label {
        font-size: 0.54rem !important;
        color: #97afc9 !important;
    }

    .market-directory-page .listing-quick-fact-value,
    .companies-page .listing-quick-fact-value {
        font-size: 0.78rem !important;
        line-height: 1.14 !important;
        white-space: normal !important;
    }

    .market-directory-page .listing-quick-fact .badge-mini {
        min-height: 22px;
        padding: 0.12rem 0.4rem;
        border-radius: 999px;
        font-size: 0.64rem;
    }

    .market-directory-page .blur-row td {
        padding: 0.9rem !important;
    }

    .market-directory-page .listing-quick-facts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.34rem !important;
        margin-top: 0.46rem !important;
    }

    .market-directory-page .listing-quick-fact.is-price {
        grid-column: auto;
    }

    .market-directory-page .listing-quick-fact-note {
        margin-top: 0.1rem;
        font-size: 0.58rem;
    }

    .market-directory-page .listing-quick-fact-note-secondary {
        font-size: 0.56rem;
    }

    .market-directory-page .market-table td.name-cell,
    .companies-page .market-table td.name-cell {
        padding: 0.72rem 0.74rem 0.76rem !important;
    }
}

@media (max-width: 560px) {
    .market-directory-page .market-table td.name-cell,
    .companies-page .market-table td.name-cell {
        padding: 0.68rem 0.7rem 0.74rem !important;
    }

    .companies-page .listing-quick-facts {
        grid-template-columns: 1fr !important;
    }

    .companies-page .listing-quick-fact.is-sector {
        grid-column: auto;
    }

    .market-directory-page .listing-quick-facts {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .market-directory-page .mobile-stock-ticker,
    .companies-page .mobile-stock-ticker {
        font-size: 0.84rem;
    }

    .market-directory-page .mobile-stock-name,
    .companies-page .mobile-stock-name {
        font-size: 0.72rem;
    }
}

.portfolio-page .portfolio-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.1rem;
    align-items: start;
    padding: 1.15rem 1.2rem !important;
    border: 1px solid rgba(86, 122, 165, 0.24);
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(57, 194, 255, 0.12), transparent 34%),
        radial-gradient(circle at bottom left, rgba(29, 78, 216, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(8, 18, 38, 0.7), rgba(7, 15, 28, 0.92)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.portfolio-page .portfolio-toolbar-main {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.portfolio-page .portfolio-toolbar-eyebrow {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 0.2rem 0.52rem;
    border-radius: 999px;
    border: 1px solid rgba(83, 121, 165, 0.34);
    background: rgba(57, 194, 255, 0.08);
    color: #9fdcff;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.portfolio-page .portfolio-page-subtitle {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #a9bfd7;
}

.portfolio-page .portfolio-context {
    gap: 0.32rem;
}

.portfolio-page .portfolio-title {
    font-size: 1.6rem;
    line-height: 1.08;
    letter-spacing: -0.03em;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.portfolio-page .portfolio-toolbar-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    max-width: 32rem;
}

.portfolio-page .portfolio-toolbar-summary-item {
    min-width: 0;
    padding: 0.72rem 0.8rem;
    border-radius: 14px;
    border: 1px solid rgba(83, 121, 165, 0.2);
    background: linear-gradient(180deg, rgba(7, 15, 29, 0.68), rgba(5, 12, 24, 0.46));
}

.portfolio-page .portfolio-toolbar-summary-label {
    display: block;
    margin-bottom: 0.22rem;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #88a6c5;
}

.portfolio-page .portfolio-toolbar-summary-value {
    display: block;
    color: #eef5ff;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
}

.portfolio-page .toolbar-actions {
    align-items: center;
    gap: 0.6rem;
}

.portfolio-page .toolbar-actions .btn-secondary,
.portfolio-page .toolbar-actions .settings-open-btn {
    min-height: 42px;
    padding: 0.55rem 0.92rem;
    border-radius: 12px;
    font-size: 0.82rem;
}

.portfolio-page .toolbar-actions .currency-form {
    border-radius: 12px;
    padding: 0.35rem 0.45rem;
    background: rgba(255,255,255,0.03);
}

.portfolio-page .toolbar-actions .currency-form select {
    min-width: 118px;
    min-height: 40px;
    border-radius: 9px;
    padding: 0.4rem 2rem 0.4rem 0.7rem;
    font-size: 0.82rem;
}

.portfolio-page .portfolio-switcher-mobile {
    display: none;
}

.portfolio-page .portfolio-create-mobile-btn {
    display: none;
}

.portfolio-page .holdings-header-copy {
    display: grid;
    gap: 0.16rem;
}

.portfolio-page .holdings-header-note {
    margin: 0;
    color: #9fb7d2;
    font-size: 0.8rem;
    line-height: 1.45;
}

.portfolio-page .holdings-header-guide,
.portfolio-transactions-page .active-holdings-scan-hint {
    margin: 0.1rem 0 0;
    color: rgba(203, 213, 225, 0.74);
    font-size: 0.76rem;
    line-height: 1.48;
}

.portfolio-page .ticker-line.ticker-with-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.portfolio-page .ticker-line .stock-logo {
    width: 1.45rem;
    height: 1.45rem;
}

.portfolio-page .ticker-line .flag-badge {
    margin-left: 0.12rem;
}

.portfolio-page .holding-stock-link,
.portfolio-transactions-page .active-holding-stock-link {
    color: inherit;
    font-weight: 900;
    text-decoration: none;
}

.portfolio-page .holding-stock-link:hover,
.portfolio-page .holding-stock-link:focus-visible,
.portfolio-transactions-page .active-holding-stock-link:hover,
.portfolio-transactions-page .active-holding-stock-link:focus-visible {
    color: #8ddcff;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

@media (max-width: 900px) {
    .portfolio-page .sidebar {
        display: none !important;
    }

    .portfolio-page .portfolio-switcher-mobile {
        display: block;
        margin-bottom: 0.78rem;
        border: 1px solid rgba(74, 95, 129, 0.28);
        border-radius: 14px;
        background: linear-gradient(180deg, rgba(8, 14, 26, 0.9), rgba(9, 18, 31, 0.94));
        overflow: hidden;
    }

    .portfolio-page .portfolio-switcher-summary {
        list-style: none;
        position: relative;
        cursor: pointer;
        display: grid;
        gap: 0.16rem;
        padding: 0.82rem 0.9rem;
    }

    .portfolio-page .portfolio-switcher-summary::-webkit-details-marker {
        display: none;
    }

    .portfolio-page .portfolio-switcher-summary::after {
        content: "";
        position: absolute;
        top: 0.92rem;
        right: 0.9rem;
        width: 0.56rem;
        height: 0.56rem;
        border-right: 2px solid #9fc8e7;
        border-bottom: 2px solid #9fc8e7;
        transform: rotate(45deg);
        transform-origin: center;
    }

    .portfolio-page .portfolio-switcher-mobile[open] .portfolio-switcher-summary::after {
        transform: rotate(225deg);
    }

    .portfolio-page .portfolio-switcher-kicker {
        font-size: 0.58rem;
        font-weight: 800;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: #8eabc6;
    }

    .portfolio-page .portfolio-switcher-name {
        color: #eef5ff;
        font-size: 0.96rem;
        line-height: 1.2;
    }

    .portfolio-page .portfolio-switcher-meta {
        color: #9fb7d2;
        font-size: 0.74rem;
    }

    .portfolio-page .portfolio-switcher-list {
        display: grid;
        gap: 0.45rem;
        padding: 0 0.82rem 0.82rem;
    }

    .portfolio-page .portfolio-switcher-list .create-p-btn {
        display: none;
    }

    .portfolio-page .portfolio-create-mobile-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.42rem;
        min-height: 44px;
        border-color: rgba(57, 194, 255, 0.34);
        background: linear-gradient(180deg, rgba(14, 46, 76, 0.92), rgba(10, 28, 49, 0.96));
        color: #e4f5ff;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }

    .portfolio-page .portfolio-create-mobile-plus {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.15rem;
        height: 1.15rem;
        border-radius: 999px;
        background: rgba(57, 194, 255, 0.18);
        color: #bfe9ff;
        font-size: 0.88rem;
        font-weight: 800;
        line-height: 1;
    }

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

    .portfolio-page .toolbar-actions {
        width: 100%;
        justify-content: stretch;
    }
}

@media (max-width: 640px) {
    .portfolio-page .portfolio-toolbar {
        padding: 0.88rem !important;
        gap: 0.8rem;
    }

    .portfolio-page .portfolio-toolbar-eyebrow {
        display: none;
    }

    .portfolio-page .portfolio-toolbar-main {
        gap: 0.7rem;
    }

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

    .portfolio-page .portfolio-toolbar-summary-item {
        padding: 0.48rem 0.5rem;
        border-radius: 10px;
    }

    .portfolio-page .portfolio-toolbar-summary-label {
        margin-bottom: 0.12rem;
        font-size: 0.5rem;
    }

    .portfolio-page .portfolio-toolbar-summary-value {
        font-size: 0.82rem;
    }

    .portfolio-page .portfolio-page-subtitle {
        font-size: 0.8rem;
    }

    .portfolio-page .portfolio-title {
        font-size: 1.28rem;
    }

    .portfolio-page .portfolio-meta {
        gap: 0.32rem;
    }

    .portfolio-page .portfolio-chip {
        padding: 0.2rem 0.5rem;
        font-size: 0.62rem;
    }

    .portfolio-page .holdings-header-note {
        font-size: 0.74rem;
    }

    .portfolio-page .ticker-line .stock-logo {
        width: 1.25rem;
        height: 1.25rem;
    }

    .portfolio-page .portfolio-switcher-summary {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.12rem 0.7rem;
        padding: 0.72rem 0.82rem;
    }

    .portfolio-page .portfolio-switcher-summary::after {
        top: 0.86rem;
        right: 0.82rem;
    }

    .portfolio-page .portfolio-switcher-kicker,
    .portfolio-page .portfolio-switcher-name {
        grid-column: 1;
    }

    .portfolio-page .portfolio-switcher-name {
        font-size: 0.92rem;
    }

    .portfolio-page .portfolio-switcher-meta {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
        justify-self: end;
        padding-right: 1rem;
        padding-left: 0.55rem;
        border-left: 1px solid rgba(83, 121, 165, 0.22);
        font-size: 0.68rem;
        text-align: right;
    }

    .portfolio-page .portfolio-switcher-list {
        padding: 0 0.76rem 0.76rem;
    }
}

.holding-mobile-performance,
.holding-mobile-actions {
    display: none;
}

@media (max-width: 900px) {
    .portfolio-page .holdings-table thead {
        display: none;
    }

    .portfolio-page .holdings-table,
    .portfolio-page .holdings-table tbody {
        display: block;
    }

    .portfolio-page .holdings-table tr.holding-row {
        display: block !important;
        margin: 0 0 0.82rem !important;
        border: 1px solid rgba(74, 95, 129, 0.34) !important;
        border-radius: 16px !important;
        background: linear-gradient(180deg, rgba(11, 22, 39, 0.96), rgba(9, 18, 32, 0.94)) !important;
        box-shadow: 0 14px 32px rgba(2, 8, 23, 0.16);
        overflow: hidden;
    }

    .portfolio-page .holdings-table tr.holding-row:last-of-type {
        margin-bottom: 0 !important;
    }

    .portfolio-page .holdings-table tr.holding-row > td {
        border-bottom: 0 !important;
        background: transparent !important;
    }

    .portfolio-page .holdings-table td.holding-main-cell {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.92rem !important;
        box-sizing: border-box !important;
    }

    .portfolio-page .holdings-table td.holding-main-cell::before {
        display: none !important;
        content: none !important;
    }

    .portfolio-page .holdings-table td.metric-amount,
    .portfolio-page .holdings-table td.metric-avg,
    .portfolio-page .holdings-table td.metric-price,
    .portfolio-page .holdings-table td.metric-value,
    .portfolio-page .holdings-table td.metric-pl,
    .portfolio-page .holdings-table td.holding-actions-cell,
    .portfolio-page .holdings-table td.holding-dividend-cell,
    .portfolio-page .holdings-table tr.holding-support-row {
        display: none !important;
    }

    .portfolio-page .holding-main-cell {
        padding-top: 0.92rem !important;
        padding-bottom: 0.92rem !important;
    }

    .portfolio-page .holding-subline {
        margin-top: 0.24rem;
    }

    .portfolio-page .holding-id-row {
        row-gap: 0.28rem;
    }

    .portfolio-page .holding-decision-line {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.34rem;
        margin-top: 0.52rem;
    }

    .portfolio-page .holding-quick-facts {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.42rem;
        margin-top: 0.72rem;
    }

    .portfolio-page .holding-quick-fact {
        padding: 0.5rem 0.56rem;
        border-radius: 10px;
        background: rgba(5, 14, 27, 0.8);
    }

    .portfolio-page .holding-mobile-performance {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.42rem;
        margin-top: 0.54rem;
    }

    .portfolio-page .holding-mobile-metric {
        display: flex;
        flex-direction: column;
        gap: 0.14rem;
        min-width: 0;
        padding: 0.52rem 0.58rem;
        border-radius: 11px;
        border: 1px solid rgba(61, 87, 122, 0.22);
        background: rgba(6, 14, 26, 0.78);
    }

    .portfolio-page .holding-mobile-metric-label {
        font-size: 0.56rem;
        font-weight: 800;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: #8ea6c3;
    }

    .portfolio-page .holding-mobile-metric-value {
        min-width: 0;
        font-size: 0.88rem;
        line-height: 1.3;
        color: #f3f8ff;
    }

    .portfolio-page .holding-mobile-metric-value.buy {
        color: #2ce6a8;
    }

    .portfolio-page .holding-mobile-metric-value.sell {
        color: #ff9a9a;
    }

    .portfolio-page .holding-mobile-metric-suffix {
        font-size: 0.72rem;
        color: #99b3cf;
    }

    .portfolio-page .holding-mobile-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.42rem;
        margin-top: 0.62rem;
    }

    .portfolio-page .holding-mobile-actions .action-btn,
    .portfolio-page .holding-mobile-actions .badge-mini {
        width: 100%;
        min-height: 40px;
        justify-content: center;
        padding: 0.32rem 0.5rem;
        border-radius: 11px;
    }
}

/* Final mobile holdings simplification: keep decision-ready data only. */
@media (max-width: 640px) {
    .portfolio-page .holdings-table tr.holding-row {
        margin-bottom: 0.68rem !important;
        border-radius: 15px !important;
    }

    .portfolio-page .holdings-table td.holding-main-cell {
        padding: 0.78rem !important;
    }

    .portfolio-page .holding-company-name {
        max-width: 18rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .portfolio-page .holding-sector-tag,
    .portfolio-page .holding-native-currency,
    .portfolio-page .holding-tax-row,
    .portfolio-page .holding-quick-facts,
    .portfolio-page .holding-mobile-actions,
    .portfolio-page .holdings-table td.holding-actions-cell,
    .portfolio-page .holdings-table td.holding-dividend-cell,
    .portfolio-page .holdings-table tr.holding-support-row {
        display: none !important;
    }

    .portfolio-page .holding-decision-line {
        margin-top: 0.44rem !important;
    }

    .portfolio-page .holding-mobile-performance {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.42rem;
        margin-top: 0.58rem;
    }

    .portfolio-page .holding-mobile-metric {
        padding: 0.54rem 0.6rem;
    }
}


/* ============================================================
   HOME PAGE - PREMIUM REFRESH
   Late override so legacy home rules do not win on cascade.
   ============================================================ */
@keyframes homePremiumAuroraShift {
    0% { transform: translate3d(-2%, -3%, 0) scale(1); }
    50% { transform: translate3d(3%, 2%, 0) scale(1.04); }
    100% { transform: translate3d(-1%, 4%, 0) scale(0.99); }
}

@keyframes homePremiumFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.home-page.home-v2-premium {
    position: relative;
    display: grid;
    gap: clamp(1.5rem, 2vw, 2.4rem);
    padding-top: clamp(1.2rem, 2vw, 1.8rem);
    padding-bottom: clamp(2rem, 4vw, 4rem);
    isolation: isolate;
}

.home-page.home-v2-premium::before {
    content: "";
    position: absolute;
    inset: -2.5rem -2rem auto;
    height: min(42rem, 58vw);
    border-radius: 40px;
    background:
        radial-gradient(circle at 18% 22%, rgba(86, 198, 255, 0.22), transparent 32%),
        radial-gradient(circle at 82% 18%, rgba(34, 211, 238, 0.16), transparent 28%),
        radial-gradient(circle at 52% 68%, rgba(94, 234, 212, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(8, 15, 28, 0.92), rgba(3, 7, 18, 0));
    filter: blur(18px);
    opacity: 0.95;
    z-index: -2;
    pointer-events: none;
}

.home-page.home-v2-premium::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg, rgba(7, 13, 25, 0.12), transparent 48%),
        repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.035) 0 1px, transparent 1px 82px),
        repeating-linear-gradient(0deg, rgba(148, 163, 184, 0.025) 0 1px, transparent 1px 82px);
    opacity: 0.5;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.18) 72%, transparent);
    z-index: -1;
    pointer-events: none;
}

.home-page.home-v2-premium .home-v2-hero,
.home-page.home-v2-premium .home-v2-resume,
.home-page.home-v2-premium .home-v2-conversion,
.home-page.home-v2-premium .home-v2-block,
.home-page.home-v2-premium .home-v2-workflow {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(129, 168, 215, 0.16);
    background:
        linear-gradient(145deg, rgba(10, 18, 34, 0.92), rgba(4, 9, 20, 0.9)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 24%);
    box-shadow:
        0 32px 64px rgba(2, 6, 23, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.home-page.home-v2-premium .home-v2-hero::before,
.home-page.home-v2-premium .home-v2-conversion::before,
.home-page.home-v2-premium .home-v2-workflow::before {
    content: "";
    position: absolute;
    inset: auto -8% 52% auto;
    width: clamp(14rem, 26vw, 24rem);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(68, 211, 255, 0.26), rgba(68, 211, 255, 0.06) 46%, transparent 72%);
    filter: blur(8px);
    opacity: 0.95;
    animation: homePremiumAuroraShift 16s ease-in-out infinite;
    pointer-events: none;
}

.home-page.home-v2-premium .home-v2-hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
    gap: clamp(1.25rem, 3vw, 2.5rem);
    padding: clamp(1.5rem, 3vw, 2.8rem);
    border-radius: 34px;
    backdrop-filter: blur(14px);
    overflow: visible;
    z-index: 20;
}

.home-page.home-v2-premium .home-v2-hero-visual {
    position: absolute;
    inset: 0 0 0 auto;
    width: min(58rem, 74%);
    height: 100%;
    object-fit: cover;
    object-position: center right;
    opacity: 0.28;
    mix-blend-mode: screen;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.22) 20%, rgba(0, 0, 0, 0.92) 100%);
    mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.22) 20%, rgba(0, 0, 0, 0.92) 100%);
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

.home-page.home-v2-premium > section:not(.home-v2-hero) {
    content-visibility: auto;
    contain-intrinsic-size: auto 640px;
}

.home-page.home-v2-premium .home-v2-copy,
.home-page.home-v2-premium .home-v2-preview {
    position: relative;
    z-index: 1;
}

.home-page.home-v2-premium .home-v2-copy {
    display: grid;
    align-content: start;
    gap: clamp(0.9rem, 1.7vw, 1.25rem);
}

.home-page.home-v2-premium .home-v2-eyebrow {
    gap: 0.75rem;
}

.home-page.home-v2-premium .home-v2-chip {
    border: 1px solid rgba(150, 199, 255, 0.26);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        rgba(6, 12, 24, 0.78);
    color: #d5eefe;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.home-page.home-v2-premium .home-v2-copy h1 {
    max-width: 10.5ch;
    margin: 0;
    font-size: clamp(3.2rem, 6vw, 5.8rem);
    line-height: 0.96;
    letter-spacing: -0.06em;
    font-weight: 800;
    color: #f9fcff;
    text-wrap: balance;
    text-shadow: 0 10px 36px rgba(16, 185, 255, 0.16);
}

.home-page.home-v2-premium .home-v2-copy h1::first-line {
    color: #dff5ff;
}

.home-page.home-v2-premium .home-v2-subtitle {
    max-width: 34rem;
    margin: 0;
    font-size: clamp(1.08rem, 1.8vw, 1.34rem);
    line-height: 1.55;
    color: rgba(229, 241, 255, 0.9);
    text-wrap: pretty;
}

.home-page.home-v2-premium .home-v2-note {
    max-width: 31rem;
    margin: 0;
    color: rgba(170, 196, 223, 0.86);
    font-size: 0.98rem;
    line-height: 1.65;
}

.home-page.home-v2-premium .home-v2-proofline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    max-width: 42rem;
}

.home-page.home-v2-premium .home-v2-proofline span {
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    min-height: 2.35rem;
    padding: 0.5rem 0.72rem 0.5rem 0.5rem;
    border: 1px solid rgba(123, 204, 255, 0.18);
    border-radius: 999px;
    background: rgba(7, 15, 30, 0.62);
    color: rgba(222, 240, 255, 0.88);
    font-size: 0.84rem;
    font-weight: 700;
}

.home-page.home-v2-premium .home-v2-proofline strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(88, 212, 255, 0.34), rgba(94, 234, 212, 0.16));
    color: #e7fbff;
    font-size: 0.72rem;
    line-height: 1;
}

.home-page.home-v2-premium .home-v2-search {
    margin-top: 0.45rem;
    min-height: 4.5rem;
    position: relative;
    z-index: 40;
    overflow: visible;
    border: 1px solid rgba(121, 166, 214, 0.22);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
        rgba(5, 10, 21, 0.88);
    box-shadow:
        0 18px 44px rgba(2, 6, 23, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.home-page.home-v2-premium .home-v2-search .search-suggestions {
    z-index: 5000;
}

.home-page.home-v2-premium .home-v2-search::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(78, 196, 255, 0.08), transparent 28%, transparent 72%, rgba(94, 234, 212, 0.08));
    pointer-events: none;
}

.home-page.home-v2-premium .home-v2-search input {
    position: relative;
    z-index: 1;
    font-size: 1.03rem;
    color: #f8fbff;
}

.home-page.home-v2-premium .home-v2-search input::placeholder {
    color: rgba(165, 190, 219, 0.7);
}

.home-page.home-v2-premium .home-v2-actions,
.home-page.home-v2-premium .home-v2-actions.home-v2-actions-final {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
}

.home-page.home-v2-premium .home-v2-actions .btn-primary,
.home-page.home-v2-premium .home-v2-actions .btn-secondary {
    min-height: 3.35rem;
    padding: 0.95rem 1.3rem;
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.home-page.home-v2-premium .home-v2-actions .btn-primary {
    background: linear-gradient(135deg, #58d4ff, #2cb6ff 52%, #0b8ddd);
    border: 1px solid rgba(120, 226, 255, 0.38);
    color: #02111f;
    box-shadow: 0 18px 36px rgba(44, 182, 255, 0.28);
}

.home-page.home-v2-premium .home-v2-actions .btn-primary:hover {
    box-shadow: 0 24px 46px rgba(44, 182, 255, 0.34);
}

.home-page.home-v2-premium .home-v2-actions .btn-secondary {
    border: 1px solid rgba(132, 174, 223, 0.28);
    background: rgba(10, 18, 35, 0.82);
    color: #e1eefb;
}

.home-page.home-v2-premium .home-v2-links {
    gap: 0.7rem;
}

.home-page.home-v2-premium .home-v2-links a {
    border: 1px solid rgba(131, 170, 216, 0.18);
    border-radius: 999px;
    background: rgba(8, 15, 29, 0.58);
    color: rgba(219, 236, 255, 0.88);
    backdrop-filter: blur(10px);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.home-page.home-v2-premium .home-v2-links a:hover,
.home-page.home-v2-premium .home-v2-links a:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(116, 214, 255, 0.32);
    background: rgba(12, 23, 42, 0.9);
}

.home-page.home-v2-premium .home-v2-trust-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.home-page.home-v2-premium .home-v2-trust-item {
    padding: 1rem 1rem 1.05rem;
    border: 1px solid rgba(122, 162, 206, 0.16);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 58%),
        rgba(7, 14, 27, 0.66);
    min-height: 100%;
}

.home-page.home-v2-premium .home-v2-trust-item strong {
    color: #edf8ff;
    font-size: 0.88rem;
    letter-spacing: 0.02em;
}

.home-page.home-v2-premium .home-v2-trust-item span {
    color: rgba(177, 200, 225, 0.78);
    font-size: 0.86rem;
    line-height: 1.55;
}

.home-page.home-v2-premium .home-v2-preview {
    display: grid;
    align-content: start;
    gap: 1rem;
    padding: clamp(1.2rem, 2vw, 1.6rem);
    border-radius: 28px;
    border: 1px solid rgba(122, 165, 212, 0.22);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 32%),
        linear-gradient(155deg, rgba(14, 30, 55, 0.92), rgba(5, 10, 22, 0.96));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 26px 56px rgba(0, 0, 0, 0.32);
}

.home-page.home-v2-premium .home-v2-preview::after {
    content: "";
    position: absolute;
    inset: auto auto -12% 60%;
    width: 9rem;
    height: 9rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(94, 234, 212, 0.16), transparent 68%);
    filter: blur(10px);
    animation: homePremiumFloat 11s ease-in-out infinite;
    pointer-events: none;
}

.home-page.home-v2-premium .home-v2-preview-head {
    display: grid;
    gap: 0.45rem;
    padding-bottom: 0.85rem;
    padding-right: 0;
    border-bottom: 1px solid rgba(123, 161, 203, 0.16);
}

.home-page.home-v2-premium .home-v2-preview-evaluator {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.95rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid rgba(94, 234, 212, 0.18);
    border-radius: 22px;
    background:
        radial-gradient(circle at top left, rgba(94, 234, 212, 0.12), transparent 38%),
        linear-gradient(180deg, rgba(11, 23, 41, 0.92), rgba(6, 13, 25, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.home-page.home-v2-premium .home-v2-preview-evaluator-score {
    display: grid;
    min-width: 6.2rem;
    padding: 0.78rem 0.8rem;
    border-radius: 18px;
    border: 1px solid rgba(88, 212, 255, 0.18);
    background: rgba(4, 10, 21, 0.72);
}

.home-page.home-v2-premium .home-v2-preview-evaluator-score span,
.home-page.home-v2-premium .home-v2-preview-evaluator-kicker {
    color: rgba(148, 196, 232, 0.82);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.home-page.home-v2-premium .home-v2-preview-evaluator-score strong {
    margin-top: 0.22rem;
    color: #f8fcff;
    font-size: 1.28rem;
    line-height: 1;
    letter-spacing: -0.04em;
}

.home-page.home-v2-premium .home-v2-preview-evaluator p {
    margin: 0.28rem 0 0;
    color: rgba(186, 210, 232, 0.84);
    line-height: 1.55;
    font-size: 0.9rem;
}

.home-page.home-v2-premium .home-v2-preview-kicker {
    padding-right: 0;
}

.home-page.home-v2-premium .home-v2-preview-head h2,
.home-page.home-v2-premium .home-v2-block h2,
.home-page.home-v2-premium .home-v2-focus-head h2,
.home-page.home-v2-premium .home-v2-resume-head h2,
.home-page.home-v2-premium .home-v2-conversion-copy h2 {
    margin: 0;
    font-size: clamp(1.4rem, 2vw, 2rem);
    letter-spacing: -0.04em;
    color: #f5fbff;
}

.home-page.home-v2-premium .home-v2-preview-head p,
.home-page.home-v2-premium .home-v2-block-head p,
.home-page.home-v2-premium .home-v2-focus-head p,
.home-page.home-v2-premium .home-v2-resume-head p,
.home-page.home-v2-premium .home-v2-conversion-copy p {
    margin: 0;
    color: rgba(171, 195, 220, 0.82);
    line-height: 1.6;
}

.home-page.home-v2-premium .home-v2-preview-list,
.home-page.home-v2-premium .home-v2-block-list,
.home-page.home-v2-premium .home-v2-workflow-grid,
.home-page.home-v2-premium .home-v2-resume-side-metrics {
    gap: 0.9rem;
}

.home-page.home-v2-premium .home-v2-preview-row,
.home-page.home-v2-premium .home-v2-list-item,
.home-page.home-v2-premium .home-v2-step,
.home-page.home-v2-premium .home-v2-resume-side-card,
.home-page.home-v2-premium .home-v2-resume-row,
.home-page.home-v2-premium .home-v2-resume-primary {
    position: relative;
    border: 1px solid rgba(127, 166, 209, 0.14);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 48%),
        rgba(8, 15, 29, 0.76);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.home-page.home-v2-premium .home-v2-preview-row {
    padding: 1rem 1.05rem;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.home-page.home-v2-premium .home-v2-preview-row::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 20px 0 0 20px;
    background: linear-gradient(180deg, rgba(88, 214, 255, 0.82), rgba(94, 234, 212, 0.18));
    opacity: 0.64;
}

.home-page.home-v2-premium .home-v2-preview-row:hover,
.home-page.home-v2-premium .home-v2-preview-row:focus-visible,
.home-page.home-v2-premium .home-v2-list-item:hover,
.home-page.home-v2-premium .home-v2-step:hover,
.home-page.home-v2-premium .home-v2-focus-card:hover,
.home-page.home-v2-premium .home-v2-resume-row:hover {
    transform: translateY(-4px);
    border-color: rgba(102, 207, 255, 0.3);
    background:
        linear-gradient(180deg, rgba(118, 214, 255, 0.08), transparent 52%),
        rgba(10, 20, 39, 0.92);
    box-shadow:
        0 20px 34px rgba(2, 6, 23, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.home-page.home-v2-premium .home-v2-row-main,
.home-page.home-v2-premium .home-v2-row-name,
.home-page.home-v2-premium .home-v2-row-meta {
    position: relative;
    z-index: 1;
}

.home-page.home-v2-premium .home-v2-row-ticker {
    color: #f3fbff;
}

.home-page.home-v2-premium .home-v2-row-rank,
.home-page.home-v2-premium .home-v2-row-score {
    color: rgba(156, 196, 235, 0.84);
}

.home-page.home-v2-premium .home-v2-preview-footer {
    padding-top: 0.2rem;
}

.home-page.home-v2-premium .home-v2-preview-footer .btn-secondary {
    width: 100%;
    justify-content: center;
}

.home-page.home-v2-premium .home-v2-resume,
.home-page.home-v2-premium .home-v2-conversion,
.home-page.home-v2-premium .home-v2-workflow,
.home-page.home-v2-premium .home-v2-block {
    padding: clamp(1.25rem, 2.5vw, 2rem);
    border-radius: 28px;
}

.home-page.home-v2-premium .home-v2-resume-head,
.home-page.home-v2-premium .home-v2-conversion {
    gap: 1rem;
}

.home-page.home-v2-premium .home-v2-resume-primary {
    padding: 1.35rem;
}

.home-page.home-v2-premium .home-v2-resume-primary-top {
    gap: 1rem;
}

.home-page.home-v2-premium .home-v2-resume-primary h3 {
    color: #f4fbff;
    letter-spacing: -0.03em;
}

.home-page.home-v2-premium .home-v2-resume-primary p,
.home-page.home-v2-premium .home-v2-resume-prompt p,
.home-page.home-v2-premium .home-v2-resume-row span,
.home-page.home-v2-premium .home-v2-resume-side-card em,
.home-page.home-v2-premium .home-v2-resume-list-head em {
    color: rgba(175, 198, 223, 0.8);
}

.home-page.home-v2-premium .home-v2-resume-score {
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(88, 212, 255, 0.18), rgba(88, 212, 255, 0.05));
    border: 1px solid rgba(88, 212, 255, 0.2);
}

.home-page.home-v2-premium .home-v2-resume-prompt {
    margin-top: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(118, 165, 213, 0.14);
    background: rgba(7, 14, 27, 0.76);
}

.home-page.home-v2-premium .home-v2-resume-chip-row {
    margin-top: 1rem;
    gap: 0.65rem;
}

.home-page.home-v2-premium .home-v2-resume-chip-row .detail-chip {
    border-color: rgba(121, 167, 215, 0.16);
    background: rgba(9, 17, 31, 0.8);
}

.home-page.home-v2-premium .home-v2-resume-side-card,
.home-page.home-v2-premium .home-v2-resume-row {
    padding: 1rem 1.05rem;
}

.home-page.home-v2-premium .home-v2-resume-side-card strong,
.home-page.home-v2-premium .home-v2-resume-row strong,
.home-page.home-v2-premium .home-v2-list-item h3,
.home-page.home-v2-premium .home-v2-step h3 {
    color: #f2f9ff;
}

.home-page.home-v2-premium .home-v2-resume-list-head,
.home-page.home-v2-premium .home-v2-focus-head {
    gap: 0.4rem;
}

.home-page.home-v2-premium .home-v2-workflow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-page.home-v2-premium .home-v2-step {
    display: grid;
    gap: 1rem;
    min-height: 100%;
    padding: 1.1rem 1.15rem;
}

.home-page.home-v2-premium .home-v2-step-index {
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid rgba(109, 193, 255, 0.28);
    background: linear-gradient(135deg, rgba(88, 212, 255, 0.18), rgba(88, 212, 255, 0.05));
    color: #dff5ff;
    box-shadow: 0 10px 22px rgba(57, 194, 255, 0.14);
}

.home-page.home-v2-premium .home-v2-focus-strip,
.home-page.home-v2-premium .home-v2-conversion {
    border-radius: 28px;
}

.home-page.home-v2-premium .home-v2-block--full .home-v2-block-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.95rem;
}

.home-page.home-v2-premium .home-v2-list-item {
    min-height: 100%;
    padding: 1.15rem;
}

.home-page.home-v2-premium .home-v2-list-item p,
.home-page.home-v2-premium .home-v2-step p {
    color: rgba(173, 196, 221, 0.82);
    line-height: 1.62;
}

.home-page.home-v2-premium .home-v2-conversion {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.25rem;
}

.home-page.home-v2-premium .home-v2-conversion-copy {
    max-width: 38rem;
}

.home-page.home-v2-premium .home-v2-conversion-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 0.85rem;
}

.home-page.home-v2-premium .home-v2-conversion-metric {
    padding: 1rem 1.05rem;
    border: 1px solid rgba(127, 166, 209, 0.16);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 58%),
        rgba(8, 15, 29, 0.76);
    min-width: 0;
}

.home-page.home-v2-premium .home-v2-conversion-value {
    color: #f7fcff;
    font-size: clamp(1.65rem, 3vw, 2.45rem);
    letter-spacing: -0.05em;
}

.home-page.home-v2-premium .home-v2-conversion-label {
    color: rgba(166, 191, 217, 0.82);
}

.home-page.home-v2-premium .home-v2-actions.home-v2-actions-final {
    grid-column: 1 / -1;
    padding-top: 0.2rem;
}

@media (max-width: 1100px) {
    .home-page.home-v2-premium .home-v2-hero,
    .home-page.home-v2-premium .home-v2-conversion {
        grid-template-columns: 1fr;
    }

    .home-page.home-v2-premium .home-v2-workflow-grid,
    .home-page.home-v2-premium .home-v2-block--full .home-v2-block-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-page.home-v2-premium .home-v2-hero-visual {
        width: 100%;
        opacity: 0.18;
        object-position: 70% center;
        mix-blend-mode: normal;
        -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 82%);
        mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 82%);
    }

    .home-page.home-v2-premium .home-v2-hero {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

@media (max-width: 820px) {
    .home-page.home-v2-premium {
        gap: 1.15rem;
    }

    .home-page.home-v2-premium::before {
        inset: -1rem -0.5rem auto;
        height: 28rem;
    }

    .home-page.home-v2-premium .home-v2-copy h1 {
        max-width: 100%;
    }

    .home-page.home-v2-premium .home-v2-trust-list,
    .home-page.home-v2-premium .home-v2-start-paths,
    .home-page.home-v2-premium .home-v2-workflow-grid,
    .home-page.home-v2-premium .home-v2-block--full .home-v2-block-list,
    .home-page.home-v2-premium .home-v2-conversion-metrics {
        grid-template-columns: 1fr;
    }

    .home-page.home-v2-premium .home-v2-actions .btn-primary,
    .home-page.home-v2-premium .home-v2-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .home-page.home-v2-premium {
        padding-top: 0.85rem;
    }

    .home-page.home-v2-premium .home-v2-hero,
    .home-page.home-v2-premium .home-v2-resume,
    .home-page.home-v2-premium .home-v2-conversion,
    .home-page.home-v2-premium .home-v2-workflow,
    .home-page.home-v2-premium .home-v2-block {
        padding: 1rem;
        border-radius: 24px;
    }

    .home-page.home-v2-premium .home-v2-search {
        min-height: 4rem;
        border-radius: 18px;
    }

    .home-page.home-v2-premium .home-v2-proofline span {
        width: 100%;
    }

    .home-page.home-v2-premium .home-v2-preview {
        padding: 1rem;
        border-radius: 24px;
    }

    .home-page.home-v2-premium .home-v2-preview-evaluator {
        grid-template-columns: 1fr;
    }

    .home-page.home-v2-premium .home-v2-preview-evaluator-score {
        min-width: 0;
    }

    .home-page.home-v2-premium .home-v2-preview-row,
    .home-page.home-v2-premium .home-v2-list-item,
    .home-page.home-v2-premium .home-v2-step,
    .home-page.home-v2-premium .home-v2-resume-primary,
    .home-page.home-v2-premium .home-v2-resume-side-card,
    .home-page.home-v2-premium .home-v2-resume-row,
    .home-page.home-v2-premium .home-v2-conversion-metric {
        border-radius: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-page.home-v2-premium .home-v2-hero::before,
    .home-page.home-v2-premium .home-v2-preview::after {
        animation: none !important;
    }

    .home-page.home-v2-premium .home-v2-preview-row:hover,
    .home-page.home-v2-premium .home-v2-preview-row:focus-visible,
    .home-page.home-v2-premium .home-v2-list-item:hover,
    .home-page.home-v2-premium .home-v2-step:hover,
    .home-page.home-v2-premium .home-v2-focus-card:hover,
    .home-page.home-v2-premium .home-v2-resume-row:hover {
        transform: none;
    }
}

/* UX audit stabilization: keep mobile pages inside the viewport after late page-specific overrides. */
@media (max-width: 900px) {
    html,
    body {
        max-width: 100%;
        overflow-x: clip;
    }

    .container {
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    .logo {
        min-height: 44px;
        padding-block: 0.35rem;
    }

    .companies-page,
    .legal-page {
        overflow-x: clip;
    }

    .companies-page .directory-header,
    .legal-page .legal-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .companies-page .letter-filter,
    .model-portfolio-filter-group {
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    .model-portfolio-filter-group {
        flex-wrap: nowrap;
    }

    .main-nav:not(.active) {
        display: none !important;
        width: 0 !important;
        min-width: 0 !important;
        padding-inline: 0 !important;
        border-left: 0 !important;
        box-shadow: none !important;
        overflow: hidden !important;
        transform: translateX(0) !important;
    }

    .main-nav.active {
        display: flex !important;
        width: min(88vw, 390px) !important;
        padding-inline: 1rem !important;
    }

    .home-page.home-v2-premium .home-v2-search input,
    .home-v2-search input,
    .header-stock-search input {
        min-height: 44px !important;
    }

    .home-page.home-v2-premium .home-v2-positioning-tape {
        contain: layout paint;
        max-width: 100%;
    }

    .model-portfolio-page .text-link,
    .model-portfolio-page .model-portfolio-card-head a,
    .model-portfolio-page .portfolio-holdings-header .text-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        padding-block: 0.45rem;
    }

    .companies-page .market-table td.name-cell .cell-value {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

@media (min-width: 1201px) {
    .nav-link.nav-link-primary {
        border-color: rgba(56, 189, 248, 0.32);
        background: rgba(14, 116, 144, 0.16);
        color: #f8fbff;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }

    .nav-link.nav-link-primary .nav-link-icon {
        color: #7dd3fc;
        border-color: rgba(125, 211, 252, 0.28);
        background: rgba(14, 116, 144, 0.18);
    }
}

.social-board-controls {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(160px, 220px));
    gap: 0.85rem;
    align-items: end;
    margin: 1.15rem 0 0.75rem;
}

.social-board-control {
    display: grid;
    gap: 0.42rem;
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.social-board-control input,
.social-board-control select {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(91, 124, 166, 0.28);
    border-radius: 12px;
    background: rgba(7, 14, 28, 0.82);
    color: #f8fbff;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    padding: 0.72rem 0.85rem;
    outline: none;
}

.social-board-control input:focus,
.social-board-control select:focus {
    border-color: rgba(56, 189, 248, 0.72);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}

.social-filter-status,
.social-filter-empty {
    margin: 0 0 0.85rem;
    color: rgba(187, 203, 226, 0.78);
    font-size: 0.9rem;
}

.social-filter-empty {
    padding: 1rem;
    border: 1px solid rgba(91, 124, 166, 0.18);
    border-radius: 14px;
    background: rgba(8, 15, 29, 0.72);
}

.social-holdings-preview {
    display: grid;
    gap: 0.45rem;
    margin: 0.7rem 0 0;
}

.social-holdings-preview > span {
    color: rgba(148, 163, 184, 0.82);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.social-holdings-preview > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.social-holdings-preview strong {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0.36rem 0.62rem;
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 999px;
    background: rgba(14, 116, 144, 0.16);
    color: #e6f6ff;
    font-size: 0.78rem;
    line-height: 1;
}

.social-holdings-preview--spotlight {
    margin-top: 0.1rem;
}

.social-row-card[hidden] {
    display: none !important;
}

.market-board-context-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.95rem 0 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: 14px;
    background: rgba(8, 15, 29, 0.72);
    color: rgba(226, 232, 240, 0.78);
}

.market-board-context-note strong {
    color: #f8fbff;
    font-size: 0.92rem;
}

.market-board-context-note span {
    max-width: 68ch;
    font-size: 0.9rem;
    line-height: 1.5;
}

.stock-decision-next-steps,
.portfolio-workflow-guide {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid rgba(91, 124, 166, 0.18);
    border-radius: 16px;
    background: rgba(8, 15, 29, 0.66);
}

.stock-decision-next-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stock-decision-next-steps article {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.32rem 0.65rem;
    align-content: start;
}

.stock-decision-next-steps article > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.16);
    color: #7dd3fc;
    font-size: 0.76rem;
    font-weight: 900;
}

.stock-decision-next-steps strong,
.portfolio-workflow-step strong {
    color: #f8fbff;
    font-size: 0.92rem;
    line-height: 1.25;
}

.stock-decision-next-steps p {
    grid-column: 2;
    margin: 0;
    color: rgba(203, 213, 225, 0.76);
    font-size: 0.86rem;
    line-height: 1.48;
}

.portfolio-workflow-guide {
    grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
    align-items: stretch;
    margin: 0 0 1.15rem;
}

.portfolio-workflow-guide-copy {
    display: grid;
    align-content: center;
    gap: 0.35rem;
}

.portfolio-workflow-guide-copy span {
    color: #7dd3fc;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.portfolio-workflow-guide-copy h3 {
    color: #f8fbff;
    font-size: 1rem;
    line-height: 1.25;
}

.portfolio-workflow-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.portfolio-workflow-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.32rem 0.62rem;
    min-height: 100%;
    padding: 0.85rem;
    border: 1px solid rgba(91, 124, 166, 0.18);
    border-radius: 14px;
    background: rgba(12, 22, 40, 0.72);
    text-decoration: none;
}

.portfolio-workflow-step:hover,
.portfolio-workflow-step:focus-visible {
    border-color: rgba(56, 189, 248, 0.42);
    background: rgba(14, 116, 144, 0.14);
}

.portfolio-workflow-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.16);
    color: #7dd3fc;
    font-size: 0.78rem;
    font-weight: 900;
}

.portfolio-workflow-step-copy {
    display: grid;
    gap: 0.28rem;
    min-width: 0;
}

.portfolio-workflow-step-copy small {
    color: rgba(203, 213, 225, 0.76);
    font-size: 0.82rem;
    line-height: 1.42;
}

.portfolio-workflow-step-action {
    grid-column: 2;
    color: #8ddcff;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

@media (max-width: 780px) {
    .social-board-controls {
        grid-template-columns: 1fr;
    }

    .market-board-context-note {
        align-items: flex-start;
        flex-direction: column;
    }

    .stock-decision-next-steps,
    .portfolio-workflow-guide,
    .portfolio-workflow-steps {
        grid-template-columns: 1fr;
    }
}

.portfolio-page .portfolio-secondary-details {
    margin-top: 0.85rem;
    border: 1px solid rgba(91, 124, 166, 0.22);
    border-radius: 14px;
    background: rgba(7, 15, 28, 0.64);
    overflow: hidden;
}

.portfolio-page .portfolio-secondary-details > .portfolio-mobile-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.86rem 0.95rem;
    list-style: none;
    cursor: pointer;
    color: #e8f0fb;
    font-size: 0.84rem;
    font-weight: 850;
}

.portfolio-page .portfolio-secondary-details > .portfolio-mobile-summary::after {
    content: "+";
    color: rgba(148, 163, 184, 0.95);
    font-size: 1rem;
    line-height: 1;
}

.portfolio-page .portfolio-secondary-details[open] > .portfolio-mobile-summary::after {
    content: "-";
}

.portfolio-page .portfolio-secondary-details > .optimizer-section,
.portfolio-page .portfolio-secondary-details > .estimate-section,
.portfolio-page .portfolio-secondary-details > .portfolio-dividend-overview-strip {
    margin: 0 !important;
    border: 0;
    border-top: 1px solid rgba(91, 124, 166, 0.16);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.portfolio-page .portfolio-secondary-details > .optimizer-section,
.portfolio-page .portfolio-secondary-details > .estimate-section {
    padding: 0.86rem 0.95rem 0.95rem;
}

.portfolio-page .portfolio-secondary-details > .portfolio-dividend-overview-strip {
    padding: 0.86rem 0.95rem 0.95rem;
}

@media (max-width: 640px) {
    .portfolio-page .portfolio-secondary-details > .portfolio-mobile-summary {
        padding: 0.82rem 0.85rem;
        font-size: 0.8rem;
    }

    .portfolio-page .portfolio-secondary-details > .optimizer-section,
    .portfolio-page .portfolio-secondary-details > .estimate-section,
    .portfolio-page .portfolio-secondary-details > .portfolio-dividend-overview-strip {
        padding: 0.78rem 0.85rem 0.85rem !important;
    }
}

/* Portfolio workspace refinement: keep core decisions first and controls usable at every size. */
.portfolio-page .holdings-header-copy p.holdings-header-note,
.portfolio-page .holdings-header-copy p.holdings-header-guide {
    display: block;
}

.portfolio-page .portfolio-workflow-guide-copy {
    margin: 0;
    list-style: none;
}

.portfolio-page .portfolio-workflow-guide-copy::-webkit-details-marker {
    display: none;
}

.portfolio-page .holding-tax-feedback {
    display: none;
    color: #6ee7b7;
    font-size: 0.64rem;
    font-weight: 700;
    line-height: 1.3;
}

.portfolio-page .holding-tax-feedback.is-visible {
    display: inline-flex;
}

.portfolio-page .holding-tax-feedback.is-error {
    color: #fca5a5;
}

.portfolio-page .holding-tax-toggle.htb-loading {
    opacity: 0.72;
}

.portfolio-page .portfolio-primary-grid > .eval-panel > p:not(.eval-status),
.portfolio-page .portfolio-primary-grid > .value-panel > .value-meta-note {
    margin: 0.28rem 0 0;
}

@media (min-width: 1101px) {
    .portfolio-page .portfolio-toolbar-main {
        grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
        align-items: center;
    }

    .portfolio-page .portfolio-toolbar-summary {
        width: 100%;
        max-width: none;
        align-self: center;
    }

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

    .portfolio-page .portfolio-primary-grid > .eval-panel,
    .portfolio-page .portfolio-primary-grid > .value-panel:not(.portfolio-secondary-metric) {
        grid-column: span 2;
    }

    .portfolio-page .portfolio-primary-grid > .portfolio-secondary-metric {
        grid-column: span 3;
    }
}

@media (min-width: 901px) and (max-width: 1100px) {
    .portfolio-page .portfolio-primary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portfolio-page .portfolio-primary-grid > .eval-panel {
        grid-column: 1 / -1;
    }
}

@media (min-width: 781px) {
    .portfolio-page .portfolio-workflow-guide-collapsible:not([open]) > .portfolio-workflow-steps {
        display: grid;
    }

    .portfolio-page .portfolio-workflow-guide-collapsible > .portfolio-workflow-guide-copy {
        cursor: default;
        pointer-events: none;
    }
}

@media (max-width: 780px) {
    .portfolio-page .portfolio-workflow-guide-collapsible {
        display: block;
        padding: 0;
        overflow: hidden;
    }

    .portfolio-page .portfolio-workflow-guide-collapsible > .portfolio-workflow-guide-copy {
        position: relative;
        display: grid;
        gap: 0.24rem;
        padding: 0.9rem 3rem 0.9rem 0.95rem;
        cursor: pointer;
    }

    .portfolio-page .portfolio-workflow-guide-collapsible > .portfolio-workflow-guide-copy::after {
        content: "+";
        position: absolute;
        top: 50%;
        right: 1rem;
        color: #8ddcff;
        font-size: 1.1rem;
        line-height: 1;
        transform: translateY(-50%);
    }

    .portfolio-page .portfolio-workflow-guide-collapsible[open] > .portfolio-workflow-guide-copy::after {
        content: "−";
    }

    .portfolio-page .portfolio-workflow-guide-collapsible:not([open]) > .portfolio-workflow-steps {
        display: none;
    }

    .portfolio-page .portfolio-workflow-guide-collapsible[open] > .portfolio-workflow-steps {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.6rem;
        padding: 0 0.75rem 0.75rem;
    }
}

@media (max-width: 780px) {
    .portfolio-page .toolbar-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        align-items: stretch;
    }

    .portfolio-page .toolbar-actions .btn-secondary,
    .portfolio-page .toolbar-actions .settings-open-btn,
    .portfolio-page .toolbar-actions .portfolio-create-mobile-btn,
    .portfolio-page .toolbar-actions .currency-form {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .portfolio-page .toolbar-actions .settings-open-btn,
    .portfolio-page .toolbar-actions .portfolio-create-mobile-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 0.55rem 0.7rem;
    }

    .portfolio-page .toolbar-actions .currency-form {
        grid-column: 1 / -1;
    }

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

    .portfolio-page .portfolio-primary-grid > .eval-panel,
    .portfolio-page .portfolio-primary-grid > .value-panel:not(.portfolio-secondary-metric) {
        grid-column: 1 / -1;
    }

    .portfolio-page .portfolio-primary-grid > .portfolio-secondary-metric {
        grid-column: span 1;
        padding: 0.78rem !important;
    }

    .portfolio-page .portfolio-primary-grid > .portfolio-secondary-metric .value-amount {
        font-size: clamp(0.96rem, 4.5vw, 1.12rem);
        overflow-wrap: anywhere;
    }

    .portfolio-page .holding-mobile-actions {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .portfolio-page .holding-mobile-actions .action-btn,
    .portfolio-page .holding-mobile-actions .badge-mini {
        min-height: 44px;
        box-sizing: border-box;
    }

    .portfolio-page .holdings-header-copy p.holdings-header-guide {
        display: none;
    }
}

/* Final model-portfolio chart presentation. Kept after legacy component rules. */
.model-portfolio-page,
.model-portfolio-page *,
.model-portfolio-page *::before,
.model-portfolio-page *::after {
    box-sizing: border-box;
}

.model-portfolio-page {
    max-width: 100%;
    overflow-x: clip;
}

.model-portfolio-page :where(
    .model-portfolio-grid,
    .model-portfolio-card,
    .model-portfolio-chart-shell,
    .model-portfolio-mini-chart-panel,
    .model-portfolio-mini-chart-svg,
    .model-portfolio-dashboard,
    .model-portfolio-dashboard-card,
    .portfolio-holdings-shell
) {
    min-width: 0;
    max-width: 100%;
}

.model-portfolio-card::before {
    height: 3px;
    background: var(--mp-chart-primary);
    opacity: 0.88;
}

.model-portfolio-card::after {
    display: none;
}

.model-portfolio-chart-shell {
    padding: 14px;
    border: 1px solid var(--mp-chart-border);
    border-radius: 16px;
    background: var(--mp-chart-surface);
    overflow: hidden;
}

.model-portfolio-chart {
    color: var(--mp-chart-primary);
    overflow: hidden;
}

.model-portfolio-chart-grid,
.model-portfolio-mini-chart-grid {
    stroke: var(--mp-chart-grid);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.model-portfolio-chart-axis,
.model-portfolio-mini-chart-axis {
    stroke: var(--mp-chart-axis);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.model-portfolio-chart-primary,
.model-portfolio-chart-benchmark,
.model-portfolio-mini-chart-primary,
.model-portfolio-mini-chart-benchmark {
    vector-effect: non-scaling-stroke;
}

.model-portfolio-chart-primary {
    stroke: var(--mp-chart-primary);
}

.model-portfolio-chart-benchmark {
    stroke: var(--mp-chart-benchmark);
    stroke-dasharray: 7 5;
}

.model-portfolio-chart-dot,
.model-portfolio-mini-chart-endpoint {
    fill: var(--mp-chart-primary);
    stroke: var(--mp-chart-point-stroke);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.model-portfolio-chart-benchmark-dot,
.model-portfolio-mini-chart-endpoint.is-benchmark {
    fill: var(--mp-chart-benchmark);
    stroke: var(--mp-chart-point-stroke);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.model-portfolio-chart-meta {
    gap: 8px 16px;
    color: var(--mp-chart-text);
}

.model-portfolio-chart-legend {
    margin-top: 2px;
}

.model-portfolio-chart-legend-item {
    border-color: var(--mp-chart-border);
    background: var(--mp-chart-surface-soft);
    color: var(--mp-chart-text);
}

.model-portfolio-chart-legend-line,
.model-portfolio-mini-chart-swatch {
    background: var(--mp-chart-primary);
    border-color: var(--mp-chart-primary);
}

.model-portfolio-chart-legend-line.is-benchmark {
    border-top-color: var(--mp-chart-benchmark);
    border-top-style: dashed;
}

.model-portfolio-mini-chart-swatch.is-benchmark {
    background: repeating-linear-gradient(90deg, var(--mp-chart-benchmark) 0 5px, transparent 5px 8px);
    box-shadow: none;
}

.model-portfolio-mini-chart-panel {
    border-color: var(--mp-chart-border);
    background: var(--mp-chart-surface);
}

.model-portfolio-mini-chart-bg {
    fill: var(--mp-chart-surface-soft);
}

.model-portfolio-mini-chart-legend,
.model-portfolio-mini-chart-meta {
    color: var(--mp-chart-text);
}

.model-portfolio-card-benchmark,
.model-portfolio-action-pill.is-benchmark,
.model-portfolio-catalog-badge:last-child,
.model-portfolio-card .is-benchmark-chip {
    border-color: rgba(168, 179, 193, 0.28);
    background: rgba(168, 179, 193, 0.1);
    color: #e2e8f0;
}

.model-portfolio-card-benchmark-label {
    color: var(--mp-chart-benchmark);
}

.model-portfolio-card-benchmark strong {
    color: #f1f5f9;
}

.model-portfolio-page .directory-header::before,
.model-portfolio-action-card::after {
    background: var(--mp-chart-primary);
    opacity: 0.82;
}

.model-portfolio-page .portfolio-holdings-shell::before {
    background: linear-gradient(180deg, var(--mp-chart-primary), transparent);
    opacity: 0.68;
}

@media (max-width: 600px) {
    .model-portfolio-chart-shell {
        padding: 10px;
        border-radius: 14px;
    }

    .model-portfolio-chart-meta {
        font-size: 0.8rem;
    }
}

/* ===== component source: theme.css ===== */
:root {
    color-scheme: dark;
    --ak-page-bg: #030b18;
    --ak-page-bg-layer:
        radial-gradient(circle at 18% 8%, rgba(57, 194, 255, 0.1), transparent 32rem),
        linear-gradient(180deg, #030b18 0%, #020617 100%);
    --ak-surface: linear-gradient(180deg, rgba(11, 19, 32, 0.98), rgba(8, 14, 25, 0.98));
    --ak-surface-solid: #0b1322;
    --ak-surface-muted: rgba(12, 22, 40, 0.78);
    --ak-surface-soft: rgba(15, 23, 42, 0.62);
    --ak-control-bg: rgba(8, 15, 26, 0.96);
    --ak-text: #f8fafc;
    --ak-text-soft: #b8c8dd;
    --ak-text-muted: #7f94b1;
    --ak-border: rgba(86, 124, 168, 0.26);
    --ak-border-strong: rgba(86, 124, 168, 0.42);
    --ak-brand: #39c2ff;
    --ak-brand-strong: #7dd3fc;
    --ak-focus: rgba(57, 194, 255, 0.32);
    --ak-shadow: 0 16px 38px rgba(2, 8, 23, 0.24);
    --ak-shadow-soft: 0 10px 26px rgba(2, 8, 23, 0.18);
    --ak-positive: #34d399;
    --ak-negative: #f87171;
    --ak-warning: #fbbf24;
    --shadow-soft: var(--ak-shadow);
    --accent: var(--ak-brand);
    --accent-soft: var(--ak-brand-strong);
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg-root: #f6f8fb;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --text-primary: #0b1728;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border-subtle: #d9e2ec;
    --border-active: #94a3b8;
    --accent-brand: #0369a1;
    --focus-ring: rgba(3, 105, 161, 0.32);
    --ak-page-bg: #f6f8fb;
    --ak-page-bg-layer:
        linear-gradient(180deg, #fbfcfe 0%, #f6f8fb 48%, #eef3f7 100%);
    --ak-surface: #ffffff;
    --ak-surface-solid: #ffffff;
    --ak-surface-muted: #f8fafc;
    --ak-surface-soft: #eef3f7;
    --ak-control-bg: #ffffff;
    --ak-text: #0b1728;
    --ak-text-soft: #334155;
    --ak-text-muted: #64748b;
    --ak-border: rgba(148, 163, 184, 0.28);
    --ak-border-strong: rgba(100, 116, 139, 0.42);
    --ak-brand: #0369a1;
    --ak-brand-strong: #0f4c81;
    --ak-focus: rgba(3, 105, 161, 0.16);
    --ak-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
    --ak-shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.06);
    --ak-positive: #047857;
    --ak-negative: #be123c;
    --ak-warning: #b45309;
    --shadow-soft: var(--ak-shadow);
    --accent: var(--ak-brand);
    --accent-soft: var(--ak-brand-strong);
}

.nav-theme-group {
    display: flex;
    align-items: center;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 42px;
    min-height: 42px;
    padding: 0.2rem 0.58rem;
    border: 1px solid var(--ak-border);
    border-radius: 999px;
    background: var(--ak-control-bg);
    color: var(--ak-text);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    line-height: 1;
    box-shadow: var(--ak-shadow-soft);
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    border-color: rgba(3, 105, 161, 0.34);
    color: var(--ak-brand-strong);
    outline: none;
    transform: translateY(-1px);
}

.theme-toggle-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.theme-toggle-text {
    font-size: 0.76rem;
    white-space: nowrap;
}

:root[data-theme="dark"] .theme-toggle-icon-moon,
:root[data-theme="light"] .theme-toggle-icon-sun {
    display: none;
}

.theme-toggle-mobile {
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
}

.theme-toggle-mobile .theme-toggle-text {
    display: none;
}

@media (max-width: 900px) {
    .theme-toggle-mobile,
    .mobile-menu-toggle,
    .mobile-auth-shortcut,
    .mobile-lang-shortcut {
        min-width: 44px !important;
        min-height: 44px !important;
        touch-action: manipulation;
    }

    .nav-theme-group {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .nav-theme-group .theme-toggle {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }
}

:root[data-theme="light"] body {
    background-color: var(--ak-page-bg) !important;
    background-image: var(--ak-page-bg-layer) !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] body.index-page-bg {
    background-image: var(--ak-page-bg-layer) !important;
}

:root[data-theme="light"] a {
    color: var(--ak-brand);
}

:root[data-theme="light"] header {
    background: rgba(255, 255, 255, 0.94) !important;
    border-bottom-color: var(--ak-border) !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08) !important;
}

:root[data-theme="light"] header::after {
    background: linear-gradient(90deg, transparent 0%, rgba(3, 105, 161, 0.16) 20%, rgba(3, 105, 161, 0.06) 82%, transparent 100%) !important;
}

:root[data-theme="light"] :where(
    .logo,
    .logo-wordmark,
    .nav-link,
    .nav-link-text,
    .market-status,
    .lang-switcher a,
    .mobile-auth-shortcut,
    .mobile-lang-shortcut,
    .mobile-menu-toggle
) {
    color: var(--ak-text) !important;
    -webkit-text-fill-color: initial !important;
}

:root[data-theme="light"] :where(.nav-links, .nav-utils) {
    background: rgba(255, 255, 255, 0.78) !important;
    border-color: var(--ak-border) !important;
    box-shadow: var(--ak-shadow-soft) !important;
}

:root[data-theme="light"] :where(.nav-link:hover, .nav-link:focus-visible, .nav-link.active, .nav-link.nav-link-primary) {
    background: rgba(3, 105, 161, 0.1) !important;
    border-color: rgba(3, 105, 161, 0.22) !important;
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] .nav-link-icon {
    color: var(--ak-brand) !important;
}

:root[data-theme="light"] .beta-tag {
    background: rgba(3, 105, 161, 0.08) !important;
    border-color: rgba(3, 105, 161, 0.28) !important;
    color: var(--ak-brand-strong) !important;
    -webkit-text-fill-color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] :where(
    .header-stock-search input,
    .market-status,
    .lang-switcher a,
    .theme-toggle,
    .nav-auth .nav-btn,
    .mobile-auth-shortcut,
    .mobile-lang-shortcut,
    .mobile-menu-toggle
) {
    background: var(--ak-control-bg) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow-soft) !important;
}

:root[data-theme="light"] :where(.header-stock-search input::placeholder, input::placeholder, textarea::placeholder) {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] :where(.header-search-icon, .nav-link-icon) {
    color: var(--ak-brand) !important;
}

:root[data-theme="light"] .header-search-suggestions {
    background: var(--ak-surface) !important;
    border-color: rgba(3, 105, 161, 0.22) !important;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.14) !important;
}

:root[data-theme="light"] .mobile-nav-overlay {
    background: rgba(15, 23, 42, 0.24) !important;
}

:root[data-theme="light"] :where(.mobile-dock, .mobile-dock.is-authenticated, .mobile-dock.is-guest) {
    background: rgba(255, 255, 255, 0.96) !important;
    border-color: rgba(148, 163, 184, 0.38) !important;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16) !important;
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .mobile-dock-link {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .mobile-dock-link.active {
    background: rgba(3, 105, 161, 0.11) !important;
    border-color: rgba(3, 105, 161, 0.26) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] .mobile-dock-link.is-auth {
    background: rgba(3, 105, 161, 0.1) !important;
    border-color: rgba(3, 105, 161, 0.24) !important;
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] .mobile-dock-link.is-logout {
    background: rgba(220, 38, 38, 0.08) !important;
    border-color: rgba(220, 38, 38, 0.18) !important;
    color: var(--ak-negative) !important;
}

:root[data-theme="light"] .mobile-dock-icon,
:root[data-theme="light"] .mobile-dock-text {
    color: inherit !important;
}

:root[data-theme="light"] .mobile-dock-text {
    max-width: 100% !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
}

:root[data-theme="light"] .mobile-cta-bar {
    background: rgba(255, 255, 255, 0.96) !important;
    border-color: rgba(148, 163, 184, 0.38) !important;
    box-shadow: 0 -12px 28px rgba(15, 23, 42, 0.14) !important;
}

:root[data-theme="light"] .main-nav.active {
    background: linear-gradient(180deg, #ffffff 0%, #eef4fb 100%) !important;
    border-left-color: var(--ak-border-strong) !important;
    box-shadow: -26px 0 52px rgba(15, 23, 42, 0.18) !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] :where(.nav-mobile-title, .nav-mobile-section-label) {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .nav-mobile-close {
    background: #e2e8f0 !important;
    border-color: var(--ak-border-strong) !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] :where(
    .card,
    .panel,
    .content-card,
    .dashboard-card,
    .form-card,
    .modal-content,
    .directory-header,
    .entry-conversion,
    .table-container,
    .market-table-container,
    .market-table-wrapper,
    .legal-card,
    .profile-container,
    .profile-card,
    .profile-section,
    .credit-card,
    .stock-insight-card,
    .stock-facts-card,
    .stock-analysis-card,
    .stock-chart-card,
    .stock-news-card,
    .stock-ai-entry-card,
    .ai-stock-report__hero,
    .ai-stock-report__section,
    .ai-stock-report__side-card,
    .ai-stock-report__summary-card
) {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] :where(
    .home-page.home-v2-premium .home-v2-hero,
    .home-page.home-v2-premium .home-v2-preview,
    .home-page.home-v2-premium .home-v2-resume,
    .home-page.home-v2-premium .home-v2-conversion,
    .home-page.home-v2-premium .home-v2-workflow,
    .home-page.home-v2-premium .home-v2-block,
    .home-page.home-v2-premium .home-v2-preview-row,
    .home-page.home-v2-premium .home-v2-list-item,
    .home-page.home-v2-premium .home-v2-step,
    .home-page.home-v2-premium .home-v2-resume-side-card,
    .home-page.home-v2-premium .home-v2-resume-row,
    .home-page.home-v2-premium .home-v2-resume-primary,
    .home-page.home-v2-premium .home-v2-conversion-metric,
    .home-page.home-v2-premium .home-v2-search
) {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] :where(
    .portfolio-page .portfolio-toolbar,
    .portfolio-page .sidebar,
    .portfolio-page .portfolio-switcher-mobile,
    .portfolio-page .portfolio-sticky-nav,
    .portfolio-page .portfolio-section-nav,
    .portfolio-page .portfolio-subnav-shell,
    .portfolio-page .portfolio-toolbar-summary-item,
    .portfolio-page .p-nav-item,
    .portfolio-page .top-stats,
    .portfolio-page .eval-panel,
    .portfolio-page .value-panel,
    .portfolio-page .summary-card,
    .portfolio-page .detail-card,
    .portfolio-page .evaluator-step-card,
    .portfolio-page .audit-holding-card,
    .portfolio-page .accounting-entry-panel,
    .portfolio-page .accounting-detail-card,
    .portfolio-page .accounting-allocation-card,
    .portfolio-page .portfolio-settings-page-card,
    .portfolio-page .portfolio-settings-modal-shell,
    .portfolio-page .estimate-section,
    .portfolio-page .estimate-card,
    .portfolio-page .optimizer-section,
    .portfolio-page .optimizer-suggestions,
    .portfolio-page .chart-container,
    .portfolio-page .charts-grid,
    .portfolio-page .holdings-container,
    .portfolio-page .portfolio-secondary-details,
    .portfolio-page .portfolio-workflow-guide,
    .portfolio-page .portfolio-workflow-step,
    .portfolio-page .stock-decision-next-steps,
    .portfolio-page .market-board-context-note,
    .portfolio-page .portfolio-priority-banner,
    .portfolio-page .portfolio-overview-focus-card,
    .portfolio-page .portfolio-current-holdings-panel,
    .portfolio-page .portfolio-current-holding-card,
    .portfolio-page .portfolio-current-holdings-stat,
    .portfolio-page .portfolio-overview-context-details,
    .portfolio-page .portfolio-empty-state,
    .portfolio-page .portfolio-empty-card,
    .portfolio-page .portfolio-post-import-card,
    .portfolio-page .portfolio-post-import-panel,
    .portfolio-page .dividend-summary-card,
    .portfolio-page .portfolio-export-panel,
    .portfolio-page .broker-drop-zone,
    .portfolio-page .broker-guide-card,
    .portfolio-page .assignment-status-card,
    .portfolio-page .sidebar-agent-card,
    .portfolio-page .sidebar-agent-btn,
    .portfolio-page .sidebar-agent-nocredits,
    .portfolio-page .sidebar-agents-balance-pill
) {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] :where(
    .portfolio-page .portfolio-toolbar,
    .portfolio-page .sidebar,
    .portfolio-page .portfolio-sticky-nav,
    .portfolio-page .top-stats,
    .portfolio-page .charts-grid,
    .portfolio-page .portfolio-income-section
) {
    background: var(--ak-surface) !important;
}

:root[data-theme="light"] :where(
    .portfolio-page .p-nav-item:hover,
    .portfolio-page .p-nav-item.active,
    .portfolio-section-link.active,
    .portfolio-subnav-link.active,
    .portfolio-page .portfolio-toolbar-eyebrow
) {
    background: rgba(3, 105, 161, 0.1) !important;
    border-color: rgba(3, 105, 161, 0.28) !important;
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] :where(
    .portfolio-page .portfolio-toolbar-summary-item,
    .portfolio-page .holding-quick-fact,
    .portfolio-page .holding-mobile-metric,
    .portfolio-page .portfolio-current-holdings-summary,
    .portfolio-page .portfolio-current-holdings-preview,
    .portfolio-page .portfolio-secondary-details > .optimizer-section,
    .portfolio-page .portfolio-secondary-details > .estimate-section,
    .portfolio-page .portfolio-secondary-details > .portfolio-dividend-overview-strip
) {
    background: var(--ak-surface-muted) !important;
    border-color: var(--ak-border) !important;
}

:root[data-theme="light"] :where(
    .model-portfolio-page .directory-header,
    .model-portfolio-page .model-portfolio-hero-main,
    .model-portfolio-page .model-portfolio-hero-side,
    .model-portfolio-page .model-portfolio-panel,
    .model-portfolio-page .model-portfolio-action-card,
    .model-portfolio-page .model-portfolio-card,
    .model-portfolio-page .model-portfolio-dashboard,
    .model-portfolio-page .model-portfolio-dashboard-item,
    .model-portfolio-page .model-portfolio-filter-panel,
    .model-portfolio-page .model-portfolio-mini-chart-panel,
    .model-portfolio-page .model-portfolio-card-performance-main,
    .model-portfolio-page .model-portfolio-card-summary > *,
    .model-portfolio-page .model-portfolio-snapshot-card,
    .model-portfolio-page .model-portfolio-status-card,
    .model-portfolio-page .model-portfolio-run-context,
    .model-portfolio-page .model-portfolio-run-context-card,
    .model-portfolio-page .model-portfolio-follow-suggestions > *,
    .model-portfolio-page .model-portfolio-holdings-card,
    .model-portfolio-page .model-portfolio-detail-card,
    .model-portfolio-page .model-portfolio-summary-card,
    .model-portfolio-page .top-stat-card
) {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] :where(
    .social-page .social-hero-premium,
    .social-page .social-directory-shell,
    .social-page .social-overview-card,
    .social-page .social-empty-state,
    .social-page .social-table tr.social-row-card,
    .social-page .social-hero-spotlight,
    .social-page .social-hero-spotlight-surface,
    .social-page .social-board-control input,
    .social-page .social-board-control select,
    .public-portfolio-page .directory-header,
    .public-portfolio-page .top-stats,
    .public-portfolio-page .eval-panel,
    .public-portfolio-page .value-panel,
    .public-portfolio-page .chart-container,
    .public-portfolio-page .public-holdings-container,
    .public-portfolio-page .public-social-rail,
    .public-portfolio-page .public-social-rail-stat,
    .public-portfolio-page .public-social-peer-card,
    .public-portfolio-page .dividend-summary-card
) {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] :where(
    .docs-page,
    .docs-admin-page
) {
    background: var(--ak-page-bg-layer) !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] :where(
    .docs-side-nav,
    .docs-hero,
    .docs-guide-hero,
    .docs-tutorial-hero,
    .docs-section,
    .docs-card,
    .docs-guide-step,
    .docs-tutorial-summary article,
    .docs-config-item,
    .docs-step-card,
    .docs-checklist-card,
    .docs-warning-card,
    .docs-tutorial-final,
    .docs-hero-panel,
    .docs-section-highlight,
    .docs-metric,
    .docs-feature-card,
    .docs-tutorial-summary-card
) {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] :where(
    .market-table,
    .holdings-table,
    .public-holdings-table,
    .social-table,
    .model-portfolio-holdings-table,
    .model-portfolio-ledger-table,
    .accounting-history-table
) {
    background: var(--ak-surface) !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] :where(th, td) {
    border-color: rgba(148, 163, 184, 0.22) !important;
}

:root[data-theme="light"] :where(
    .market-table thead,
    .market-table th,
    .holdings-table tr.holding-row,
    .social-table tr.social-row-card,
    .public-holdings-table tr,
    .model-portfolio-holdings-table tr,
    .model-portfolio-ledger-table tr
) {
    background: var(--ak-surface-muted) !important;
}

:root[data-theme="light"] :where(
    input,
    select,
    textarea,
    .currency-form,
    .portfolio-page .currency-form,
    .portfolio-page .currency-form select,
    .portfolio-page .portfolio-settings input,
    .portfolio-page .portfolio-settings select,
    .accounting-filter-form input,
    .accounting-filter-form select,
    .accounting-entry-form input,
    .accounting-entry-form select,
    .social-board-control input,
    .social-board-control select
) {
    background: var(--ak-control-bg) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] :where(input:focus, select:focus, textarea:focus) {
    border-color: rgba(3, 105, 161, 0.62) !important;
    box-shadow: 0 0 0 3px var(--ak-focus) !important;
}

:root[data-theme="light"] :where(
    .btn-secondary,
    .settings-open-btn,
    .filter-chip,
    .detail-chip,
    .tag,
    .badge,
    .pill,
    .portfolio-chip,
    .p-risk-badge,
    .p-tax-badge,
    .social-rank-badge,
    .docs-secondary-action
) {
    background: var(--ak-surface-muted) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] :where(.btn-primary, .docs-action) {
    background: var(--ak-brand-strong) !important;
    border-color: var(--ak-brand-strong) !important;
    color: #ffffff !important;
}

:root[data-theme="light"] :where(
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    .portfolio-title,
    .portfolio-toolbar-summary-value,
    .p-nav-name,
    .sidebar-agent-name,
    .eval-score,
    .value-amount,
    .summary-card .value,
    .detail-card strong,
    .top-stat-card strong,
    .model-portfolio-page strong,
    .social-overview-value,
    .social-card-title-group strong,
    .public-social-rail-stat-value,
    .docs-side-nav-title,
    .docs-page strong,
    .ai-stock-report__title,
    .ai-stock-report__summary-card strong
) {
    color: var(--ak-text) !important;
    -webkit-text-fill-color: initial !important;
}

:root[data-theme="light"] :where(
    p,
    li,
    small,
    label,
    .subtitle,
    .section-subtitle,
    .directory-meta,
    .text-muted,
    .text-secondary,
    .muted,
    .helper-text,
    .portfolio-page-subtitle,
    .portfolio-toolbar-summary-label,
    .sidebar-label,
    .sidebar-count,
    .p-nav-meta,
    .sidebar-agents-intro,
    .sidebar-agent-role,
    .sidebar-agent-cost,
    .eval-status,
    .value-meta-note,
    .summary-card .label,
    .summary-card .meta,
    .detail-card p,
    .table-note,
    .field-help,
    .holding-company-name,
    .holding-subline,
    .social-board-control,
    .social-overview-label,
    .social-hero-note,
    .model-portfolio-card-text,
    .model-portfolio-card-meta,
    .model-portfolio-card-performance-note,
    .docs-breadcrumbs,
    .docs-side-nav-link small,
    .docs-card p,
    .docs-section p,
    .docs-section li,
    .docs-config-item span,
    .ai-stock-report__subtitle,
    .ai-stock-report__summary-card p
) {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] :where(
    .docs-eyebrow,
    .docs-side-nav-group-label,
    .docs-breadcrumbs a,
    .docs-side-nav-home.active,
    .docs-side-nav-link.active,
    .portfolio-toolbar-eyebrow,
    .portfolio-section-group-label,
    .model-portfolio-action-eyebrow,
    .social-hero-kicker
) {
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] :where(
    .portfolio-page .sidebar-agent-btn:not([disabled]),
    .portfolio-page .sidebar-agents-link,
    .portfolio-page .sidebar-agent-buycredits
) {
    color: var(--ak-brand-strong) !important;
    border-color: rgba(3, 105, 161, 0.26) !important;
    background: rgba(3, 105, 161, 0.08) !important;
}

:root[data-theme="light"] :where(
    .docs-side-nav-home:hover,
    .docs-side-nav-home:focus-visible,
    .docs-side-nav-link:hover,
    .docs-side-nav-link:focus-visible,
    .docs-side-nav-home.active,
    .docs-side-nav-link.active
) {
    background: rgba(3, 105, 161, 0.1) !important;
    border-color: rgba(3, 105, 161, 0.24) !important;
}

:root[data-theme="light"] .docs-page :where(
    .docs-card-meta,
    .docs-hero-panel span,
    .docs-guide-step-number,
    .docs-step-number,
    .docs-mini-icon,
    .docs-step-icon
) {
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] .docs-page :where(
    .docs-tutorial-summary strong,
    .docs-step-card h3,
    .docs-guide-step h2
) {
    color: var(--ak-text) !important;
    -webkit-text-fill-color: var(--ak-text) !important;
}

:root[data-theme="light"] .docs-page :where(
    .docs-tutorial-summary p,
    .docs-step-card p,
    .docs-guide-step p,
    .docs-hero-panel p,
    .docs-note,
    .docs-tip
) {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .docs-page :where(.docs-tip, .docs-note) {
    background: var(--ak-surface-muted) !important;
    border-color: var(--ak-border) !important;
}

:root[data-theme="light"] .docs-page :where(.docs-section code, .docs-config code) {
    background: rgba(3, 105, 161, 0.08) !important;
    border-color: rgba(3, 105, 161, 0.2) !important;
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] .docs-page :where(.docs-guide-step-number, .docs-step-number) {
    background: rgba(3, 105, 161, 0.1) !important;
    border: 1px solid rgba(3, 105, 161, 0.22) !important;
}

:root[data-theme="light"] .docs-page :where(.docs-mini-icon, .docs-step-icon) {
    background: rgba(3, 105, 161, 0.08) !important;
    border-color: rgba(3, 105, 161, 0.22) !important;
}

:root[data-theme="light"] :where(
    .buy,
    .positive,
    .gain,
    .score-positive,
    .value-amount.buy,
    .eval-score.tone-good,
    .kv-value.tone-good
) {
    color: var(--ak-positive) !important;
}

:root[data-theme="light"] :where(
    .sell,
    .negative,
    .loss,
    .score-negative,
    .value-amount.sell,
    .eval-score.tone-risk,
    .kv-value.tone-risk
) {
    color: var(--ak-negative) !important;
}

:root[data-theme="light"] :where(
    .hold,
    .warning,
    .tone-warn,
    .eval-score.tone-warn
) {
    color: var(--ak-warning) !important;
}

:root[data-theme="light"] :where(.tone-good, .portfolio-chip.tone-good, .detail-chip.tone-good) {
    border-color: rgba(4, 120, 87, 0.24) !important;
    background: rgba(16, 185, 129, 0.08) !important;
}

:root[data-theme="light"] :where(.tone-warn, .portfolio-chip.tone-warn, .detail-chip.tone-warn) {
    border-color: rgba(180, 83, 9, 0.24) !important;
    background: rgba(245, 158, 11, 0.1) !important;
}

:root[data-theme="light"] :where(.tone-risk, .detail-chip.tone-risk) {
    border-color: rgba(190, 18, 60, 0.22) !important;
    background: rgba(244, 63, 94, 0.08) !important;
}

@media (max-width: 900px) {
    :root[data-theme="light"] .portfolio-page .holdings-table tr.holding-row {
        background: var(--ak-surface) !important;
        border-color: var(--ak-border) !important;
        box-shadow: var(--ak-shadow-soft) !important;
    }
}

/* High-specificity portfolio light-mode fixes for legacy dark rules that use !important. */
:root[data-theme="light"] .portfolio-page .portfolio-toolbar,
:root[data-theme="light"] .portfolio-page .sidebar,
:root[data-theme="light"] .portfolio-page .portfolio-sticky-nav,
:root[data-theme="light"] .portfolio-page .portfolio-section-nav,
:root[data-theme="light"] .portfolio-page .portfolio-subnav-shell,
:root[data-theme="light"] .portfolio-page .portfolio-switcher-mobile {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-sticky-nav {
    top: 92px;
    z-index: 58;
    margin-bottom: 1.1rem;
}

:root[data-theme="light"] .portfolio-page .portfolio-section-link,
:root[data-theme="light"] .portfolio-page .portfolio-subnav-link {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-section-link.active,
:root[data-theme="light"] .portfolio-page .portfolio-subnav-link.active,
:root[data-theme="light"] .portfolio-page .portfolio-section-link:hover,
:root[data-theme="light"] .portfolio-page .portfolio-subnav-link:hover,
:root[data-theme="light"] .portfolio-page .portfolio-section-link:focus-visible,
:root[data-theme="light"] .portfolio-page .portfolio-subnav-link:focus-visible {
    background: rgba(3, 105, 161, 0.1) !important;
    border-color: rgba(3, 105, 161, 0.26) !important;
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-toolbar-summary-item,
:root[data-theme="light"] .portfolio-page .p-nav-item,
:root[data-theme="light"] .portfolio-page .sidebar-agent-card,
:root[data-theme="light"] .portfolio-page .sidebar-agent-btn,
:root[data-theme="light"] .portfolio-page .sidebar-agents-balance-pill,
:root[data-theme="light"] .portfolio-page .currency-form,
:root[data-theme="light"] .portfolio-page .toolbar-actions .currency-form {
    background: var(--ak-surface-muted) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .portfolio-page .p-nav-item.active,
:root[data-theme="light"] .portfolio-page .p-nav-item:hover {
    background: rgba(3, 105, 161, 0.08) !important;
    border-color: rgba(3, 105, 161, 0.24) !important;
    border-left-color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] .portfolio-page .p-nav-item.active .p-nav-name,
:root[data-theme="light"] .portfolio-page .p-nav-item:hover .p-nav-name {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .portfolio-page .top-stats,
:root[data-theme="light"] .portfolio-page .top-stats-primary,
:root[data-theme="light"] .portfolio-page .top-stats-secondary {
    background: transparent !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .portfolio-page .eval-panel,
:root[data-theme="light"] .portfolio-page .value-panel,
:root[data-theme="light"] .portfolio-page .is-secondary-stat,
:root[data-theme="light"] .public-portfolio-page .eval-panel,
:root[data-theme="light"] .public-portfolio-page .value-panel,
:root[data-theme="light"] .public-portfolio-page .is-secondary-stat {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] .portfolio-page .eval-panel.tone-good,
:root[data-theme="light"] .portfolio-page .value-panel.tone-good,
:root[data-theme="light"] .portfolio-page .summary-card.tone-good,
:root[data-theme="light"] .portfolio-page .detail-card.tone-good,
:root[data-theme="light"] .portfolio-page .evaluator-step-card.tone-good,
:root[data-theme="light"] .portfolio-page .audit-holding-card.tone-good,
:root[data-theme="light"] .portfolio-page .accounting-allocation-card.tone-good {
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%) !important;
    border-color: rgba(4, 120, 87, 0.24) !important;
    border-top-color: rgba(4, 120, 87, 0.42) !important;
}

:root[data-theme="light"] .portfolio-page .eval-panel.tone-warn,
:root[data-theme="light"] .portfolio-page .value-panel.tone-warn,
:root[data-theme="light"] .portfolio-page .summary-card.tone-warn,
:root[data-theme="light"] .portfolio-page .detail-card.tone-warn,
:root[data-theme="light"] .portfolio-page .evaluator-step-card.tone-warn,
:root[data-theme="light"] .portfolio-page .audit-holding-card.tone-warn,
:root[data-theme="light"] .portfolio-page .accounting-allocation-card.tone-warn {
    background: linear-gradient(180deg, #ffffff 0%, #fffbeb 100%) !important;
    border-color: rgba(180, 83, 9, 0.24) !important;
    border-top-color: rgba(180, 83, 9, 0.42) !important;
}

:root[data-theme="light"] .portfolio-page .eval-panel.tone-risk,
:root[data-theme="light"] .portfolio-page .value-panel.tone-risk,
:root[data-theme="light"] .portfolio-page .summary-card.tone-risk,
:root[data-theme="light"] .portfolio-page .detail-card.tone-risk,
:root[data-theme="light"] .portfolio-page .evaluator-step-card.tone-risk,
:root[data-theme="light"] .portfolio-page .audit-holding-card.tone-risk,
:root[data-theme="light"] .portfolio-page .accounting-allocation-card.tone-risk {
    background: linear-gradient(180deg, #ffffff 0%, #fff1f2 100%) !important;
    border-color: rgba(190, 18, 60, 0.22) !important;
    border-top-color: rgba(190, 18, 60, 0.42) !important;
}

:root[data-theme="light"] .portfolio-page .eval-panel.tone-good .eval-score,
:root[data-theme="light"] .portfolio-page .summary-card.tone-good .value,
:root[data-theme="light"] .portfolio-page .detail-card.tone-good strong {
    color: var(--ak-positive) !important;
}

:root[data-theme="light"] .portfolio-page .eval-panel.tone-warn .eval-score,
:root[data-theme="light"] .portfolio-page .summary-card.tone-warn .value,
:root[data-theme="light"] .portfolio-page .detail-card.tone-warn strong {
    color: var(--ak-warning) !important;
}

:root[data-theme="light"] .portfolio-page .eval-panel.tone-risk .eval-score,
:root[data-theme="light"] .portfolio-page .summary-card.tone-risk .value,
:root[data-theme="light"] .portfolio-page .detail-card.tone-risk strong {
    color: var(--ak-negative) !important;
}

:root[data-theme="light"] .portfolio-page .value-amount,
:root[data-theme="light"] .portfolio-page .eval-score,
:root[data-theme="light"] .portfolio-page .portfolio-toolbar-summary-value {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .portfolio-page .value-amount.buy,
:root[data-theme="light"] .portfolio-page .eval-score.buy,
:root[data-theme="light"] .portfolio-page .eval-score-delta.is-up {
    color: var(--ak-positive) !important;
}

:root[data-theme="light"] .portfolio-page .value-amount.sell,
:root[data-theme="light"] .portfolio-page .eval-score.sell,
:root[data-theme="light"] .portfolio-page .eval-score-delta.is-down {
    color: var(--ak-negative) !important;
}

:root[data-theme="light"] .portfolio-page .eval-score-delta.is-up {
    background: rgba(4, 120, 87, 0.1) !important;
    border-color: rgba(4, 120, 87, 0.22) !important;
    color: var(--ak-positive) !important;
}

:root[data-theme="light"] .portfolio-page .eval-score-delta.is-down {
    background: rgba(220, 38, 38, 0.08) !important;
    border-color: rgba(220, 38, 38, 0.18) !important;
    color: var(--ak-negative) !important;
}

:root[data-theme="light"] .portfolio-page .eval-score-delta.is-flat {
    background: rgba(180, 83, 9, 0.1) !important;
    border-color: rgba(180, 83, 9, 0.2) !important;
    color: var(--ak-warning) !important;
}

:root[data-theme="light"] .portfolio-page .eval-status,
:root[data-theme="light"] .portfolio-page .value-meta-note,
:root[data-theme="light"] .portfolio-page .eval-score-delta-meta,
:root[data-theme="light"] .portfolio-page .portfolio-page-subtitle,
:root[data-theme="light"] .portfolio-page .portfolio-toolbar-summary-label,
:root[data-theme="light"] .portfolio-page .holdings-header-note,
:root[data-theme="light"] .portfolio-page .holdings-header-guide,
:root[data-theme="light"] .portfolio-transactions-page .active-holdings-scan-hint,
:root[data-theme="light"] .portfolio-page .sidebar-label,
:root[data-theme="light"] .portfolio-page .sidebar-count,
:root[data-theme="light"] .portfolio-page .sidebar-agents-intro,
:root[data-theme="light"] .portfolio-page .sidebar-agent-role,
:root[data-theme="light"] .portfolio-page .summary-card .label,
:root[data-theme="light"] .portfolio-page .summary-card .meta {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-stats-controls {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 0.55rem;
}

:root[data-theme="light"] .portfolio-page .totals-mode-toggle {
    background: var(--ak-surface-muted) !important;
    border: 1px solid var(--ak-border) !important;
    border-radius: 12px !important;
    box-shadow: var(--ak-shadow-soft) !important;
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .portfolio-page .totals-mode-label {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] .portfolio-page .totals-mode-btn {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .portfolio-page .totals-mode-btn.is-active {
    background: rgba(3, 105, 161, 0.14) !important;
    border-color: rgba(3, 105, 161, 0.2) !important;
    color: var(--ak-brand-strong) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-overview-focus-card,
:root[data-theme="light"] .portfolio-page .portfolio-priority-banner,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-panel {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-overview-focus-card.tone-good,
:root[data-theme="light"] .portfolio-page .portfolio-priority-banner.tone-good,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-panel.tone-good {
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%) !important;
    border-color: rgba(4, 120, 87, 0.24) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-overview-focus-card.tone-warn,
:root[data-theme="light"] .portfolio-page .portfolio-priority-banner.tone-warn,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-panel.tone-warn {
    background: linear-gradient(180deg, #ffffff 0%, #fffbeb 100%) !important;
    border-color: rgba(180, 83, 9, 0.24) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-overview-focus-card.tone-risk,
:root[data-theme="light"] .portfolio-page .portfolio-priority-banner.tone-risk,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-panel.tone-risk {
    background: linear-gradient(180deg, #ffffff 0%, #fff1f2 100%) !important;
    border-color: rgba(190, 18, 60, 0.22) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-overview-focus-card h3,
:root[data-theme="light"] .portfolio-page .portfolio-priority-copy h3,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-copy h3 {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-overview-focus-card p,
:root[data-theme="light"] .portfolio-page .portfolio-priority-copy p,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-copy p {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .portfolio-page .holdings-container,
:root[data-theme="light"] .portfolio-page .holdings-header,
:root[data-theme="light"] .portfolio-page .portfolio-workflow-guide,
:root[data-theme="light"] .portfolio-page .portfolio-workflow-step,
:root[data-theme="light"] .portfolio-page .portfolio-current-holding-card,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-stat,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-summary,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-preview {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .portfolio-page .holdings-table thead th {
    background: var(--ak-surface-muted) !important;
    border-bottom-color: var(--ak-border) !important;
    color: var(--ak-text-muted) !important;
}

/* Portfolio subpage light-mode overrides for late legacy dark sections. */
:root[data-theme="light"] .portfolio-page .portfolio-title {
    background: none !important;
    color: var(--ak-text) !important;
    -webkit-text-fill-color: var(--ak-text) !important;
}

:root[data-theme="light"] .portfolio-page .add-stock-grid,
:root[data-theme="light"] .portfolio-page .export-section,
:root[data-theme="light"] .portfolio-page .import-section,
:root[data-theme="light"] .portfolio-page .portfolio-dividend-overview-strip,
:root[data-theme="light"] .portfolio-page .optimizer-section,
:root[data-theme="light"] .portfolio-page .optimizer-suggestions,
:root[data-theme="light"] .portfolio-page .optimizer-card,
:root[data-theme="light"] .portfolio-page .estimate-section,
:root[data-theme="light"] .portfolio-page .estimate-card,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-card,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-panel,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-stat,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-start-panel,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-start-item,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-evidence-panel,
:root[data-theme="light"] .portfolio-page .evaluator-steps-section,
:root[data-theme="light"] .portfolio-page .evaluator-tax-section,
:root[data-theme="light"] .portfolio-page .evaluator-holdings-section,
:root[data-theme="light"] .portfolio-page .evaluator-history-section,
:root[data-theme="light"] .portfolio-page .evaluator-detail-grid,
:root[data-theme="light"] .portfolio-page .accounting-history-section,
:root[data-theme="light"] .portfolio-page .accounting-controls,
:root[data-theme="light"] .portfolio-page .accounting-secondary-grid .accounting-detail-card {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] .portfolio-page .optimizer-card,
:root[data-theme="light"] .portfolio-page .estimate-card,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-panel,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-stat,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-start-item,
:root[data-theme="light"] .portfolio-page .accounting-controls,
:root[data-theme="light"] .portfolio-page .accounting-secondary-grid .accounting-detail-card {
    background: var(--ak-surface-muted) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .portfolio-page .add-stock-grid,
:root[data-theme="light"] .portfolio-page .export-section,
:root[data-theme="light"] .portfolio-page .import-section,
:root[data-theme="light"] .portfolio-page .portfolio-dividend-overview-strip,
:root[data-theme="light"] .portfolio-page .optimizer-section,
:root[data-theme="light"] .portfolio-page .estimate-section,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-card,
:root[data-theme="light"] .portfolio-page .evaluator-steps-section,
:root[data-theme="light"] .portfolio-page .evaluator-tax-section,
:root[data-theme="light"] .portfolio-page .evaluator-holdings-section,
:root[data-theme="light"] .portfolio-page .evaluator-history-section,
:root[data-theme="light"] .portfolio-page .evaluator-detail-grid,
:root[data-theme="light"] .portfolio-page .accounting-history-section {
    border-top-color: rgba(3, 105, 161, 0.18) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-alert.is-success {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(4, 120, 87, 0.28) !important;
    border-left-color: rgba(4, 120, 87, 0.66) !important;
    color: var(--ak-positive) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-alert.is-error {
    background: rgba(244, 63, 94, 0.08) !important;
    border-color: rgba(190, 18, 60, 0.24) !important;
    border-left-color: rgba(190, 18, 60, 0.66) !important;
    color: var(--ak-negative) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-post-import-kicker,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-source,
:root[data-theme="light"] .portfolio-page .holding-quick-fact,
:root[data-theme="light"] .portfolio-page .holding-mobile-metric,
:root[data-theme="light"] .portfolio-page .accounting-source-chip,
:root[data-theme="light"] .portfolio-page .portfolio-priority-chip,
:root[data-theme="light"] .portfolio-page .holdings-header-chip {
    background: rgba(3, 105, 161, 0.08) !important;
    border-color: rgba(3, 105, 161, 0.22) !important;
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-post-import-head h2,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-panel strong,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-start-copy h3,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-start-item strong,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-evidence-panel > summary strong,
:root[data-theme="light"] .portfolio-page .split-header h3,
:root[data-theme="light"] .portfolio-page .evaluator-detail-grid .detail-card h3,
:root[data-theme="light"] .portfolio-page .accounting-detail-card > summary {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-post-import-head p,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-panel p,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-meta,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-start-copy p,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-start-item small,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-evidence-panel > summary small,
:root[data-theme="light"] .portfolio-page .evaluator-history-table th,
:root[data-theme="light"] .portfolio-page .accounting-history-table th,
:root[data-theme="light"] .portfolio-page .estimate-card .label,
:root[data-theme="light"] .portfolio-page .estimate-card .cov,
:root[data-theme="light"] .portfolio-page .optimizer-card .label,
:root[data-theme="light"] .portfolio-page .optimizer-card .detail,
:root[data-theme="light"] .portfolio-page .portfolio-mobile-summary {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-evaluator-start-copy span,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-start-item span,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-evidence-panel > summary span,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-evidence-panel > summary::after,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-stat-label {
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] .portfolio-page .evaluator-history-table th,
:root[data-theme="light"] .portfolio-page .accounting-history-table th,
:root[data-theme="light"] .portfolio-page .accounting-secondary-grid .market-table tr,
:root[data-theme="light"] .portfolio-page .holdings-table tr.holding-row:hover td {
    background: var(--ak-surface-muted) !important;
}

:root[data-theme="light"] .portfolio-page .estimate-card.buy,
:root[data-theme="light"] .portfolio-page .optimizer-card.good {
    border-left-color: rgba(4, 120, 87, 0.52) !important;
}

:root[data-theme="light"] .portfolio-page .estimate-card.sell,
:root[data-theme="light"] .portfolio-page .optimizer-card.risk {
    border-left-color: rgba(190, 18, 60, 0.52) !important;
}

:root[data-theme="light"] .portfolio-page .estimate-card.hold,
:root[data-theme="light"] .portfolio-page .optimizer-card.warn {
    border-left-color: rgba(180, 83, 9, 0.52) !important;
}

:root[data-theme="light"] .portfolio-page .estimate-card.buy .pct,
:root[data-theme="light"] .portfolio-page .optimizer-card.good .value {
    color: var(--ak-positive) !important;
}

:root[data-theme="light"] .portfolio-page .estimate-card.sell .pct,
:root[data-theme="light"] .portfolio-page .optimizer-card.risk .value {
    color: var(--ak-negative) !important;
}

:root[data-theme="light"] .portfolio-page .estimate-card.hold .pct,
:root[data-theme="light"] .portfolio-page .optimizer-card.warn .value {
    color: var(--ak-warning) !important;
}

/* Professional light footer: avoid dark-mode leftovers and stretched empty cards. */
:root[data-theme="light"] .main-footer {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(238, 243, 247, 0.92) 100%) !important;
    border-top: 1px solid rgba(148, 163, 184, 0.32) !important;
    color: var(--ak-text-soft) !important;
    margin-top: clamp(2rem, 4vw, 3.2rem) !important;
    padding: clamp(2.2rem, 4vw, 3.2rem) 0 1.4rem !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94) !important;
}

:root[data-theme="light"] .main-footer .container {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .footer-grid {
    align-items: start !important;
    gap: 1rem !important;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr) !important;
    margin-bottom: 1rem !important;
}

:root[data-theme="light"] .f-col {
    align-self: start !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 1.15rem 1.2rem !important;
    border: 1px solid var(--ak-border) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.92) !important;
    color: var(--ak-text-soft) !important;
    box-shadow: var(--ak-shadow-soft) !important;
}

:root[data-theme="light"] .f-col .logo,
:root[data-theme="light"] .f-col h4 {
    color: var(--ak-text) !important;
    -webkit-text-fill-color: var(--ak-text) !important;
}

:root[data-theme="light"] .f-col .logo {
    margin-bottom: 0.8rem !important;
}

:root[data-theme="light"] .f-col h4 {
    margin-bottom: 0.65rem !important;
}

:root[data-theme="light"] .f-col p,
:root[data-theme="light"] .contact-info,
:root[data-theme="light"] .disclaimer-box,
:root[data-theme="light"] .footer-bottom {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .footer-links {
    gap: 0.35rem !important;
}

:root[data-theme="light"] .footer-links a,
:root[data-theme="light"] .contact-info a {
    color: var(--ak-brand-strong) !important;
    border-bottom-color: rgba(15, 76, 129, 0.34) !important;
    text-decoration: none !important;
}

:root[data-theme="light"] .footer-links a:hover,
:root[data-theme="light"] .footer-links a:focus-visible,
:root[data-theme="light"] .contact-info a:hover,
:root[data-theme="light"] .contact-info a:focus-visible {
    color: #08375f !important;
    border-bottom-color: #08375f !important;
    outline: none !important;
}

:root[data-theme="light"] .disclaimer-box {
    background: rgba(255, 255, 255, 0.82) !important;
    border-color: var(--ak-border) !important;
    border-radius: 16px !important;
    margin: 1rem 0 1.2rem !important;
    box-shadow: var(--ak-shadow-soft) !important;
}

:root[data-theme="light"] .disclaimer-box strong {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .footer-bottom {
    border-top-color: rgba(148, 163, 184, 0.34) !important;
    padding-top: 1.1rem !important;
}

@media (max-width: 900px) {
    :root[data-theme="light"] .footer-grid {
        grid-template-columns: 1fr !important;
    }

    :root[data-theme="light"] .f-col,
    :root[data-theme="light"] .disclaimer-box {
        padding: 1rem !important;
    }
}

/* Social/public light-mode contrast stabilization. */
:root[data-theme="light"] .social-page .social-hero-kicker,
:root[data-theme="light"] .social-page .social-hero-spotlight-kicker,
:root[data-theme="light"] .social-page .social-rank-badge,
:root[data-theme="light"] .social-page .portfolio-risk-label,
:root[data-theme="light"] .social-page .action-link,
:root[data-theme="light"] .social-page .social-follow-form .social-follow-btn {
    background: var(--ak-surface-muted) !important;
    border-color: rgba(3, 105, 161, 0.22) !important;
    color: var(--ak-brand-strong) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .social-page .social-overview-label,
:root[data-theme="light"] .social-page .social-card-owner-inline,
:root[data-theme="light"] .social-page .listing-quick-fact-label,
:root[data-theme="light"] .social-page .social-hero-spotlight-owner,
:root[data-theme="light"] .social-page .social-hero-spotlight-copy,
:root[data-theme="light"] .social-page .social-hero-spotlight-return-label,
:root[data-theme="light"] .public-portfolio-page .public-social-rail small {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .social-page .social-overview-value,
:root[data-theme="light"] .social-page .social-card-title-group,
:root[data-theme="light"] .social-page .social-card-title-group strong,
:root[data-theme="light"] .social-page strong.social-card-title-group,
:root[data-theme="light"] .social-page .listing-quick-fact-value,
:root[data-theme="light"] .social-page .social-cell-holdings,
:root[data-theme="light"] .social-page .social-cell-followers,
:root[data-theme="light"] .social-page .social-cell-return,
:root[data-theme="light"] .social-page .social-hero-spotlight h2,
:root[data-theme="light"] .social-page .social-hero-spotlight-return strong {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .social-page .listing-quick-fact,
:root[data-theme="light"] .social-page .social-hero-spotlight-return,
:root[data-theme="light"] .social-page .social-hero-spotlight-stats .detail-chip {
    background: var(--ak-surface-muted) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .social-page .social-holdings-preview > span {
    color: #41566b !important;
    opacity: 1 !important;
}

:root[data-theme="light"] .social-page .social-holdings-preview strong {
    background: #e7f4f8 !important;
    border-color: #8fc3d2 !important;
    color: #164f73 !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72) !important;
}

/* Preserve the social spotlight's technical/radar character in light mode. */
:root[data-theme="light"] .social-page .social-hero-spotlight-surface {
    border-color: #b9d7e3 !important;
    background:
        linear-gradient(rgba(22, 79, 115, 0.055) 1px, transparent 1px) 0 0 / 38px 38px,
        linear-gradient(90deg, rgba(22, 79, 115, 0.055) 1px, transparent 1px) 0 0 / 38px 38px,
        radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.2), rgba(14, 165, 233, 0.055) 22%, transparent 47%),
        linear-gradient(145deg, #fbfeff 0%, #eef8fb 56%, #e7f3f8 100%) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 0 42px rgba(14, 116, 144, 0.055),
        0 14px 30px rgba(22, 79, 115, 0.09) !important;
}

:root[data-theme="light"] .social-page .social-hero-spotlight-surface::before {
    content: "";
    position: absolute;
    inset: 13px;
    border: 1px solid rgba(22, 79, 115, 0.1);
    border-radius: 14px;
    background:
        linear-gradient(90deg, transparent 49.7%, rgba(14, 116, 144, 0.12) 50%, transparent 50.3%),
        linear-gradient(transparent 49.7%, rgba(14, 116, 144, 0.12) 50%, transparent 50.3%);
    pointer-events: none;
}

:root[data-theme="light"] .social-page .social-hero-orbit {
    border-color: rgba(11, 111, 159, 0.24) !important;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.09), transparent 70%) !important;
    box-shadow: inset 0 0 18px rgba(14, 165, 233, 0.06);
}

:root[data-theme="light"] .social-page .social-hero-orbit--inner {
    border-color: rgba(11, 111, 159, 0.34) !important;
}

:root[data-theme="light"] .social-page .social-hero-beam {
    height: 36px;
    background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.11), rgba(14, 165, 233, 0.44), rgba(45, 212, 191, 0.11), transparent) !important;
    filter: blur(3px);
    mix-blend-mode: multiply;
}

:root[data-theme="light"] .social-page .social-hero-core {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    background: radial-gradient(circle at 32% 28%, #f5fdff 0 10%, #67dcff 34%, #0ea5e9 64%, #075985 100%) !important;
    box-shadow:
        0 0 0 7px rgba(14, 165, 233, 0.11),
        0 0 0 15px rgba(14, 165, 233, 0.055),
        0 10px 24px rgba(3, 105, 161, 0.34) !important;
}

:root[data-theme="light"] .social-page .social-table td,
:root[data-theme="light"] .social-page .social-table tbody tr:hover td {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .social-page .action-link:hover,
:root[data-theme="light"] .social-page .social-follow-form .social-follow-btn:hover {
    background: rgba(3, 105, 161, 0.1) !important;
    border-color: rgba(3, 105, 161, 0.3) !important;
    color: var(--ak-brand-strong) !important;
}

/* Professional light-mode homepage palette. */
:root[data-theme="light"] body.index-page-bg {
    background-color: var(--ak-page-bg) !important;
    background-image:
        linear-gradient(180deg, #fbfcfe 0%, #f6f8fb 48%, #eef3f7 100%) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium::before {
    background:
        radial-gradient(circle at 18% 18%, rgba(15, 76, 129, 0.08), transparent 30%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.05), transparent 72%) !important;
    filter: none !important;
    opacity: 1 !important;
}

:root[data-theme="light"] .home-page.home-v2-premium::after {
    background:
        repeating-linear-gradient(90deg, rgba(100, 116, 139, 0.025) 0 1px, transparent 1px 96px),
        repeating-linear-gradient(0deg, rgba(100, 116, 139, 0.02) 0 1px, transparent 1px 96px) !important;
    opacity: 0.28 !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-hero,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-conversion,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-workflow,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-block,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-demo,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator {
    background:
        linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%) !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
    color: var(--ak-text) !important;
    box-shadow: 0 26px 58px rgba(15, 23, 42, 0.09) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-hero::before,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-conversion::before,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-workflow::before,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning::before,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-demo::before,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator::before {
    background: radial-gradient(circle, rgba(15, 76, 129, 0.08), transparent 72%) !important;
    filter: blur(6px) !important;
    opacity: 0.5 !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-hero-visual {
    opacity: 0.055 !important;
    mix-blend-mode: multiply !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-copy h1,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-copy h1::first-line,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-head h2,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-block h2,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-focus-head h2,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-head h2,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-conversion-copy h2,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning-head h2,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-demo-head h2,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator-head h2,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator-copy h3,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator-card h3,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning-card h3,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-list-item h3,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-step h3,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-primary h3,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-side-card strong,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-row strong,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-row-ticker,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-conversion-value {
    color: var(--ak-text) !important;
    text-shadow: none !important;
    -webkit-text-fill-color: var(--ak-text) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-copy h1 {
    background: none !important;
    background-clip: border-box !important;
    -webkit-background-clip: border-box !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-subtitle {
    color: #26364d !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-note,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-head p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-block-head p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-focus-head p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-head p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-conversion-copy p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning-head p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-demo-head p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator-head p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator-copy p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator-card p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning-card p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-list-item p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-step p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-primary p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-prompt p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-row span,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-side-card em,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-list-head em,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-row-name,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-row-rank,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-row-score,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-conversion-label {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-chip,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-proofline span,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-links a,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-start-path,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-trust-item,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-row,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-list-item,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-step,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-primary,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-side-card,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-row,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-prompt,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-conversion-metric,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning-manifesto,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning-card,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-demo-audit,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-demo-compare,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-demo-signal,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-demo-compare-card,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator-card {
    background: #ffffff !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
    color: var(--ak-text) !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.055) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-chip,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-proofline span,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-links a {
    background: #f8fafc !important;
    color: var(--ak-text-soft) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-proofline strong,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-step-index,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning-card-index,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator-card-index,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-section-kicker,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning-label {
    background: rgba(3, 105, 161, 0.08) !important;
    border-color: rgba(3, 105, 161, 0.2) !important;
    color: var(--ak-brand-strong) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-search {
    background: #ffffff !important;
    border-color: rgba(148, 163, 184, 0.32) !important;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.09) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-search::after {
    background: linear-gradient(90deg, rgba(3, 105, 161, 0.045), transparent 32%, transparent 68%, rgba(20, 184, 166, 0.045)) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-search input {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-search input::placeholder {
    color: #5a6c7e !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-actions .btn-primary {
    background: linear-gradient(135deg, #0f4c81, #0369a1) !important;
    background-color: #0f4c81 !important;
    border-color: rgba(3, 105, 161, 0.34) !important;
    color: #ffffff !important;
    box-shadow: 0 14px 28px rgba(3, 105, 161, 0.18) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-actions .btn-primary:hover {
    box-shadow: 0 18px 34px rgba(3, 105, 161, 0.22) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-actions .btn-secondary,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-footer .btn-secondary {
    background: #ffffff !important;
    border-color: rgba(148, 163, 184, 0.38) !important;
    color: var(--ak-text) !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview {
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%) !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
    box-shadow: 0 24px 52px rgba(15, 23, 42, 0.09) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview::after {
    background: radial-gradient(circle, rgba(15, 76, 129, 0.08), transparent 70%) !important;
    opacity: 0.55 !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-head {
    border-bottom-color: rgba(148, 163, 184, 0.22) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-kicker,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-evaluator-kicker,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-demo-panel-kicker,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-demo-compare-kicker {
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-evaluator {
    background: linear-gradient(145deg, #112338 0%, #17243a 100%) !important;
    background-color: #112338 !important;
    border-color: rgba(15, 76, 129, 0.34) !important;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-evaluator-score {
    background: rgba(2, 10, 22, 0.5) !important;
    border-color: rgba(125, 211, 252, 0.18) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-evaluator-score span,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-evaluator-score strong,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-evaluator-kicker,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-evaluator p {
    color: #e8f4ff !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-evaluator-score span,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-evaluator-kicker {
    color: #9cc7e8 !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-chart {
    background: linear-gradient(135deg, #eef2f7 0%, #dfe7ef 100%) !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-chart-line,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-chart-point {
    opacity: 0.68 !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-row::after {
    background: linear-gradient(180deg, rgba(3, 105, 161, 0.42), rgba(20, 184, 166, 0.16)) !important;
    opacity: 0.62 !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-row:hover,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-row:focus-visible,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-list-item:hover,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-step:hover,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-focus-card:hover,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-row:hover,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning-card:hover,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator-card:hover {
    background: #ffffff !important;
    border-color: rgba(3, 105, 161, 0.26) !important;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.09) !important;
}

/* Light interface refinement: restrained navigation and a clearer portfolio workspace. */
:root[data-theme="light"] {
    --ak-page-bg: #f3f6f9;
    --ak-page-bg-layer: linear-gradient(180deg, #f8fafc 0%, #f3f6f9 28rem, #eef2f6 100%);
    --ak-surface-muted: #f7f9fb;
    --ak-surface-soft: #eef3f7;
    --ak-text: #10253b;
    --ak-text-soft: #41566b;
    --ak-text-muted: #5a6c7e;
    --ak-border: #dce4eb;
    --ak-border-strong: #c7d2dc;
    --ak-brand: #0b6f9f;
    --ak-brand-strong: #164f73;
    --ak-focus: rgba(11, 111, 159, 0.18);
    --ak-shadow: 0 1px 2px rgba(15, 35, 55, 0.04), 0 12px 30px rgba(15, 35, 55, 0.065);
    --ak-shadow-soft: 0 1px 2px rgba(15, 35, 55, 0.035), 0 6px 18px rgba(15, 35, 55, 0.045);
}

:root[data-theme="light"] body {
    background-color: var(--ak-page-bg) !important;
    background-image: var(--ak-page-bg-layer) !important;
}

:root[data-theme="light"] body > header {
    background: rgba(255, 255, 255, 0.97) !important;
    border-bottom: 1px solid #dde5ec !important;
    box-shadow: 0 1px 2px rgba(15, 35, 55, 0.035), 0 6px 18px rgba(15, 35, 55, 0.035) !important;
    backdrop-filter: blur(16px) saturate(135%) !important;
}

:root[data-theme="light"] body > header::after {
    display: none !important;
}

:root[data-theme="light"] .logo,
:root[data-theme="light"] .logo-wordmark {
    color: #102b43 !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: #102b43 !important;
    text-shadow: none !important;
}

:root[data-theme="light"] .logo {
    gap: 0.48rem;
    letter-spacing: -0.035em !important;
}

:root[data-theme="light"] .beta-tag {
    padding: 0.15rem 0.42rem !important;
    border: 1px solid #a9cddd !important;
    border-radius: 6px !important;
    background: #eaf5f9 !important;
    color: #176589 !important;
    -webkit-text-fill-color: #176589 !important;
    box-shadow: none !important;
    font-size: 0.55rem !important;
    letter-spacing: 0.08em !important;
}

@media (min-width: 901px) {
    :root[data-theme="light"] body > header .header-inner {
        min-height: 68px !important;
        max-width: 1320px !important;
        padding-inline: clamp(1rem, 2vw, 1.6rem) !important;
        gap: 0;
    }

    :root[data-theme="light"] body > header .logo {
        font-size: 1.12rem !important;
    }

    :root[data-theme="light"] body > header .main-nav {
        gap: 0.75rem;
        margin-left: 1.45rem;
    }

    :root[data-theme="light"] body > header :where(.nav-links, .nav-utils) {
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
    }

    :root[data-theme="light"] body > header .nav-links {
        gap: 0.08rem;
    }

    :root[data-theme="light"] body > header .nav-link {
        min-height: 40px;
        padding: 0.55rem 0.7rem;
        border: 1px solid transparent !important;
        border-radius: 9px;
        color: #42566a !important;
        font-size: 0.82rem;
        font-weight: 720;
        line-height: 1;
        white-space: nowrap;
        box-shadow: none !important;
        transform: none !important;
    }

    :root[data-theme="light"] body > header .nav-link:hover,
    :root[data-theme="light"] body > header .nav-link:focus-visible {
        background: #f2f6f9 !important;
        border-color: #e2e8ee !important;
        color: #17354f !important;
    }

    :root[data-theme="light"] body > header .nav-link.active,
    :root[data-theme="light"] body > header .nav-link.nav-link-primary.active {
        background: #e8f2f7 !important;
        border-color: #c4dce7 !important;
        color: #135f84 !important;
        box-shadow: inset 0 -2px 0 #3a8db3 !important;
    }

    :root[data-theme="light"] body > header .header-action-cluster {
        gap: 0.48rem;
        padding-left: 0.8rem;
        border-left: 1px solid #e4eaf0;
    }

    :root[data-theme="light"] body > header .nav-utils {
        gap: 0.42rem;
    }

    :root[data-theme="light"] body > header .header-stock-search {
        width: clamp(170px, 16vw, 220px);
    }

    :root[data-theme="light"] body > header .header-stock-search input {
        min-height: 40px;
        padding: 0.56rem 0.8rem 0.56rem 2.15rem;
        border: 1px solid #d8e1e9 !important;
        border-radius: 10px !important;
        background: #f7f9fb !important;
        color: #173047 !important;
        box-shadow: none !important;
        font-size: 0.8rem;
    }

    :root[data-theme="light"] body > header .header-stock-search input:focus {
        border-color: #68a7c3 !important;
        background: #ffffff !important;
        box-shadow: 0 0 0 3px rgba(11, 111, 159, 0.11) !important;
    }

    :root[data-theme="light"] body > header .header-search-icon {
        left: 0.72rem;
        color: #5a6c7e !important;
    }

    :root[data-theme="light"] body > header .market-status {
        min-height: 40px;
        padding: 0.35rem 0.68rem;
        border: 1px solid #dce5eb !important;
        border-radius: 10px;
        background: #ffffff !important;
        color: #43586c !important;
        box-shadow: none !important;
    }

    :root[data-theme="light"] body > header .market-status-text {
        font-size: 0.76rem;
        font-weight: 700;
    }

    :root[data-theme="light"] body > header .status-dot {
        width: 7px;
        height: 7px;
        box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
    }

    :root[data-theme="light"] body > header :where(.theme-toggle, .lang-switcher a, .nav-auth .nav-btn) {
        width: 40px;
        min-width: 40px;
        min-height: 40px;
        padding: 0 !important;
        border: 1px solid #dce4eb !important;
        border-radius: 10px !important;
        background: #ffffff !important;
        color: #40566a !important;
        box-shadow: none !important;
    }

    :root[data-theme="light"] body > header :where(.theme-toggle, .lang-switcher a, .nav-auth .nav-btn):hover,
    :root[data-theme="light"] body > header :where(.theme-toggle, .lang-switcher a, .nav-auth .nav-btn):focus-visible {
        border-color: #b8ccd8 !important;
        background: #f3f7f9 !important;
        color: #155f83 !important;
    }

    :root[data-theme="light"] body > header .theme-toggle-text {
        display: none;
    }

    :root[data-theme="light"] body > header .nav-auth {
        margin-left: 0;
    }

    :root[data-theme="light"] body > header .nav-auth .nav-btn-icon {
        width: 40px;
        min-width: 40px;
    }
}

@media (min-width: 901px) and (max-width: 1180px) {
    :root[data-theme="light"] body > header .market-status {
        display: none;
    }
}

@media (min-width: 901px) and (max-width: 1060px) {
    :root[data-theme="light"] body > header .header-stock-search {
        display: none;
    }

    :root[data-theme="light"] body > header .main-nav {
        margin-left: 0.8rem;
    }
}

/* Portfolio surfaces */
:root[data-theme="light"] .portfolio-page .portfolio-layout {
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

:root[data-theme="light"] .portfolio-page .sidebar {
    top: 84px;
    padding: 0.9rem;
    border: 1px solid #dce4eb !important;
    border-radius: 16px;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(15, 35, 55, 0.04), 0 10px 26px rgba(15, 35, 55, 0.055) !important;
}

:root[data-theme="light"] .portfolio-page .sidebar-header {
    margin-bottom: 0.68rem;
    padding: 0.08rem 0.18rem;
}

:root[data-theme="light"] .portfolio-page .sidebar-label {
    color: #52677b !important;
    font-size: 0.63rem;
    letter-spacing: 0.11em;
}

:root[data-theme="light"] .portfolio-page .sidebar-count {
    border: 1px solid #d8e4ea !important;
    background: #edf5f8 !important;
    color: #316d89 !important;
}

:root[data-theme="light"] .portfolio-page .p-nav-item {
    margin-bottom: 0.35rem;
    padding: 0.68rem 0.72rem;
    border: 1px solid transparent !important;
    border-left: 3px solid transparent !important;
    border-radius: 10px;
    background: transparent !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .portfolio-page .p-nav-item:hover {
    border-color: #e0e7ed !important;
    border-left-color: #a8bdca !important;
    background: #f7f9fb !important;
}

:root[data-theme="light"] .portfolio-page .p-nav-item.active {
    border-color: #cfe0e9 !important;
    border-left-color: #1c739b !important;
    background: #edf5f8 !important;
}

:root[data-theme="light"] .portfolio-page .p-nav-name,
:root[data-theme="light"] .portfolio-page .p-nav-item.active .p-nav-name {
    color: #183249 !important;
}

:root[data-theme="light"] .portfolio-page .p-risk-badge,
:root[data-theme="light"] .portfolio-page .p-tax-badge {
    background: #ffffff !important;
    border-color: #dce4eb !important;
    color: #617487 !important;
}

:root[data-theme="light"] .portfolio-page .create-p-btn {
    min-height: 42px;
    border-color: #c9d9e2 !important;
    color: #316f8d !important;
    opacity: 1;
}

:root[data-theme="light"] .portfolio-page .create-p-btn:hover,
:root[data-theme="light"] .portfolio-page .create-p-btn:focus-visible {
    border-color: #78abc1 !important;
    background: #f0f7fa !important;
    color: #155f83 !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-toolbar {
    gap: 1rem;
    margin-bottom: 0.78rem;
    padding: 1.25rem 1.3rem !important;
    border: 1px solid #dce4eb !important;
    border-radius: 16px;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(15, 35, 55, 0.04), 0 12px 30px rgba(15, 35, 55, 0.06) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-toolbar-main {
    gap: 0.9rem;
}

:root[data-theme="light"] .portfolio-page .portfolio-toolbar-eyebrow {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #397a99 !important;
    font-size: 0.64rem;
    letter-spacing: 0.12em;
}

:root[data-theme="light"] .portfolio-page .portfolio-title {
    color: #10253b !important;
    font-size: 1.62rem;
    letter-spacing: -0.035em;
}

:root[data-theme="light"] .portfolio-page .portfolio-page-subtitle {
    max-width: 62ch;
    margin-top: 0.3rem;
    color: #52677a !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-chip {
    padding: 0.2rem 0.5rem;
    border: 1px solid #dce4eb !important;
    background: #f6f8fa !important;
    color: #53687b !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-toolbar-summary {
    gap: 0.5rem;
}

:root[data-theme="light"] .portfolio-page .portfolio-toolbar-summary-item {
    padding: 0.68rem 0.76rem;
    border: 1px solid #dfe6ec !important;
    border-radius: 11px;
    background: #f7f9fb !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-toolbar-summary-label {
    color: #5a6c7e !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-toolbar-summary-value {
    color: #152c42 !important;
}

:root[data-theme="light"] .portfolio-page .toolbar-actions .btn-secondary,
:root[data-theme="light"] .portfolio-page .toolbar-actions .settings-open-btn,
:root[data-theme="light"] .portfolio-page .portfolio-create-mobile-btn {
    border: 1px solid #d7e1e8 !important;
    background: #ffffff !important;
    color: #29445b !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .portfolio-page .toolbar-actions .btn-secondary:hover,
:root[data-theme="light"] .portfolio-page .toolbar-actions .settings-open-btn:hover,
:root[data-theme="light"] .portfolio-page .portfolio-create-mobile-btn:hover {
    border-color: #aac5d3 !important;
    background: #f1f7f9 !important;
    color: #155f83 !important;
}

:root[data-theme="light"] .portfolio-page .toolbar-actions .currency-form {
    border: 1px solid #dce4eb !important;
    background: #f7f9fb !important;
}

:root[data-theme="light"] .portfolio-page .toolbar-actions .currency-form select {
    border: 0 !important;
    background-color: transparent !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-sticky-nav {
    top: 76px;
    margin-bottom: 1rem;
    border: 1px solid #dce4eb !important;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 1px 2px rgba(15, 35, 55, 0.035), 0 8px 22px rgba(15, 35, 55, 0.05) !important;
    backdrop-filter: blur(12px);
}

:root[data-theme="light"] .portfolio-page .portfolio-section-nav {
    gap: 0.2rem;
    padding: 0.34rem !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-section-link {
    min-height: 40px;
    padding: 0.58rem 0.85rem;
    border: 1px solid transparent !important;
    border-radius: 9px;
    color: #4a6074 !important;
    font-weight: 720;
}

:root[data-theme="light"] .portfolio-page .portfolio-section-link:hover,
:root[data-theme="light"] .portfolio-page .portfolio-section-link:focus-visible {
    border-color: #e1e8ed !important;
    background: #f4f7f9 !important;
    color: #17364f !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-section-link.active {
    border-color: #c9dce6 !important;
    background: #eaf3f7 !important;
    color: #155f83 !important;
    box-shadow: inset 0 -2px 0 #3f8fb2 !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-workflow-guide {
    grid-template-columns: minmax(190px, 0.32fr) minmax(0, 1fr);
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding: 0.9rem;
    border: 1px solid #dce4eb !important;
    border-radius: 15px;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(15, 35, 55, 0.035) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-workflow-guide-copy {
    padding: 0.25rem 0.45rem;
}

:root[data-theme="light"] .portfolio-page .portfolio-workflow-guide-copy span {
    color: #397a99 !important;
    font-size: 0.66rem;
}

:root[data-theme="light"] .portfolio-page .portfolio-workflow-guide-copy h3 {
    color: #173047 !important;
    font-size: 0.96rem;
}

:root[data-theme="light"] .portfolio-page .portfolio-workflow-steps {
    gap: 0.55rem;
}

:root[data-theme="light"] .portfolio-page .portfolio-workflow-step {
    padding: 0.75rem;
    border: 1px solid #e0e7ed !important;
    border-radius: 11px;
    background: #f8fafb !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-workflow-step:hover,
:root[data-theme="light"] .portfolio-page .portfolio-workflow-step:focus-visible {
    border-color: #b9d1dc !important;
    background: #f0f7f9 !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-workflow-step-number {
    width: 26px;
    height: 26px;
    background: #e4f1f6 !important;
    color: #1c7198 !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-workflow-step strong {
    color: #1c344a !important;
    font-size: 0.84rem;
}

:root[data-theme="light"] .portfolio-page .portfolio-workflow-step-copy small {
    color: #617487 !important;
    font-size: 0.76rem;
}

:root[data-theme="light"] .portfolio-page .portfolio-workflow-step-action {
    color: #1b7097 !important;
    font-size: 0.68rem;
}

:root[data-theme="light"] .portfolio-page .top-stats {
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .portfolio-page :where(.eval-panel, .value-panel, .is-secondary-stat) {
    min-height: 124px;
    padding: 1rem !important;
    border: 1px solid #dce4eb !important;
    border-radius: 15px;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(15, 35, 55, 0.035), 0 8px 22px rgba(15, 35, 55, 0.045) !important;
}

:root[data-theme="light"] .portfolio-page :where(.eval-panel, .value-panel).tone-good {
    border-color: #cfe4da !important;
    background: #ffffff !important;
    box-shadow: inset 0 3px 0 #4da57b, 0 1px 2px rgba(15, 35, 55, 0.035), 0 8px 22px rgba(15, 35, 55, 0.045) !important;
}

:root[data-theme="light"] .portfolio-page .eval-panel.tone-good,
:root[data-theme="light"] .portfolio-page .value-panel.tone-good {
    border-color: #cfe4da !important;
    background: #ffffff !important;
    box-shadow: inset 0 3px 0 #4da57b, 0 1px 2px rgba(15, 35, 55, 0.035), 0 8px 22px rgba(15, 35, 55, 0.045) !important;
}

:root[data-theme="light"] .portfolio-page .eval-panel.tone-warn,
:root[data-theme="light"] .portfolio-page .value-panel.tone-warn {
    border-color: #eadfc8 !important;
    background: #ffffff !important;
    box-shadow: inset 0 3px 0 #c39142, 0 1px 2px rgba(15, 35, 55, 0.035), 0 8px 22px rgba(15, 35, 55, 0.045) !important;
}

:root[data-theme="light"] .portfolio-page .eval-panel.tone-risk,
:root[data-theme="light"] .portfolio-page .value-panel.tone-risk {
    border-color: #ecd4d8 !important;
    background: #ffffff !important;
    box-shadow: inset 0 3px 0 #c05a6c, 0 1px 2px rgba(15, 35, 55, 0.035), 0 8px 22px rgba(15, 35, 55, 0.045) !important;
}

:root[data-theme="light"] .portfolio-page :where(.eval-label, .value-label) {
    color: #586d80 !important;
    font-size: 0.78rem;
    font-weight: 720;
}

:root[data-theme="light"] .portfolio-page :where(.eval-score, .value-amount) {
    color: #10253b !important;
    letter-spacing: -0.025em;
}

:root[data-theme="light"] .portfolio-page :where(.eval-status, .value-meta-note) {
    color: #5a6c7e !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-overview-focus-card,
:root[data-theme="light"] .portfolio-page .portfolio-priority-banner,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-panel {
    border: 1px solid #dce4eb !important;
    border-left: 4px solid #4d9b76 !important;
    border-radius: 15px;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(15, 35, 55, 0.035), 0 8px 22px rgba(15, 35, 55, 0.045) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-overview-focus-card.tone-good,
:root[data-theme="light"] .portfolio-page .portfolio-priority-banner.tone-good,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-panel.tone-good {
    border-color: #d7e5dd !important;
    border-left-color: #4d9b76 !important;
    background: #ffffff !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-overview-focus-card.tone-warn,
:root[data-theme="light"] .portfolio-page .portfolio-priority-banner.tone-warn,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-panel.tone-warn {
    border-color: #e7dfcf !important;
    border-left-color: #c39142 !important;
    background: #ffffff !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-overview-focus-card.tone-risk,
:root[data-theme="light"] .portfolio-page .portfolio-priority-banner.tone-risk,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-panel.tone-risk {
    border-color: #ead8db !important;
    border-left-color: #c05a6c !important;
    background: #ffffff !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-overview-focus-kicker {
    color: #397a64 !important;
}

:root[data-theme="light"] .portfolio-page .btn-primary {
    border-color: #155f83 !important;
    background: #155f83 !important;
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(21, 95, 131, 0.16) !important;
}

:root[data-theme="light"] .portfolio-page .btn-primary:hover,
:root[data-theme="light"] .portfolio-page .btn-primary:focus-visible {
    border-color: #104c69 !important;
    background: #104c69 !important;
    box-shadow: 0 8px 20px rgba(21, 95, 131, 0.2) !important;
}

:root[data-theme="light"] .portfolio-page .holdings-container {
    border: 1px solid #dce4eb !important;
    border-radius: 16px;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(15, 35, 55, 0.035), 0 10px 26px rgba(15, 35, 55, 0.05) !important;
}

:root[data-theme="light"] .portfolio-page .holdings-header {
    border-bottom: 1px solid #e2e8ee !important;
    background: #ffffff !important;
}

:root[data-theme="light"] .portfolio-page .holdings-header h3,
:root[data-theme="light"] .portfolio-page .holdings-table strong {
    color: #173047 !important;
}

:root[data-theme="light"] .portfolio-page .holdings-header-chip {
    border-color: #d7e3e9 !important;
    background: #eef5f8 !important;
    color: #316f8d !important;
}

:root[data-theme="light"] .portfolio-page .holdings-table thead th {
    border-bottom: 1px solid #dde5eb !important;
    background: #f6f8fa !important;
    color: #5a6c7e !important;
}

:root[data-theme="light"] .portfolio-page .holdings-table tbody td {
    border-bottom-color: #e8edf1 !important;
    color: #344b60 !important;
}

:root[data-theme="light"] .portfolio-page .holdings-table tbody tr:hover td {
    background: #f8fafb !important;
}

:root[data-theme="light"] .portfolio-page .badge-mini.action-link {
    border-color: #ccdce4 !important;
    background: #ffffff !important;
    color: #286d8d !important;
}

@media (max-width: 900px) {
    :root[data-theme="light"] body > header .header-inner {
        min-height: 60px !important;
        padding-inline: 0.75rem !important;
    }

    :root[data-theme="light"] body > header .logo {
        min-height: 44px;
        padding: 0;
        gap: 0.34rem;
        font-size: 1rem !important;
    }

    :root[data-theme="light"] body > header .beta-tag {
        padding: 0.12rem 0.3rem !important;
        font-size: 0.48rem !important;
    }

    :root[data-theme="light"] body > header .mobile-top-actions {
        gap: 0.3rem;
        margin-right: 0.35rem;
    }

    :root[data-theme="light"] body > header :where(.theme-toggle-mobile, .mobile-lang-shortcut, .mobile-auth-shortcut, .mobile-menu-toggle) {
        width: 44px !important;
        min-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 !important;
        border: 1px solid #dce4eb !important;
        border-radius: 11px !important;
        background: #ffffff !important;
        color: #40566a !important;
        box-shadow: none !important;
    }

    :root[data-theme="light"] body > header .mobile-menu-toggle .bar {
        width: 20px;
        height: 2px;
        background: #40566a !important;
    }

    :root[data-theme="light"] body > header .mobile-menu-toggle.active {
        opacity: 0 !important;
        pointer-events: none !important;
    }

    :root[data-theme="light"] .mobile-nav-overlay.active {
        background: rgba(16, 37, 59, 0.34) !important;
        backdrop-filter: blur(3px);
    }

    :root[data-theme="light"] .main-nav.active {
        width: min(88vw, 360px) !important;
        padding: calc(0.7rem + env(safe-area-inset-top)) 0.9rem calc(0.9rem + env(safe-area-inset-bottom)) !important;
        border-left: 1px solid #d7e0e8 !important;
        background: #ffffff !important;
        color: #173047 !important;
        box-shadow: -18px 0 46px rgba(15, 35, 55, 0.16) !important;
    }

    :root[data-theme="light"] .main-nav.active :where(.nav-mobile-title, .nav-link-text, .nav-link, .lang-switcher a, .header-stock-search input) {
        color: #173047 !important;
    }

    :root[data-theme="light"] .main-nav.active .nav-mobile-section-label {
        color: #5a6c7e !important;
    }

    :root[data-theme="light"] .main-nav.active .nav-mobile-head {
        padding: 0 0 0.65rem;
        border-bottom-color: #e1e7ec;
    }

    :root[data-theme="light"] .main-nav.active .nav-mobile-close {
        border-color: #dce4eb !important;
        background: #f6f8fa !important;
        color: #40566a !important;
    }

    :root[data-theme="light"] .main-nav.active .nav-mobile-auth {
        border-bottom-color: #e1e7ec;
    }

    :root[data-theme="light"] .main-nav.active .nav-mobile-auth .nav-mobile-auth-btn {
        min-height: 44px;
        padding: 0.55rem 0.7rem;
        border: 1px solid #d5e0e7 !important;
        background: #f7f9fb !important;
        color: #26435b !important;
        box-shadow: none !important;
        box-sizing: border-box;
    }

    :root[data-theme="light"] .main-nav.active .nav-links {
        gap: 0.12rem;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    :root[data-theme="light"] .main-nav.active .nav-link {
        min-height: 46px;
        padding: 0.7rem 0.68rem;
        border-color: transparent !important;
        border-radius: 10px;
        background: transparent !important;
        color: #2f485e !important;
        box-shadow: none !important;
        box-sizing: border-box;
    }

    :root[data-theme="light"] .main-nav.active .nav-link:hover,
    :root[data-theme="light"] .main-nav.active .nav-link:focus-visible {
        border-color: #e0e7ed !important;
        background: #f4f7f9 !important;
        color: #173047 !important;
    }

    :root[data-theme="light"] .main-nav.active .nav-link.active {
        border-color: #cbdfe8 !important;
        background: #eaf3f7 !important;
        color: #155f83 !important;
        box-shadow: inset 3px 0 0 #3b8fb3 !important;
    }

    :root[data-theme="light"] .main-nav.active .nav-link-icon,
    :root[data-theme="light"] .main-nav.active .nav-link.active .nav-link-icon,
    :root[data-theme="light"] .main-nav.active .header-search-icon {
        color: #337d9e !important;
    }

    :root[data-theme="light"] .main-nav.active .nav-utils {
        gap: 0.7rem;
        padding-top: 0.75rem !important;
        border: 0 !important;
        border-top: 1px solid #e1e7ec !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    :root[data-theme="light"] .main-nav.active .header-stock-search input {
        border-color: #d8e1e9 !important;
        background: #f7f9fb !important;
        color: #173047 !important;
    }

    :root[data-theme="light"] .main-nav.active .lang-switcher {
        border-color: #dce4eb !important;
        background: #ffffff !important;
    }

    :root[data-theme="light"] .portfolio-page .portfolio-layout {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        margin-top: 0.9rem;
    }

    :root[data-theme="light"] .portfolio-page .portfolio-toolbar {
        padding: 0.95rem !important;
        border-radius: 14px;
        box-shadow: 0 1px 2px rgba(15, 35, 55, 0.04), 0 8px 22px rgba(15, 35, 55, 0.05) !important;
    }

    :root[data-theme="light"] .portfolio-page .portfolio-sticky-nav {
        top: 68px;
        border-radius: 13px;
        box-shadow: 0 1px 2px rgba(15, 35, 55, 0.035), 0 6px 16px rgba(15, 35, 55, 0.04) !important;
    }

    :root[data-theme="light"] .portfolio-page .portfolio-section-nav {
        padding: 0.28rem !important;
    }

    :root[data-theme="light"] .portfolio-page .portfolio-section-link {
        min-height: 42px;
        padding: 0.55rem 0.65rem;
        font-size: 0.78rem;
    }

    :root[data-theme="light"] .portfolio-page .portfolio-workflow-guide {
        grid-template-columns: 1fr;
        padding: 0;
        overflow: hidden;
    }

    :root[data-theme="light"] .portfolio-page .portfolio-workflow-guide-copy {
        padding: 0.85rem 2.8rem 0.85rem 0.9rem;
    }

    :root[data-theme="light"] .portfolio-page .portfolio-workflow-guide-copy::after {
        color: #377d9d !important;
    }

    :root[data-theme="light"] .portfolio-page .portfolio-workflow-guide[open] .portfolio-workflow-steps {
        gap: 0.45rem;
        padding: 0 0.65rem 0.65rem;
    }

    :root[data-theme="light"] .portfolio-page .portfolio-workflow-step {
        min-height: 0;
        padding: 0.68rem;
    }

    :root[data-theme="light"] .portfolio-page :where(.eval-panel, .value-panel, .is-secondary-stat) {
        min-height: 108px;
        padding: 0.82rem !important;
        border-radius: 13px;
        box-shadow: 0 1px 2px rgba(15, 35, 55, 0.035), 0 6px 16px rgba(15, 35, 55, 0.04) !important;
    }

    :root[data-theme="light"] .portfolio-page .holdings-container {
        border-radius: 14px;
    }

    :root[data-theme="light"] .portfolio-page .holdings-table tr.holding-row {
        border-color: #dce4eb !important;
        background: #ffffff !important;
        box-shadow: 0 1px 2px rgba(15, 35, 55, 0.035) !important;
    }
}

@media (max-width: 430px) {
    :root[data-theme="light"] body > header .header-inner {
        padding-inline: 0.55rem !important;
    }

    :root[data-theme="light"] body > header .mobile-top-actions {
        gap: 0.22rem;
        margin-right: 0.26rem;
    }

    :root[data-theme="light"] body > header :where(.theme-toggle-mobile, .mobile-lang-shortcut, .mobile-auth-shortcut, .mobile-menu-toggle) {
        width: 42px !important;
        min-width: 42px !important;
        height: 44px !important;
    }

    :root[data-theme="light"] .portfolio-page .portfolio-toolbar-summary-item {
        padding: 0.54rem 0.58rem;
    }

    :root[data-theme="light"] .portfolio-page .portfolio-toolbar-summary-value {
        font-size: 0.86rem;
    }
}

/* Holdings light-mode contrast pass: remove pale dark-theme foregrounds from light surfaces. */
:root[data-theme="light"] .portfolio-page .holdings-table thead th {
    color: #506579 !important;
}

:root[data-theme="light"] .portfolio-page .holding-company-name {
    color: #40566a !important;
}

:root[data-theme="light"] .portfolio-page .holding-sector-tag {
    color: #5b7084 !important;
    opacity: 1 !important;
}

:root[data-theme="light"] .portfolio-page .holding-sector-tag::before,
:root[data-theme="light"] .portfolio-page .holding-day-divider {
    color: #5f7387 !important;
    opacity: 1 !important;
}

:root[data-theme="light"] .portfolio-page .signal-badge.hold {
    border-color: #e8bd74 !important;
    background: #fff4df !important;
    color: #8a4608 !important;
}

:root[data-theme="light"] .portfolio-page .holding-native-currency {
    border-color: #cbd7e1 !important;
    background: #f7f9fb !important;
    color: #344b60 !important;
}

:root[data-theme="light"] .portfolio-page .holding-tax-toggle {
    margin-left: 0;
    border: 1px solid #bdcbd7 !important;
    border-radius: 6px;
    background: #e8edf2 !important;
    box-shadow: inset 0 1px 1px rgba(15, 35, 55, 0.04);
}

:root[data-theme="light"] .portfolio-page .holding-tax-toggle .htb {
    height: 22px;
    padding-inline: 0.52rem;
    background: transparent !important;
    color: #455b70 !important;
    font-size: 0.62rem;
    font-weight: 800;
}

:root[data-theme="light"] .portfolio-page .holding-tax-toggle .htb + .htb {
    border-left-color: #bdcbd7 !important;
}

:root[data-theme="light"] .portfolio-page .holding-tax-toggle .htb:hover,
:root[data-theme="light"] .portfolio-page .holding-tax-toggle .htb:focus-visible {
    background: #dce5eb !important;
    color: #173047 !important;
    outline: none;
}

:root[data-theme="light"] .portfolio-page .holding-tax-toggle .htb.active {
    background: #d8edf5 !important;
    color: #125d7d !important;
    box-shadow: inset 0 -2px 0 #3687aa;
}

:root[data-theme="light"] .portfolio-page .holding-account-chip {
    border-color: #cbd7e1 !important;
    background: #f7f9fb !important;
    color: #40566a !important;
}

:root[data-theme="light"] .portfolio-page .holding-account-chip.tone-good {
    border-color: #8fd3b4 !important;
    background: #e4f7ee !important;
    color: #176443 !important;
}

:root[data-theme="light"] .portfolio-page .holding-account-chip.tone-warn {
    border-color: #e5bd75 !important;
    background: #fff7e8 !important;
    color: #854107 !important;
}

:root[data-theme="light"] .portfolio-page .holding-dividend-meta,
:root[data-theme="light"] .portfolio-page .holding-dividend-next,
:root[data-theme="light"] .portfolio-page .holding-quick-fact-label {
    color: #52677b !important;
}

:root[data-theme="light"] .portfolio-page .holding-dividend-next.forecast {
    color: #8a4608 !important;
}

:root[data-theme="light"] .portfolio-page .holding-support-cell {
    background: #ffffff !important;
}

:root[data-theme="light"] .portfolio-page .holding-support-panel {
    border-color: #d4dfe7 !important;
    background: #f8fafb !important;
    color: #344b60 !important;
}

:root[data-theme="light"] .portfolio-page .holding-support-panel.tone-good {
    border-color: #b9ddcd !important;
    background: #f5fbf8 !important;
}

:root[data-theme="light"] .portfolio-page .holding-support-panel.tone-warn {
    border-color: #ead3aa !important;
    background: #fffbf3 !important;
}

:root[data-theme="light"] .portfolio-page .holding-support-panel.tone-risk {
    border-color: #ebc4cb !important;
    background: #fff8f8 !important;
}

:root[data-theme="light"] .portfolio-page .holding-support-panel-tax,
:root[data-theme="light"] .portfolio-page .holding-support-panel-tax.tone-good {
    border-left-color: #3d9270 !important;
}

:root[data-theme="light"] .portfolio-page .holding-support-panel-tax.tone-warn {
    border-left-color: #b87920 !important;
}

:root[data-theme="light"] .portfolio-page .holding-support-panel-tax.tone-risk {
    border-left-color: #b9485d !important;
}

:root[data-theme="light"] .portfolio-page .holding-support-panel-sector {
    border-left-color: #3478b8 !important;
}

:root[data-theme="light"] .portfolio-page .holding-support-panel-replacement,
:root[data-theme="light"] .portfolio-page .holding-support-panel-replacement.tone-good {
    border-left-color: #3d9270 !important;
}

:root[data-theme="light"] .portfolio-page .holding-support-panel-replacement.tone-warn {
    border-left-color: #b87920 !important;
}

:root[data-theme="light"] .portfolio-page .holding-support-panel-replacement.tone-risk {
    border-left-color: #b9485d !important;
}

:root[data-theme="light"] .portfolio-page .hsp-type-tag {
    border-right-color: #c5d1db !important;
    color: #53687c !important;
}

:root[data-theme="light"] .portfolio-page .hsp-primary-text,
:root[data-theme="light"] .portfolio-page .hsp-amount {
    color: #1f3b52 !important;
}

:root[data-theme="light"] .portfolio-page .hsp-detail-row,
:root[data-theme="light"] .portfolio-page .hsp-detail-item,
:root[data-theme="light"] .portfolio-page .hsp-notes {
    color: #40566a !important;
    opacity: 1 !important;
}

:root[data-theme="light"] .portfolio-page .hsp-delta.pos {
    color: #176443 !important;
}

:root[data-theme="light"] .portfolio-page .hsp-delta.neg {
    color: #9f1239 !important;
}

:root[data-theme="light"] .portfolio-page .holding-tax-chip,
:root[data-theme="light"] .portfolio-page .holding-replacement-chip {
    border-color: #bdcbd7 !important;
    background: #ffffff !important;
    color: #344b60 !important;
}

:root[data-theme="light"] .portfolio-page .holding-sector-chip {
    border-color: #9dc3e4 !important;
    background: #eef6fd !important;
    color: #1f5688 !important;
}

:root[data-theme="light"] .portfolio-page .holding-tax-chip.tone-good,
:root[data-theme="light"] .portfolio-page .holding-replacement-chip.tone-good {
    border-color: #8fd3b4 !important;
    background: #e4f7ee !important;
    color: #176443 !important;
}

:root[data-theme="light"] .portfolio-page .holding-tax-chip.tone-warn,
:root[data-theme="light"] .portfolio-page .holding-replacement-chip.tone-warn {
    border-color: #e5bd75 !important;
    background: #fff7e8 !important;
    color: #854107 !important;
}

:root[data-theme="light"] .portfolio-page .holding-tax-chip.tone-risk,
:root[data-theme="light"] .portfolio-page .holding-replacement-chip.tone-risk {
    border-color: #e8a6b1 !important;
    background: #fff1f3 !important;
    color: #9f1239 !important;
}

:root[data-theme="light"] .portfolio-page .action-stack .badge-mini,
:root[data-theme="light"] .portfolio-page .action-stack .action-btn,
:root[data-theme="light"] .portfolio-page .holding-mobile-actions .badge-mini,
:root[data-theme="light"] .portfolio-page .holding-mobile-actions .action-btn {
    background: #ffffff !important;
    font-weight: 750 !important;
}

:root[data-theme="light"] .portfolio-page :where(.action-stack, .holding-mobile-actions) .history-btn {
    border-color: #ddc49c !important;
    background: #fffaf2 !important;
    color: #854107 !important;
}

:root[data-theme="light"] .portfolio-page :where(.action-stack, .holding-mobile-actions) .sell-btn {
    border-color: #e7aebb !important;
    background: #fff5f6 !important;
    color: #9f1239 !important;
}

:root[data-theme="light"] .portfolio-page :where(.action-stack, .holding-mobile-actions) .move-open-btn:not(:disabled) {
    border-color: #abc9d8 !important;
    background: #f3f8fa !important;
    color: #155f83 !important;
}

:root[data-theme="light"] .portfolio-page :where(.action-stack, .holding-mobile-actions) button:disabled,
:root[data-theme="light"] .portfolio-page :where(.action-stack, .holding-mobile-actions) a[disabled] {
    border-color: #cbd5df !important;
    background: #eef2f5 !important;
    color: #596d80 !important;
    opacity: 1 !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .portfolio-page .action-stack .move-open-btn:disabled,
:root[data-theme="light"] .portfolio-page .holding-mobile-actions .move-open-btn:disabled {
    border-color: #c3ced8 !important;
    background: #e9eef2 !important;
    color: #52687c !important;
    opacity: 1 !important;
}

@media (max-width: 900px) {
    :root[data-theme="light"] .portfolio-page .holding-mobile-metric-label {
        color: #52677b !important;
    }

    :root[data-theme="light"] .portfolio-page .holding-mobile-metric-value {
        color: #173047 !important;
    }

    :root[data-theme="light"] .portfolio-page .holding-mobile-metric-suffix {
        color: #596d80 !important;
    }
}

/* Site-wide light contrast guardrails for legacy dark-first components. */
:root[data-theme="light"] :where(button, input, select, textarea):disabled,
:root[data-theme="light"] :where(button, input, select, textarea)[aria-disabled="true"] {
    border-color: #c7d2dc !important;
    background: #e9eef2 !important;
    color: #596d80 !important;
    opacity: 1 !important;
    box-shadow: none !important;
}

:root[data-theme="light"] :where(.alert, .notice, .status-message) {
    border-color: #a9cddd !important;
    background: #edf7fb !important;
    color: #164f73 !important;
}

:root[data-theme="light"] :where(.alert-success, .alert.is-success, .status-message.is-success) {
    border-color: #86c9ad !important;
    background: #ecfdf5 !important;
    color: #065f46 !important;
}

:root[data-theme="light"] :where(.alert-error, .alert.is-error, .status-message.is-error) {
    border-color: #e8a6b1 !important;
    background: #fff1f3 !important;
    color: #9f1239 !important;
}

:root[data-theme="light"] :where(.alert-warn, .alert.is-warning, .status-message.is-warning) {
    border-color: #e5bd75 !important;
    background: #fff8e8 !important;
    color: #854107 !important;
}

:root[data-theme="light"] .credit-transaction-amount.is-debit {
    color: #be123c !important;
}

:root[data-theme="light"] .credit-transaction-amount.is-credit {
    color: #047857 !important;
}

/* Profile workspace and report archive. */
:root[data-theme="light"] .profile-page .directory-header h1 {
    background: none !important;
    color: var(--ak-text) !important;
    -webkit-text-fill-color: var(--ak-text) !important;
}

:root[data-theme="light"] .profile-page :where(
    .profile-dashboard-card,
    .profile-stock-ai-section,
    .profile-portfolio-hub,
    .profile-stock-ai-summary-card,
    .profile-stock-ai-rail-card,
    .profile-stock-ai-card,
    .profile-stock-ai-empty,
    .profile-portfolio-empty,
    .profile-portfolio-summary-card,
    .profile-portfolio-card
) {
    border-color: var(--ak-border) !important;
    background: var(--ak-surface) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow-soft) !important;
}

:root[data-theme="light"] .profile-page :where(
    .profile-stock-ai-recent-item,
    .profile-stock-ai-card-metrics > div,
    .profile-stock-ai-no-results,
    .credits-balance-bar
) {
    border-color: var(--ak-border) !important;
    background: var(--ak-surface-muted) !important;
    color: var(--ak-text) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .profile-page .profile-section.delete-section {
    border-color: #e8a6b1 !important;
    border-top-color: #be123c !important;
    background: #fff7f8 !important;
}

:root[data-theme="light"] .profile-page :where(
    .profile-dashboard-card span,
    .profile-dashboard-card em,
    .profile-stock-ai-summary-card span,
    .profile-stock-ai-summary-card em,
    .profile-stock-ai-card-metrics span,
    .profile-stock-ai-card-foot-meta,
    .profile-stock-ai-recent-meta,
    .profile-stock-ai-sort span,
    .profile-stock-ai-search span,
    .profile-portfolio-summary-card span,
    .profile-portfolio-summary-card em,
    .profile-portfolio-grid-head em,
    .profile-portfolio-more
) {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] .profile-page :where(
    .profile-dashboard-card strong,
    .profile-stock-ai-summary-card strong,
    .profile-stock-ai-card-metrics strong,
    .profile-stock-ai-recent-name,
    .profile-stock-ai-card h4,
    .profile-portfolio-summary-card strong,
    .profile-portfolio-card h3,
    .profile-portfolio-grid-head span
) {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .profile-page :where(
    .profile-stock-ai-kicker,
    .profile-portfolio-kicker,
    .profile-stock-ai-rail-head span,
    .profile-stock-ai-card-ticker,
    .profile-stock-ai-recent-top strong,
    .profile-details > summary,
    .credits-balance-amount
) {
    border-color: #a9cddd !important;
    background: #edf7fb !important;
    color: #164f73 !important;
}

:root[data-theme="light"] .profile-page .profile-summary-chip:first-child {
    border-color: #a9cddd !important;
    background: #edf7fb !important;
    color: #164f73 !important;
}

:root[data-theme="light"] .profile-page :where(.profile-stock-ai-search input, .profile-stock-ai-sort select) {
    border-color: var(--ak-border-strong) !important;
    background: #ffffff !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .profile-page .profile-portfolio-score {
    border-color: #a9cddd !important;
    background: #edf7fb !important;
    color: #164f73 !important;
}

:root[data-theme="light"] .profile-page .profile-portfolio-review-state.is-good {
    border-color: #86c9ad !important;
    background: #ecfdf5 !important;
    color: #065f46 !important;
}

:root[data-theme="light"] .profile-page .profile-portfolio-review-state.is-warn {
    border-color: #e5bd75 !important;
    background: #fff8e8 !important;
    color: #854107 !important;
}

:root[data-theme="light"] .profile-page .profile-portfolio-review-state.is-risk {
    border-color: #e8a6b1 !important;
    background: #fff1f3 !important;
    color: #9f1239 !important;
}

/* Portfolio creation wizard: the component stylesheet is dark-first. */
:root[data-theme="light"] #createModal .portfolio-create-modal {
    border-color: var(--ak-border-strong) !important;
    background: #ffffff !important;
    color: var(--ak-text) !important;
    box-shadow: 0 28px 70px rgba(15, 35, 55, 0.18) !important;
}

:root[data-theme="light"] #createModal :where(.modal-head, .portfolio-wizard-main) {
    border-color: var(--ak-border) !important;
}

:root[data-theme="light"] #createModal .portfolio-wizard-main {
    background: var(--ak-surface-muted) !important;
}

:root[data-theme="light"] #createModal .portfolio-wizard-progress-step {
    border-color: #c7d2dc !important;
    background: #ffffff !important;
    color: #5a6c7e !important;
}

:root[data-theme="light"] #createModal .portfolio-wizard-progress-step.is-active {
    border-color: #164f73 !important;
    background: #164f73 !important;
    color: #ffffff !important;
}

:root[data-theme="light"] #createModal .portfolio-wizard-progress-step.is-complete {
    border-color: #86c9ad !important;
    background: #ecfdf5 !important;
    color: #065f46 !important;
}

:root[data-theme="light"] #createModal .portfolio-wizard-progress-index {
    border-color: inherit !important;
    color: inherit !important;
}

:root[data-theme="light"] #createModal :where(
    .portfolio-wizard-step-meta,
    .portfolio-wizard-section-head p,
    .portfolio-wizard-option small,
    .portfolio-wizard-review-callout p
) {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] #createModal :where(
    .modal-head h2,
    .portfolio-wizard-step-meta strong,
    .portfolio-wizard-section-head h3,
    .portfolio-wizard-option strong,
    .portfolio-wizard-review-callout strong
) {
    color: var(--ak-text) !important;
    -webkit-text-fill-color: var(--ak-text) !important;
}

:root[data-theme="light"] #createModal .portfolio-wizard-group-label {
    color: #164f73 !important;
}

:root[data-theme="light"] #createModal .portfolio-wizard-option {
    border-color: var(--ak-border-strong) !important;
    background: #ffffff !important;
    color: var(--ak-text) !important;
    box-shadow: 0 1px 2px rgba(15, 35, 55, 0.04) !important;
}

:root[data-theme="light"] #createModal .portfolio-wizard-option:hover {
    border-color: #78abc1 !important;
    background: #f5f9fb !important;
}

:root[data-theme="light"] #createModal .portfolio-wizard-choice input:checked + .portfolio-wizard-option {
    border-color: #397fa1 !important;
    background: #eaf4f8 !important;
    box-shadow: inset 0 0 0 1px rgba(22, 79, 115, 0.16) !important;
}

:root[data-theme="light"] #createModal .portfolio-wizard-review-callout {
    border-color: #a9cddd !important;
    background: #edf7fb !important;
}

/* Market directory and company directory. */
:root[data-theme="light"] .market-directory-page {
    --market-premium-border: #dce4eb !important;
    --market-premium-surface: #ffffff !important;
    --market-premium-glow: rgba(11, 111, 159, 0.08) !important;
}

:root[data-theme="light"] .market-directory-page::before {
    background: radial-gradient(circle at 20% 20%, rgba(11, 111, 159, 0.08), transparent 38%) !important;
    filter: none !important;
}

:root[data-theme="light"] .market-directory-page :where(
    .market-hero-premium,
    .market-board-shell,
    .market-intent-strip,
    .market-spotlight-card,
    .market-board-table-container
) {
    border-color: var(--ak-border) !important;
    background: #ffffff !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] .market-directory-page :where(
    .market-search-shell,
    .market-hero-stat,
    .market-intent-card,
    .market-spotlight-chip,
    .market-read-guide-item,
    .listing-quick-fact
) {
    border-color: var(--ak-border) !important;
    background: var(--ak-surface-muted) !important;
    color: var(--ak-text) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .market-directory-page .market-spotlight-visual {
    border-color: var(--ak-border) !important;
    background:
        repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.12) 0 1px, transparent 1px 56px),
        repeating-linear-gradient(180deg, rgba(148, 163, 184, 0.12) 0 1px, transparent 1px 44px),
        #f4f8fb !important;
}

:root[data-theme="light"] .market-directory-page :where(
    .market-hero-kicker,
    .market-board-kicker,
    .market-spotlight-kicker,
    .market-read-guide-item span
) {
    border-color: #a9cddd !important;
    background: #edf7fb !important;
    color: #164f73 !important;
}

:root[data-theme="light"] .market-directory-page :where(
    .market-hero-premium h1,
    .market-spotlight-copy h2,
    .market-spotlight-title,
    .market-board-head h2,
    .market-intent-card h2,
    .market-hero-stat-value,
    .market-read-guide-item strong,
    .market-board-shell .market-table td.ticker-cell strong,
    .market-board-shell .market-table td.name-cell .company-name,
    .market-price-main,
    .listing-quick-fact-value
) {
    color: var(--ak-text) !important;
    -webkit-text-fill-color: var(--ak-text) !important;
}

:root[data-theme="light"] .market-directory-page :where(
    .market-hero-premium .subtitle,
    .market-hero-note,
    .market-spotlight-body,
    .market-board-head p,
    .market-intent-card p,
    .market-hero-stat-label,
    .market-hero-stat-meta,
    .market-read-guide-item small,
    .listing-quick-fact-label,
    .listing-quick-fact-note-secondary
) {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] .market-directory-page .market-board-shell .market-table thead th {
    border-color: var(--ak-border) !important;
    background: #eef3f7 !important;
    color: #41566b !important;
}

:root[data-theme="light"] .market-directory-page .market-board-shell .market-table tbody tr:hover {
    background: #f4f8fb !important;
}

:root[data-theme="light"] .market-directory-page .market-spotlight-chip-signal.buy,
:root[data-theme="light"] .market-directory-page .listing-quick-fact-note.buy,
:root[data-theme="light"] .market-directory-page .market-price-change.buy {
    border-color: #86c9ad !important;
    background: #ecfdf5 !important;
    color: #047857 !important;
}

:root[data-theme="light"] .market-directory-page .market-spotlight-chip-signal.sell,
:root[data-theme="light"] .market-directory-page .listing-quick-fact-note.sell,
:root[data-theme="light"] .market-directory-page .market-price-change.sell {
    border-color: #e8a6b1 !important;
    background: #fff1f3 !important;
    color: #be123c !important;
}

:root[data-theme="light"] .companies-page :where(.letter-filter, .letter-chip) {
    border-color: var(--ak-border) !important;
    background: #ffffff !important;
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .companies-page .letter-chip:is(.active, :hover, :focus-visible) {
    border-color: #a9cddd !important;
    background: #edf7fb !important;
    color: #164f73 !important;
}

:root[data-theme="light"] .companies-page :where(
    .company-name,
    .mobile-stock-ticker,
    .listing-quick-fact-value,
    .market-price-main
) {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .companies-page :where(
    .mobile-stock-name,
    .listing-quick-fact-label,
    .listing-quick-fact-note-secondary,
    .company-cell-sector
) {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] .companies-page .market-table thead th {
    border-bottom-color: #cbd8e2 !important;
    background: #f1f5f8 !important;
    color: #41566b !important;
}

:root[data-theme="light"] .companies-page .market-table td {
    border-bottom-color: #dce4eb !important;
    background: #ffffff !important;
    color: #41566b !important;
}

:root[data-theme="light"] .companies-page .market-table td.name-cell,
:root[data-theme="light"] .companies-page .market-table td.name-cell .company-name,
:root[data-theme="light"] .companies-page .market-table td.company-cell-sector {
    color: #334155 !important;
}

:root[data-theme="light"] .companies-page .market-table td.ticker-cell .link-clean,
:root[data-theme="light"] .companies-page .market-table td.ticker-cell .link-clean strong {
    color: #0b5f8a !important;
    text-decoration-color: rgba(11, 95, 138, 0.42) !important;
}

:root[data-theme="light"] .companies-page .market-table tbody tr:hover td {
    background: #f4f9fb !important;
}

:root[data-theme="light"] .companies-page .market-table td.ticker-cell .link-clean:hover,
:root[data-theme="light"] .companies-page .market-table td.ticker-cell .link-clean:hover strong {
    color: #083f5f !important;
    text-decoration: underline;
    text-underline-offset: 3px;
}

:root[data-theme="light"] .companies-page .market-table td.ticker-cell .link-clean:focus-visible {
    border-radius: 4px;
    outline: 3px solid rgba(11, 111, 159, 0.22) !important;
    outline-offset: 3px;
}

@media (max-width: 900px) {
    :root[data-theme="light"] :where(.market-directory-page, .companies-page) .market-table tr {
        border-color: var(--ak-border) !important;
        background: #ffffff !important;
        color: var(--ak-text) !important;
        box-shadow: var(--ak-shadow-soft) !important;
    }

    :root[data-theme="light"] :where(.market-directory-page, .companies-page) .market-table td {
        border-color: var(--ak-border) !important;
        background: transparent !important;
        color: var(--ak-text) !important;
    }

    :root[data-theme="light"] :where(.market-directory-page, .companies-page) .listing-quick-fact {
        border-color: var(--ak-border) !important;
        background: var(--ak-surface-muted) !important;
    }

    :root[data-theme="light"] :where(.market-directory-page, .companies-page) .mobile-stock-ticker {
        color: var(--ak-text) !important;
    }

    :root[data-theme="light"] :where(.market-directory-page, .companies-page) .mobile-stock-name,
    :root[data-theme="light"] :where(.market-directory-page, .companies-page) .listing-quick-fact-label {
        color: var(--ak-text-muted) !important;
    }
}

/* Stock detail: decision cards, research panels, and score components. */
:root[data-theme="light"] .stock-detail-page :where(
    .stock-decision-hero,
    .stock-insight-card,
    .stock-trader-card,
    .stock-chart-panel,
    .dividend-history-panel,
    .stock-ai-entry-card
) {
    border-color: var(--ak-border) !important;
    background: #ffffff !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] .stock-detail-page :where(
    .stock-summary-item,
    .stock-timeframe-card,
    .stock-setup-item,
    .stock-ladder-item,
    .stock-peer-row,
    .score-cell,
    .projection-bar-card,
    .metric-box,
    .stock-fact-card,
    .insight-kv,
    .stock-quote-chip,
    .stock-chart-stat,
    .stock-mobile-details
) {
    border-color: var(--ak-border) !important;
    background: var(--ak-surface-muted) !important;
    color: var(--ak-text) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .stock-detail-page :where(
    .stock-decision-title,
    .stock-company-name,
    .stock-ticker-symbol,
    .stock-summary-item strong,
    .stock-timeframe-card strong,
    .stock-setup-item strong,
    .stock-ladder-item strong,
    .stock-peer-identity strong,
    .stock-peer-score,
    .score-cell .value,
    .metric-box .value,
    .stock-fact-card strong,
    .quote-price,
    .stock-chart-stat strong,
    .dividend-summary-grid strong
) {
    color: var(--ak-text) !important;
    -webkit-text-fill-color: var(--ak-text) !important;
}

:root[data-theme="light"] .stock-detail-page :where(
    .stock-decision-kicker,
    .stock-trader-kicker,
    .stock-ai-panel-kicker,
    .score-label,
    .stock-timeframe-label,
    .stock-ladder-label,
    .stock-summary-item .label,
    .stock-quote-chip-label,
    .quote-meta,
    .insight-meta,
    .stock-chart-stat span,
    .stock-fact-card span
) {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] .stock-detail-page :where(
    .stock-decision-copy,
    .stock-decision-note,
    .stock-timeframe-card small,
    .stock-setup-item small,
    .stock-ladder-item small,
    .stock-peer-identity span,
    .stock-signal-summary,
    .stock-mobile-summary
) {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .stock-detail-page .stock-ladder-score {
    border-color: #d1dde7 !important;
    background: #ffffff !important;
}

:root[data-theme="light"] .stock-detail-page .stock-ladder-score span {
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
}

:root[data-theme="light"] .stock-detail-page .stock-ladder-score strong {
    color: #0f2337 !important;
    -webkit-text-fill-color: #0f2337 !important;
}

:root[data-theme="light"] .stock-detail-page .stock-ladder-item .stock-signal-stamp {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--stamp-ink) 16%, transparent) !important;
}

:root[data-theme="light"] .stock-detail-page .stock-ladder-item.level-strong-buy .stock-signal-stamp {
    --stamp-ink: #047857;
    --stamp-surface: rgba(4, 120, 87, 0.055);
    background: var(--stamp-surface) !important;
    color: var(--stamp-ink) !important;
    -webkit-text-fill-color: #047857 !important;
}

:root[data-theme="light"] .stock-detail-page .stock-ladder-item.level-buy .stock-signal-stamp {
    --stamp-ink: #0f766e;
    --stamp-surface: rgba(15, 118, 110, 0.055);
    background: var(--stamp-surface) !important;
    color: var(--stamp-ink) !important;
    -webkit-text-fill-color: #0f766e !important;
}

:root[data-theme="light"] .stock-detail-page .stock-ladder-item.level-weak-buy .stock-signal-stamp {
    --stamp-ink: #0e7490;
    --stamp-surface: rgba(14, 116, 144, 0.055);
    background: var(--stamp-surface) !important;
    color: var(--stamp-ink) !important;
    -webkit-text-fill-color: #0e7490 !important;
}

:root[data-theme="light"] .stock-detail-page .stock-ladder-item.level-hold .stock-signal-stamp {
    --stamp-ink: #92400e;
    --stamp-surface: rgba(146, 64, 14, 0.055);
    background: var(--stamp-surface) !important;
    color: var(--stamp-ink) !important;
    -webkit-text-fill-color: #92400e !important;
}

:root[data-theme="light"] .stock-detail-page .stock-ladder-item.level-weak-sell .stock-signal-stamp {
    --stamp-ink: #c2410c;
    --stamp-surface: rgba(194, 65, 12, 0.055);
    background: var(--stamp-surface) !important;
    color: var(--stamp-ink) !important;
    -webkit-text-fill-color: #c2410c !important;
}

:root[data-theme="light"] .stock-detail-page .stock-ladder-item.level-sell .stock-signal-stamp {
    --stamp-ink: #b91c1c;
    --stamp-surface: rgba(185, 28, 28, 0.055);
    background: var(--stamp-surface) !important;
    color: var(--stamp-ink) !important;
    -webkit-text-fill-color: #b91c1c !important;
}

:root[data-theme="light"] .stock-detail-page .stock-ladder-item.level-strong-sell .stock-signal-stamp {
    --stamp-ink: #be123c;
    --stamp-surface: rgba(190, 18, 60, 0.055);
    background: var(--stamp-surface) !important;
    color: var(--stamp-ink) !important;
    -webkit-text-fill-color: #be123c !important;
}

:root[data-theme="light"] .stock-detail-page .stock-setup-track {
    border-color: #c7d5df !important;
    background: #e6eef5 !important;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08) !important;
}

:root[data-theme="light"] .stock-detail-page .stock-setup-visual-return .stock-setup-track {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.16), rgba(100, 116, 139, 0.12) 50%, rgba(5, 150, 105, 0.18)) !important;
}

:root[data-theme="light"] .stock-detail-page .stock-setup-visual-range .stock-setup-track {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.15), rgba(217, 119, 6, 0.14) 50%, rgba(5, 150, 105, 0.18)) !important;
}

:root[data-theme="light"] .stock-detail-page .stock-setup-visual-rank .stock-setup-track {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.15), rgba(217, 119, 6, 0.14) 50%, rgba(5, 150, 105, 0.18)) !important;
}

:root[data-theme="light"] .stock-detail-page .stock-setup-visual-risk .stock-setup-track {
    background: linear-gradient(90deg, rgba(5, 150, 105, 0.18), rgba(217, 119, 6, 0.14) 52%, rgba(220, 38, 38, 0.15)) !important;
}

:root[data-theme="light"] .stock-detail-page .stock-setup-marker {
    border-color: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(14, 116, 144, 0.14) !important;
}

:root[data-theme="light"] .stock-detail-page .stock-setup-zero {
    background: rgba(71, 85, 105, 0.42) !important;
}

:root[data-theme="light"] .stock-detail-page .stock-setup-visual-labels {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] .stock-detail-page :where(.buy, .is-bull, .tone-buy) {
    color: #047857 !important;
}

:root[data-theme="light"] .stock-detail-page :where(.sell, .is-bear, .tone-sell) {
    color: #be123c !important;
}

:root[data-theme="light"] .stock-detail-page :where(.hold, .is-hold, .tone-hold) {
    color: #92400e !important;
}

:root[data-theme="light"] .stock-detail-page .stock-score-scale-neutral {
    border-color: #c7d2dc !important;
    background: #e2e8f0 !important;
}

:root[data-theme="light"] .stock-detail-page .stock-score-scale-marker {
    border-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(65, 86, 107, 0.28) !important;
}

/* Stock AI entry card and progress dialog. */
:root[data-theme="light"] .stock-detail-page :where(
    .stock-ai-command-main,
    .stock-ai-command-side,
    .stock-ai-status-pill,
    .stock-ai-summary-card,
    .stock-ai-side-note
) {
    border-color: var(--ak-border) !important;
    background: var(--ak-surface-muted) !important;
    color: var(--ak-text) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .stock-detail-page :where(
    .stock-ai-hero-title,
    .stock-ai-status-pill strong,
    .stock-ai-summary-card strong,
    .stock-ai-panel-heading h2
) {
    color: var(--ak-text) !important;
    -webkit-text-fill-color: var(--ak-text) !important;
}

:root[data-theme="light"] .stock-detail-page :where(
    .stock-ai-hero-subtitle,
    .stock-ai-status-copy,
    .stock-ai-summary-card span,
    .stock-ai-summary-card em,
    .stock-ai-side-note p,
    .stock-ai-notify-toggle,
    .sidebar-agent-cost
) {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .stock-detail-page :where(
    .stock-ai-panel-kicker,
    .stock-ai-badge--cyan,
    .stock-ai-side-note span,
    .stock-ai-inline-links a
) {
    color: #164f73 !important;
}

:root[data-theme="light"] .stock-detail-page .stock-ai-warning {
    border-color: #e5bd75 !important;
    background: #fff8e8 !important;
    color: #854107 !important;
}

:root[data-theme="light"] #stock-ai-analysis-modal .ai-modal-box,
:root[data-theme="light"] #ai-analysis-modal .ai-modal-box {
    border-color: var(--ak-border-strong) !important;
    background: #ffffff !important;
    color: var(--ak-text) !important;
    box-shadow: 0 28px 70px rgba(15, 35, 55, 0.2) !important;
}

:root[data-theme="light"] :where(#stock-ai-analysis-modal, #ai-analysis-modal) :where(
    .ai-modal-title,
    .ai-modal-phase
) {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] :where(#stock-ai-analysis-modal, #ai-analysis-modal) :where(
    .ai-modal-subtitle,
    .ai-modal-timer,
    .ai-modal-dismiss-note
) {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] :where(#stock-ai-analysis-modal, #ai-analysis-modal) .ai-modal-close {
    color: #41566b !important;
}

/* Saved stock-analysis library and generated report. */
:root[data-theme="light"] .stock-detail-page .ai-stock-report-shell,
:root[data-theme="light"] .stock-detail-page :where(
    .stock-ai-report-topbar,
    .stock-ai-library-card,
    .stock-ai-history-item,
    .stock-ai-rail-item
) {
    border-color: var(--ak-border) !important;
    background: #ffffff !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow-soft) !important;
}

:root[data-theme="light"] .stock-detail-page :where(
    .stock-ai-report-overview-card,
    .stock-ai-library-summary > div,
    .stock-ai-current-meta > div,
    .stock-ai-history-stat,
    .stock-ai-history-badge,
    .stock-ai-library-empty
) {
    border-color: var(--ak-border) !important;
    background: var(--ak-surface-muted) !important;
    color: var(--ak-text) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .stock-detail-page :where(
    .stock-ai-report-title h2,
    .stock-ai-report-overview-card strong,
    .stock-ai-library-card h3,
    .stock-ai-library-summary strong,
    .stock-ai-current-meta strong,
    .stock-ai-rail-item-date,
    .stock-ai-rail-meta strong,
    .stock-ai-history-head h2,
    .stock-ai-history-item-date,
    .stock-ai-history-stat strong
) {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .stock-detail-page :where(
    .stock-ai-report-title p,
    .stock-ai-report-overview-card span,
    .stock-ai-report-overview-card em,
    .stock-ai-library-card p,
    .stock-ai-library-summary span,
    .stock-ai-current-meta span,
    .stock-ai-rail-meta span,
    .stock-ai-history-head p,
    .stock-ai-history-stat span,
    .stock-ai-library-empty
) {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] .stock-detail-page :where(
    .stock-ai-library-kicker,
    .stock-ai-current-note,
    .stock-ai-history-count
) {
    border-color: #a9cddd !important;
    background: #edf7fb !important;
    color: #164f73 !important;
}

:root[data-theme="light"] .stock-detail-page .ai-stock-report {
    --stock-card-bg: #ffffff !important;
    --stock-card-border: #dce4eb !important;
    --stock-soft-border: #dce4eb !important;
    --stock-soft-text: #5a6c7e !important;
    --stock-strong-text: #10253b !important;
    --stock-accent: #164f73 !important;
}

:root[data-theme="light"] .stock-detail-page .ai-stock-report__hero {
    border-color: #c9dce6 !important;
    background: linear-gradient(145deg, #edf7fb 0%, #ffffff 68%) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow-soft) !important;
}

:root[data-theme="light"] .stock-detail-page :where(
    .ai-stock-report__section,
    .ai-stock-report__side-card
) {
    border-color: var(--ak-border) !important;
    background: #ffffff !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow-soft) !important;
}

:root[data-theme="light"] .stock-detail-page :where(
    .ai-stock-report__summary-card,
    .ai-stock-report__metric,
    .ai-stock-report__thesis-card,
    .ai-stock-report__commentary-card,
    .ai-stock-report__closing-card,
    .ai-stock-report__list-card,
    .ai-stock-report__trend-card,
    .ai-stock-report__scenario-card,
    .ai-stock-report__peer-card,
    .ai-stock-report__action-card,
    .ai-stock-report__score-cell,
    .ai-stock-report__mini-facts
) {
    border-color: var(--ak-border) !important;
    background: var(--ak-surface-muted) !important;
    color: var(--ak-text) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .stock-detail-page :where(
    .ai-stock-report__title,
    .ai-stock-report__title span,
    .ai-stock-report__section-head h3,
    .ai-stock-report__summary-card strong,
    .ai-stock-report__metric strong,
    .ai-stock-report__list-title,
    .ai-stock-report__scenario-foot strong,
    .ai-stock-report__peer-top strong,
    .ai-stock-report__action-card strong,
    .ai-stock-report__facts strong,
    .ai-stock-report__mini-facts strong,
    .ai-stock-report__score-cell strong,
    .ai-stock-report__closing-callout strong
) {
    color: var(--ak-text) !important;
    -webkit-text-fill-color: var(--ak-text) !important;
}

:root[data-theme="light"] .stock-detail-page :where(
    .ai-stock-report__subtitle,
    .ai-stock-report__summary-card p,
    .ai-stock-report__metric em,
    .ai-stock-report__thesis-card p,
    .ai-stock-report__commentary-card p,
    .ai-stock-report__closing-card p,
    .ai-stock-report__trend-card p,
    .ai-stock-report__scenario-card p,
    .ai-stock-report__peer-card p,
    .ai-stock-report__action-card p,
    .ai-stock-report__side-text,
    .ai-stock-report__trend-card span,
    .ai-stock-report__scenario-foot span,
    .ai-stock-report__peer-view,
    .ai-stock-report__peer-top span,
    .ai-stock-report__facts span,
    .ai-stock-report__mini-facts span,
    .ai-stock-report__score-cell span,
    .ai-stock-report__footer
) {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .stock-detail-page :where(
    .ai-stock-report__eyebrow,
    .ai-stock-report__section-head span,
    .ai-stock-report__side-kicker,
    .ai-stock-report__closing-callout span,
    .ai-stock-report__action-step
) {
    color: #164f73 !important;
}

:root[data-theme="light"] .stock-detail-page :where(
    .ai-stock-report__metric strong.is-bull,
    .ai-stock-report__metric em.is-positive,
    .ai-stock-report__score-cell.is-bull strong
) {
    color: #047857 !important;
}

:root[data-theme="light"] .stock-detail-page :where(
    .ai-stock-report__metric strong.is-bear,
    .ai-stock-report__metric em.is-negative,
    .ai-stock-report__score-cell.is-bear strong
) {
    color: #be123c !important;
}

:root[data-theme="light"] .stock-detail-page :where(
    .ai-stock-report__metric strong.is-hold,
    .ai-stock-report__score-cell.is-hold strong
) {
    color: #92400e !important;
}

:root[data-theme="light"] .stock-detail-page .ai-stock-report__closing-callout {
    border-color: #a9cddd !important;
    background: #edf7fb !important;
}

/* Portfolio AI analysis and shared report templates. */
:root[data-theme="light"] .portfolio-ai-analysis-page :where(
    .ai-analysis-section,
    .ai-analysis-history-entry,
    .ai-handler-result
) {
    border-color: var(--ak-border) !important;
    background: #ffffff !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow-soft) !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page :where(
    .ai-analysis-agent-header,
    .ai-analysis-current-report-stat,
    .ai-analysis-history-meta,
    .ai-analysis-history-empty,
    .ai-analysis-body--history,
    .ai-input-data-panel,
    .ai-handler-result-meta
) {
    border-color: var(--ak-border) !important;
    background: var(--ak-surface-muted) !important;
    color: var(--ak-text) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page :where(
    .ai-analysis-agent-name,
    .ai-analysis-current-report-title-row strong,
    .ai-analysis-current-report-stat strong,
    .ai-handler-label
) {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page :where(
    .ai-analysis-model,
    .ai-analysis-date,
    .ai-analysis-tokens,
    .ai-analysis-current-report-copy p,
    .ai-analysis-current-report-stat span,
    .ai-analysis-history-note,
    .ai-analysis-history-toggle,
    .ai-analysis-history-empty,
    .ai-legacy-notice,
    .ai-legacy-json-notice,
    .ai-handler-results-head,
    .ai-handler-tokens,
    .ai-handler-duration,
    .ai-handler-result-text,
    .ai-input-data-pre
) {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page :where(
    .ai-analysis-current-report-kicker,
    .ai-analysis-current-report-badge,
    .ai-analysis-history-entry-badge,
    .ai-action-btn--print,
    .ai-input-data-btn
) {
    border-color: #a9cddd !important;
    background: #edf7fb !important;
    color: #164f73 !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page :where(.ai-action-btn--delete, .ai-delete-error, .ai-handler-error) {
    border-color: #e8a6b1 !important;
    background: #fff1f3 !important;
    color: #9f1239 !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page .ai-agent-icon--market_analyst {
    background: #edf7fb !important;
    color: #164f73 !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page .ai-agent-icon--risk_analyst,
:root[data-theme="light"] .portfolio-ai-analysis-page .ai-handler-status--failed {
    background: #fff1f3 !important;
    color: #9f1239 !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page .ai-agent-icon--tax_strategist,
:root[data-theme="light"] .portfolio-ai-analysis-page .ai-handler-status--success {
    background: #ecfdf5 !important;
    color: #065f46 !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page .agent-result-content .ai-tpl,
:root[data-theme="light"] .portfolio-ai-analysis-page .ai-tpl {
    --tpl-text: #10253b !important;
    --tpl-muted: #5a6c7e !important;
    --tpl-card-bg: #f7f9fb !important;
    --tpl-border: #dce4eb !important;
    --tpl-row-hover: #eef3f7 !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page .ai-tpl :where(
    .ai-tpl-commentary-card,
    .ai-tpl-chart-card,
    .ai-tpl-sector-card,
    .ai-tpl-signal-item,
    .ai-tpl-rec-item,
    .ai-tpl-outlook-card,
    .ai-tpl-score-card,
    .ai-tpl-tax-metric-card,
    .ai-tpl-opp-risk-card
) {
    border-color: var(--ak-border) !important;
    background: var(--ak-surface-muted) !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page .ai-tpl :where(
    .ai-tpl-assess-label,
    .ai-tpl-card-label,
    .ai-tpl-section-title,
    .ai-tpl-weight-label,
    .ai-tpl-sector-comment,
    .ai-tpl-holdings-head,
    .ai-tpl-insight,
    .ai-tpl-signal-desc,
    .ai-tpl-rec-rationale,
    .ai-tpl-outlook-card p
) {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page .ai-tpl :where(
    .ai-tpl-assess-value,
    .ai-tpl-sector-name,
    .ai-tpl-company,
    .ai-tpl-orcard-title,
    .ai-tpl-rec-action,
    .ai-tpl-score-val,
    .ai-tpl-tax-metric-value,
    .ai-tpl-prose
) {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page .ai-tpl :where(
    .tpl-sig--bull,
    .tpl-badge--bull,
    .tpl-action--bull
) {
    border-color: #86c9ad !important;
    background: #ecfdf5 !important;
    color: #065f46 !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page .ai-tpl :where(
    .tpl-sig--bear,
    .tpl-action--bear,
    .tpl-sig-high,
    .tpl-priority--high
) {
    border-color: #e8a6b1 !important;
    background: #fff1f3 !important;
    color: #9f1239 !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page .ai-tpl :where(
    .tpl-sig--warn,
    .tpl-badge--warn,
    .tpl-action--warn,
    .tpl-sig-medium,
    .tpl-priority--med
) {
    border-color: #e5bd75 !important;
    background: #fff8e8 !important;
    color: #854107 !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page .ai-tpl :where(
    .tpl-sig--neutral,
    .tpl-badge--muted,
    .tpl-action--hold,
    .tpl-sig-low,
    .tpl-priority--low
) {
    border-color: var(--ak-border-strong) !important;
    background: #eef3f7 !important;
    color: #41566b !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page .ai-tpl .tpl-badge--ok {
    border-color: #a9cddd !important;
    background: #edf7fb !important;
    color: #164f73 !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page .ai-tpl .tpl-assess--bull .ai-tpl-assess-value {
    color: #065f46 !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page .ai-tpl .tpl-assess--bear .ai-tpl-assess-value {
    color: #9f1239 !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page .ai-tpl .tpl-assess--neutral .ai-tpl-assess-value {
    color: #41566b !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page .ai-tpl :where(.ai-tpl-tax-metric-sub.is-positive, .ai-tpl-gain.is-positive) {
    color: #047857 !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page .ai-tpl .ai-tpl-gain.is-negative {
    color: #be123c !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page .ai-tpl .ai-tpl-error {
    border-color: #e8a6b1 !important;
    background: #fff1f3 !important;
    color: #9f1239 !important;
}

:root[data-theme="light"] .portfolio-ai-analysis-page .ai-tpl .ai-tpl-gain.is-neutral {
    color: var(--ak-text-soft) !important;
}

/* Legal confirmations and the third-party date picker follow the active theme. */
:root[data-theme="light"] .unsubscribe-page .unsubscribe-ok {
    border-color: #86c9ad !important;
    background: #ecfdf5 !important;
    color: #065f46 !important;
}

:root[data-theme="light"] .unsubscribe-page .unsubscribe-err {
    border-color: #e8a6b1 !important;
    background: #fff1f3 !important;
    color: #9f1239 !important;
}

:root[data-theme="light"] :where(.flatpickr-calendar, .flatpickr-months, .flatpickr-innerContainer) {
    border-color: var(--ak-border) !important;
    background: #ffffff !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] :where(
    .flatpickr-month,
    .flatpickr-current-month,
    .flatpickr-current-month input.cur-year,
    .flatpickr-weekday,
    .flatpickr-day
) {
    color: var(--ak-text-soft) !important;
    fill: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .flatpickr-day:hover,
:root[data-theme="light"] .flatpickr-day:focus {
    border-color: #a9cddd !important;
    background: #edf7fb !important;
    color: #164f73 !important;
}

:root[data-theme="light"] .flatpickr-day.selected {
    border-color: #164f73 !important;
    background: #164f73 !important;
    color: #ffffff !important;
}

:root[data-theme="light"] .flatpickr-day.flatpickr-disabled,
:root[data-theme="light"] .flatpickr-day.prevMonthDay,
:root[data-theme="light"] .flatpickr-day.nextMonthDay {
    color: #5a6c7e !important;
    opacity: 0.72 !important;
}

/* Model portfolios: secondary cards and timeline elements missed by the base layer. */
:root[data-theme="light"] .model-portfolio-page :where(
    .model-portfolio-tab-hero,
    .model-portfolio-activity-strip,
    .model-portfolio-quick-nav,
    .model-portfolio-follow-suggestions,
    .model-portfolio-overview-card,
    .model-portfolio-chart-shell,
    .portfolio-holdings-shell
) {
    border-color: var(--ak-border) !important;
    background: #ffffff !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow-soft) !important;
}

:root[data-theme="light"] .model-portfolio-page .model-portfolio-disclosure {
    border-color: var(--ak-border) !important;
    background: #ffffff !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .model-portfolio-page .model-portfolio-disclosure summary span:first-child {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .model-portfolio-page .model-portfolio-disclosure summary::after {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] .model-portfolio-page :where(
    .model-portfolio-kpi,
    .model-portfolio-overview-stat,
    .model-portfolio-performance-item,
    .model-portfolio-activity-item,
    .model-portfolio-signal-item,
    .model-portfolio-timeline-item,
    .model-portfolio-overview-list-row,
    .model-portfolio-overview-move-card,
    .model-portfolio-follow-suggestion,
    .model-portfolio-guide-item,
    .holding-fact-chip,
    .model-portfolio-tab-hero-fact
) {
    border-color: var(--ak-border) !important;
    background: var(--ak-surface-muted) !important;
    color: var(--ak-text) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .model-portfolio-page :where(
    .model-portfolio-filter-pill,
    .model-portfolio-chip,
    .model-portfolio-action-pill,
    .model-portfolio-action-tag,
    .model-portfolio-freshness-badge,
    .model-portfolio-run-context-badge,
    .model-portfolio-ticker-pill,
    .model-portfolio-overview-move-chip
) {
    border-color: var(--ak-border-strong) !important;
    background: #ffffff !important;
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .model-portfolio-page .model-portfolio-filter-pill:is(.is-active, :hover, :focus-visible) {
    border-color: #a9cddd !important;
    background: #edf7fb !important;
    color: #164f73 !important;
}

:root[data-theme="light"] .model-portfolio-page :where(
    .model-portfolio-action-metric,
    .model-portfolio-kpi strong,
    .model-portfolio-overview-value,
    .model-portfolio-overview-stat strong,
    .model-portfolio-performance-top strong,
    .model-portfolio-activity-top strong,
    .model-portfolio-signal-top strong,
    .model-portfolio-timeline-top strong,
    .model-portfolio-dashboard-item-main strong,
    .model-portfolio-tab-hero-main h1,
    .model-portfolio-tab-hero-main h2,
    .model-portfolio-tab-hero-fact strong
) {
    color: var(--ak-text) !important;
    -webkit-text-fill-color: var(--ak-text) !important;
}

:root[data-theme="light"] .model-portfolio-page :where(
    .model-portfolio-muted,
    .model-portfolio-action-meta,
    .model-portfolio-panel-note,
    .model-portfolio-inline-meta,
    .model-portfolio-performance-meta,
    .model-portfolio-signal-meta,
    .model-portfolio-signal-note,
    .model-portfolio-timeline-label,
    .model-portfolio-overview-subtitle,
    .model-portfolio-overview-move-label,
    .model-portfolio-card-story-label,
    .model-portfolio-card-benchmark-label,
    .model-portfolio-tab-hero-caption,
    .model-portfolio-tab-hero-fact span,
    .model-portfolio-filter-label
) {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] .model-portfolio-page :where(
    .model-portfolio-header-eyebrow,
    .model-portfolio-section-kicker,
    .model-portfolio-tab-hero-kicker,
    .model-portfolio-action-eyebrow,
    .model-portfolio-quick-nav-label
) {
    color: #164f73 !important;
}

:root[data-theme="light"] .model-portfolio-page :where(.is-positive, .buy, .metric-good) {
    color: #047857 !important;
}

:root[data-theme="light"] .model-portfolio-page .metric-buy {
    color: #047857 !important;
}

:root[data-theme="light"] .model-portfolio-page :where(.is-negative, .sell, .metric-risk) {
    color: #be123c !important;
}

/* Public portfolio cards and social comparison rail. */
:root[data-theme="light"] .public-portfolio-page :where(
    .public-portfolio-hero-main,
    .public-portfolio-follow-panel,
    .public-portfolio-priority
) {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] .public-portfolio-page :where(
    .public-portfolio-return-card,
    .public-portfolio-hero-fact,
    .public-portfolio-follow-stat,
    .public-portfolio-header-chip,
    .public-portfolio-priority-chip
) {
    background: var(--ak-surface-muted) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text-soft) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .public-portfolio-page :where(
    .public-portfolio-hero-copy h1,
    .public-portfolio-follow-panel h2,
    .public-portfolio-hero-fact strong,
    .public-portfolio-priority-copy h3
) {
    color: var(--ak-text) !important;
    -webkit-text-fill-color: var(--ak-text) !important;
}

:root[data-theme="light"] .public-portfolio-page :where(
    .public-portfolio-hero-copy .subtitle,
    .public-portfolio-owner-copy p,
    .public-portfolio-return-note,
    .public-portfolio-privacy-note,
    .public-portfolio-priority-copy p
) {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .public-portfolio-page :where(
    .public-portfolio-return-label,
    .public-portfolio-hero-fact span
) {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] .public-portfolio-page :where(
    .public-portfolio-hero-kicker,
    .public-portfolio-follow-kicker,
    .public-portfolio-priority-eyebrow
) {
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] .public-portfolio-page .public-portfolio-return-chip.buy {
    background: #ecfdf5 !important;
    border-color: #86c9ad !important;
    color: #047857 !important;
}

:root[data-theme="light"] .public-portfolio-page .public-portfolio-return-chip.sell {
    background: #fff1f3 !important;
    border-color: #e8a6b1 !important;
    color: #be123c !important;
}

:root[data-theme="light"] .public-portfolio-page .public-portfolio-priority.tone-good {
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%) !important;
    border-color: rgba(4, 120, 87, 0.3) !important;
}

:root[data-theme="light"] .public-portfolio-page .public-portfolio-priority.tone-warn {
    background: linear-gradient(180deg, #ffffff 0%, #fffbeb 100%) !important;
    border-color: rgba(180, 83, 9, 0.28) !important;
}

:root[data-theme="light"] .public-portfolio-page .public-portfolio-priority.tone-risk {
    background: linear-gradient(180deg, #ffffff 0%, #fff1f2 100%) !important;
    border-color: rgba(190, 18, 60, 0.26) !important;
}

:root[data-theme="light"] .public-portfolio-page :where(
    .stock-trader-card,
    .stock-timeframe-card,
    .stock-setup-item,
    .stock-ladder-item,
    .public-social-peer-card,
    .public-social-rail-stat,
    .public-holdings-container
) {
    border-color: var(--ak-border) !important;
    background: #ffffff !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow-soft) !important;
}

:root[data-theme="light"] .public-portfolio-page :where(
    .stock-timeframe-card,
    .stock-setup-item,
    .stock-ladder-item,
    .holding-fact-chip
) {
    background: var(--ak-surface-muted) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .public-portfolio-page :where(
    .public-holdings-table strong,
    .public-social-peer-card strong,
    .public-social-rail-stat-value
) {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .public-portfolio-page :where(
    .public-holdings-table small,
    .public-social-peer-card small,
    .stock-timeframe-card small,
    .stock-setup-item small,
    .stock-ladder-item small
) {
    color: var(--ak-text-muted) !important;
}

/* Portfolio transactions: desktop filters and mobile card table. */
:root[data-theme="light"] .portfolio-transactions-page :where(
    .tx-toolbar,
    .tx-table-wrap,
    .tx-edit-cell,
    .tx-empty-state
) {
    border-color: var(--ak-border) !important;
    background: #ffffff !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow-soft) !important;
}

:root[data-theme="light"] .portfolio-transactions-page :where(.tx-filter-tag, .tx-import-link) {
    border-color: var(--ak-border-strong) !important;
    background: #ffffff !important;
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .portfolio-transactions-page .tx-filter-tag:is(.is-active, :hover, :focus-visible),
:root[data-theme="light"] .portfolio-transactions-page .tx-import-link:hover {
    border-color: #a9cddd !important;
    background: #edf7fb !important;
    color: #164f73 !important;
}

@media (max-width: 900px) {
    :root[data-theme="light"] .portfolio-transactions-page .tx-card-row {
        border-color: var(--ak-border) !important;
        background: #ffffff !important;
        color: var(--ak-text) !important;
        box-shadow: var(--ak-shadow-soft) !important;
    }

    :root[data-theme="light"] .portfolio-transactions-page .tx-card-row .tx-detail-cell {
        border-color: var(--ak-border) !important;
        background: var(--ak-surface-muted) !important;
        color: var(--ak-text) !important;
        box-shadow: none !important;
    }

    :root[data-theme="light"] .portfolio-transactions-page .tx-card-row :where(
        .tx-security-link,
        .tx-stipulated-label,
        .tx-date-prefix
    ) {
        color: var(--ak-text) !important;
    }

    :root[data-theme="light"] .portfolio-transactions-page .tx-card-row .tx-meta-cell::before,
    :root[data-theme="light"] .portfolio-transactions-page .tx-card-row .tx-detail-cell::before,
    :root[data-theme="light"] .portfolio-transactions-page .tx-card-row .tx-date-value,
    :root[data-theme="light"] .portfolio-transactions-page .tx-card-row .tx-date-mobile {
        color: var(--ak-text-muted) !important;
    }
}

/* Final component-level contrast sweep for label-only and chip elements. */
:root[data-theme="light"] .legal-kicker {
    border-color: #a9cddd !important;
    background: #edf7fb !important;
    color: #164f73 !important;
}

:root[data-theme="light"] .modal-close-btn {
    border-color: var(--ak-border-strong) !important;
    background: #ffffff !important;
    color: #41566b !important;
    opacity: 1 !important;
}

:root[data-theme="light"] .modal-close-btn:hover,
:root[data-theme="light"] .modal-close-btn:focus-visible {
    border-color: #a9cddd !important;
    background: #edf7fb !important;
    color: #164f73 !important;
}

:root[data-theme="light"] .ai-modal-error {
    border-color: #e8a6b1 !important;
    background: #fff1f3 !important;
    color: #9f1239 !important;
}

:root[data-theme="light"] :where(.market-directory-page, .companies-page, .social-page) :where(
    .entry-conversion-value,
    .social-hero-spotlight-rank
) {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] :where(.market-directory-page, .companies-page, .social-page) :where(
    .entry-conversion-label,
    .social-overview-note,
    .social-filter-empty,
    .small-caps
) {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] .market-directory-page .market-search-icon {
    color: #5a6c7e !important;
}

:root[data-theme="light"] :where(.market-directory-page, .companies-page) .link-clean:hover {
    color: #164f73 !important;
}

:root[data-theme="light"] .home-page.home-v2-premium :where(
    .home-v2-hero-insight,
    .home-v2-demo-metric,
    .home-v2-demo-compare-score,
    .home-v2-positioning-tape-item
) {
    border-color: var(--ak-border) !important;
    background: var(--ak-surface-muted) !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium :where(
    .home-v2-hero-insight-value,
    .home-v2-demo-metric-value,
    .home-v2-demo-compare-score
) {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium :where(
    .home-v2-hero-insight-label,
    .home-v2-demo-metric-label,
    .home-v2-positioning-tape-item
) {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-score {
    border-color: #a9cddd !important;
    background: #edf7fb !important;
    color: #164f73 !important;
}

:root[data-theme="light"] .stock-detail-page :where(.stock-trader-lede, .stock-decision-body, .related-sector-title) {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .stock-detail-page .stock-chart-pill {
    border-color: var(--ak-border-strong) !important;
    background: #ffffff !important;
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .stock-detail-page .stock-chart-pill:is(.active, :hover, :focus-visible) {
    border-color: #a9cddd !important;
    background: #edf7fb !important;
    color: #164f73 !important;
}

:root[data-theme="light"] .stock-detail-page :where(.stock-peer-change.buy, .stock-decision-pill.buy) {
    border-color: #86c9ad !important;
    background: #ecfdf5 !important;
    color: #047857 !important;
}

:root[data-theme="light"] .stock-detail-page :where(.stock-peer-change.sell, .stock-decision-pill.sell) {
    border-color: #e8a6b1 !important;
    background: #fff1f3 !important;
    color: #be123c !important;
}

:root[data-theme="light"] .stock-detail-page .stock-decision-pill.hold {
    border-color: #e5bd75 !important;
    background: #fff8e8 !important;
    color: #854107 !important;
}

:root[data-theme="light"] .public-portfolio-page :where(
    .holding-name,
    .public-portfolio-follow-stat
) {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .public-portfolio-page :where(
    .public-portfolio-return-note,
    .public-portfolio-privacy-note,
    .public-social-rail-kicker
) {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] .public-portfolio-page .public-portfolio-header-chip.is-privacy {
    border-color: var(--ak-border-strong) !important;
    background: #eef3f7 !important;
    color: #41566b !important;
}

:root[data-theme="light"] .public-portfolio-page .holding-dividend-next.declared {
    color: #047857 !important;
}

:root[data-theme="light"] .portfolio-page :where(
    .portfolio-section-link-secondary,
    .portfolio-breadcrumb-item a,
    .portfolio-breadcrumb-item [aria-current="page"],
    .dividend-overview-link,
    .tx-history-guide-link
) {
    color: #164f73 !important;
}

:root[data-theme="light"] .portfolio-page :where(
    .portfolio-input-guide span,
    .modal-helper-note,
    .portfolio-holdings-meta,
    .broker-card-detail,
    .broker-upload-copy,
    .tx-history-guide-copy,
    .top-stat-meta
) {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-overview-focus-btn {
    border-color: #164f73 !important;
    background: #164f73 !important;
    color: #ffffff !important;
}

:root[data-theme="light"] .portfolio-page :where(
    .optimizer-suggestion-tag,
    .portfolio-empty-kicker,
    .portfolio-post-import-stat-value,
    .portfolio-create-mobile-plus,
    .portfolio-switcher-name
) {
    color: #164f73 !important;
}

:root[data-theme="light"] .portfolio-page :where(.chart-range-pill, .export-format-option span) {
    border-color: var(--ak-border-strong) !important;
    background: #ffffff !important;
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .portfolio-page .chart-range-pill:is(.is-active, :hover, :focus-visible),
:root[data-theme="light"] .portfolio-page .export-format-option input:checked + span {
    border-color: #a9cddd !important;
    background: #edf7fb !important;
    color: #164f73 !important;
}

:root[data-theme="light"] .portfolio-page :where(
    .sector-insight-block,
    .chart-subpanel,
    .broker-import-summary-row
) {
    border-color: var(--ak-border) !important;
    background: var(--ak-surface-muted) !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .portfolio-page :where(
    .sector-insight-head strong,
    .sector-insight-grid strong,
    .chart-subpanel-title,
    .dividend-board-total,
    .dividend-board-metric,
    .dividend-ranking-name,
    .dividend-ranking-value,
    .dividend-year-total,
    .audit-step-row-value,
    .active-holding-stock-link
) {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .portfolio-page :where(
    .sector-insight-block p,
    .dividend-year-label,
    .dividend-ranking-tab
) {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] .portfolio-page :where(.p-risk-badge.risk-low, .amount-positive, .deposit) {
    border-color: #86c9ad !important;
    background: #ecfdf5 !important;
    color: #047857 !important;
}

:root[data-theme="light"] .portfolio-page :where(.p-risk-badge.risk-medium, .tx-log-unassigned, .metric-hold) {
    border-color: #e5bd75 !important;
    background: #fff8e8 !important;
    color: #854107 !important;
}

:root[data-theme="light"] .portfolio-page :where(.p-risk-badge.risk-high, .metric-risk) {
    border-color: #e8a6b1 !important;
    background: #fff1f3 !important;
    color: #be123c !important;
}

:root[data-theme="light"] .portfolio-page :where(.fee, .tax, .tx-badge) {
    color: #41566b !important;
}

:root[data-theme="light"] .portfolio-page .broker-delete-warn,
:root[data-theme="light"] .portfolio-page .holding-tax-feedback.is-error {
    border-color: #e8a6b1 !important;
    background: #fff1f3 !important;
    color: #9f1239 !important;
}

:root[data-theme="light"] .model-portfolio-page :where(
    .model-portfolio-header-fact,
    .model-portfolio-dashboard-header-badge,
    .model-portfolio-dashboard-rank,
    .model-portfolio-dashboard-weight,
    .model-portfolio-catalog-badge,
    .model-portfolio-card-fit,
    .model-portfolio-chip-neutral,
    .model-portfolio-chip-soft,
    .model-portfolio-chip-watch,
    .model-portfolio-chip-risk,
    .is-benchmark-chip
) {
    border-color: var(--ak-border) !important;
    background: var(--ak-surface-muted) !important;
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .model-portfolio-page :where(
    .model-portfolio-card-kicker,
    .model-portfolio-dashboard-header-badge,
    .model-portfolio-dashboard-rank,
    .model-portfolio-dashboard-weight
) {
    color: #164f73 !important;
}

:root[data-theme="light"] .model-portfolio-page :where(
    .model-portfolio-chart-meta,
    .model-portfolio-chart-legend-item,
    .model-portfolio-mini-chart-legend,
    .model-portfolio-sector-legend-label,
    .model-portfolio-header-fact span,
    .model-portfolio-note-cell,
    .model-portfolio-bar-head,
    .model-portfolio-change-title,
    .model-portfolio-guide-step
) {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] .model-portfolio-page :where(
    .model-portfolio-sector-ring-center strong,
    .model-portfolio-definition-grid strong,
    .model-portfolio-card-head strong,
    .top-stat-value
) {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .model-portfolio-page .model-portfolio-sector-ring-center span {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] .model-portfolio-page .model-portfolio-action-tag.is-today {
    border-color: #86c9ad !important;
    background: #ecfdf5 !important;
    color: #065f46 !important;
}

:root[data-theme="light"] .model-portfolio-page .model-portfolio-action-tag.is-recent {
    border-color: #a9cddd !important;
    background: #edf7fb !important;
    color: #164f73 !important;
}

:root[data-theme="light"] .model-portfolio-page .model-portfolio-action-tag.is-earlier {
    border-color: #e5bd75 !important;
    background: #fff8e8 !important;
    color: #854107 !important;
}

/* Professional light header: one authoritative layer over the legacy nav passes. */
@media (min-width: 1101px) {
    :root[data-theme="light"] body > header {
        background: rgba(255, 255, 255, 0.985) !important;
        border-bottom: 1px solid #cfd9e3 !important;
        box-shadow: 0 1px 2px rgba(15, 35, 55, 0.05), 0 8px 24px rgba(15, 35, 55, 0.055) !important;
        backdrop-filter: blur(18px) saturate(145%) !important;
    }

    :root[data-theme="light"] body > header .header-inner {
        width: 100%;
        max-width: 1440px !important;
        min-height: 72px !important;
        padding-inline: clamp(1rem, 2.2vw, 2rem) !important;
        gap: 0 !important;
        box-sizing: border-box;
    }

    :root[data-theme="light"] body > header .logo {
        flex: 0 0 auto;
        min-height: 44px;
        padding: 0.35rem 0;
        gap: 0.5rem;
        color: #102a43 !important;
        font-size: 1.08rem !important;
        letter-spacing: -0.045em !important;
    }

    :root[data-theme="light"] body > header .beta-tag {
        padding: 0.17rem 0.4rem !important;
        border-color: #9bc8dc !important;
        border-radius: 6px !important;
        background: #e8f5fa !important;
        color: #075985 !important;
        -webkit-text-fill-color: #075985 !important;
        font-size: 0.54rem !important;
    }

    :root[data-theme="light"] body > header .main-nav {
        flex: 1 1 auto;
        align-items: center;
        gap: 0.8rem;
        margin-left: clamp(1rem, 1.7vw, 1.5rem) !important;
    }

    :root[data-theme="light"] body > header .nav-links {
        flex: 0 1 auto;
        align-items: center;
        gap: 0.08rem !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    :root[data-theme="light"] body > header .nav-link,
    :root[data-theme="light"] body > header .nav-link.nav-link-primary {
        position: relative;
        align-self: center;
        height: 42px !important;
        min-height: 42px !important;
        padding: 0 0.7rem !important;
        border: 1px solid transparent !important;
        border-radius: 9px !important;
        background: transparent !important;
        color: #334b61 !important;
        font-size: 0.82rem !important;
        font-weight: 720 !important;
        line-height: 1 !important;
        box-shadow: none !important;
        transform: none !important;
        box-sizing: border-box;
    }

    :root[data-theme="light"] body > header .nav-link::after {
        display: block !important;
        right: 0.72rem;
        bottom: 3px;
        left: 0.72rem;
        height: 2px;
        border-radius: 999px;
        background: #0f749f !important;
        transform: scaleX(0) !important;
        transform-origin: center;
        transition: transform 160ms ease;
    }

    :root[data-theme="light"] body > header .nav-link:hover,
    :root[data-theme="light"] body > header .nav-link:focus-visible {
        border-color: #d8e3ea !important;
        background: #f4f7f9 !important;
        color: #102f49 !important;
    }

    :root[data-theme="light"] body > header .nav-link:hover::after,
    :root[data-theme="light"] body > header .nav-link:focus-visible::after {
        transform: scaleX(0.42) !important;
    }

    :root[data-theme="light"] body > header .nav-link.active,
    :root[data-theme="light"] body > header .nav-link.nav-link-primary.active {
        border-color: #bfd8e4 !important;
        background: #eaf4f8 !important;
        color: #075985 !important;
        font-weight: 800 !important;
        box-shadow: none !important;
    }

    :root[data-theme="light"] body > header .nav-link.active::after {
        transform: scaleX(1) !important;
    }

    :root[data-theme="light"] body > header .header-action-cluster {
        flex: 0 1 auto;
        gap: 0.5rem;
        margin-left: auto;
        padding-left: 0.8rem;
        border-left: 1px solid #dce4eb;
    }

    :root[data-theme="light"] body > header .nav-utils {
        gap: 0.42rem !important;
        margin: 0;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    :root[data-theme="light"] body > header .header-stock-search {
        width: clamp(176px, 15vw, 216px) !important;
    }

    :root[data-theme="light"] body > header .header-stock-search input {
        height: 42px !important;
        min-height: 42px !important;
        padding: 0 0.8rem 0 2.2rem !important;
        border: 1px solid #cfdbe5 !important;
        border-radius: 10px !important;
        background: #f7f9fb !important;
        color: #173047 !important;
        font-size: 0.81rem !important;
        box-shadow: inset 0 1px 1px rgba(15, 35, 55, 0.025) !important;
    }

    :root[data-theme="light"] body > header .header-stock-search input::placeholder {
        color: #64748b !important;
        opacity: 1 !important;
    }

    :root[data-theme="light"] body > header .header-stock-search input:focus {
        border-color: #468dab !important;
        background: #ffffff !important;
        box-shadow: 0 0 0 3px rgba(15, 116, 159, 0.14) !important;
    }

    :root[data-theme="light"] body > header .header-search-icon {
        left: 0.76rem;
        color: #52677b !important;
    }

    :root[data-theme="light"] body > header .header-search-suggestions {
        border-color: #c7d5e0 !important;
        background: #ffffff !important;
        color: #173047 !important;
        box-shadow: 0 18px 38px rgba(15, 35, 55, 0.14) !important;
    }

    :root[data-theme="light"] body > header .market-status {
        height: 42px !important;
        min-height: 42px !important;
        padding: 0 0.7rem !important;
        border: 1px solid #cfe1da !important;
        border-radius: 10px !important;
        background: #f7fbf9 !important;
        color: #285849 !important;
        box-shadow: none !important;
        box-sizing: border-box;
    }

    :root[data-theme="light"] body > header .market-status-text {
        color: #285849 !important;
        font-size: 0.76rem !important;
        font-weight: 760 !important;
    }

    :root[data-theme="light"] body > header :where(.theme-toggle, .lang-switcher a, .nav-auth .nav-btn) {
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        padding: 0 !important;
        border: 1px solid #cfdbe5 !important;
        border-radius: 10px !important;
        background: #ffffff !important;
        color: #334b61 !important;
        box-shadow: none !important;
        box-sizing: border-box;
    }

    :root[data-theme="light"] body > header :where(.theme-toggle, .lang-switcher a, .nav-auth .nav-btn):hover,
    :root[data-theme="light"] body > header :where(.theme-toggle, .lang-switcher a, .nav-auth .nav-btn):focus-visible {
        border-color: #9eb8c8 !important;
        background: #eef4f7 !important;
        color: #075985 !important;
        transform: none !important;
    }

    :root[data-theme="light"] body > header :where(.theme-toggle, .lang-switcher a, .nav-auth .nav-btn):focus-visible,
    :root[data-theme="light"] body > header .nav-link:focus-visible {
        outline: 3px solid rgba(15, 116, 159, 0.2) !important;
        outline-offset: 2px !important;
    }

    :root[data-theme="light"] body > header .theme-toggle-text {
        display: none !important;
    }

    :root[data-theme="light"] body > header .lang-switcher {
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }
}

@media (min-width: 1101px) and (max-width: 1320px) {
    :root[data-theme="light"] body > header .main-nav {
        margin-left: 0.8rem !important;
        gap: 0.45rem;
    }

    :root[data-theme="light"] body > header .nav-link,
    :root[data-theme="light"] body > header .nav-link.nav-link-primary {
        padding-inline: 0.52rem !important;
        font-size: 0.78rem !important;
    }

    :root[data-theme="light"] body > header .market-status {
        display: none !important;
    }

    :root[data-theme="light"] body > header .header-stock-search {
        width: clamp(160px, 14vw, 190px) !important;
    }
}

/* Tablet and mobile: switch to a calm drawer before the desktop header becomes crowded. */
@media (max-width: 1100px) {
    body > header .header-inner {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto auto !important;
        min-height: 64px !important;
        padding-inline: 0.8rem !important;
        gap: 0.45rem !important;
    }

    body > header .mobile-top-actions {
        display: inline-flex !important;
        align-items: center;
        justify-self: end;
        gap: 0.3rem !important;
        margin: 0 !important;
    }

    body > header .mobile-menu-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    body > header .main-nav {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        display: flex !important;
        width: min(88vw, 380px) !important;
        max-width: min(88vw, 380px) !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        padding: calc(0.75rem + env(safe-area-inset-top)) 0.9rem calc(0.9rem + env(safe-area-inset-bottom)) !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 0 !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        transform: translateX(102%) !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transition: transform 220ms ease, visibility 0s linear 220ms !important;
        z-index: 1003 !important;
    }

    body > header .main-nav.active {
        transform: translateX(0) !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transition: transform 220ms ease !important;
    }

    .mobile-nav-overlay {
        display: block !important;
        position: fixed;
        inset: 0;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 180ms ease, visibility 0s linear 180ms;
        z-index: 1000 !important;
    }

    .mobile-nav-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: opacity 180ms ease;
    }

    body > header .nav-mobile-head {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        margin: 0 0 0.6rem !important;
        padding: 0 0 0.7rem !important;
        border-bottom: 1px solid;
    }

    body > header .nav-mobile-auth {
        display: grid !important;
        width: 100%;
        gap: 0.5rem;
        margin: 0.35rem 0 0.45rem !important;
        padding: 0 0 0.85rem !important;
        border-bottom: 1px solid;
    }

    body > header .nav-mobile-auth .nav-mobile-auth-btn {
        width: 100% !important;
        margin: 0 !important;
        justify-content: center;
        text-align: center;
    }

    body > header .nav-mobile-title {
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.11em;
        text-transform: uppercase;
    }

    body > header .nav-mobile-section-label {
        display: block !important;
        padding: 0 0.2rem;
        font-size: 0.66rem;
        font-weight: 800;
        letter-spacing: 0.11em;
        text-transform: uppercase;
    }

    body > header .nav-links {
        display: flex !important;
        width: 100%;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.12rem !important;
    }

    body > header .nav-link {
        display: flex !important;
        width: 100% !important;
        align-items: center;
        gap: 0.65rem;
    }

    body > header .nav-link-icon {
        display: inline-flex !important;
        width: 1.25rem;
        height: 1.25rem;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
    }

    body > header .nav-link-icon svg {
        width: 1.05rem;
        height: 1.05rem;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    body > header .header-action-cluster {
        display: contents !important;
    }

    body > header .nav-utils {
        width: 100%;
        margin: 0.55rem 0 0 !important;
        padding: 0.75rem 0 0 !important;
        border-top: 1px solid;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.7rem !important;
    }

    body > header .header-stock-search,
    body > header .nav-theme-group,
    body > header .nav-lang-group {
        width: 100% !important;
    }

    body > header .nav-theme-group,
    body > header .nav-lang-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
    }

    body > header .nav-theme-group .theme-toggle,
    body > header .lang-switcher,
    body > header .lang-switcher a {
        width: 100% !important;
    }

    body > header .nav-theme-group .theme-toggle {
        min-height: 44px;
        justify-content: center;
    }

    body > header .nav-theme-group .theme-toggle-text {
        display: inline !important;
    }

    body > header .lang-switcher a {
        min-height: 44px;
    }

    body > header .market-status,
    body > header .nav-auth {
        display: none !important;
    }
}

@media (max-width: 1100px) {
    :root[data-theme="light"] body > header .main-nav {
        border-left: 1px solid #cbd8e2 !important;
        background: #ffffff !important;
        color: #173047 !important;
        box-shadow: -20px 0 48px rgba(15, 35, 55, 0.18) !important;
    }

    :root[data-theme="light"] .mobile-nav-overlay.active {
        background: rgba(15, 35, 55, 0.4) !important;
        backdrop-filter: blur(3px);
    }

    :root[data-theme="light"] body > header .nav-mobile-head,
    :root[data-theme="light"] body > header .nav-mobile-auth,
    :root[data-theme="light"] body > header .nav-utils {
        border-color: #dce4eb !important;
    }

    :root[data-theme="light"] body > header .nav-mobile-title {
        color: #173047 !important;
    }

    :root[data-theme="light"] body > header .nav-mobile-section-label {
        color: #52677b !important;
    }

    :root[data-theme="light"] body > header .nav-mobile-close {
        border-color: #cfdbe5 !important;
        background: #f4f7f9 !important;
        color: #334b61 !important;
    }

    :root[data-theme="light"] body > header .nav-mobile-auth .nav-mobile-auth-btn {
        min-height: 44px !important;
        border: 1px solid #bcd3df !important;
        background: #edf5f8 !important;
        color: #075985 !important;
        box-shadow: none !important;
    }

    :root[data-theme="light"] body > header .nav-link,
    :root[data-theme="light"] body > header .nav-link.nav-link-primary {
        min-height: 46px !important;
        padding: 0.7rem !important;
        border: 1px solid transparent !important;
        border-radius: 10px !important;
        background: transparent !important;
        color: #29445b !important;
        box-shadow: none !important;
    }

    :root[data-theme="light"] body > header .nav-link:hover,
    :root[data-theme="light"] body > header .nav-link:focus-visible {
        border-color: #d8e3ea !important;
        background: #f4f7f9 !important;
        color: #102f49 !important;
    }

    :root[data-theme="light"] body > header .nav-link.active {
        border-color: #bfd8e4 !important;
        background: #eaf4f8 !important;
        color: #075985 !important;
        box-shadow: inset 3px 0 0 #0f749f !important;
    }

    :root[data-theme="light"] body > header .nav-link-icon,
    :root[data-theme="light"] body > header .header-search-icon {
        color: #276f90 !important;
    }

    :root[data-theme="light"] body > header .header-stock-search input {
        min-height: 44px !important;
        border-color: #cfdbe5 !important;
        background: #f7f9fb !important;
        color: #173047 !important;
    }

    :root[data-theme="light"] body > header .nav-theme-group .theme-toggle,
    :root[data-theme="light"] body > header .lang-switcher a {
        border: 1px solid #cfdbe5 !important;
        border-radius: 10px !important;
        background: #ffffff !important;
        color: #334b61 !important;
        box-shadow: none !important;
    }
}

@media (min-width: 901px) and (max-width: 1100px) {
    :root[data-theme="dark"] body > header .main-nav {
        border-left: 1px solid rgba(126, 162, 206, 0.42) !important;
        background: linear-gradient(180deg, #0b1626 0%, #13243d 100%) !important;
        color: #f8fbff !important;
        box-shadow: -24px 0 52px rgba(0, 0, 0, 0.54) !important;
    }

    :root[data-theme="dark"] .mobile-nav-overlay.active {
        background: rgba(2, 8, 15, 0.76) !important;
        backdrop-filter: blur(3px);
    }

    :root[data-theme="dark"] body > header :where(.nav-mobile-head, .nav-mobile-auth, .nav-utils) {
        border-color: rgba(126, 162, 206, 0.28) !important;
    }

    :root[data-theme="dark"] body > header :where(.nav-mobile-title, .nav-link, .nav-link-text) {
        color: #f8fbff !important;
    }

    :root[data-theme="dark"] body > header .nav-mobile-section-label {
        color: #bfd3ea !important;
    }

    :root[data-theme="dark"] body > header .nav-link {
        min-height: 46px !important;
        padding: 0.7rem !important;
        border: 1px solid rgba(120, 156, 199, 0.28) !important;
        border-radius: 10px !important;
        background: rgba(255, 255, 255, 0.055) !important;
        box-shadow: none !important;
    }

    :root[data-theme="dark"] body > header .nav-link:hover,
    :root[data-theme="dark"] body > header .nav-link:focus-visible {
        border-color: rgba(133, 190, 255, 0.48) !important;
        background: rgba(104, 174, 255, 0.16) !important;
    }

    :root[data-theme="dark"] body > header .nav-link.active {
        border-color: rgba(133, 190, 255, 0.6) !important;
        background: rgba(104, 174, 255, 0.2) !important;
        box-shadow: inset 3px 0 0 #7dd3fc !important;
    }

    :root[data-theme="dark"] body > header .nav-link-icon,
    :root[data-theme="dark"] body > header .header-search-icon {
        color: #cfe5ff !important;
    }

    :root[data-theme="dark"] body > header .nav-mobile-auth .nav-mobile-auth-btn {
        min-height: 44px !important;
        border-color: #ffffff !important;
        background: #ffffff !important;
        color: #0b1626 !important;
    }

    :root[data-theme="dark"] body > header .header-stock-search input {
        min-height: 44px !important;
        border-color: rgba(133, 168, 212, 0.38) !important;
        background: #0a1525 !important;
        color: #f8fbff !important;
    }

    :root[data-theme="dark"] body > header .nav-theme-group .theme-toggle,
    :root[data-theme="dark"] body > header .lang-switcher a {
        border: 1px solid rgba(118, 154, 198, 0.34) !important;
        border-radius: 10px !important;
        background: #16253b !important;
        color: #f8fbff !important;
        box-shadow: none !important;
    }
}

@media (max-width: 520px) {
    body > header .mobile-top-actions .mobile-lang-shortcut,
    body > header .mobile-top-actions .mobile-auth-shortcut {
        display: none !important;
    }

    body > header .header-inner {
        grid-template-columns: minmax(0, 1fr) auto auto !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body > header .main-nav,
    .mobile-nav-overlay,
    body > header .nav-link::after {
        transition: none !important;
    }
}

/* Model portfolios: final light-mode contrast and data-visualization audit. */
:root[data-theme="light"] {
    --mp-chart-primary: #0f5f82;
    --mp-chart-benchmark: #52677b;
    --mp-chart-grid: #d8e1e9;
    --mp-chart-axis: #9aacba;
    --mp-chart-surface: #f8fafc;
    --mp-chart-surface-soft: #ffffff;
    --mp-chart-border: #cbd7e1;
    --mp-chart-point-stroke: #ffffff;
    --mp-chart-text: #41566b;
    --mp-sector-1: #0f5f82;
    --mp-sector-2: #287a78;
    --mp-sector-3: #58708c;
    --mp-sector-4: #8a6a3a;
    --mp-sector-5: #766b8f;
    --mp-sector-6: #6b7885;
}

:root[data-theme="light"] .model-portfolio-page :where(
    .model-portfolio-card,
    .model-portfolio-panel,
    .model-portfolio-action-card,
    .model-portfolio-dashboard,
    .model-portfolio-dashboard-item,
    .model-portfolio-overview-card,
    .model-portfolio-tab-hero,
    .portfolio-holdings-shell
) {
    border-color: #cbd7e1 !important;
    background: #ffffff !important;
    color: #12263a !important;
    box-shadow: 0 1px 2px rgba(15, 35, 55, 0.045), 0 10px 26px rgba(15, 35, 55, 0.055) !important;
}

:root[data-theme="light"] .model-portfolio-page :where(
    .model-portfolio-chart-shell,
    .model-portfolio-mini-chart-panel
) {
    border-color: var(--mp-chart-border) !important;
    background: var(--mp-chart-surface) !important;
    color: var(--mp-chart-text) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .model-portfolio-page .model-portfolio-card::before {
    background: var(--mp-chart-primary) !important;
}

:root[data-theme="light"] .model-portfolio-page .model-portfolio-card::after {
    display: none !important;
}

:root[data-theme="light"] .model-portfolio-page :where(
    .model-portfolio-chart-meta,
    .model-portfolio-mini-chart-legend,
    .model-portfolio-mini-chart-meta
) {
    color: var(--mp-chart-text) !important;
}

:root[data-theme="light"] .model-portfolio-page .model-portfolio-chart-legend-item {
    border-color: #cbd7e1 !important;
    background: #ffffff !important;
    color: #334b61 !important;
}

:root[data-theme="light"] .model-portfolio-page :where(
    .model-portfolio-card-benchmark,
    .model-portfolio-action-pill.is-benchmark,
    .model-portfolio-catalog-badge:last-child,
    .is-benchmark-chip
) {
    border-color: #bcc9d5 !important;
    background: #f1f5f8 !important;
    color: #334b61 !important;
}

:root[data-theme="light"] .model-portfolio-page .model-portfolio-card-benchmark-label {
    color: #52677b !important;
}

:root[data-theme="light"] .model-portfolio-page .model-portfolio-card-benchmark strong {
    color: #12263a !important;
}

:root[data-theme="light"] .model-portfolio-page :where(
    .model-portfolio-sector-legend-row,
    .model-portfolio-kpi,
    .model-portfolio-overview-stat,
    .model-portfolio-performance-item,
    .model-portfolio-activity-item,
    .model-portfolio-signal-item,
    .model-portfolio-timeline-item,
    .model-portfolio-follow-suggestion
) {
    border-color: #d5dee7 !important;
    background: #f8fafc !important;
    color: #334b61 !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .model-portfolio-page .model-portfolio-sector-dot {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px #cbd7e1 !important;
}

:root[data-theme="light"] .model-portfolio-page :where(
    .model-portfolio-sector-legend-label,
    .model-portfolio-dashboard-item-main span,
    .model-portfolio-card-text,
    .model-portfolio-card-meta,
    .model-portfolio-card-performance-note,
    .model-portfolio-inline-meta,
    .model-portfolio-panel-note
) {
    color: #52677b !important;
}

:root[data-theme="light"] .model-portfolio-page :where(
    .model-portfolio-sector-legend-row strong,
    .model-portfolio-dashboard-item-main strong,
    .model-portfolio-card-title,
    .model-portfolio-performance-top strong
) {
    color: #12263a !important;
    -webkit-text-fill-color: #12263a !important;
}

/* The catalogue heading is an intentional dark surface inside the light theme. */
:root[data-theme="light"] .model-portfolio-page .model-portfolio-catalog-head {
    border-color: #405268 !important;
    background: linear-gradient(150deg, #2b3746 0%, #202b39 100%) !important;
    color: #f8fafc !important;
    box-shadow: 0 14px 32px rgba(15, 35, 55, 0.16) !important;
}

:root[data-theme="light"] .model-portfolio-page .model-portfolio-catalog-head .model-portfolio-section-kicker {
    color: #8bdcff !important;
}

:root[data-theme="light"] .model-portfolio-page .model-portfolio-catalog-head h2 {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

:root[data-theme="light"] .model-portfolio-page .model-portfolio-catalog-head p {
    color: #d8e3ed !important;
}

@media (max-width: 600px) {
    :root[data-theme="light"] .model-portfolio-page :where(
        .model-portfolio-chart-shell,
        .model-portfolio-mini-chart-panel
    ) {
        border-radius: 14px !important;
    }

    :root[data-theme="light"] .model-portfolio-page .model-portfolio-chart-legend-item {
        padding: 7px 10px !important;
    }
}

/* Homepage positioning statement: maintain readable contrast on the light surface. */
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning-manifesto blockquote {
    color: #10253b !important;
    -webkit-text-fill-color: #10253b !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning-tape-item {
    color: #41566b !important;
    border-color: #c7d2dc !important;
    background: #f7f9fb !important;
}

/* ===== component source: header.css ===== */
/*
 * Shared site header
 * This file is loaded after the legacy and theme stylesheets and is the
 * authoritative header component for both themes and all breakpoints.
 */

body > .site-header {
    --header-bg: #07111f;
    --header-surface: #0d1a29;
    --header-surface-hover: #142437;
    --header-text: #e5edf6;
    --header-text-strong: #f8fafc;
    --header-muted: #9aacc0;
    --header-border: #26384c;
    --header-accent: #67b3d2;
    --header-accent-contrast: #06111d;
    --header-accent-soft: #132b3c;
    --header-focus: rgba(103, 179, 210, 0.32);
    --header-shadow: 0 8px 24px rgba(2, 8, 18, 0.2);
    --header-drawer-bg: #081422;
}

:root[data-theme="light"] body > .site-header {
    --header-bg: #ffffff;
    --header-surface: #f7f9fb;
    --header-surface-hover: #eef3f6;
    --header-text: #33485d;
    --header-text-strong: #14283b;
    --header-muted: #617488;
    --header-border: #d6e0e8;
    --header-accent: #0f5f82;
    --header-accent-contrast: #ffffff;
    --header-accent-soft: #edf5f8;
    --header-focus: rgba(15, 95, 130, 0.2);
    --header-shadow: 0 1px 2px rgba(15, 35, 55, 0.04), 0 8px 24px rgba(15, 35, 55, 0.055);
    --header-drawer-bg: #ffffff;
}

body > .site-header,
body > .site-header *,
body > .site-header *::before,
body > .site-header *::after {
    box-sizing: border-box;
}

body > .site-header {
    position: sticky !important;
    inset: 0 0 auto !important;
    z-index: 1000 !important;
    width: 100% !important;
    min-height: 68px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--header-border) !important;
    border-radius: 0 !important;
    background: var(--header-bg) !important;
    color: var(--header-text) !important;
    box-shadow: var(--header-shadow) !important;
    backdrop-filter: none !important;
}

body > .site-header::before,
body > .site-header::after {
    display: none !important;
    content: none !important;
}

body > .site-header .header-inner {
    width: 100% !important;
    max-width: 1520px !important;
    min-height: 68px !important;
    margin: 0 auto !important;
    padding: 0 24px !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 26px !important;
}

body > .site-header .logo {
    min-width: max-content !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: var(--header-text-strong) !important;
    text-decoration: none !important;
    letter-spacing: -0.035em !important;
}

body > .site-header .logo-wordmark {
    color: inherit !important;
    font-family: var(--font-display, "Sora", sans-serif) !important;
    font-size: 1.06rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
}

body > .site-header .beta-tag {
    min-width: 34px !important;
    min-height: 20px !important;
    padding: 0 7px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid color-mix(in srgb, var(--header-accent) 38%, var(--header-border)) !important;
    border-radius: 6px !important;
    background: var(--header-accent-soft) !important;
    color: var(--header-accent) !important;
    font-size: 0.62rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em !important;
    line-height: 1 !important;
}

body > .site-header :where(a, button, input):focus-visible {
    outline: 2px solid var(--header-accent) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px var(--header-focus) !important;
}

body > .site-header svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body > .site-header .status-dot {
    width: 8px !important;
    height: 8px !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #0f9f78 !important;
    box-shadow: 0 0 0 3px rgba(15, 159, 120, 0.12) !important;
}

body > .site-header .theme-toggle-icon {
    width: 18px !important;
    height: 18px !important;
}

body > .site-header .theme-toggle-icon-sun,
:root[data-theme="light"] body > .site-header .theme-toggle-icon-moon {
    display: block !important;
}

body > .site-header .theme-toggle-icon-moon,
:root[data-theme="light"] body > .site-header .theme-toggle-icon-sun {
    display: none !important;
}

body > .site-header .lang-flag-icon {
    display: block !important;
    width: 21px !important;
    height: 15px !important;
    border-radius: 2px !important;
    object-fit: cover !important;
}

body > .site-header .header-search-suggestions .suggestion-item {
    border-bottom-color: var(--header-border) !important;
    background: transparent !important;
    color: var(--header-text) !important;
}

body > .site-header .header-search-suggestions .suggestion-item:is(:hover, :focus-visible, .is-active) {
    background: var(--header-surface-hover) !important;
    color: var(--header-text-strong) !important;
}

body > .site-header .header-search-suggestions .s-ticker {
    color: var(--header-text-strong) !important;
}

body > .site-header .header-search-suggestions .s-name {
    color: var(--header-muted) !important;
}

@media (min-width: 1240px) {
    body > .site-header .mobile-top-actions,
    body > .site-header .mobile-menu-toggle,
    body > .site-header .nav-mobile-head,
    body > .site-header .nav-mobile-auth,
    body > .site-header .nav-mobile-section-label {
        display: none !important;
    }

    body > .site-header .main-nav {
        position: static !important;
        inset: auto !important;
        width: auto !important;
        height: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 18px !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        overflow: visible !important;
    }

    body > .site-header .nav-links {
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 2px !important;
        border: 0 !important;
        background: transparent !important;
    }

    body > .site-header .nav-link,
    body > .site-header .nav-link.nav-link-primary {
        position: relative !important;
        min-width: 0 !important;
        min-height: 42px !important;
        padding: 0 10px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0 !important;
        border: 0 !important;
        border-radius: 8px !important;
        background: transparent !important;
        color: var(--header-text) !important;
        box-shadow: none !important;
        font-size: 0.79rem !important;
        font-weight: 700 !important;
        line-height: 1 !important;
        text-decoration: none !important;
        white-space: nowrap !important;
    }

    body > .site-header .nav-link-icon {
        display: none !important;
    }

    body > .site-header .nav-link::after {
        content: "" !important;
        position: absolute !important;
        right: 10px !important;
        bottom: 2px !important;
        left: 10px !important;
        width: auto !important;
        height: 2px !important;
        border-radius: 2px !important;
        background: var(--header-accent) !important;
        opacity: 0 !important;
        transform: scaleX(0.45) !important;
        transition: opacity 150ms ease, transform 150ms ease !important;
    }

    body > .site-header .nav-link:hover,
    body > .site-header .nav-link:focus-visible {
        background: var(--header-surface-hover) !important;
        color: var(--header-text-strong) !important;
        transform: none !important;
    }

    body > .site-header .nav-link.active,
    body > .site-header .nav-link.nav-link-primary.active {
        background: var(--header-accent-soft) !important;
        color: var(--header-accent) !important;
        box-shadow: none !important;
    }

    body > .site-header .nav-link.active::after {
        opacity: 1 !important;
        transform: scaleX(1) !important;
    }

    body > .site-header .header-action-cluster {
        min-width: 0 !important;
        margin-left: auto !important;
        padding-left: 16px !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        border-left: 1px solid var(--header-border) !important;
    }

    body > .site-header .nav-utils {
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 7px !important;
    }

    body > .site-header .header-stock-search {
        position: relative !important;
        width: clamp(168px, 14vw, 210px) !important;
        min-width: 0 !important;
        margin: 0 !important;
        display: block !important;
    }

    body > .site-header .header-stock-search input {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 40px !important;
        padding: 0 34px 0 36px !important;
        border: 1px solid var(--header-border) !important;
        border-radius: 9px !important;
        background: var(--header-surface) !important;
        color: var(--header-text-strong) !important;
        box-shadow: none !important;
        font-size: 0.78rem !important;
    }

    body > .site-header .header-stock-search input::placeholder {
        color: var(--header-muted) !important;
        opacity: 1 !important;
    }

    body > .site-header .header-search-icon {
        position: absolute !important;
        z-index: 2 !important;
        top: 50% !important;
        left: 12px !important;
        width: 16px !important;
        height: 16px !important;
        color: var(--header-muted) !important;
        transform: translateY(-50%) !important;
        pointer-events: none !important;
    }

    body > .site-header .market-status {
        min-height: 40px !important;
        padding: 0 11px !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 8px !important;
        border: 1px solid var(--header-border) !important;
        border-radius: 9px !important;
        background: transparent !important;
        color: var(--header-text) !important;
        white-space: nowrap !important;
    }

    body > .site-header .market-status-text {
        color: inherit !important;
        font-size: 0.74rem !important;
        font-weight: 700 !important;
    }

    body > .site-header :where(.nav-theme-group, .nav-lang-group, .lang-switcher, .nav-auth) {
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }

    body > .site-header :where(.theme-toggle, .lang-switcher a, .nav-auth .nav-btn) {
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0 !important;
        border: 1px solid var(--header-border) !important;
        border-radius: 9px !important;
        background: transparent !important;
        color: var(--header-text) !important;
        box-shadow: none !important;
        text-decoration: none !important;
    }

    body > .site-header :where(.theme-toggle, .lang-switcher a, .nav-auth .nav-btn):hover {
        border-color: color-mix(in srgb, var(--header-accent) 46%, var(--header-border)) !important;
        background: var(--header-surface-hover) !important;
        color: var(--header-text-strong) !important;
        transform: none !important;
    }

    body > .site-header .theme-toggle-text {
        display: none !important;
    }

    body > .site-header .nav-auth .nav-btn:not(.nav-btn-icon) {
        width: auto !important;
        min-width: 76px !important;
        padding: 0 14px !important;
        border-color: var(--header-accent) !important;
        background: var(--header-accent) !important;
        color: var(--header-accent-contrast) !important;
        font-size: 0.76rem !important;
        font-weight: 800 !important;
    }

    body > .site-header .logout-icon-btn svg {
        width: 18px !important;
        height: 18px !important;
    }

    body > .site-header .header-search-suggestions {
        top: calc(100% + 8px) !important;
        right: 0 !important;
        left: 0 !important;
        border: 1px solid var(--header-border) !important;
        border-radius: 10px !important;
        background: var(--header-bg) !important;
        color: var(--header-text) !important;
        box-shadow: 0 18px 40px rgba(2, 8, 18, 0.18) !important;
        overflow: hidden !important;
    }
}

@media (min-width: 1240px) and (max-width: 1390px) {
    body > .site-header .header-inner {
        gap: 18px !important;
        padding: 0 18px !important;
    }

    body > .site-header .main-nav,
    body > .site-header .header-action-cluster {
        gap: 10px !important;
    }

    body > .site-header .nav-link,
    body > .site-header .nav-link.nav-link-primary {
        padding-right: 8px !important;
        padding-left: 8px !important;
        font-size: 0.75rem !important;
    }

    body > .site-header .header-stock-search {
        width: 166px !important;
    }

    body > .site-header .market-status {
        display: none !important;
    }
}

@media (max-width: 1239px) {
    body.menu-open {
        overflow: hidden !important;
    }

    body > .site-header {
        min-height: 64px !important;
    }

    body > .site-header .header-inner {
        min-height: 64px !important;
        padding: 0 14px !important;
        grid-template-columns: auto minmax(0, 1fr) auto !important;
        gap: 10px !important;
    }

    body > .site-header .logo-wordmark {
        font-size: 1rem !important;
    }

    body > .site-header .mobile-top-actions {
        min-width: 0 !important;
        margin: 0 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 6px !important;
    }

    body > .site-header .mobile-lang-shortcut {
        display: none !important;
    }

    body > .site-header :where(.theme-toggle-mobile, .mobile-auth-shortcut, .mobile-menu-toggle) {
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        margin: 0 !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: 1px solid var(--header-border) !important;
        border-radius: 9px !important;
        background: transparent !important;
        color: var(--header-text) !important;
        box-shadow: none !important;
        text-decoration: none !important;
    }

    body > .site-header :where(.theme-toggle-mobile, .mobile-auth-shortcut, .mobile-menu-toggle):hover {
        background: var(--header-surface-hover) !important;
        color: var(--header-text-strong) !important;
    }

    body > .site-header .mobile-auth-shortcut {
        display: none !important;
    }

    body > .site-header .mobile-shortcut-icon {
        width: 18px !important;
        height: 18px !important;
    }

    body > .site-header .mobile-menu-toggle {
        position: relative !important;
        flex-direction: column !important;
        gap: 4px !important;
    }

    body > .site-header .mobile-menu-toggle .bar {
        position: static !important;
        width: 18px !important;
        height: 1.5px !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 2px !important;
        background: currentColor !important;
        transform: none !important;
        transition: transform 150ms ease, opacity 150ms ease !important;
    }

    body > .site-header .mobile-menu-toggle.active .bar:nth-child(1) {
        transform: translateY(5.5px) rotate(45deg) !important;
    }

    body > .site-header .mobile-menu-toggle.active .bar:nth-child(2) {
        opacity: 0 !important;
    }

    body > .site-header .mobile-menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-5.5px) rotate(-45deg) !important;
    }

    body > .site-header .main-nav {
        position: fixed !important;
        z-index: 1102 !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;
        width: min(390px, calc(100vw - 22px)) !important;
        max-width: none !important;
        height: 100dvh !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 16px 24px !important;
        display: block !important;
        border: 0 !important;
        border-left: 1px solid var(--header-border) !important;
        border-radius: 0 !important;
        background: var(--header-drawer-bg) !important;
        color: var(--header-text) !important;
        box-shadow: -22px 0 52px rgba(2, 8, 18, 0.24) !important;
        opacity: 1 !important;
        visibility: visible !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        transform: translateX(104%) !important;
        transition: transform 190ms ease !important;
        overscroll-behavior: contain !important;
    }

    body > .site-header .main-nav.active {
        transform: translateX(0) !important;
    }

    body > .site-header .nav-mobile-head {
        position: sticky !important;
        z-index: 3 !important;
        top: 0 !important;
        min-height: 68px !important;
        margin: 0 -16px !important;
        padding: 0 16px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        border-bottom: 1px solid var(--header-border) !important;
        background: var(--header-drawer-bg) !important;
    }

    body > .site-header .nav-mobile-title {
        color: var(--header-text-strong) !important;
        font-family: var(--font-display, "Sora", sans-serif) !important;
        font-size: 0.92rem !important;
        font-weight: 800 !important;
        letter-spacing: -0.02em !important;
    }

    body > .site-header .nav-mobile-close {
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: 1px solid var(--header-border) !important;
        border-radius: 9px !important;
        background: transparent !important;
        color: var(--header-text) !important;
        font-size: 1.45rem !important;
        font-weight: 400 !important;
        line-height: 1 !important;
    }

    body > .site-header .nav-mobile-section-label {
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        color: var(--header-muted) !important;
        font-size: 0.65rem !important;
        font-weight: 800 !important;
        letter-spacing: 0.1em !important;
        line-height: 1.2 !important;
        text-transform: uppercase !important;
    }

    body > .site-header .nav-mobile-auth {
        margin: 0 -16px !important;
        padding: 18px 16px !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 9px !important;
        border-bottom: 1px solid var(--header-border) !important;
        background: var(--header-surface) !important;
    }

    body > .site-header .nav-mobile-auth .nav-mobile-section-label {
        grid-column: 1 / -1 !important;
    }

    body > .site-header .nav-mobile-auth .nav-mobile-auth-btn {
        width: 100% !important;
        min-height: 42px !important;
        padding: 0 12px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: 1px solid var(--header-accent) !important;
        border-radius: 9px !important;
        background: var(--header-accent) !important;
        color: var(--header-accent-contrast) !important;
        font-size: 0.76rem !important;
        font-weight: 800 !important;
        text-decoration: none !important;
    }

    body > .site-header .nav-links {
        margin: 0 !important;
        padding: 18px 0 !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 5px !important;
        border: 0 !important;
        border-bottom: 1px solid var(--header-border) !important;
        background: transparent !important;
    }

    body > .site-header .nav-links > .nav-mobile-section-label {
        margin: 0 10px 6px !important;
    }

    body > .site-header .nav-links > .nav-mobile-account-label {
        margin-top: 14px !important;
        padding-top: 16px !important;
        border-top: 1px solid var(--header-border) !important;
    }

    body > .site-header .nav-link,
    body > .site-header .nav-link.nav-link-primary {
        position: relative !important;
        width: 100% !important;
        min-height: 48px !important;
        margin: 0 !important;
        padding: 0 12px !important;
        display: grid !important;
        grid-template-columns: 30px minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 10px !important;
        border: 1px solid transparent !important;
        border-radius: 9px !important;
        background: transparent !important;
        color: var(--header-text) !important;
        box-shadow: none !important;
        font-size: 0.88rem !important;
        font-weight: 700 !important;
        line-height: 1.2 !important;
        text-align: left !important;
        text-decoration: none !important;
    }

    body > .site-header .nav-link::after {
        display: none !important;
        content: none !important;
    }

    body > .site-header .nav-link-icon {
        width: 30px !important;
        height: 30px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: 1px solid var(--header-border) !important;
        border-radius: 8px !important;
        background: var(--header-surface) !important;
        color: var(--header-muted) !important;
    }

    body > .site-header .nav-link-icon svg {
        width: 17px !important;
        height: 17px !important;
    }

    body > .site-header .nav-link:hover,
    body > .site-header .nav-link:focus-visible {
        border-color: var(--header-border) !important;
        background: var(--header-surface-hover) !important;
        color: var(--header-text-strong) !important;
        transform: none !important;
    }

    body > .site-header .nav-link.active,
    body > .site-header .nav-link.nav-link-primary.active {
        border-color: color-mix(in srgb, var(--header-accent) 35%, var(--header-border)) !important;
        background: var(--header-accent-soft) !important;
        color: var(--header-accent) !important;
        box-shadow: inset 3px 0 0 var(--header-accent) !important;
    }

    body > .site-header .nav-link.active .nav-link-icon {
        border-color: color-mix(in srgb, var(--header-accent) 35%, var(--header-border)) !important;
        background: var(--header-bg) !important;
        color: var(--header-accent) !important;
    }

    body > .site-header .header-action-cluster {
        margin: 0 !important;
        padding: 18px 0 0 !important;
        display: block !important;
        border: 0 !important;
        background: transparent !important;
    }

    body > .site-header .nav-utils {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    body > .site-header .header-stock-search {
        position: relative !important;
        grid-column: 1 / -1 !important;
        width: 100% !important;
        margin: 0 !important;
        display: block !important;
    }

    body > .site-header .header-stock-search input {
        width: 100% !important;
        min-height: 44px !important;
        padding: 0 38px 0 40px !important;
        border: 1px solid var(--header-border) !important;
        border-radius: 9px !important;
        background: var(--header-surface) !important;
        color: var(--header-text-strong) !important;
        box-shadow: none !important;
        font-size: 0.9rem !important;
    }

    body > .site-header .header-stock-search input::placeholder {
        color: var(--header-muted) !important;
        opacity: 1 !important;
    }

    body > .site-header .header-search-icon {
        position: absolute !important;
        z-index: 2 !important;
        top: 50% !important;
        left: 14px !important;
        width: 17px !important;
        height: 17px !important;
        color: var(--header-muted) !important;
        transform: translateY(-50%) !important;
        pointer-events: none !important;
    }

    body > .site-header .header-search-suggestions {
        top: calc(100% + 7px) !important;
        right: 0 !important;
        left: 0 !important;
        border: 1px solid var(--header-border) !important;
        border-radius: 10px !important;
        background: var(--header-bg) !important;
        color: var(--header-text) !important;
        box-shadow: 0 18px 40px rgba(2, 8, 18, 0.2) !important;
    }

    body > .site-header .market-status {
        grid-column: 1 / -1 !important;
        min-height: 42px !important;
        padding: 0 12px !important;
        display: flex !important;
        align-items: center !important;
        gap: 9px !important;
        border: 1px solid var(--header-border) !important;
        border-radius: 9px !important;
        background: transparent !important;
        color: var(--header-text) !important;
    }

    body > .site-header .market-status-text {
        color: inherit !important;
        font-size: 0.79rem !important;
        font-weight: 700 !important;
    }

    body > .site-header :where(.nav-theme-group, .nav-lang-group) {
        min-width: 0 !important;
        display: grid !important;
        gap: 7px !important;
    }

    body > .site-header .nav-lang-group .lang-switcher {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    body > .site-header :where(.nav-theme-group .theme-toggle, .nav-lang-group .lang-switcher a) {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 44px !important;
        padding: 0 12px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        border: 1px solid var(--header-border) !important;
        border-radius: 9px !important;
        background: var(--header-surface) !important;
        color: var(--header-text) !important;
        box-shadow: none !important;
        text-decoration: none !important;
    }

    body > .site-header .nav-theme-group .theme-toggle-text {
        display: inline !important;
        color: inherit !important;
        font-size: 0.78rem !important;
        font-weight: 700 !important;
    }

    body > .site-header .nav-auth {
        display: none !important;
    }

    body > .mobile-nav-overlay {
        position: fixed !important;
        z-index: 999 !important;
        inset: 0 !important;
        display: block !important;
        background: rgba(2, 8, 18, 0.54) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: opacity 180ms ease, visibility 180ms ease !important;
        backdrop-filter: blur(2px) !important;
    }

    body > .mobile-nav-overlay.active {
        opacity: 1 !important;
        visibility: visible !important;
    }
}

@media (max-width: 430px) {
    body > .site-header .header-inner {
        padding: 0 10px !important;
        gap: 7px !important;
    }

    body > .site-header .logo {
        gap: 6px !important;
    }

    body > .site-header .logo-wordmark {
        font-size: 0.94rem !important;
    }

    body > .site-header .beta-tag {
        min-width: 30px !important;
        padding: 0 5px !important;
        font-size: 0.56rem !important;
    }

    body > .site-header .mobile-top-actions {
        gap: 5px !important;
    }

    body > .site-header :where(.theme-toggle-mobile, .mobile-auth-shortcut, .mobile-menu-toggle) {
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body > .site-header *,
    body > .mobile-nav-overlay {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

/* ===== component source: public-ux.css ===== */
/*
 * Public UX guardrails
 *
 * This file is intentionally loaded after the legacy page and theme bundles.
 * It provides one predictable accessibility and responsive layer across every
 * user-facing route while the older page-specific styles remain in place.
 */

:root {
    --public-header-offset: 88px;
    --public-control-height: 44px;
    --public-content-width: 1200px;
    --public-reading-width: 76ch;
}

.fx-data-quality-wrap {
    padding-top: 0.75rem;
}

.fx-data-quality-notice {
    display: grid;
    gap: 0.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(245, 158, 11, 0.42);
    border-radius: 0.75rem;
    background: rgba(120, 53, 15, 0.14);
    color: var(--text-primary, #eef6ff);
}

.fx-data-quality-notice strong {
    color: #fbbf24;
}

.fx-data-quality-notice span,
.fx-data-quality-notice small {
    color: var(--text-secondary, #b7c7d9);
}

html {
    scroll-padding-top: var(--public-header-offset);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body.public-site {
    overflow-x: clip;
}

.public-site main,
.public-site main > *,
.public-site .container,
.public-site .grid,
.public-site [class*="-grid"] {
    min-width: 0;
}

.public-site img,
.public-site svg,
.public-site canvas {
    max-width: 100%;
}

.public-site :where(h1, h2, h3) {
    text-wrap: balance;
    overflow-wrap: anywhere;
}

.public-site :where(p, li, td, th, label, small) {
    overflow-wrap: anywhere;
}

.public-site :where(section[id], article[id], div[id]) {
    scroll-margin-top: var(--public-header-offset);
}

.public-site :where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid #67d5ff !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px rgba(6, 182, 212, 0.2) !important;
}

:root[data-theme="light"] .public-site :where(a, button, input, select, textarea, summary):focus-visible {
    outline-color: #0369a1 !important;
    box-shadow: 0 0 0 5px rgba(3, 105, 161, 0.16) !important;
}

.public-site :where(button, input, select, textarea) {
    font: inherit;
}

.public-site :where(
    button,
    input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    select,
    textarea,
    .btn-primary,
    .btn-secondary,
    .nav-btn,
    .model-portfolio-filter-pill,
    .letter-chip
) {
    min-height: var(--public-control-height);
}

.public-site :where(button, input, select, textarea, a)[disabled],
.public-site :where(button, input, select, textarea, a)[aria-disabled="true"] {
    cursor: not-allowed !important;
    opacity: 0.58;
}

.public-site [hidden] {
    display: none !important;
}

.public-site .skip-link:focus {
    position: fixed !important;
    inset: 12px auto auto 12px !important;
    z-index: 100000 !important;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 1rem;
}

.public-site .site-header :where(.nav-link, .theme-toggle, .lang-switcher a, .mobile-menu-toggle, .mobile-auth-shortcut, .mobile-lang-shortcut) {
    min-width: 44px;
    min-height: 44px;
}

.public-site .main-nav .nav-link {
    display: inline-flex;
    align-items: center;
}

.public-site .mobile-dock-link {
    min-height: 54px;
}

.public-site .table-container,
.public-site .tx-table-shell,
.public-site [data-scroll-region] {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

.public-site .table-container.is-scrollable,
.public-site .tx-table-shell.is-scrollable,
.public-site [data-scroll-region].is-scrollable {
    box-shadow: inset -18px 0 18px -22px rgba(103, 213, 255, 0.8);
}

.public-site .table-container:focus-visible,
.public-site .tx-table-shell:focus-visible,
.public-site [data-scroll-region]:focus-visible {
    border-radius: 12px;
}

.public-site :where(.flash-message, .alert, .notice, .form-error, .success-message)[role="status"] {
    scroll-margin-top: var(--public-header-offset);
}

.public-site form.is-submitting :where(button[type="submit"], input[type="submit"]) {
    pointer-events: none;
    opacity: 0.68;
}

.public-site .modal[role="dialog"] {
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    overflow-y: auto;
    overscroll-behavior: contain;
}

.public-site .modal-content {
    width: min(100%, 760px);
    max-height: min(88vh, 900px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.public-site .modal-content.modal-sm {
    width: min(100%, 560px);
}

.public-site .modal-content.modal-lg {
    width: min(100%, 1040px);
}

.public-site .modal-close-btn {
    flex: 0 0 44px;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    display: inline-grid;
    place-items: center;
}

body.public-site.modal-open {
    overflow: hidden;
}

.public-site .ux-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.public-site .ux-pagination button {
    min-width: 44px;
    padding-inline: 1rem;
}

.public-site .ux-pagination-status,
.public-site .ux-results-status {
    color: var(--text-secondary, #aebdd0);
    font-size: 0.92rem;
}

/* Keep the first task visible instead of making every landing page a poster. */
body.page-home .home-page.home-v2-premium .home-v2-hero,
body.page-market .market-directory-page .market-hero-premium,
body.page-social .social-page .social-hero-premium {
    min-height: 0 !important;
    padding: clamp(1.75rem, 3.8vw, 3.4rem) !important;
    gap: clamp(1.5rem, 3vw, 2.75rem) !important;
}

body.page-home .home-page.home-v2-premium .home-v2-hero h1,
body.page-market .market-directory-page .market-hero-premium h1,
body.page-social .social-page .social-hero-premium h1 {
    font-size: clamp(2.65rem, 5.4vw, 5rem) !important;
    line-height: 0.98 !important;
    letter-spacing: -0.055em !important;
}

body.page-home .home-page.home-v2-premium .home-v2-copy,
body.page-market .market-directory-page .market-hero-copy,
body.page-social .social-page .social-hero-copy {
    align-content: start;
}

body.page-home .home-page.home-v2-premium > section:not(.home-v2-hero) {
    min-height: 0 !important;
    margin-top: clamp(1.75rem, 3vw, 3rem) !important;
    padding-block: clamp(2rem, 4.5vw, 4.25rem) !important;
}

body.page-home .home-page.home-v2-premium .home-v2-entry-panel {
    display: grid;
    gap: 1.25rem;
    margin-top: clamp(1rem, 2vw, 1.75rem) !important;
    padding: clamp(1.35rem, 2.6vw, 2rem) !important;
    border: 1px solid rgba(122, 162, 206, 0.2);
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.09), transparent 32%),
        linear-gradient(155deg, rgba(10, 20, 38, 0.96), rgba(6, 13, 26, 0.94));
    box-shadow: 0 22px 48px rgba(2, 6, 23, 0.2);
}

body.page-home .home-page.home-v2-premium .home-v2-entry-head {
    display: grid;
    gap: 0.45rem;
    max-width: 48rem;
}

body.page-home .home-page.home-v2-premium .home-v2-entry-head h2 {
    margin: 0;
    color: #f8fbff;
    font-size: clamp(1.65rem, 3vw, 2.4rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

body.page-home .home-page.home-v2-premium .home-v2-entry-head p {
    margin: 0;
    color: rgba(191, 211, 232, 0.82);
    font-size: 0.98rem;
    line-height: 1.55;
}

body.page-home .home-page.home-v2-premium .home-v2-entry-panel .home-v2-start-paths {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.page-home .home-page.home-v2-premium .home-v2-entry-panel .home-v2-start-path {
    min-height: 100%;
    gap: 0.5rem;
    padding: 1.15rem 1.2rem;
    border-radius: 18px;
    border-color: rgba(122, 174, 218, 0.22);
    background: rgba(255, 255, 255, 0.045);
    box-shadow: none;
}

body.page-home .home-page.home-v2-premium .home-v2-entry-panel .home-v2-start-path em {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

body.page-home .home-page.home-v2-premium .home-v2-entry-panel .home-v2-start-path em::after {
    content: "\2192";
    font-size: 1rem;
}

body.page-home .home-page.home-v2-premium .home-v2-entry-evidence {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 1rem;
    align-items: stretch;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(122, 162, 206, 0.16);
}

body.page-home .home-page.home-v2-premium .home-v2-entry-evidence > * {
    min-width: 0;
    margin: 0 !important;
}

body.page-home .home-page.home-v2-premium .home-v2-entry-evidence .home-v2-proofline {
    display: grid;
    grid-template-columns: 1fr;
    align-content: center;
    max-width: none;
}

body.page-home .home-page.home-v2-premium .home-v2-entry-evidence .home-v2-proofline span {
    width: 100%;
}

:root[data-theme="light"] body.page-home .home-page.home-v2-premium .home-v2-entry-panel {
    border-color: #cbd7e1 !important;
    background:
        radial-gradient(circle at top right, rgba(3, 105, 161, 0.06), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    box-shadow: 0 18px 44px rgba(15, 35, 55, 0.08) !important;
}

:root[data-theme="light"] body.page-home .home-page.home-v2-premium .home-v2-entry-head h2 {
    color: #10253b !important;
    -webkit-text-fill-color: #10253b !important;
}

:root[data-theme="light"] body.page-home .home-page.home-v2-premium .home-v2-entry-head p {
    color: #52677b !important;
}

:root[data-theme="light"] body.page-home .home-page.home-v2-premium .home-v2-entry-panel .home-v2-start-path {
    border-color: #d5dee7 !important;
    background: #ffffff !important;
    box-shadow: 0 8px 22px rgba(15, 35, 55, 0.055) !important;
}

:root[data-theme="light"] body.page-home .home-page.home-v2-premium .home-v2-entry-panel .home-v2-start-path:is(:hover, :focus-visible) {
    border-color: #7cb8d0 !important;
    background: #f8fbfd !important;
    box-shadow: 0 14px 30px rgba(15, 76, 129, 0.1) !important;
}

:root[data-theme="light"] body.page-home .home-page.home-v2-premium .home-v2-entry-panel .home-v2-start-path span,
:root[data-theme="light"] body.page-home .home-page.home-v2-premium .home-v2-entry-panel .home-v2-start-path em {
    color: #0369a1 !important;
    -webkit-text-fill-color: #0369a1 !important;
}

:root[data-theme="light"] body.page-home .home-page.home-v2-premium .home-v2-entry-panel .home-v2-start-path strong {
    color: #10253b !important;
    -webkit-text-fill-color: #10253b !important;
}

:root[data-theme="light"] body.page-home .home-page.home-v2-premium .home-v2-entry-panel .home-v2-start-path small {
    color: #52677b !important;
    -webkit-text-fill-color: #52677b !important;
}

:root[data-theme="light"] body.page-home .home-page.home-v2-premium .home-v2-entry-evidence {
    border-top-color: #d8e1e9;
}

body.page-home .home-page.home-v2-premium .home-v2-positioning-grid,
body.page-home .home-page.home-v2-premium .home-v2-demo-grid,
body.page-home .home-page.home-v2-premium .home-v2-evaluator-grid {
    align-items: start;
}

body.page-social .social-page .social-hero-spotlight {
    min-height: 0 !important;
    padding: clamp(1.35rem, 2.5vw, 2.25rem) !important;
}

body.page-market .market-directory-page .market-hero-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0 !important;
    overflow: hidden;
    border: 1px solid rgba(79, 126, 199, 0.18);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(17, 30, 50, 0.88), rgba(10, 19, 34, 0.9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.page-market .market-directory-page .market-hero-stat {
    display: grid;
    grid-template-rows: 1.8rem auto 1rem;
    align-content: start;
    min-width: 0;
    min-height: 126px;
    padding: 0.95rem 1rem;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.page-market .market-directory-page .market-hero-stat + .market-hero-stat {
    border-left: 1px solid rgba(79, 126, 199, 0.18) !important;
}

body.page-market .market-directory-page .market-hero-stat-label,
body.page-market .market-directory-page .market-hero-stat-value,
body.page-market .market-directory-page .market-hero-stat-meta {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    overflow-wrap: normal !important;
    word-break: normal !important;
    text-overflow: ellipsis;
}

body.page-market .market-directory-page .market-hero-stat-label {
    align-self: start;
    font-size: 0.7rem;
    letter-spacing: 0.075em;
}

body.page-market .market-directory-page .market-hero-stat-value {
    align-self: end;
    margin-top: 0;
    font-size: clamp(1.55rem, 1.75vw, 1.85rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

body.page-market .market-directory-page .market-hero-stat-meta {
    align-self: end;
    margin-top: 0.25rem;
    font-size: 0.74rem;
    line-height: 1;
}

:root[data-theme="light"] body.page-market .market-directory-page .market-hero-stats {
    border-color: var(--ak-border);
    background: var(--ak-surface-muted);
    box-shadow: none;
}

:root[data-theme="light"] body.page-market .market-directory-page .market-hero-stat + .market-hero-stat {
    border-left-color: var(--ak-border) !important;
}

body.page-social .social-page .social-hero-dashboard {
    gap: 0.75rem !important;
}

@media (max-width: 760px) {
    body.page-market .market-directory-page .market-hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.page-market .market-directory-page .market-hero-stat + .market-hero-stat {
        border-left: 0 !important;
    }

    body.page-market .market-directory-page .market-hero-stat:nth-child(even) {
        border-left: 1px solid rgba(79, 126, 199, 0.18) !important;
    }

    body.page-market .market-directory-page .market-hero-stat:nth-child(n + 3) {
        border-top: 1px solid rgba(79, 126, 199, 0.18) !important;
    }

    :root[data-theme="light"] body.page-market .market-directory-page .market-hero-stat:nth-child(even) {
        border-left-color: var(--ak-border) !important;
    }

    :root[data-theme="light"] body.page-market .market-directory-page .market-hero-stat:nth-child(n + 3) {
        border-top-color: var(--ak-border) !important;
    }
}

@media (max-width: 460px) {
    body.page-market .market-directory-page .market-hero-stats {
        grid-template-columns: 1fr;
    }

    body.page-market .market-directory-page .market-hero-stat:nth-child(even) {
        border-left: 0 !important;
    }

    body.page-market .market-directory-page .market-hero-stat:nth-child(n + 2) {
        border-top: 1px solid rgba(79, 126, 199, 0.18) !important;
    }

    :root[data-theme="light"] body.page-market .market-directory-page .market-hero-stat:nth-child(n + 2) {
        border-top-color: var(--ak-border) !important;
    }
}

/* Stock detail: compact decision dashboard with clear evidence hierarchy. */
body.page-stock-detail .stock-detail-page .directory-header.stock-detail-header {
    padding: clamp(1.35rem, 2.2vw, 1.85rem) !important;
    border-radius: 20px !important;
}

body.page-stock-detail .stock-detail-page .stock-decision-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(17rem, 0.65fr) !important;
    align-items: stretch !important;
    gap: clamp(1.15rem, 2vw, 1.65rem) !important;
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.page-stock-detail .stock-detail-page .stock-decision-copy {
    width: 100%;
    gap: 0.62rem;
}

body.page-stock-detail .stock-detail-page .stock-identity-stack {
    width: 100%;
    gap: 0.52rem;
}

body.page-stock-detail .stock-detail-page :where(
    .stock-ticker-symbol,
    .stock-company-name,
    .stock-analysis-byline,
    .stock-decision-title,
    .stock-decision-body,
    .stock-timeframe-card,
    .stock-ladder-item,
    .stock-signal-stamp,
    .stock-ladder-score,
    .stock-setup-item,
    .stock-setup-item small,
    .stock-setup-visual-labels,
    .stock-peer-row,
    .stock-trader-head,
    .stock-summary-item,
    .stock-decision-note,
    .stock-decision-next-steps
) {
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none;
}

body.page-stock-detail .stock-detail-page .stock-ticker-symbol {
    white-space: nowrap;
}

body.page-stock-detail .stock-detail-page .stock-company-name {
    max-width: 18ch;
    font-size: clamp(2.15rem, 4.2vw, 3.6rem) !important;
    line-height: 0.98 !important;
}

body.page-stock-detail .stock-detail-page .stock-analysis-byline {
    max-width: 64ch;
    margin: 0;
    line-height: 1.5;
}

body.page-stock-detail .stock-detail-page .stock-signal-row {
    align-items: center;
    gap: 0.7rem;
    margin-top: 0.18rem;
}

body.page-stock-detail .stock-detail-page .stock-decision-title {
    font-size: 1rem;
    line-height: 1.4;
}

body.page-stock-detail .stock-detail-page .stock-decision-body {
    max-width: 58ch;
    margin-top: 0;
    line-height: 1.6;
}

body.page-stock-detail .stock-detail-page .stock-timeframe-tape {
    width: 100%;
    align-items: stretch;
    gap: 0.7rem;
    margin-top: 0.85rem;
}

body.page-stock-detail .stock-detail-page .stock-timeframe-card {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-width: 0;
    min-height: 7.4rem;
    padding: 0.95rem 1rem;
    border-radius: 14px;
}

body.page-stock-detail .stock-detail-page .stock-timeframe-label,
body.page-stock-detail .stock-detail-page .stock-timeframe-card small {
    white-space: nowrap;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

body.page-stock-detail .stock-detail-page .stock-timeframe-card strong {
    align-self: center;
    margin-top: 0.42rem;
    font-size: 1rem;
    line-height: 1.3;
}

body.page-stock-detail .stock-detail-page .stock-quote-line {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.55rem;
    min-width: 0;
    margin: 0;
    padding: 1.2rem 1.25rem;
    border: 1px solid rgba(69, 110, 152, 0.34);
    border-radius: 16px;
    background: rgba(8, 17, 30, 0.62);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

body.page-stock-detail .stock-detail-page .stock-quote-label {
    color: #8ea6c3;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

body.page-stock-detail .stock-detail-page .quote-price {
    white-space: nowrap;
    font-size: clamp(1.8rem, 3vw, 2.45rem);
    line-height: 1.05;
    letter-spacing: -0.045em;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

body.page-stock-detail .stock-detail-page .quote-change {
    align-self: flex-start;
    padding: 0.28rem 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.08);
    font-size: 0.82rem;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

body.page-stock-detail .stock-detail-page .quote-change.buy {
    border-color: rgba(16, 185, 129, 0.32);
    background: rgba(16, 185, 129, 0.11);
}

body.page-stock-detail .stock-detail-page .quote-change.sell {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
}

body.page-stock-detail .stock-detail-page .quote-meta {
    margin-top: 0.15rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(69, 110, 152, 0.24);
    line-height: 1.45;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

body.page-stock-detail .stock-detail-page .stock-quote-highlights {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 0.45rem;
    margin-top: 0.25rem;
}

body.page-stock-detail .stock-detail-page .stock-quote-chip {
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    padding: 0.52rem 0.62rem;
    border-radius: 10px;
}

body.page-stock-detail .stock-detail-page .stock-signal-summary {
    align-items: stretch;
    gap: 0.8rem;
    margin-top: 1.15rem;
}

body.page-stock-detail .stock-detail-page .stock-summary-item {
    min-width: 0;
    min-height: 8.25rem;
    justify-content: flex-start;
    gap: 0.42rem;
    padding: 1rem 1.05rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025) !important;
    box-shadow: none !important;
}

body.page-stock-detail .stock-detail-page .stock-summary-item strong {
    font-size: 1.05rem;
    line-height: 1.35;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

body.page-stock-detail .stock-detail-page .stock-summary-item small {
    margin-top: auto;
    font-size: 0.77rem;
    line-height: 1.45;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

body.page-stock-detail .stock-detail-page .stock-score-primary {
    font-size: 1.8rem;
}

body.page-stock-detail .stock-detail-page .stock-detail-actions.stock-decision-actions {
    align-items: center;
    gap: 0.7rem;
    margin: 1rem 0 0.75rem;
}

body.page-stock-detail .stock-detail-page .stock-decision-actions :where(.btn-primary, .btn-secondary) {
    min-width: 9.5rem;
    padding-inline: 1.2rem;
}

body.page-stock-detail .stock-detail-page .stock-decision-note {
    max-width: 74ch;
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.55;
}

body.page-stock-detail .stock-detail-page .stock-decision-next-steps {
    gap: 0;
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border-color: rgba(91, 124, 166, 0.28);
    background: rgba(8, 17, 30, 0.52);
}

body.page-stock-detail .stock-detail-page .stock-decision-next-steps article {
    min-width: 0;
    padding: 0.15rem 1rem;
}

body.page-stock-detail .stock-detail-page .stock-decision-next-steps article:first-child {
    padding-left: 0;
}

body.page-stock-detail .stock-detail-page .stock-decision-next-steps article + article {
    border-left: 1px solid rgba(91, 124, 166, 0.24);
}

body.page-stock-detail .stock-detail-page .stock-decision-next-steps strong {
    color: #f5f9ff;
    font-size: 0.9rem;
    line-height: 1.35;
}

body.page-stock-detail .stock-detail-page .stock-decision-next-steps p {
    color: #b5c5d6;
    font-size: 0.82rem;
    line-height: 1.55;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

:root[data-theme="light"] body.page-stock-detail .stock-detail-page .stock-quote-line {
    border-color: #cddbe6;
    background: #f4f8fb;
    box-shadow: none;
}

:root[data-theme="light"] body.page-stock-detail .stock-detail-page .stock-quote-label,
:root[data-theme="light"] body.page-stock-detail .stock-detail-page .quote-meta {
    color: #52677b !important;
}

:root[data-theme="light"] body.page-stock-detail .stock-detail-page .quote-meta {
    border-top-color: #d8e2ea;
}

:root[data-theme="light"] body.page-stock-detail .stock-detail-page .stock-quote-chip {
    border-color: #d3dfe8 !important;
    background: #ffffff !important;
}

:root[data-theme="light"] body.page-stock-detail .stock-detail-page .stock-quote-chip strong {
    color: #10253b !important;
    -webkit-text-fill-color: #10253b !important;
}

:root[data-theme="light"] body.page-stock-detail .stock-detail-page .stock-summary-item {
    border-color: #d5e0e8 !important;
    background: #f6f9fb !important;
}

:root[data-theme="light"] body.page-stock-detail .stock-detail-page .stock-summary-item > span {
    color: #5b7084 !important;
}

:root[data-theme="light"] body.page-stock-detail .stock-detail-page .stock-summary-item small,
:root[data-theme="light"] body.page-stock-detail .stock-detail-page .stock-decision-note {
    color: #52677b !important;
    -webkit-text-fill-color: #52677b !important;
}

:root[data-theme="light"] body.page-stock-detail .stock-detail-page .stock-decision-next-steps {
    border-color: #ccd9e3 !important;
    background: #f2f7fa !important;
}

:root[data-theme="light"] body.page-stock-detail .stock-detail-page .stock-decision-next-steps article + article {
    border-left-color: #d5e0e8;
}

:root[data-theme="light"] body.page-stock-detail .stock-detail-page .stock-decision-next-steps article > span {
    background: #dff1f7;
    color: #075d82;
}

:root[data-theme="light"] body.page-stock-detail .stock-detail-page .stock-decision-next-steps strong {
    color: #10253b !important;
    -webkit-text-fill-color: #10253b !important;
}

:root[data-theme="light"] body.page-stock-detail .stock-detail-page .stock-decision-next-steps p {
    color: #52677b !important;
    -webkit-text-fill-color: #52677b !important;
}

@media (max-width: 920px) {
    body.page-stock-detail .stock-detail-page .directory-header.stock-detail-header {
        display: grid;
    }

    body.page-stock-detail .stock-detail-page .stock-decision-hero {
        grid-template-columns: 1fr !important;
        order: 1;
    }

    body.page-stock-detail .stock-detail-page .stock-timeframe-tape,
    body.page-stock-detail .stock-detail-page .stock-signal-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    body.page-stock-detail .stock-detail-page .stock-signal-summary {
        order: 2;
    }

    body.page-stock-detail .stock-detail-page .stock-decision-actions {
        order: 3;
    }

    body.page-stock-detail .stock-detail-page .stock-decision-note {
        order: 4;
    }

    body.page-stock-detail .stock-detail-page .stock-decision-next-steps {
        order: 5;
    }

    body.page-stock-detail .stock-detail-page .stock-quote-line {
        min-height: 0;
    }

    body.page-stock-detail .stock-detail-page .stock-quote-highlights {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.page-stock-detail .stock-detail-page .stock-decision-next-steps {
        grid-template-columns: 1fr;
        gap: 0;
    }

    body.page-stock-detail .stock-detail-page .stock-decision-next-steps article,
    body.page-stock-detail .stock-detail-page .stock-decision-next-steps article:first-child {
        padding: 0.85rem 0;
    }

    body.page-stock-detail .stock-detail-page .stock-decision-next-steps article:first-child {
        padding-top: 0;
    }

    body.page-stock-detail .stock-detail-page .stock-decision-next-steps article:last-child {
        padding-bottom: 0;
    }

    body.page-stock-detail .stock-detail-page .stock-decision-next-steps article + article {
        border-top: 1px solid rgba(91, 124, 166, 0.24);
        border-left: 0;
    }

    :root[data-theme="light"] body.page-stock-detail .stock-detail-page .stock-decision-next-steps article + article {
        border-top-color: #d5e0e8;
    }
}

@media (max-width: 600px) {
    body.page-stock-detail .stock-detail-page .directory-header.stock-detail-header {
        padding: 1rem !important;
        border-radius: 16px !important;
    }

    body.page-stock-detail .stock-detail-page .stock-company-name {
        font-size: clamp(2rem, 10vw, 2.75rem) !important;
    }

    body.page-stock-detail .stock-detail-page .stock-timeframe-tape,
    body.page-stock-detail .stock-detail-page .stock-signal-summary,
    body.page-stock-detail .stock-detail-page .stock-quote-highlights {
        grid-template-columns: 1fr !important;
    }

    body.page-stock-detail .stock-detail-page .stock-timeframe-card,
    body.page-stock-detail .stock-detail-page .stock-summary-item {
        min-height: 0;
    }

    body.page-stock-detail .stock-detail-page .stock-decision-actions :where(.btn-primary, .btn-secondary) {
        width: 100%;
    }
}

/* Model catalogue: keep choice controls and real portfolios above the fold. */
body.page-model-portfolios .model-portfolio-page > .container {
    padding-top: clamp(1rem, 2vw, 1.75rem);
}

body.page-model-portfolios .model-portfolio-page .directory-header {
    min-height: 0 !important;
    padding: clamp(1.35rem, 2.5vw, 2.25rem) !important;
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-hero-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 1rem !important;
    margin-top: 1rem !important;
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-hero-main,
body.page-model-portfolios .model-portfolio-page .model-portfolio-hero-side {
    min-width: 0;
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-hero-side {
    position: static !important;
}

body.page-model-portfolios .model-portfolio-page .top-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: stretch;
    gap: 0.75rem !important;
}

body.page-model-portfolios .model-portfolio-page .top-stat-card {
    min-height: 11rem !important;
    padding: 1.15rem 1.25rem !important;
}

body.page-model-portfolios .model-portfolio-page .top-stat-card strong {
    font-size: clamp(1.75rem, 3.5vw, 3rem) !important;
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-panel {
    padding: 1.15rem 1.25rem !important;
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-panel-head {
    margin-bottom: 0.85rem !important;
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-guide-list {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(14rem, 1fr));
    gap: 0.8rem !important;
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-guide-item {
    margin: 0 !important;
    min-width: 0;
    min-height: 8.5rem;
    padding: 1rem !important;
    align-items: flex-start;
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-guide-item > div {
    min-width: 0;
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-guide-item strong {
    overflow-wrap: normal;
    word-break: normal;
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-guide-item p {
    margin-top: 0.25rem !important;
    font-size: 0.88rem !important;
    line-height: 1.45 !important;
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-filter-row {
    position: sticky;
    top: calc(var(--public-header-offset) - 12px);
    z-index: 20;
    margin-block: 1rem !important;
    padding: 0.85rem 1rem !important;
    backdrop-filter: blur(18px);
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-catalog-head {
    margin-block: 1.25rem 1rem !important;
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-card {
    height: 100%;
    gap: 0.9rem !important;
    padding: 1.1rem !important;
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-grid {
    align-items: stretch;
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-card-chips {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 0.5rem;
    min-height: 3.75rem;
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-card-chip-primary {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.55rem;
    min-width: 0;
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-card-chip-primary .holding-fact-chip,
body.page-model-portfolios .model-portfolio-page .model-portfolio-card-basis {
    white-space: nowrap;
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-card-basis {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 0.45rem;
    min-width: 0;
    color: var(--text-muted, #64748b);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.35;
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-card-basis::before {
    content: "";
    width: 0.42rem;
    height: 0.42rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #38bdf8;
    box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.12);
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-card-performance,
body.page-model-portfolios .model-portfolio-page .model-portfolio-card-body-grid,
body.page-model-portfolios .model-portfolio-page .model-portfolio-mini-chart-panel {
    margin: 0 !important;
}

body.page-model-portfolios .model-portfolio-page .model-portfolio-mini-chart svg {
    max-height: 170px;
}

/* Detail pages should read like dashboards, not oversized empty hero cards. */
body.page-model-portfolio-detail .model-portfolio-page .directory-header,
body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-detail-header {
    min-height: 0 !important;
    padding: clamp(1.25rem, 2.5vw, 2rem) !important;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-quick-nav,
body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-detail-nav {
    position: sticky;
    top: calc(var(--public-header-offset) - 12px);
    z-index: 19;
    backdrop-filter: blur(18px);
}

body.page-model-portfolio-detail .model-portfolio-page :where(.model-portfolio-overview-grid, .model-portfolio-dashboard-grid, .model-portfolio-snapshot-grid) {
    gap: 1rem !important;
    margin-bottom: 1rem !important;
}

body.page-model-portfolio-detail .model-portfolio-page :where(.model-portfolio-panel, .portfolio-holdings-shell) {
    gap: 0.85rem !important;
    padding: 1rem 1.1rem !important;
}

body.page-model-portfolio-detail .model-portfolio-page .portfolio-holdings-header {
    padding-bottom: 0.75rem !important;
}

body.page-model-portfolio-detail .model-portfolio-page :where(.model-portfolio-performance-summary, .model-portfolio-holdings-summary) {
    margin-bottom: 0.75rem !important;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-performance-summary-hero .model-portfolio-kpi {
    min-height: 92px !important;
    padding: 0.85rem !important;
}

body.page-model-portfolio-detail .model-portfolio-page #model-holdings .model-portfolio-filter-row {
    margin-block: 0 !important;
    padding: 0.75rem !important;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table :where(th, td) {
    padding-block: 0.7rem !important;
}

/* Values in these blocks inherit pale dark-theme text unless explicitly reset. */
:root[data-theme="light"] body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-definition-grid {
    color: #334b61 !important;
    -webkit-text-fill-color: #334b61 !important;
}

:root[data-theme="light"] body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-definition-grid strong {
    color: #10253b !important;
    -webkit-text-fill-color: #10253b !important;
}

:root[data-theme="light"] body.page-model-portfolio-detail .model-portfolio-page .portfolio-holdings-meta {
    color: #52677b !important;
    -webkit-text-fill-color: #52677b !important;
}

/* Social directory: keep the board introduction compact and use the full row. */
body.page-social .social-page .social-directory-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.45rem;
    width: 100%;
    max-width: none !important;
    min-height: 0;
    margin: 0 0 1rem !important;
    padding: 0 0 1.15rem !important;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid var(--ak-border) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

body.page-social .social-page .social-directory-header .social-hero-kicker {
    justify-self: start;
}

body.page-social .social-page .social-directory-header h2 {
    max-width: 24ch !important;
    margin: 0.55rem 0 0;
    font-size: clamp(1.75rem, 2.5vw, 2.35rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
    overflow-wrap: normal;
}

body.page-social .social-page .social-directory-header .subtitle {
    max-width: 48ch !important;
    margin: 0.25rem 0 0;
    font-size: 0.98rem;
    line-height: 1.55;
}

body.page-social .social-page .social-board-controls {
    margin-top: 1rem;
}

@media (min-width: 1000px) {
    body.page-social .social-page .social-directory-header {
        grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
        column-gap: clamp(1.5rem, 4vw, 3.5rem);
        align-items: end;
    }

    body.page-social .social-page .social-directory-header .social-hero-kicker {
        grid-column: 1 / -1;
    }

    body.page-social .social-page .social-directory-header h2 {
        grid-column: 1;
    }

    body.page-social .social-page .social-directory-header .subtitle {
        grid-column: 2;
        margin-bottom: 0.15rem;
    }
}

/* Company directory: the browser pager keeps a 15,000px table manageable. */
body.page-companies .companies-page .directory-header {
    min-height: 0 !important;
    padding: clamp(1.25rem, 2.5vw, 2rem) !important;
}

body.page-companies .companies-page .directory-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 0.75rem;
}

body.page-companies .companies-page .directory-search-field {
    display: grid;
    gap: 0.4rem;
}

body.page-companies .companies-page .directory-search-field > span {
    color: var(--text-secondary, #aebdd0);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body.page-companies .companies-page .market-search {
    width: 100%;
}

body.page-companies .companies-page .company-directory-status {
    min-width: 12rem;
    text-align: right;
}

body.page-companies .companies-page .market-table tbody tr[hidden] {
    display: none !important;
}

/* Long-form content keeps a readable measure. */
body.page-trust .legal-page,
body.page-trust .trust-page,
body.page-docs .docs-article {
    --public-reading-width: 76ch;
}

body.page-trust .legal-page :where(p, li),
body.page-trust .trust-page :where(p, li),
body.page-docs .docs-article :where(p, li) {
    max-width: var(--public-reading-width);
    line-height: 1.72;
}

/* The footer remains useful without occupying another full screen. */
.public-site .main-footer {
    margin-top: clamp(3rem, 6vw, 5rem) !important;
    padding-block: clamp(2rem, 4vw, 3.5rem) 1.25rem !important;
}

.public-site .footer-grid {
    gap: clamp(1.5rem, 3vw, 3rem) !important;
}

.public-site .main-footer .disclaimer-box {
    margin-top: 1.5rem !important;
    padding: 1rem !important;
}

@media (max-width: 900px) {
    :root {
        --public-header-offset: 76px;
    }

    .public-site main.container,
    .public-site main > .container,
    .public-site .main-footer > .container {
        padding-inline: 1rem !important;
    }

    .public-site :where(.mobile-dock, .mobile-dock.is-authenticated, .mobile-dock.is-guest) {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 0.35rem !important;
    }

    .public-site .mobile-dock-text {
        font-size: clamp(0.58rem, 2.4vw, 0.68rem);
        line-height: 1.05;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    .public-site :where(.hero-actions, .modal-actions) {
        align-items: stretch;
    }

    .public-site :where(.hero-actions, .modal-actions) > :where(a, button) {
        min-width: 0;
    }

    body.page-home .home-page.home-v2-premium .home-v2-hero,
    body.page-market .market-directory-page .market-hero-premium,
    body.page-social .social-page .social-hero-premium {
        padding: 1.25rem !important;
    }

    body.page-home .home-page.home-v2-premium .home-v2-hero h1,
    body.page-market .market-directory-page .market-hero-premium h1,
    body.page-social .social-page .social-hero-premium h1 {
        font-size: clamp(2.35rem, 11vw, 4rem) !important;
    }

    body.page-home .home-page.home-v2-premium .home-v2-entry-panel .home-v2-start-paths,
    body.page-home .home-page.home-v2-premium .home-v2-entry-evidence {
        grid-template-columns: 1fr;
    }

    body.page-model-portfolios .model-portfolio-page .model-portfolio-guide-list {
        grid-template-columns: 1fr;
    }

    body.page-model-portfolios .model-portfolio-page .model-portfolio-guide-item {
        min-height: 0;
    }

    body.page-model-portfolios .model-portfolio-page .model-portfolio-filter-row,
    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-quick-nav,
    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-detail-nav {
        position: static;
    }

    body.page-companies .companies-page .directory-search-row {
        grid-template-columns: 1fr;
    }

    body.page-companies .companies-page .company-directory-status {
        min-width: 0;
        text-align: left;
    }

    .public-site .modal[role="dialog"] {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    .public-site .modal-content,
    .public-site .modal-content.modal-sm,
    .public-site .modal-content.modal-lg {
        width: 100% !important;
        max-width: none !important;
        max-height: min(92dvh, 900px) !important;
        border-radius: 20px 20px 0 0 !important;
        padding-bottom: max(1rem, env(safe-area-inset-bottom)) !important;
    }
}

.home-page .home-v2-insights {
    margin-top: 1.5rem;
    padding: clamp(1.2rem, 3vw, 2rem);
    border: 1px solid #20334a;
    border-radius: 22px;
    background: linear-gradient(145deg, #0a1525, #07111f);
}

.home-page .home-v2-insights-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.home-page .home-v2-insights-head h2 {
    margin: 0.3rem 0 0.45rem;
    color: #f7fbff;
    font-size: clamp(1.65rem, 3vw, 2.35rem);
}

.home-page .home-v2-insights-head p {
    max-width: 62ch;
    margin: 0;
    color: #9db0c6;
}

.home-page .home-v2-insights-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.home-page .home-v2-insight-card {
    display: grid;
    min-width: 0;
    overflow: hidden;
    grid-template-rows: auto 1fr auto;
    border: 1px solid #263a52;
    border-radius: 16px;
    background: #0e1a2b;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
}

.home-page .home-v2-insight-visual {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 8.4;
    background: linear-gradient(135deg, #10344d, #0a1b2e 58%, #123d4c);
}

.home-page .home-v2-insight-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 220ms ease;
}

.home-page .home-v2-insight-card:hover .home-v2-insight-visual img {
    transform: scale(1.025);
}

.home-page .home-v2-insight-visual > span {
    display: flex;
    height: 100%;
    align-items: flex-start;
    justify-content: flex-end;
    flex-direction: column;
    padding: 1.25rem;
    color: #e7f8ff;
}

.home-page .home-v2-insight-visual small {
    color: #7dd3fc;
    font-size: 0.65rem;
    font-weight: 850;
    letter-spacing: 0.16em;
}

.home-page .home-v2-insight-visual strong {
    font-size: 1.35rem;
    letter-spacing: 0.03em;
}

.home-page .home-v2-insight-copy {
    padding: 1.15rem 1.15rem 0.85rem;
}

.home-page .home-v2-insight-meta {
    color: #7dd3fc;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.home-page .home-v2-insight-copy h3 {
    margin: 0.55rem 0 0.6rem;
    font-size: 1.12rem;
    line-height: 1.35;
}

.home-page .home-v2-insight-copy h3 a {
    color: #f5f9ff;
    text-decoration: none;
}

.home-page .home-v2-insight-copy h3 a:hover,
.home-page .home-v2-insight-footer a:hover {
    color: #7dd3fc;
}

.home-page .home-v2-insight-copy p {
    margin: 0;
    color: #9db0c6;
    font-size: 0.82rem;
    line-height: 1.62;
}

.home-page .home-v2-insight-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 1.15rem;
    padding: 0.9rem 0 1.05rem;
    border-top: 1px solid #22354b;
    color: #7f95ad;
    font-size: 0.72rem;
}

.home-page .home-v2-insight-footer a {
    color: #bfeaff;
    font-weight: 800;
    text-decoration: none;
}

:root[data-theme="light"] .home-page .home-v2-insights {
    border-color: #c9d9e7;
    background: #f7fbfe;
}

:root[data-theme="light"] .home-page .home-v2-insight-card {
    border-color: #cfdeea;
    background: #fff;
    box-shadow: 0 12px 30px rgba(29, 57, 79, 0.08);
}

:root[data-theme="light"] .home-page .home-v2-insights-head h2,
:root[data-theme="light"] .home-page .home-v2-insight-copy h3 a {
    color: #10263c;
}

:root[data-theme="light"] .home-page .home-v2-insights-head p,
:root[data-theme="light"] .home-page .home-v2-insight-copy p {
    color: #50667d;
}

:root[data-theme="light"] .home-page .home-v2-insight-footer {
    border-color: #d8e4ed;
    color: #657a90;
}

:root[data-theme="light"] .home-page .home-v2-insight-footer a {
    color: #075d85;
}

@media (max-width: 900px) {
    .home-page .home-v2-insights-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .public-site :where(.btn-primary, .btn-secondary) {
        justify-content: center;
    }

    body.page-model-portfolios .model-portfolio-page .top-stats {
        grid-template-columns: 1fr !important;
    }

    body.page-model-portfolios .model-portfolio-page .top-stat-card {
        min-height: 0 !important;
    }

    body.page-social .social-page .social-directory-header h2 {
        max-width: 100% !important;
        font-size: clamp(1.65rem, 8vw, 2.05rem);
        line-height: 1.12;
    }

    body.page-model-portfolios .model-portfolio-page .model-portfolio-filter-group {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        scroll-snap-type: x proximity;
    }

    body.page-model-portfolios .model-portfolio-page .model-portfolio-filter-pill {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .public-site .footer-links {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem 1rem !important;
    }

    .public-site .footer-links a {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
    }

    .home-page .home-v2-insights-head {
        align-items: stretch;
        flex-direction: column;
    }

    .home-page .home-v2-insights-head .btn-secondary {
        width: 100%;
    }

    .home-page .home-v2-insights-grid {
        grid-template-columns: 1fr;
    }
}

/* Model portfolio detail: compact, evidence-first presentation. */
body.page-model-portfolio-detail .model-portfolio-page {
    --mp-clean-surface: rgba(10, 17, 29, 0.78);
    --mp-clean-surface-soft: rgba(255, 255, 255, 0.035);
    --mp-clean-border: rgba(148, 163, 184, 0.18);
    --mp-clean-border-strong: rgba(148, 163, 184, 0.28);
    --mp-clean-text: #f8fafc;
    --mp-clean-muted: rgba(226, 232, 240, 0.7);
}

:root[data-theme="light"] body.page-model-portfolio-detail .model-portfolio-page {
    --mp-clean-surface: #ffffff;
    --mp-clean-surface-soft: #f6f8fa;
    --mp-clean-border: #d8e1ea;
    --mp-clean-border-strong: #c4d0dc;
    --mp-clean-text: #10253b;
    --mp-clean-muted: #52677b;
}

body.page-model-portfolio-detail .model-portfolio-page > .container {
    max-width: 1200px;
}

body.page-model-portfolio-detail .model-portfolio-page .directory-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 1.5rem;
    margin: 0.75rem 0 0 !important;
    padding: 1.4rem 0 1.25rem !important;
    overflow: visible;
    border: 0 !important;
    border-bottom: 1px solid var(--mp-clean-border) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.page-model-portfolio-detail .model-portfolio-page .directory-header::before {
    display: none !important;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-header-main {
    gap: 0.48rem;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-header-main > .text-link {
    width: max-content;
    margin-bottom: 0.25rem;
    font-size: 0.83rem;
    font-weight: 700;
    text-decoration: none;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-header-eyebrow {
    color: var(--mp-clean-muted) !important;
    font-size: 0.7rem;
    letter-spacing: 0.09em;
}

body.page-model-portfolio-detail .model-portfolio-page .directory-header h1 {
    margin: 0 !important;
    color: var(--mp-clean-text) !important;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.045em;
    line-height: 1.04;
}

body.page-model-portfolio-detail .model-portfolio-page .directory-header .model-portfolio-header-description {
    max-width: 62ch;
    margin: 0.2rem 0 0;
    color: var(--mp-clean-text) !important;
    font-size: 1rem;
    line-height: 1.55;
}

body.page-model-portfolio-detail .model-portfolio-page .directory-header .stock-analysis-byline {
    max-width: none;
    margin: 0.2rem 0 0;
    color: var(--mp-clean-muted) !important;
    font-size: 0.8rem;
    line-height: 1.5;
}

body.page-model-portfolio-detail .model-portfolio-page .directory-header-meta {
    align-self: end;
    display: flex !important;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-currency-form {
    min-height: 40px;
    padding: 0 0.5rem;
    border: 1px solid var(--mp-clean-border-strong);
    border-radius: 9px;
    background: var(--mp-clean-surface);
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-currency-form select {
    min-height: 38px;
    color: var(--mp-clean-text);
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-quick-nav {
    top: var(--public-header-offset);
    gap: 1.35rem;
    margin: 0 0 1rem;
    padding: 0;
    overflow-x: auto;
    border: 0;
    border-bottom: 1px solid var(--mp-clean-border);
    border-radius: 0;
    background: color-mix(in srgb, var(--mp-clean-surface) 94%, transparent);
    box-shadow: none;
    scrollbar-width: none;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-quick-nav::-webkit-scrollbar {
    display: none;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-quick-nav .model-portfolio-filter-pill {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0.1rem 0;
    border: 0 !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--mp-clean-muted) !important;
    font-weight: 700;
    box-shadow: none !important;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-quick-nav .model-portfolio-filter-pill.is-active {
    border-bottom-color: #0f7895 !important;
    color: var(--mp-clean-text) !important;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-overview-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
    gap: 1rem !important;
    margin-bottom: 1rem !important;
}

body.page-model-portfolio-detail .model-portfolio-page :where(.model-portfolio-panel, .portfolio-holdings-shell) {
    border: 1px solid var(--mp-clean-border) !important;
    border-radius: 14px !important;
    background: var(--mp-clean-surface) !important;
    box-shadow: none !important;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-panel::before,
body.page-model-portfolio-detail .model-portfolio-page .portfolio-holdings-shell::before {
    display: none !important;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-panel-head {
    align-items: start;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--mp-clean-border);
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-panel-head h2,
body.page-model-portfolio-detail .model-portfolio-page .portfolio-holdings-header h2 {
    color: var(--mp-clean-text) !important;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-panel-head p,
body.page-model-portfolio-detail .model-portfolio-page .portfolio-holdings-meta {
    color: var(--mp-clean-muted) !important;
    font-size: 0.84rem;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-return-summary {
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1.2fr);
    gap: 1.25rem;
    align-items: stretch;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-return-primary {
    display: grid;
    align-content: center;
    gap: 0.55rem;
    min-height: 108px;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-return-primary > span,
body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-return-benchmark span {
    color: var(--mp-clean-muted) !important;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-return-period {
    color: var(--mp-clean-muted);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.35;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-overview-value {
    color: var(--mp-clean-text);
    font-size: clamp(2.55rem, 5vw, 4.15rem);
    line-height: 0.95;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-return-benchmark {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--mp-clean-border);
    border-radius: 10px;
    background: var(--mp-clean-surface-soft);
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-return-benchmark > div {
    display: grid;
    align-content: center;
    gap: 0.4rem;
    min-width: 0;
    padding: 0.9rem 1rem;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-return-benchmark > div + div {
    border-left: 1px solid var(--mp-clean-border);
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-return-benchmark strong {
    color: var(--mp-clean-text) !important;
    font-size: 1rem;
    line-height: 1.35;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-overview-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid var(--mp-clean-border);
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-overview-stat {
    gap: 0.35rem;
    padding: 0.85rem 0.9rem 0.25rem 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-overview-stat + .model-portfolio-overview-stat {
    padding-left: 0.9rem;
    border-left: 1px solid var(--mp-clean-border);
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-overview-stat span,
body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-overview-list-row span {
    color: var(--mp-clean-muted) !important;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-overview-stat strong,
body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-overview-list-row strong {
    color: var(--mp-clean-text) !important;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-card-actions {
    gap: 0.55rem;
    padding-top: 0.15rem;
}

body.page-model-portfolio-detail .model-portfolio-page :where(.model-portfolio-history-scope-note, .model-portfolio-candidate-note, .model-portfolio-performance-context) {
    margin: 0.8rem 0 0;
    padding: 0.65rem 0.75rem;
    border-left: 3px solid #2f91ad;
    border-radius: 0 7px 7px 0;
    background: color-mix(in srgb, #2f91ad 9%, transparent);
    color: var(--mp-clean-muted);
    font-size: 0.76rem;
    line-height: 1.5;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-candidate-note {
    margin-top: 0.65rem;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-performance-context {
    margin: 0.75rem 0 0;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-card-actions :where(.btn-primary, .btn-secondary) {
    min-height: 40px;
    padding: 0.55rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-overview-card-tertiary {
    align-content: start;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-overview-list-row {
    align-items: center;
    min-height: 42px;
    padding: 0.6rem 0;
    border-color: var(--mp-clean-border);
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-status-value {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.42rem;
    min-width: 0;
    color: var(--mp-clean-text);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: right;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-status-value .model-portfolio-status-ticker,
body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-status-value .model-portfolio-status-context {
    color: var(--mp-clean-text) !important;
    font-size: inherit;
    font-weight: 700;
    letter-spacing: normal;
    text-transform: none;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-status-value .model-portfolio-status-ticker {
    flex: 0 0 auto;
    gap: 0.42rem;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-status-value .model-portfolio-status-ticker .text-link {
    color: var(--mp-clean-text) !important;
    text-decoration: none;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-status-value .model-portfolio-status-ticker .text-link:hover {
    color: var(--accent-brand) !important;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-status-value .stock-logo {
    flex: 0 0 auto;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-overview-move-card {
    padding: 0.7rem 0.8rem;
    border-radius: 9px;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-dashboard-grid {
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
    align-items: start;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-dashboard-performance .model-portfolio-kpi-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--mp-clean-border);
    border-radius: 10px;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-performance-summary-hero .model-portfolio-kpi {
    align-items: flex-start;
    justify-content: center;
    min-height: 78px !important;
    padding: 0.75rem 0.8rem !important;
    border: 0;
    border-radius: 0;
    background: var(--mp-clean-surface-soft);
    text-align: left;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-performance-summary-hero .model-portfolio-kpi + .model-portfolio-kpi {
    border-left: 1px solid var(--mp-clean-border);
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-performance-summary-hero .model-portfolio-kpi label {
    color: var(--mp-clean-muted) !important;
    font-size: 0.64rem;
    letter-spacing: 0.06em;
    line-height: 1.3;
    white-space: nowrap;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-performance-summary-hero .model-portfolio-kpi strong {
    color: var(--mp-clean-text) !important;
    font-size: 1.15rem;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-performance-window {
    flex: 0 0 auto;
    border-color: var(--mp-clean-border);
    background: var(--mp-clean-surface-soft);
    color: var(--mp-clean-muted);
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-chart-shell {
    padding: 0.85rem;
    border: 1px solid var(--mp-clean-border);
    border-radius: 10px;
    background: var(--mp-clean-surface-soft);
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-chart-meta,
body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-chart-legend {
    color: var(--mp-clean-muted) !important;
    font-size: 0.76rem;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-sector-visual {
    --model-portfolio-sector-ring-size: clamp(144px, 12vw, 164px);
    grid-template-columns: 1fr;
    gap: 0.9rem;
    margin: 0;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-sector-ring-shell,
body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-sector-ring {
    width: var(--model-portfolio-sector-ring-size);
    height: var(--model-portfolio-sector-ring-size);
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-sector-ring-center {
    padding: 1.25rem;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-sector-ring-center strong {
    color: var(--mp-clean-text) !important;
    font-size: clamp(1.3rem, 1.8vw, 1.55rem);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.025em;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-sector-legend-row strong {
    color: var(--mp-clean-text) !important;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-sector-ring-center span {
    width: min(92px, 100%);
    margin-inline: auto;
    font-size: 0.69rem;
    line-height: 1.18;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-sector-legend-label {
    color: var(--mp-clean-muted) !important;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-sector-legend {
    gap: 0;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-sector-legend-row {
    padding: 0.55rem 0;
    border: 0;
    border-bottom: 1px solid var(--mp-clean-border);
    border-radius: 0;
    background: transparent;
}

body.page-model-portfolio-detail .model-portfolio-page #model-holdings {
    margin-top: 1rem;
}

body.page-model-portfolio-detail .model-portfolio-page #model-holdings .model-portfolio-filter-row {
    padding: 0.65rem 0 !important;
    border: 0;
    border-bottom: 1px solid var(--mp-clean-border);
    border-radius: 0;
    background: transparent;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-list {
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--mp-clean-border);
    border-radius: 12px;
    background: var(--mp-clean-surface);
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-col-security {
    width: 26%;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-col-allocation {
    width: 14%;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-col-price {
    width: 18%;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-col-position {
    width: 20%;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-col-status {
    width: 22%;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 th {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--mp-clean-border);
    background: var(--mp-clean-surface-soft);
    color: var(--mp-clean-muted) !important;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    line-height: 1.25;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 td {
    min-width: 0;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--mp-clean-border);
    color: var(--mp-clean-text);
    vertical-align: middle;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 tbody tr:last-child td {
    border-bottom: 0;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 tbody tr {
    transition: background-color 140ms ease;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 tbody tr:hover {
    background: var(--mp-clean-surface-soft);
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holding-security .ticker-with-logo {
    white-space: nowrap;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holding-security .model-portfolio-muted {
    margin-top: 0.38rem;
    line-height: 1.35;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holding-security .model-portfolio-table-flags {
    margin-top: 0.5rem;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holding-group > strong {
    display: block;
    min-width: 0;
    color: var(--mp-clean-text) !important;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
    white-space: nowrap;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holding-group > span {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.22rem 0.4rem;
    margin-top: 0.38rem;
    color: var(--mp-clean-muted) !important;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holding-group > span > span {
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holding-status {
    vertical-align: middle;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holding-status > div {
    display: grid;
    grid-template-columns: minmax(3.9rem, auto) minmax(0, 1fr);
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holding-status > div + div {
    margin-top: 0.48rem;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holding-status > div > span:first-child {
    color: var(--mp-clean-muted) !important;
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    line-height: 1.25;
    text-transform: uppercase;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holding-status > div > :last-child {
    justify-self: start;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-primary-driver {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    min-height: 28px;
    padding: 0.28rem 0.52rem;
    border: 1px solid var(--mp-clean-border);
    border-radius: 999px;
    background: var(--mp-clean-surface-soft);
    color: var(--mp-clean-text) !important;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

@media (max-width: 900px) {
    body.page-model-portfolio-detail .model-portfolio-page .directory-header,
    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-overview-grid,
    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-dashboard-grid {
        grid-template-columns: 1fr;
    }

    body.page-model-portfolio-detail .model-portfolio-page .directory-header-meta {
        justify-content: flex-start;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-dashboard-performance .model-portfolio-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-performance-summary-hero .model-portfolio-kpi:nth-child(4) {
        border-left: 0;
    }
}

@media (max-width: 640px) {
    body.page-model-portfolio-detail .model-portfolio-page .directory-header {
        padding: 1rem 0 !important;
    }

    body.page-model-portfolio-detail .model-portfolio-page .directory-header h1 {
        font-size: clamp(1.75rem, 9vw, 2.35rem) !important;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-currency-form {
        width: auto;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-return-summary,
    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-return-benchmark {
        grid-template-columns: 1fr;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-return-benchmark > div + div {
        border-top: 1px solid var(--mp-clean-border);
        border-left: 0;
    }

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

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-overview-stat:nth-child(3) {
        padding-left: 0;
        border-left: 0;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-dashboard-performance .model-portfolio-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-performance-summary-hero .model-portfolio-kpi:nth-child(odd) {
        border-left: 0;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-card-actions :where(.btn-primary, .btn-secondary) {
        width: 100%;
        justify-content: center;
    }

    body.page-model-portfolio-detail .model-portfolio-page #model-holdings .model-portfolio-filter-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        overflow: hidden;
    }

    body.page-model-portfolio-detail .model-portfolio-page #model-holdings .model-portfolio-filter-group {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        contain: inline-size layout paint;
    }
}

@media (max-width: 720px) {
    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-list {
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2,
    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 tbody {
        display: block;
        width: 100%;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 :where(colgroup, thead) {
        display: none;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 tbody {
        display: grid;
        gap: 0.75rem;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: hidden;
        border: 1px solid var(--mp-clean-border);
        border-radius: 12px;
        background: var(--mp-clean-surface);
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 td {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
        padding: 0.72rem 0.8rem;
        border-bottom: 1px solid var(--mp-clean-border);
        vertical-align: top;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 tbody tr:last-child td {
        border-bottom: 1px solid var(--mp-clean-border);
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 tbody tr td:last-child {
        border-bottom: 0;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 td::before {
        content: attr(data-label);
        margin-bottom: 0.42rem;
        color: var(--mp-clean-muted);
        font-size: 0.61rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        line-height: 1.2;
        text-transform: uppercase;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 td:nth-child(even) {
        border-right: 1px solid var(--mp-clean-border);
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 .model-portfolio-holding-security {
        grid-column: 1 / -1;
        border-right: 0;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 .model-portfolio-holding-security::before,
    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 .model-portfolio-holding-status::before {
        display: none;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holding-status {
        gap: 0.52rem;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holding-status > div + div {
        margin-top: 0;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holding-status > div {
        grid-template-columns: minmax(3.6rem, auto) minmax(0, 1fr);
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-primary-driver {
        white-space: normal;
    }
}

@media (max-width: 440px) {
    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 tbody tr {
        grid-template-columns: minmax(0, 1fr);
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 .model-portfolio-holding-security {
        grid-column: 1;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-holdings-table-v2 td {
        border-right: 0 !important;
    }
}

/* Authenticated portfolio workspace: restrained, data-first and consistent. */
body.page-portfolio .portfolio-page {
    --portfolio-pro-surface: #0b1728;
    --portfolio-pro-surface-muted: #0f1e32;
    --portfolio-pro-border: #273b55;
    --portfolio-pro-border-strong: #375371;
    --portfolio-pro-text: #f3f7fb;
    --portfolio-pro-text-soft: #a8bbcf;
    --portfolio-pro-accent: #55c7ee;
    --portfolio-pro-positive: #48c78e;
    --portfolio-pro-warning: #f2b84b;
    --portfolio-pro-negative: #ff737d;
    --portfolio-pro-radius: 12px;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page {
    --portfolio-pro-surface: #ffffff;
    --portfolio-pro-surface-muted: #f5f8fb;
    --portfolio-pro-border: #d5e0ea;
    --portfolio-pro-border-strong: #b9cbd9;
    --portfolio-pro-text: #10253d;
    --portfolio-pro-text-soft: #536980;
    --portfolio-pro-accent: #096a96;
    --portfolio-pro-positive: #087a57;
    --portfolio-pro-warning: #9a5b08;
    --portfolio-pro-negative: #c8273d;
}

body.page-portfolio .portfolio-page :where(h1, h2, h3, th, td, label, button, .portfolio-chip, .detail-chip) {
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}

body.page-portfolio .portfolio-page .portfolio-layout {
    grid-template-columns: 228px minmax(0, 1fr);
    gap: 1.25rem;
    margin-top: 1.25rem;
}

body.page-portfolio .portfolio-page .sidebar {
    top: calc(var(--public-header-offset) + 0.75rem);
    padding: 0.85rem;
    border: 1px solid var(--portfolio-pro-border) !important;
    border-radius: var(--portfolio-pro-radius) !important;
    background: var(--portfolio-pro-surface) !important;
    box-shadow: none !important;
}

body.page-portfolio .portfolio-page .sidebar-header {
    margin-bottom: 0.65rem;
    padding: 0 0.35rem 0.55rem;
    border-bottom: 1px solid var(--portfolio-pro-border);
}

body.page-portfolio .portfolio-page .p-nav-item {
    margin: 0;
    padding: 0.68rem 0.72rem;
    border: 0 !important;
    border-left: 3px solid transparent !important;
    border-radius: 7px !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.page-portfolio .portfolio-page .p-nav-item + .p-nav-item {
    margin-top: 0.2rem;
}

body.page-portfolio .portfolio-page .p-nav-item:hover,
body.page-portfolio .portfolio-page .p-nav-item.active {
    border-left-color: var(--portfolio-pro-accent) !important;
    background: color-mix(in srgb, var(--portfolio-pro-accent) 9%, transparent) !important;
}

body.page-portfolio .portfolio-page .p-nav-name,
body.page-portfolio .portfolio-page .p-nav-item.active .p-nav-name {
    color: var(--portfolio-pro-text) !important;
}

body.page-portfolio .portfolio-page .create-p-btn {
    margin-top: 0.55rem;
    border-color: var(--portfolio-pro-border-strong);
    border-radius: 8px;
    color: var(--portfolio-pro-text-soft);
    opacity: 1;
}

body.page-portfolio .portfolio-page .portfolio-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.25rem;
    align-items: center;
    padding: 1.15rem 1.25rem !important;
    border: 1px solid var(--portfolio-pro-border) !important;
    border-top: 1px solid var(--portfolio-pro-border) !important;
    border-left: 4px solid var(--portfolio-pro-accent) !important;
    border-radius: var(--portfolio-pro-radius) !important;
    background: var(--portfolio-pro-surface) !important;
    box-shadow: 0 8px 24px rgba(4, 15, 30, 0.08) !important;
}

body.page-portfolio .portfolio-page .portfolio-toolbar-main {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 1.5rem;
    align-items: center;
}

body.page-portfolio .portfolio-page .portfolio-context {
    gap: 0.2rem;
}

body.page-portfolio .portfolio-page .portfolio-toolbar-eyebrow {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--portfolio-pro-accent) !important;
    font-size: 0.66rem;
    letter-spacing: 0.13em;
}

body.page-portfolio .portfolio-page .portfolio-title {
    margin: 0.12rem 0 0;
    color: var(--portfolio-pro-text) !important;
    font-size: clamp(1.55rem, 2.1vw, 2rem) !important;
    line-height: 1.08;
    letter-spacing: -0.035em;
}

body.page-portfolio .portfolio-page .portfolio-page-subtitle {
    margin: 0.28rem 0 0;
    color: var(--portfolio-pro-text-soft) !important;
    font-size: 0.83rem;
}

body.page-portfolio .portfolio-page .portfolio-meta {
    margin-top: 0.6rem;
    gap: 0.35rem;
}

body.page-portfolio .portfolio-page .portfolio-chip {
    min-height: 0;
    padding: 0.24rem 0.5rem;
    border: 1px solid var(--portfolio-pro-border) !important;
    border-radius: 6px !important;
    background: var(--portfolio-pro-surface-muted) !important;
    color: var(--portfolio-pro-text-soft) !important;
    font-size: 0.66rem;
    font-weight: 750;
}

body.page-portfolio .portfolio-page .portfolio-toolbar-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(7.5rem, 1fr));
    gap: 0;
    min-width: 17rem;
}

body.page-portfolio .portfolio-page .portfolio-toolbar-summary-item {
    padding: 0.15rem 0.9rem !important;
    border: 0 !important;
    border-left: 1px solid var(--portfolio-pro-border) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.page-portfolio .portfolio-page .portfolio-toolbar-summary-label {
    margin-bottom: 0.28rem;
    color: var(--portfolio-pro-text-soft) !important;
    font-size: 0.6rem;
}

body.page-portfolio .portfolio-page .portfolio-toolbar-summary-value {
    color: var(--portfolio-pro-text) !important;
    font-size: 0.94rem;
    font-variant-numeric: tabular-nums;
}

body.page-portfolio .portfolio-page .toolbar-actions {
    gap: 0.5rem;
}

body.page-portfolio .portfolio-page .toolbar-actions :where(.btn-secondary, .settings-open-btn, .currency-form, select) {
    border-radius: 8px !important;
    box-shadow: none !important;
}

body.page-portfolio .portfolio-page .toolbar-actions .currency-form {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

body.page-portfolio .portfolio-page .portfolio-breadcrumb {
    margin: 0.5rem 0 0;
    padding-inline: 0.25rem;
}

body.page-portfolio .portfolio-page .portfolio-sticky-nav {
    margin: 0.75rem 0 1rem;
    padding: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid var(--portfolio-pro-border) !important;
    border-radius: 0 !important;
    background: var(--portfolio-pro-surface) !important;
    box-shadow: none !important;
}

body.page-portfolio .portfolio-page .portfolio-section-nav,
body.page-portfolio .portfolio-page .portfolio-section-nav-shell,
body.page-portfolio .portfolio-page .portfolio-subnav-shell {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.page-portfolio .portfolio-page .portfolio-section-link,
body.page-portfolio .portfolio-page .portfolio-subnav-link {
    min-height: 42px;
    padding: 0.65rem 0.9rem;
    border: 0 !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--portfolio-pro-text-soft) !important;
}

body.page-portfolio .portfolio-page .portfolio-section-link:is(.active, :hover, :focus-visible),
body.page-portfolio .portfolio-page .portfolio-subnav-link:is(.active, :hover, :focus-visible) {
    border-bottom-color: var(--portfolio-pro-accent) !important;
    background: transparent !important;
    color: var(--portfolio-pro-text) !important;
}

body.page-portfolio .portfolio-page .portfolio-workflow-guide {
    margin: 0 0 1rem;
    padding: 0.95rem !important;
    border: 1px solid var(--portfolio-pro-border) !important;
    border-radius: var(--portfolio-pro-radius) !important;
    background: var(--portfolio-pro-surface-muted) !important;
    box-shadow: none !important;
}

body.page-portfolio .portfolio-page .portfolio-workflow-step {
    border-color: var(--portfolio-pro-border) !important;
    border-radius: 8px !important;
    background: var(--portfolio-pro-surface) !important;
    box-shadow: none !important;
}

body.page-portfolio .portfolio-page .portfolio-stats-controls {
    margin-bottom: 0.5rem;
}

body.page-portfolio .portfolio-page .totals-mode-toggle {
    border: 1px solid var(--portfolio-pro-border) !important;
    border-radius: 8px !important;
    background: var(--portfolio-pro-surface-muted) !important;
    box-shadow: none !important;
}

body.page-portfolio .portfolio-page .totals-mode-btn {
    border-radius: 6px !important;
}

body.page-portfolio .portfolio-page .totals-mode-btn.is-active {
    background: var(--portfolio-pro-surface) !important;
    box-shadow: inset 0 0 0 1px var(--portfolio-pro-border-strong) !important;
    color: var(--portfolio-pro-text) !important;
}

body.page-portfolio .portfolio-page .top-stats {
    overflow: hidden;
    padding: 0 !important;
    border: 1px solid var(--portfolio-pro-border) !important;
    border-radius: var(--portfolio-pro-radius) !important;
    background: var(--portfolio-pro-surface) !important;
    box-shadow: none !important;
}

body.page-portfolio .portfolio-page .portfolio-primary-grid {
    grid-template-columns: minmax(7rem, 0.8fr) minmax(10rem, 1.2fr) minmax(10rem, 1.2fr) minmax(9rem, 1fr) minmax(9rem, 1fr) !important;
    gap: 0 !important;
}

body.page-portfolio .portfolio-page .portfolio-primary-grid > :where(.eval-panel, .value-panel) {
    grid-column: auto !important;
    min-width: 0;
    min-height: 7.5rem;
    padding: 1rem !important;
    border: 0 !important;
    border-left: 1px solid var(--portfolio-pro-border) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.page-portfolio .portfolio-page .portfolio-primary-grid > :first-child {
    border-left: 0 !important;
}

body.page-portfolio .portfolio-page .eval-status {
    color: var(--portfolio-pro-text-soft) !important;
    font-size: 0.63rem;
    letter-spacing: 0.09em;
    overflow-wrap: normal;
    word-break: normal;
    white-space: nowrap;
}

body.page-portfolio .portfolio-page :where(.eval-score, .value-amount) {
    color: var(--portfolio-pro-text) !important;
    font-size: clamp(1.15rem, 1.7vw, 1.5rem) !important;
    font-variant-numeric: tabular-nums;
}

body.page-portfolio .portfolio-page :where(.value-meta-note, .eval-score-delta-meta) {
    color: var(--portfolio-pro-text-soft) !important;
    font-size: 0.72rem;
    line-height: 1.4;
}

body.page-portfolio .portfolio-page .portfolio-overview-focus-grid {
    overflow: hidden;
    gap: 0 !important;
    margin: 0 0 1rem;
    border: 1px solid var(--portfolio-pro-border);
    border-radius: var(--portfolio-pro-radius);
    background: var(--portfolio-pro-surface);
}

body.page-portfolio .portfolio-page .portfolio-overview-focus-card {
    position: relative;
    min-height: 100%;
    padding: 1rem 1.05rem 1.05rem !important;
    border: 0 !important;
    border-left: 1px solid var(--portfolio-pro-border) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.page-portfolio .portfolio-page .portfolio-overview-focus-card:first-child {
    border-left: 0 !important;
}

body.page-portfolio .portfolio-page .portfolio-overview-focus-label {
    gap: 0.42rem;
    margin-bottom: 0.55rem;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--portfolio-pro-text-soft) !important;
}

body.page-portfolio .portfolio-page .portfolio-overview-focus-label::before {
    content: "";
    width: 0.42rem;
    height: 0.42rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--portfolio-pro-warning);
}

body.page-portfolio .portfolio-page .portfolio-overview-focus-card.tone-good .portfolio-overview-focus-label::before {
    background: var(--portfolio-pro-positive);
}

body.page-portfolio .portfolio-page .portfolio-overview-focus-card.tone-risk .portfolio-overview-focus-label::before {
    background: var(--portfolio-pro-negative);
}

body.page-portfolio .portfolio-page .portfolio-overview-focus-card h3 {
    color: var(--portfolio-pro-text) !important;
    font-size: 0.98rem;
}

body.page-portfolio .portfolio-page .portfolio-overview-focus-card p {
    color: var(--portfolio-pro-text-soft) !important;
    font-size: 0.83rem;
    line-height: 1.5;
}

body.page-portfolio .portfolio-page .portfolio-overview-focus-btn {
    min-height: 36px;
    padding: 0.45rem 0.7rem;
    border-color: var(--portfolio-pro-border-strong) !important;
    border-radius: 7px !important;
    background: transparent !important;
    color: var(--portfolio-pro-text) !important;
}

body.page-portfolio .portfolio-page :where(
    .holdings-container,
    .portfolio-overview-context-details,
    .chart-container,
    .charts-grid,
    .optimizer-section,
    .optimizer-suggestions,
    .estimate-section,
    .estimate-card,
    .summary-card,
    .detail-card
) {
    border: 1px solid var(--portfolio-pro-border) !important;
    border-top: 1px solid var(--portfolio-pro-border) !important;
    border-radius: var(--portfolio-pro-radius) !important;
    background: var(--portfolio-pro-surface) !important;
    box-shadow: none !important;
}

body.page-portfolio .portfolio-page .holdings-container {
    overflow-x: auto;
    margin-bottom: 1rem;
}

body.page-portfolio .portfolio-page .holdings-header {
    padding: 1rem 1.05rem;
    border-bottom: 1px solid var(--portfolio-pro-border);
}

body.page-portfolio .portfolio-page .holdings-header h3 {
    color: var(--portfolio-pro-text) !important;
    font-size: 1.05rem;
}

body.page-portfolio .portfolio-page :where(.holdings-header-note, .holdings-header-guide) {
    color: var(--portfolio-pro-text-soft) !important;
}

body.page-portfolio .portfolio-page .holdings-header-chip,
body.page-portfolio .portfolio-page .detail-chip {
    border-color: var(--portfolio-pro-border) !important;
    background: var(--portfolio-pro-surface-muted) !important;
    color: var(--portfolio-pro-text-soft) !important;
}

body.page-portfolio .portfolio-page .holdings-table {
    margin: 0;
}

body.page-portfolio .portfolio-page .holdings-table thead th {
    padding-block: 0.72rem;
    background: var(--portfolio-pro-surface-muted) !important;
    color: var(--portfolio-pro-text-soft) !important;
    white-space: nowrap;
}

body.page-portfolio .portfolio-page .holdings-table td {
    border-color: var(--portfolio-pro-border) !important;
    color: var(--portfolio-pro-text-soft);
}

body.page-portfolio .portfolio-page .holdings-table :where(.holding-stock-link, strong) {
    color: var(--portfolio-pro-text);
}

body.page-portfolio .portfolio-page .portfolio-overview-context-details > summary {
    color: var(--portfolio-pro-text) !important;
}

/* Override the older high-specificity light-theme card treatments. */
:root[data-theme="light"] body.page-portfolio .portfolio-page .portfolio-toolbar-summary-item {
    border: 0 !important;
    border-left: 1px solid var(--portfolio-pro-border) !important;
    background: transparent !important;
    box-shadow: none !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page .portfolio-primary-grid > :where(.eval-panel, .value-panel),
:root[data-theme="light"] body.page-portfolio .portfolio-page .portfolio-primary-grid > :where(.eval-panel, .value-panel).tone-good,
:root[data-theme="light"] body.page-portfolio .portfolio-page .portfolio-primary-grid > :where(.eval-panel, .value-panel).tone-warn,
:root[data-theme="light"] body.page-portfolio .portfolio-page .portfolio-primary-grid > :where(.eval-panel, .value-panel).tone-risk {
    border: 0 !important;
    border-left: 1px solid var(--portfolio-pro-border) !important;
    background: transparent !important;
    box-shadow: none !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page .portfolio-primary-grid > :first-child {
    border-left: 0 !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page .portfolio-overview-focus-card,
:root[data-theme="light"] body.page-portfolio .portfolio-page .portfolio-overview-focus-card.tone-good,
:root[data-theme="light"] body.page-portfolio .portfolio-page .portfolio-overview-focus-card.tone-warn,
:root[data-theme="light"] body.page-portfolio .portfolio-page .portfolio-overview-focus-card.tone-risk {
    border: 0 !important;
    border-left: 1px solid var(--portfolio-pro-border) !important;
    background: transparent !important;
    box-shadow: none !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page .portfolio-overview-focus-card:first-child {
    border-left: 0 !important;
}

@media (max-width: 1100px) {
    body.page-portfolio .portfolio-page .portfolio-toolbar {
        grid-template-columns: 1fr;
    }

    body.page-portfolio .portfolio-page .toolbar-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 900px) {
    body.page-portfolio .portfolio-page .portfolio-layout {
        grid-template-columns: minmax(0, 1fr);
        margin-top: 0.9rem;
    }

    body.page-portfolio .portfolio-page .portfolio-toolbar-main {
        grid-template-columns: minmax(0, 1fr) auto !important;
    }
}

@media (max-width: 780px) {
    body.page-portfolio .portfolio-page .portfolio-toolbar {
        padding: 1rem !important;
    }

    body.page-portfolio .portfolio-page .portfolio-toolbar-main {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    body.page-portfolio .portfolio-page .portfolio-toolbar-summary {
        min-width: 0;
        width: 100%;
        border-top: 1px solid var(--portfolio-pro-border);
        padding-top: 0.8rem;
    }

    body.page-portfolio .portfolio-page .portfolio-toolbar-summary-item:first-child {
        padding-left: 0 !important;
        border-left: 0 !important;
    }

    :root[data-theme="light"] body.page-portfolio .portfolio-page .portfolio-toolbar-summary-item:first-child {
        border-left: 0 !important;
    }

    body.page-portfolio .portfolio-page .portfolio-primary-grid {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x proximity;
    }

    body.page-portfolio .portfolio-page .portfolio-primary-grid > :where(.eval-panel, .value-panel) {
        flex: 0 0 min(78vw, 13rem);
        min-height: 7rem;
        border-left: 1px solid var(--portfolio-pro-border) !important;
        scroll-snap-align: start;
    }

    body.page-portfolio .portfolio-page .portfolio-primary-grid > :first-child {
        border-left: 0 !important;
    }

    body.page-portfolio .portfolio-page .portfolio-overview-focus-grid {
        grid-template-columns: 1fr;
    }

    body.page-portfolio .portfolio-page .portfolio-overview-focus-card,
    body.page-portfolio .portfolio-page .portfolio-overview-focus-card:first-child {
        border-left: 0 !important;
        border-top: 1px solid var(--portfolio-pro-border) !important;
    }

    body.page-portfolio .portfolio-page .portfolio-overview-focus-card:first-child {
        border-top: 0 !important;
    }

    :root[data-theme="light"] body.page-portfolio .portfolio-page .portfolio-overview-focus-card,
    :root[data-theme="light"] body.page-portfolio .portfolio-page .portfolio-overview-focus-card.tone-good,
    :root[data-theme="light"] body.page-portfolio .portfolio-page .portfolio-overview-focus-card.tone-warn,
    :root[data-theme="light"] body.page-portfolio .portfolio-page .portfolio-overview-focus-card.tone-risk {
        border-left: 0 !important;
        border-top: 1px solid var(--portfolio-pro-border) !important;
    }

    :root[data-theme="light"] body.page-portfolio .portfolio-page .portfolio-overview-focus-card:first-child {
        border-top: 0 !important;
    }
}

@media (max-width: 520px) {
    body.page-portfolio .portfolio-page .toolbar-actions {
        grid-template-columns: 1fr !important;
    }

    body.page-portfolio .portfolio-page .toolbar-actions .currency-form {
        grid-column: auto !important;
    }

    body.page-portfolio .portfolio-page .portfolio-section-link,
    body.page-portfolio .portfolio-page .portfolio-subnav-link {
        padding-inline: 0.72rem;
    }
}

/* Transaction-derived cash: visible on the overview and reconcilable to the ledger. */
body.page-portfolio .portfolio-page .portfolio-cash-primary {
    position: relative;
}

body.page-portfolio .portfolio-page .portfolio-cash-primary .value-amount {
    white-space: nowrap;
}

body.page-portfolio .portfolio-page .portfolio-cash-reconciled-meta {
    line-height: 1.35;
}

body.page-portfolio .portfolio-page .portfolio-cash-audit-link {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    margin-top: 0.42rem;
    color: var(--portfolio-pro-accent) !important;
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.3;
    text-decoration: none;
}

body.page-portfolio .portfolio-page .portfolio-cash-audit-link::after {
    content: "\2192";
}

body.page-portfolio .portfolio-page .portfolio-cash-audit-link:hover {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

body.page-portfolio .portfolio-page .tx-cash-reconciliation {
    display: grid;
    grid-template-columns: minmax(10rem, 0.6fr) minmax(0, 1.4fr) auto;
    align-items: center;
    gap: 1rem;
    margin: 0 0 0.85rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--portfolio-pro-border);
    border-left: 4px solid var(--portfolio-pro-positive);
    border-radius: var(--portfolio-pro-radius);
    background: var(--portfolio-pro-surface);
}

body.page-portfolio .portfolio-page .tx-cash-reconciliation.is-negative {
    border-left-color: var(--portfolio-pro-negative);
}

body.page-portfolio .portfolio-page .tx-cash-reconciliation-value {
    min-width: 0;
}

body.page-portfolio .portfolio-page .tx-cash-reconciliation-value > span {
    display: block;
    color: var(--portfolio-pro-text-soft);
    font-size: 0.63rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

body.page-portfolio .portfolio-page .tx-cash-reconciliation-value > strong {
    display: block;
    margin-top: 0.28rem;
    color: var(--portfolio-pro-positive);
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
    white-space: nowrap;
}

body.page-portfolio .portfolio-page .tx-cash-reconciliation.is-negative .tx-cash-reconciliation-value > strong {
    color: var(--portfolio-pro-negative);
}

body.page-portfolio .portfolio-page .tx-cash-reconciliation-value small {
    color: var(--portfolio-pro-text-soft);
    font-size: 0.68em;
}

body.page-portfolio .portfolio-page .tx-cash-reconciliation-copy {
    min-width: 0;
}

body.page-portfolio .portfolio-page .tx-cash-reconciliation-copy strong {
    display: block;
    color: var(--portfolio-pro-text);
    font-size: 0.82rem;
    line-height: 1.35;
}

body.page-portfolio .portfolio-page .tx-cash-reconciliation-copy p,
body.page-portfolio .portfolio-page .tx-cash-reconciliation-copy span {
    margin: 0.18rem 0 0;
    color: var(--portfolio-pro-text-soft);
    font-size: 0.72rem;
    line-height: 1.4;
}

body.page-portfolio .portfolio-page .tx-cash-reconciliation-copy span {
    display: block;
}

@media (max-width: 820px) {
    body.page-portfolio .portfolio-page .tx-cash-reconciliation {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    body.page-portfolio .portfolio-page .tx-cash-reconciliation .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* Portfolio evaluator: a compact professional review surface. */
body.page-portfolio .portfolio-page.portfolio-evaluator-page .accounting-summary-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.65rem !important;
    margin: 0 0 0.85rem;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(.top-stats-primary, .top-stats-secondary) {
    display: grid;
    gap: 0 !important;
    overflow: hidden;
    border: 1px solid var(--portfolio-pro-border);
    border-radius: var(--portfolio-pro-radius);
    background: var(--portfolio-pro-surface);
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .top-stats-primary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .top-stats-secondary {
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    background: var(--portfolio-pro-surface-muted);
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(.top-stats-primary, .top-stats-secondary) .summary-card {
    min-width: 0;
    min-height: 7rem;
    padding: 0.9rem 1rem !important;
    border: 0 !important;
    border-left: 1px solid var(--portfolio-pro-border) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(.top-stats-primary, .top-stats-secondary) .summary-card:first-child {
    border-left: 0 !important;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .summary-card .label {
    color: var(--portfolio-pro-text-soft) !important;
    font-size: 0.62rem;
    letter-spacing: 0.09em;
    white-space: nowrap;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .summary-card .value {
    color: var(--portfolio-pro-text) !important;
    font-size: clamp(1.2rem, 1.8vw, 1.55rem) !important;
    font-variant-numeric: tabular-nums;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .summary-card .meta {
    color: var(--portfolio-pro-text-soft) !important;
    line-height: 1.4;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-panel {
    margin: 0 0 0.85rem;
    padding: 1rem 1.05rem;
    border: 1px solid var(--portfolio-pro-border);
    border-left: 4px solid var(--portfolio-pro-warning);
    border-radius: var(--portfolio-pro-radius);
    background: var(--portfolio-pro-surface);
    box-shadow: none;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-panel.tone-good {
    border-left-color: var(--portfolio-pro-positive);
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-panel.tone-risk {
    border-left-color: var(--portfolio-pro-negative);
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.85rem;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-head > div {
    min-width: 0;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-kicker {
    display: block;
    margin-bottom: 0.32rem;
    color: var(--portfolio-pro-accent);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-head h2 {
    margin: 0;
    color: var(--portfolio-pro-text);
    font-size: 1.08rem;
    line-height: 1.25;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-head p {
    max-width: 65ch;
    margin: 0.28rem 0 0;
    color: var(--portfolio-pro-text-soft);
    font-size: 0.82rem;
    line-height: 1.5;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-head .btn-secondary {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0.48rem 0.75rem;
    border-radius: 7px;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--portfolio-pro-border);
    border-radius: 9px;
    background: var(--portfolio-pro-surface-muted);
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-stat {
    display: grid;
    align-content: start;
    gap: 0.28rem;
    min-width: 0;
    padding: 0.85rem 0.9rem;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-stat + .portfolio-evaluator-cash-stat {
    border-left: 1px solid var(--portfolio-pro-border);
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-stat.is-target {
    background: color-mix(in srgb, var(--portfolio-pro-accent) 7%, transparent);
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-stat span {
    color: var(--portfolio-pro-text-soft);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-stat strong {
    color: var(--portfolio-pro-text);
    font-size: clamp(1rem, 1.55vw, 1.28rem);
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-stat small {
    color: var(--portfolio-pro-text-soft);
    font-size: 0.72rem;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-guidance {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.8rem;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-guidance strong {
    color: var(--portfolio-pro-text);
    font-size: 0.84rem;
    line-height: 1.45;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-guidance span {
    color: var(--portfolio-pro-text-soft);
    font-size: 0.72rem;
    line-height: 1.4;
    text-align: right;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-start-panel {
    grid-template-columns: minmax(12rem, 0.55fr) minmax(0, 1.45fr) !important;
    gap: 0 !important;
    margin: 0 0 0.85rem;
    padding: 0 !important;
    overflow: hidden;
    border: 1px solid var(--portfolio-pro-border) !important;
    border-radius: var(--portfolio-pro-radius) !important;
    background: var(--portfolio-pro-surface) !important;
    box-shadow: none !important;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-start-copy {
    padding: 1rem;
    border-right: 1px solid var(--portfolio-pro-border);
    background: var(--portfolio-pro-surface-muted);
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-start-copy span,
body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-start-item span {
    color: var(--portfolio-pro-accent) !important;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-start-copy h3,
body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-start-item strong {
    color: var(--portfolio-pro-text) !important;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-start-copy p,
body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-start-item small {
    color: var(--portfolio-pro-text-soft) !important;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-start-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-start-item {
    padding: 1rem 1.05rem !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-evidence-panel {
    margin: 0 0 0.85rem;
    border: 1px solid var(--portfolio-pro-border) !important;
    border-radius: var(--portfolio-pro-radius) !important;
    background: var(--portfolio-pro-surface) !important;
    box-shadow: none !important;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-evidence-panel > summary {
    padding: 0.9rem 2.5rem 0.9rem 1rem;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-evidence-panel > summary strong {
    color: var(--portfolio-pro-text) !important;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-evidence-panel > summary small {
    color: var(--portfolio-pro-text-soft) !important;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(
    .evaluator-steps-section,
    .evaluator-tax-section,
    .evaluator-delta-section,
    .evaluator-holdings-section,
    .evaluator-history-section,
    .evaluator-detail-grid
) {
    border-color: var(--portfolio-pro-border) !important;
    border-radius: var(--portfolio-pro-radius) !important;
    background: var(--portfolio-pro-surface) !important;
    box-shadow: none !important;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .split-header h3 {
    padding-left: 0 !important;
    border-left: 0 !important;
    color: var(--portfolio-pro-text) !important;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page .split-header .subtitle {
    color: var(--portfolio-pro-text-soft) !important;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(.evaluator-step-card, .audit-holding-card, .detail-card) {
    border-color: var(--portfolio-pro-border) !important;
    border-radius: 9px !important;
    background: var(--portfolio-pro-surface-muted) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(.top-stats-primary, .top-stats-secondary) .summary-card,
:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(.top-stats-primary, .top-stats-secondary) .summary-card.tone-good,
:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(.top-stats-primary, .top-stats-secondary) .summary-card.tone-warn,
:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(.top-stats-primary, .top-stats-secondary) .summary-card.tone-risk {
    border: 0 !important;
    border-left: 1px solid var(--portfolio-pro-border) !important;
    background: transparent !important;
    box-shadow: none !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(.top-stats-primary, .top-stats-secondary) .summary-card:first-child {
    border-left: 0 !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(
    .portfolio-evaluator-cash-panel,
    .portfolio-evaluator-start-panel,
    .portfolio-evaluator-evidence-panel,
    .evaluator-steps-section,
    .evaluator-tax-section,
    .evaluator-delta-section,
    .evaluator-holdings-section,
    .evaluator-history-section,
    .evaluator-detail-grid
) {
    border-color: var(--portfolio-pro-border) !important;
    background: var(--portfolio-pro-surface) !important;
    box-shadow: none !important;
}

/* Evaluator light mode: keep every data and audit layer above WCAG AA contrast. */
:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page {
    --portfolio-pro-surface-muted: #f2f6f9;
    --portfolio-pro-border: #c7d5e1;
    --portfolio-pro-border-strong: #9fb5c7;
    --portfolio-pro-text: #10253d;
    --portfolio-pro-text-soft: #435b72;
    --portfolio-pro-accent: #075d87;
    --portfolio-pro-positive: #056647;
    --portfolio-pro-warning: #7a4305;
    --portfolio-pro-negative: #ad1f34;
    color: var(--portfolio-pro-text) !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(
    .top-stats-primary,
    .top-stats-secondary,
    .portfolio-evaluator-cash-panel,
    .portfolio-evaluator-start-panel,
    .portfolio-evaluator-evidence-panel,
    .evaluator-steps-section,
    .evaluator-tax-section,
    .evaluator-delta-section,
    .evaluator-holdings-section,
    .evaluator-history-section,
    .evaluator-detail-grid,
    .detail-card,
    .audit-holding-card,
    .evaluator-step-card
) {
    border-color: var(--portfolio-pro-border) !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(
    h1,
    h2,
    h3,
    h4,
    strong,
    .value,
    .evaluator-step-value,
    .audit-step-row-value,
    .kv-value,
    .evaluator-history-table td
) {
    color: var(--portfolio-pro-text) !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(
    .portfolio-page-subtitle,
    .subtitle,
    .summary-card .meta,
    .portfolio-evaluator-cash-head p,
    .portfolio-evaluator-cash-stat small,
    .portfolio-evaluator-cash-guidance span,
    .portfolio-evaluator-start-copy p,
    .portfolio-evaluator-start-item small,
    .portfolio-evaluator-evidence-panel > summary small,
    .portfolio-priority-copy p,
    .evaluator-step-detail,
    .audit-step-row-detail,
    .detail-list,
    .detail-list li,
    .table-note,
    .kv-label
) {
    color: var(--portfolio-pro-text-soft) !important;
    opacity: 1 !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(
    .summary-card .label,
    .portfolio-evaluator-cash-kicker,
    .portfolio-evaluator-cash-stat span,
    .portfolio-evaluator-start-copy span,
    .portfolio-evaluator-start-item span,
    .portfolio-priority-eyebrow,
    .evaluator-step-title,
    .audit-step-row-title,
    .delta-group-label
) {
    color: #2f4a63 !important;
    opacity: 1 !important;
}

body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(
    .evaluator-step-title,
    .audit-step-row-title,
    .delta-group-label,
    .kv-label,
    .table-note
) {
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
}

@media (min-width: 641px) {
    body.page-portfolio .portfolio-page.portfolio-evaluator-page .audit-step-row,
    body.page-portfolio .portfolio-page.portfolio-evaluator-page .audit-step-row-wide,
    body.page-portfolio .portfolio-page.portfolio-evaluator-page .audit-step-row-full {
        grid-template-columns: 9rem minmax(0, 1fr) !important;
    }
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(
    .portfolio-evaluator-cash-kicker,
    .portfolio-evaluator-start-copy span,
    .portfolio-evaluator-start-item span
) {
    color: var(--portfolio-pro-accent) !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(
    .portfolio-evaluator-cash-grid,
    .portfolio-evaluator-start-copy,
    .audit-step-row,
    .kv-row,
    .evaluator-history-table th
) {
    border-color: var(--portfolio-pro-border) !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-grid,
:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-start-copy,
:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page .evaluator-history-table th {
    background: var(--portfolio-pro-surface-muted) !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-stat.is-target {
    background: #e9f5fb !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page .audit-step-row {
    background: #f7f9fb !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page details.audit-holding-card[open] > summary,
:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page details.audit-holding-card > .audit-holding-factors {
    border-color: var(--portfolio-pro-border) !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page details.audit-holding-card > summary .audit-holding-header::after {
    color: #526b82 !important;
    opacity: 1 !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(.detail-chip, .portfolio-priority-chip) {
    border-color: #b5c7d5 !important;
    background: #edf3f7 !important;
    color: #17344f !important;
    opacity: 1 !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(.chip-label, .chip-score, .detail-chip.chip-meta) {
    color: #435b72 !important;
    opacity: 1 !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(
    .detail-chip.tone-good,
    .detail-chip.chip-added,
    .detail-chip.freshness-fresh
) {
    border-color: #91c9b5 !important;
    background: #e8f6f0 !important;
    color: var(--portfolio-pro-positive) !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(
    .detail-chip.tone-warn,
    .detail-chip.freshness-aging
) {
    border-color: #dfbd7c !important;
    background: #fff4df !important;
    color: var(--portfolio-pro-warning) !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(
    .detail-chip.tone-risk,
    .detail-chip.chip-removed,
    .detail-chip.freshness-stale
) {
    border-color: #e0a5ae !important;
    background: #fff0f2 !important;
    color: var(--portfolio-pro-negative) !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page .detail-chip.chip-changed {
    border-color: #94bdd1 !important;
    background: #e9f5fb !important;
    color: var(--portfolio-pro-accent) !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(
    .evaluator-step-card.tone-good,
    .audit-holding-card.tone-good
) {
    border-top-color: #4f9f82 !important;
    background: #ffffff !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(
    .evaluator-step-card.tone-warn,
    .audit-holding-card.tone-warn
) {
    border-top-color: #bd8332 !important;
    background: #ffffff !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(
    .evaluator-step-card.tone-risk,
    .audit-holding-card.tone-risk
) {
    border-top-color: #c45b6c !important;
    background: #ffffff !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(
    .evaluator-step-card.tone-good .evaluator-step-value,
    .audit-step-row.tone-good .audit-step-row-value,
    .kv-value.tone-good,
    .score-tone-good
) {
    color: var(--portfolio-pro-positive) !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(
    .evaluator-step-card.tone-warn .evaluator-step-value,
    .audit-step-row.tone-warn .audit-step-row-value,
    .score-tone-warn
) {
    color: var(--portfolio-pro-warning) !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(
    .evaluator-step-card.tone-risk .evaluator-step-value,
    .audit-step-row.tone-risk .audit-step-row-value,
    .kv-value.tone-risk,
    .score-tone-risk
) {
    color: var(--portfolio-pro-negative) !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-priority-banner {
    border-color: var(--portfolio-pro-border) !important;
    background: #f7f9fb !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-priority-chip:hover {
    border-color: #7bafc7 !important;
    background: #e1f1f8 !important;
    color: #064f73 !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page .evaluator-history-table {
    border-color: var(--portfolio-pro-border) !important;
    color: var(--portfolio-pro-text) !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page .evaluator-history-table th {
    color: #2f4a63 !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page .evaluator-history-table :where(th, td) {
    border-bottom-color: var(--portfolio-pro-border) !important;
}

:root[data-theme="light"] body.page-portfolio .portfolio-page.portfolio-evaluator-page :where(
    .portfolio-evaluator-cash-panel a,
    .evaluator-detail-grid a,
    .evaluator-history-section a,
    .evaluator-holdings-section a
) {
    color: #075d87;
    text-decoration-color: #7bafc7;
}

@media (max-width: 640px) {
    body.page-portfolio .portfolio-page.portfolio-evaluator-page .audit-step-row,
    body.page-portfolio .portfolio-page.portfolio-evaluator-page .audit-step-row-wide,
    body.page-portfolio .portfolio-page.portfolio-evaluator-page .audit-step-row-full {
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-rows: auto auto auto !important;
        row-gap: 0.22rem;
    }

    body.page-portfolio .portfolio-page.portfolio-evaluator-page .audit-step-row-title {
        grid-row: 1 !important;
        grid-column: 1 !important;
        padding: 0 0 0.34rem !important;
        border-right: 0 !important;
        border-bottom: 1px solid var(--portfolio-pro-border) !important;
    }

    body.page-portfolio .portfolio-page.portfolio-evaluator-page .audit-step-row-value {
        grid-row: 2 !important;
        grid-column: 1 !important;
    }

    body.page-portfolio .portfolio-page.portfolio-evaluator-page .audit-step-row-detail {
        grid-row: 3 !important;
        grid-column: 1 !important;
    }
}

@media (max-width: 900px) {
    body.page-portfolio .portfolio-page.portfolio-evaluator-page .top-stats-primary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.page-portfolio .portfolio-page.portfolio-evaluator-page .top-stats-primary .summary-card:nth-child(odd) {
        border-left: 0 !important;
    }

    body.page-portfolio .portfolio-page.portfolio-evaluator-page .top-stats-primary .summary-card:nth-child(n + 3) {
        border-top: 1px solid var(--portfolio-pro-border) !important;
    }

    body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-start-panel {
        grid-template-columns: 1fr !important;
    }

    body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-start-copy {
        border-right: 0;
        border-bottom: 1px solid var(--portfolio-pro-border);
    }
}

@media (max-width: 680px) {
    body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-head,
    body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-guidance {
        align-items: stretch;
        flex-direction: column;
    }

    body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-head .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-grid {
        grid-template-columns: 1fr;
    }

    body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-stat + .portfolio-evaluator-cash-stat {
        border-top: 1px solid var(--portfolio-pro-border);
        border-left: 0;
    }

    body.page-portfolio .portfolio-page.portfolio-evaluator-page .portfolio-evaluator-cash-guidance span {
        text-align: left;
    }
}

@media (max-width: 520px) {
    body.page-portfolio .portfolio-page.portfolio-evaluator-page .top-stats-primary {
        grid-template-columns: 1fr;
    }

    body.page-portfolio .portfolio-page.portfolio-evaluator-page .top-stats-primary .summary-card,
    body.page-portfolio .portfolio-page.portfolio-evaluator-page .top-stats-primary .summary-card:nth-child(odd) {
        border-left: 0 !important;
        border-top: 1px solid var(--portfolio-pro-border) !important;
    }

    body.page-portfolio .portfolio-page.portfolio-evaluator-page .top-stats-primary .summary-card:first-child {
        border-top: 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .public-site *,
    .public-site *::before,
    .public-site *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (forced-colors: active) {
    .public-site :where(.btn-primary, .btn-secondary, button, input, select, textarea, .badge-mini) {
        border: 1px solid ButtonText !important;
    }
}

/* Model portfolio search introduction: concise, crawlable context without a second hero. */
body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-seo-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(27rem, 0.85fr);
    gap: 1.25rem;
    align-items: center;
    margin: 0.9rem 0 1rem;
    padding: 1.1rem 1.2rem;
    border: 1px solid rgba(69, 110, 152, 0.28);
    border-radius: 16px;
    background:
        radial-gradient(circle at 86% 20%, rgba(56, 189, 248, 0.08), transparent 34%),
        rgba(8, 17, 30, 0.58);
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-seo-intro-copy {
    min-width: 0;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-seo-intro-kicker {
    display: block;
    margin-bottom: 0.35rem;
    color: #58c7ee;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.085em;
    text-transform: uppercase;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-seo-intro h2 {
    margin: 0;
    font-size: clamp(1.05rem, 1.45vw, 1.3rem);
    line-height: 1.25;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-seo-intro p {
    max-width: 76ch;
    margin: 0.42rem 0 0;
    color: var(--text-muted, #a9bad0);
    font-size: 0.86rem;
    line-height: 1.55;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-orientation {
    display: grid;
    gap: 0.3rem;
    margin-top: 0.75rem;
    padding: 0.7rem 0.8rem;
    border-left: 3px solid #2f91ad;
    border-radius: 0 8px 8px 0;
    background: rgba(47, 145, 173, 0.08);
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-orientation strong {
    color: var(--mp-clean-text);
    font-size: 0.8rem;
    line-height: 1.4;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-orientation span {
    color: var(--mp-clean-muted);
    font-size: 0.76rem;
    line-height: 1.45;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-seo-facts {
    display: grid;
    grid-template-columns: minmax(9.5rem, 1.45fr) minmax(6.5rem, 1fr) minmax(5.5rem, 0.85fr);
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(69, 110, 152, 0.25);
    border-radius: 12px;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-seo-facts div {
    min-width: 0;
    padding: 0.72rem 0.78rem;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-seo-facts div + div {
    border-left: 1px solid rgba(69, 110, 152, 0.25);
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-seo-facts dt,
body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-seo-facts dd {
    min-width: 0;
    margin: 0;
    white-space: nowrap;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-seo-facts dt {
    color: var(--text-muted, #8ea6c3);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-seo-facts dd {
    margin-top: 0.28rem;
    color: var(--text-primary, #f5f9ff);
    font-size: 0.82rem;
    font-weight: 800;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-data-strip {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    overflow: hidden;
    border-top: 1px solid rgba(69, 110, 152, 0.25);
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-data-strip div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
    padding-top: 0.8rem;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-data-strip div + div {
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(69, 110, 152, 0.25);
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-data-strip :where(dt, dd) {
    min-width: 0;
    margin: 0;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-data-strip dt {
    color: var(--mp-clean-muted);
    font-size: 0.68rem;
    font-weight: 700;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-data-strip dd {
    color: var(--mp-clean-text);
    font-size: 0.76rem;
    font-weight: 800;
    text-align: right;
}

body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-overview-data-status {
    display: flex;
    width: 100%;
    margin: -0.35rem 0 1rem;
}

:root[data-theme="light"] body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-seo-intro {
    border-color: var(--ak-border);
    background: var(--ak-surface-muted);
}

:root[data-theme="light"] body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-orientation,
:root[data-theme="light"] body.page-model-portfolio-detail .model-portfolio-page :where(.model-portfolio-history-scope-note, .model-portfolio-candidate-note, .model-portfolio-performance-context) {
    background: rgba(15, 120, 149, 0.08);
}

@media (max-width: 1060px) {
    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-seo-intro {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-seo-intro {
        padding: 1rem;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-seo-facts {
        grid-template-columns: 1fr;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-seo-facts div + div {
        border-top: 1px solid rgba(69, 110, 152, 0.25);
        border-left: 0;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-data-strip {
        grid-template-columns: 1fr;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-data-strip div {
        padding: 0.7rem 0 0;
    }

    body.page-model-portfolio-detail .model-portfolio-page .model-portfolio-data-strip div + div {
        margin: 0.7rem 0 0;
        padding-left: 0;
        border-top: 1px solid rgba(69, 110, 152, 0.25);
        border-left: 0;
    }
}

/* ===== component source: components/portfolio-settings.css ===== */
/* Portfolio settings: persistent save state and action bar. */

.portfolio-settings-page .portfolio-settings-savebar {
    position: sticky;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    z-index: 24;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 0.78rem 0.9rem;
    border: 1px solid rgba(89, 124, 164, 0.42);
    border-radius: 14px;
    background: rgba(8, 18, 32, 0.96);
    box-shadow: 0 18px 42px rgba(1, 7, 17, 0.42);
    backdrop-filter: blur(16px);
}

.portfolio-settings-save-status,
.portfolio-settings-save-actions {
    display: flex;
    align-items: center;
}

.portfolio-settings-save-status {
    gap: 0.55rem;
    min-width: 0;
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 700;
}

.portfolio-settings-save-actions {
    justify-content: flex-end;
    gap: 0.6rem;
}

.portfolio-settings-save-dot {
    width: 0.58rem;
    height: 0.58rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #36c99a;
    box-shadow: 0 0 0 4px rgba(54, 201, 154, 0.12);
}

.portfolio-settings.has-unsaved-changes .portfolio-settings-save-status {
    color: #f8d985;
}

.portfolio-settings.has-unsaved-changes .portfolio-settings-save-dot {
    background: #f0b94d;
    box-shadow: 0 0 0 4px rgba(240, 185, 77, 0.14);
}

.portfolio-settings-savebar [data-settings-submit]:disabled {
    cursor: not-allowed;
    opacity: 0.48;
    filter: saturate(0.45);
}

@media (max-width: 720px) {
    .portfolio-settings-page .portfolio-settings-savebar {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 0.7rem;
        bottom: max(0.5rem, env(safe-area-inset-bottom));
    }

    .portfolio-settings-save-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
