:root {
    --bg: #f7f2e8;
    --bg-deep: #eee6d8;
    --panel: #122033;
    --panel-strong: #0e1a29;
    --panel-muted: #18273d;
    --line: rgba(18, 32, 51, 0.16);
    --ink: #122033;
    --muted: rgba(18, 32, 51, 0.72);
    --forest: #1e7c6d;
    --forest-soft: #194f48;
    --amber: #b37a22;
    --amber-soft: #83591b;
    --rose: #bf604d;
    --surface-ink: #f8f3eb;
    --surface-muted: rgba(248, 243, 235, 0.74);
    --surface-soft: rgba(248, 243, 235, 0.09);
    --shadow: 0 18px 40px rgba(18, 32, 51, 0.08);
    --chart-grid: rgba(18, 32, 51, 0.14);
    --chart-ink: #122033;
    --chart-muted: rgba(18, 32, 51, 0.62);
    --chart-history: #64748b;
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

body.dark-mode {
    --bg: #09111b;
    --bg-deep: #101926;
    --panel: #f5efe5;
    --panel-strong: #fffaf3;
    --panel-muted: #ebe2d3;
    --line: rgba(255, 250, 243, 0.22);
    --ink: #f8f3eb;
    --muted: rgba(248, 243, 235, 0.72);
    --forest: #73d1bc;
    --forest-soft: #d7fff5;
    --amber: #f0b55f;
    --amber-soft: #ffe0b2;
    --rose: #ff9a84;
    --surface-ink: #102033;
    --surface-muted: rgba(16, 32, 51, 0.7);
    --surface-soft: rgba(16, 32, 51, 0.06);
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
    --chart-grid: rgba(255, 250, 243, 0.16);
    --chart-ink: #f8f3eb;
    --chart-muted: rgba(248, 243, 235, 0.72);
    --chart-history: #b8c4d4;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--bg);
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
    overflow-x: hidden;
}

body.scroll-locked {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

.auth-gate {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(8, 8, 8, 0.58);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.auth-gate[hidden] {
    display: none !important;
}

.auth-forms[hidden],
.billing-actions[hidden] {
    display: none !important;
}

.auth-card {
    width: min(960px, 100%);
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    display: grid;
    gap: 20px;
    padding: 28px;
    border-radius: 28px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--surface-ink);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.auth-brand h2 {
    margin: 0;
    font-family: "Palatino Linotype", "Book Antiqua", serif;
    font-size: 2.2rem;
}

.auth-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.auth-copy,
.auth-message {
    margin: 0;
    color: var(--surface-muted);
    line-height: 1.7;
}

.legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
}

.legal-links a {
    color: var(--surface-muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.legal-links a:hover {
    color: var(--surface-ink);
    border-bottom-color: currentColor;
}

.legal-links-sidebar {
    margin-top: 8px;
}

.auth-message.is-error {
    color: #ff9b9b;
}

.auth-forms {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.auth-form {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.auth-form h3 {
    margin: 0;
    font-size: 1.1rem;
}

.billing-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-button {
    border: 1px solid var(--line);
    border-radius: 999px;
    min-height: 46px;
    padding: 0 18px;
    background: var(--bg);
    color: var(--ink);
    font-weight: 800;
    cursor: pointer;
}

.auth-button-secondary {
    background: var(--surface-soft);
    color: var(--surface-ink);
}

.auth-button-ghost {
    background: transparent;
    color: var(--surface-muted);
}

body.dark-mode {
    background: var(--bg);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.16), transparent 82%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.16), transparent 82%);
}

body.dark-mode::before {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
}

button,
select,
input[type="search"],
input[type="text"],
input[type="email"],
input[type="password"] {
    font: inherit;
    -webkit-appearance: none;
    appearance: none;
}

button {
    color: inherit;
}

.auto-invert-text {
    color: #ffffff;
    mix-blend-mode: difference;
}

.app-shell {
    width: min(1440px, calc(100% - 32px));
    margin: 16px auto 32px;
}

.menu-scrim {
    position: fixed;
    inset: 0;
    z-index: 25;
    border: 0;
    background: rgba(15, 23, 21, 0.38);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.detail-scrim {
    position: fixed;
    inset: 0;
    z-index: 34;
    border: 0;
    background: rgba(10, 10, 10, 0.42);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.sidebar,
.panel,
.content-topbar {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--panel);
    color: var(--surface-ink);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.sidebar {
    position: fixed;
    inset: 16px auto 16px 16px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    width: min(340px, calc(100vw - 32px));
    padding: 28px;
    transform: translateX(calc(-100% - 24px));
    transition: transform 220ms ease;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

body.menu-open .menu-scrim {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.detail-open .detail-scrim {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.menu-open .sidebar {
    transform: translateX(0);
}

.sidebar::after,
.panel::after {
    content: "";
    position: absolute;
    inset: auto -10% -35% auto;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle, var(--surface-soft), transparent 68%);
    pointer-events: none;
}

.sidebar-head,
.sidebar-brand,
.section-heading,
.sidebar-footer {
    position: relative;
    z-index: 1;
}

.sidebar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.sidebar-brand {
    display: grid;
    gap: 18px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    color: var(--surface-ink);
    filter: none;
}

.brand-svg {
    width: 64px;
    height: 64px;
    display: block;
}

.eyebrow,
.mini-eyebrow {
    margin: 0 0 10px;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--surface-muted);
    font-weight: 800;
}

.sidebar-brand h1,
.landing-hero h2,
.section-heading h3 {
    margin: 0;
    font-family: "Palatino Linotype", "Book Antiqua", serif;
}

.sidebar-brand h1 {
    font-size: 2rem;
    line-height: 1;
}

.sidebar-copy,
.landing-text,
.section-copy,
.note-text {
    margin: 0;
    color: var(--surface-muted);
    line-height: 1.7;
}

.sidebar-menu {
    display: grid;
    gap: 12px;
}

.nav-link {
    border: 1px solid transparent;
    border-radius: 18px;
    background: var(--surface-soft);
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.nav-link-anchor {
    color: inherit;
    text-decoration: none;
}

.nav-link:hover,
.theme-toggle:hover,
.switch-pill:hover,
.inline-link:hover,
.swap-button:hover,
.leaderboard-card-item:hover {
    transform: translateY(-1px);
}

.sidebar .nav-link {
    display: block;
    width: 100%;
    padding: 16px 18px;
    text-align: left;
}

.nav-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.nav-copy strong {
    font-size: 1rem;
}

.nav-copy small {
    color: var(--surface-muted);
    line-height: 1.45;
}

.nav-link.is-active {
    border-color: var(--line);
    background: var(--bg);
    color: var(--ink);
}

.account-menu-button {
    margin-top: 4px;
}

.sidebar-footer {
    display: grid;
    gap: 14px;
}

.sidebar-stat {
    display: grid;
    gap: 6px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.sidebar-stat span,
.stat-label {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: inherit;
}

.sidebar-stat strong,
.stat-card strong {
    font-size: 1.3rem;
    color: inherit;
}

.theme-toggle,
.menu-toggle,
.icon-button,
.switch-pill,
.swap-button,
.inline-link {
    border: 1px solid var(--line);
    border-radius: 999px;
    min-height: 44px;
    padding: 0 16px;
    background: var(--surface-soft);
    color: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.menu-toggle-icon {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 46px;
    padding: 0;
}

.menu-toggle-icon span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.theme-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    padding: 0;
}

.moon-icon {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    box-shadow: inset -4px -4px 0 0 currentColor;
    transform: rotate(-25deg);
}

.content-shell {
    display: grid;
    gap: 20px;
    min-width: 0;
    width: min(1180px, 100%);
    margin: 0 auto;
}

.content-topbar {
    position: sticky;
    top: 16px;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
}

body[data-active-section="home"] .content-topbar {
    position: fixed;
    top: 18px;
    right: 24px;
    left: auto;
    z-index: 20;
    width: auto;
    min-width: 0;
    transform: none;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--ink);
    backdrop-filter: none;
}

body[data-active-section="home"] .content-topbar .topbar-copy {
    display: none;
}

body[data-active-section="home"] .content-topbar .topbar-actions {
    gap: 10px;
}

body[data-active-section="home"] .content-topbar .theme-toggle,
body[data-active-section="home"] .content-topbar .menu-toggle {
    border-color: var(--line);
    background: var(--bg);
    color: var(--ink);
}

body[data-active-section="home"] .content-topbar .theme-toggle,
body[data-active-section="home"] .content-topbar .menu-toggle,
body[data-active-section="home"] .landing-hero h2,
body[data-active-section="home"] .landing-emblem {
    color: #ffffff;
    mix-blend-mode: difference;
}

body:not(.dark-mode)[data-active-section="home"] .content-topbar .theme-toggle,
body:not(.dark-mode)[data-active-section="home"] .content-topbar .menu-toggle {
    background: #000000;
    color: #ffffff;
    mix-blend-mode: normal;
}

body.dark-mode[data-active-section="home"] .content-topbar .theme-toggle,
body.dark-mode[data-active-section="home"] .content-topbar .menu-toggle {
    background: #ffffff;
    color: #000000;
    mix-blend-mode: normal;
}

.screen {
    display: none;
}

.screen.is-active {
    display: grid;
    gap: 20px;
    animation: fadeIn 220ms ease;
}

.screen.is-active > * {
    width: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

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

.panel {
    padding: 24px;
    overflow: hidden;
}

.topbar-actions,
.topbar-copy {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-copy {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.topbar-title {
    font-family: "Palatino Linotype", "Book Antiqua", serif;
    font-size: 1.35rem;
    line-height: 1;
}

.topbar-title:empty {
    display: none;
}

.landing-text {
    max-width: 58ch;
    margin-top: 18px;
    font-size: 1rem;
}

.landing-hero {
    display: grid;
    align-content: center;
    justify-items: center;
    min-height: calc(100vh - 80px);
    max-width: 1320px;
    margin: 0 auto;
    padding-top: 120px;
    text-align: center;
    color: var(--ink);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    background:
        radial-gradient(circle at 50% 18%, rgba(0, 0, 0, 0.06), transparent 28%),
        radial-gradient(circle at 20% 30%, rgba(0, 0, 0, 0.04), transparent 24%),
        radial-gradient(circle at 80% 72%, rgba(0, 0, 0, 0.04), transparent 22%),
        transparent;
}

body.dark-mode .landing-hero {
    color: var(--ink);
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.08), transparent 28%),
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.05), transparent 24%),
        radial-gradient(circle at 80% 72%, rgba(255, 255, 255, 0.05), transparent 22%),
        transparent;
}

.landing-hero h2 {
    max-width: none;
    font-size: clamp(3.4rem, 9vw, 6.8rem);
    line-height: 0.92;
    text-shadow: none;
}

.landing-emblem {
    display: grid;
    place-items: center;
    width: 112px;
    height: 112px;
    margin-bottom: 18px;
    color: var(--surface-ink);
}

.landing-emblem-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.landing-hero .eyebrow,
.landing-hero .landing-text {
    margin-left: auto;
    margin-right: auto;
}

.landing-hero .landing-text,
.landing-hero .landing-pillar {
    color: inherit;
}

.landing-pillars {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.landing-pillar {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: transparent;
    color: var(--ink);
    backdrop-filter: none;
}

.landing-pillar span {
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.landing-pillar strong {
    line-height: 1.45;
}

.landing-stats {
    display: flex;
    align-items: stretch;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    width: 100%;
}

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

.stat-card,
.summary-chip,
.sector-card,
.compare-stock-card,
.compare-empty-state,
.leaderboard-card-item,
.home-item {
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.stat-card {
    padding: 18px;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.section-heading h3 {
    font-size: 1.7rem;
    line-height: 1.08;
}

.inline-link {
    align-self: flex-start;
}

.home-list {
    display: grid;
    gap: 12px;
}

.home-item {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.home-item-top,
.sector-card-top,
.card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.home-item-title,
.sector-name,
.card-symbol,
.compare-stock-ticker,
.stock-ticker {
    font-weight: 800;
    color: inherit;
}

.home-item-title {
    font-size: 1.1rem;
}

.home-item-copy,
.home-item-meta,
.sector-etf,
.sector-stats,
.card-meta,
.card-stats,
.compare-stock-meta,
.compare-stock-stats,
.compare-empty-state p,
.sub-metric,
thead th {
    color: var(--surface-muted);
}

.home-item-copy,
.note-text {
    line-height: 1.7;
}

.home-item-meta,
.card-meta,
.compare-stock-meta {
    font-size: 0.92rem;
    line-height: 1.55;
}

.home-item-statline,
.sector-stats,
.card-stats,
.compare-stock-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.ranking-switch {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.switch-pill {
    background: var(--amber-soft);
    color: var(--surface-ink);
}

.switch-pill.is-active,
.score-pill {
    background: var(--panel);
    color: var(--surface-ink);
}

.filter-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(150px, 0.45fr) minmax(190px, 0.65fr) minmax(210px, 0.7fr) auto;
    gap: 14px;
    margin-top: 18px;
}

body.is-filter-locked #sectorFilter,
body.is-filter-locked #marketCapFilter,
body.is-filter-locked #passedOnlyToggle {
    cursor: not-allowed;
}

body.is-filter-locked .guest-locked-control {
    opacity: 0.48;
}

.locked-feature-note,
.locked-feature-card {
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink);
}

.locked-feature-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 8px;
}

.locked-feature-note[hidden] {
    display: none !important;
}

.locked-feature-note span,
.locked-feature-card p {
    color: var(--muted);
    line-height: 1.6;
}

.locked-feature-card {
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 12px;
    min-height: 260px;
    padding: 22px;
    border-radius: 8px;
    grid-column: 1 / -1;
}

.locked-feature-card strong {
    font-size: 1.15rem;
}

.locked-feature-card p {
    max-width: 56ch;
    margin: 0;
}

.locked-feature-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.field {
    display: grid;
    gap: 8px;
    color: var(--surface-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.field input,
.field select {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink);
}

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

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    align-self: end;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink);
}

.toggle input {
    accent-color: var(--forest);
}

.view-summary,
.compare-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 18px;
    align-items: stretch;
}

.summary-chip {
    padding: 14px 16px;
    min-width: 0;
}

.summary-chip span {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--surface-muted);
}

.summary-chip strong {
    display: block;
    margin-top: 6px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.leaderboard-panel {
    display: grid;
    gap: 18px;
}

.leaderboard-table-wrap {
    display: block;
}

.leaderboard-cards {
    display: none;
    gap: 12px;
}

.table-wrap {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid var(--line);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 14px 12px;
    background: var(--panel-strong);
    font-size: 0.75rem;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

tbody td {
    padding: 14px 12px;
    border-top: 1px solid var(--line);
    vertical-align: top;
}

tbody tr:nth-child(even) {
    background: var(--surface-soft);
}

tbody tr:hover {
    background: var(--bg);
    color: var(--ink);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: var(--panel);
    color: var(--surface-ink);
    font-weight: 800;
}

.stock-cell {
    min-width: 220px;
}

.stock-ticker {
    display: block;
}

.stock-name {
    display: block;
    margin-top: 4px;
    color: var(--surface-muted);
    font-size: 0.94rem;
}

.score-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 800;
}

.leaderboard-card-item {
    display: grid;
    gap: 14px;
    padding: 18px;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
    cursor: pointer;
}

.leaderboard-row {
    cursor: pointer;
}

.leaderboard-row:focus-visible,
.leaderboard-card-item:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
}

.card-symbol {
    font-size: 1.12rem;
}

.card-name {
    margin-top: 4px;
    font-size: 0.96rem;
    color: var(--surface-muted);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.card-stat {
    padding: 12px;
    border-radius: 16px;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--ink);
}

.card-stat span {
    display: block;
    margin-bottom: 4px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.card-stat strong {
    display: block;
    line-height: 1.4;
    color: var(--ink);
    word-break: break-word;
}

.comparison-card {
    display: grid;
    gap: 18px;
}

.compare-picker-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 14px;
    align-items: end;
}

.compare-field input {
    font-size: 1rem;
}

.swap-button {
    min-height: 46px;
}

.compare-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}

.compare-stock-card,
.compare-empty-state {
    padding: 18px;
}

.compare-stock-card.is-leading {
    box-shadow: inset 0 0 0 1px var(--line);
}

.compare-stock-label {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--surface-muted);
}

.compare-stock-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.compare-stock-ticker {
    font-size: 1.45rem;
    line-height: 1;
}

.compare-stock-name {
    margin-top: 10px;
    font-size: 1.04rem;
    font-weight: 700;
    line-height: 1.4;
}

.compare-versus {
    display: grid;
    place-items: center;
    min-width: 56px;
    color: var(--surface-muted);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.compare-empty-state strong {
    display: block;
    font-family: "Palatino Linotype", "Book Antiqua", serif;
    font-size: 1.15rem;
}

.compare-table-wrap {
    margin-top: 2px;
}

.compare-scenario-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.scenario-card,
.scenario-card-empty {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.scenario-card-head,
.scenario-card-meta,
.scenario-legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.scenario-card-title {
    display: block;
    margin-top: 8px;
    font-size: 1.05rem;
    line-height: 1.35;
}

.scenario-card-meta,
.scenario-legend,
.scenario-card-empty p,
.scenario-chart-label {
    color: var(--surface-muted);
    font-size: 0.88rem;
}

.scenario-chart-wrap {
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--bg);
}

.scenario-chart-svg {
    display: block;
    width: 100%;
    min-width: 0;
    height: auto;
}

.scenario-chart-bg {
    fill: transparent;
}

.scenario-chart-divider {
    stroke: var(--chart-grid);
    stroke-width: 1.4;
    stroke-dasharray: 5 6;
}

.scenario-grid-line {
    stroke: var(--chart-grid);
    stroke-width: 1;
    opacity: 0.72;
}

.scenario-axis-line {
    stroke: var(--chart-grid);
    stroke-width: 1.2;
}

.scenario-path {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
}

.scenario-path.history {
    stroke: var(--chart-history);
}

.scenario-path.base {
    stroke: #18a36f;
}

.scenario-path.best {
    stroke: #49c98b;
    stroke-dasharray: 7 7;
}

.scenario-path.worst {
    stroke: #d95b5b;
    stroke-dasharray: 7 7;
}

body.dark-mode .scenario-path.base {
    stroke: #58d3a1;
}

body.dark-mode .scenario-path.best {
    stroke: #8af0c2;
}

body.dark-mode .scenario-path.worst {
    stroke: #ff8a8a;
}

.scenario-chart-label {
    fill: var(--chart-muted);
}

.scenario-axis-tick,
.scenario-axis-title {
    fill: var(--chart-muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.scenario-axis-title {
    letter-spacing: 0;
    text-transform: uppercase;
}

.scenario-legend {
    justify-content: flex-start;
}

.scenario-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: currentColor;
}

.legend-dot.history {
    color: #53616c;
}

.legend-dot.base {
    color: #18a36f;
}

.legend-dot.best {
    color: #49c98b;
}

.legend-dot.worst {
    color: #d95b5b;
}

.scenario-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.scenario-metric {
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--bg);
}

.scenario-metric span {
    display: block;
    margin-bottom: 6px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.scenario-metric strong {
    display: block;
    line-height: 1.35;
    color: var(--ink);
}

.scenario-chart-loading,
.scenario-chart-empty {
    display: grid;
    place-items: center;
    min-height: 280px;
    padding: 18px;
    color: var(--surface-muted);
    text-align: center;
}

.detail-modal {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 35;
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--panel);
    color: var(--surface-ink);
    box-shadow: var(--shadow);
    transform: translateX(calc(100% + 24px));
    transition: transform 220ms ease;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

body.detail-open .detail-modal {
    transform: translateX(0);
}

.detail-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.detail-modal-head h3 {
    margin: 0;
    font-family: "Palatino Linotype", "Book Antiqua", serif;
    font-size: 1.6rem;
    line-height: 1.05;
}

.detail-modal-body {
    display: grid;
    gap: 16px;
}

.detail-hero,
.detail-section,
.detail-chart-card {
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.detail-hero,
.detail-section {
    padding: 18px;
}

.detail-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.detail-symbol {
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1;
}

.detail-company {
    margin-top: 10px;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.4;
}

.detail-meta,
.detail-section-head span,
.detail-status-badge {
    color: var(--surface-muted);
}

.detail-meta {
    margin-top: 8px;
    line-height: 1.55;
}

.detail-hero-badges {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.detail-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.3);
    background: #ffffff;
    color: #111111;
    font-size: 0.88rem;
    font-weight: 800;
}

.detail-status-badge.is-passed {
    border-color: rgba(13, 104, 65, 0.4);
    background: #e9fff4;
    color: #06482f;
}

.detail-status-badge.is-failed {
    border-color: rgba(130, 32, 32, 0.38);
    background: #fff0f0;
    color: #6b1717;
}

.detail-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.detail-chart-card {
    overflow: hidden;
    background: var(--bg);
}

.detail-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.detail-metric {
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--bg);
}

.detail-metric span {
    display: block;
    margin-bottom: 6px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.detail-metric strong {
    display: block;
    line-height: 1.4;
    color: var(--ink);
    word-break: break-word;
}

.compare-table {
    min-width: 640px;
}

.metric-cell {
    min-width: 180px;
    font-weight: 700;
}

.compare-value {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.compare-value.is-winner {
    color: inherit;
}

.compare-value.is-even {
    color: var(--surface-muted);
}

.edge-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--bg);
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 800;
    white-space: nowrap;
}

.edge-pill.is-left,
.edge-pill.is-right {
    background: var(--forest-soft);
    color: var(--surface-ink);
}

.edge-pill.is-even {
    background: var(--amber-soft);
    color: var(--surface-ink);
}

.sector-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.sector-card {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.sector-etf {
    font-size: 0.85rem;
}

.meter {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: var(--bg);
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    border-radius: inherit;
    background: #3bb8a4;
}

body.dark-mode .meter-fill {
    background: #6ee7d2;
}

.note-text code {
    margin: 0 2px;
}

code {
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--bg);
    color: var(--ink);
}


body.menu-open,
body.account-modal-open,
body.detail-open {
    overflow: hidden;
}

@media (max-width: 1180px) {
    .app-shell {
        width: min(100% - 24px, 100%);
    }

    .sidebar {
        inset: 12px auto 12px 12px;
        width: min(320px, calc(100vw - 24px));
        padding: 22px;
    }

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

@media (max-width: 980px) {
    .auth-forms {
        grid-template-columns: 1fr;
    }

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

    .toggle {
        align-self: stretch;
        justify-content: flex-start;
    }

    .compare-picker-grid,
    .compare-overview,
    .compare-scenario-grid {
        grid-template-columns: 1fr;
    }

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

    .compare-versus {
        min-height: 24px;
    }

    .landing-pillars,
    .stat-grid-compact {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .auth-card {
        max-height: calc(100dvh - 20px);
        padding: 20px;
        border-radius: 22px;
    }

    .app-shell {
        width: min(100% - 20px, 100%);
        margin: 10px auto 24px;
    }

    .sidebar {
        inset: 10px auto 10px 10px;
        width: min(320px, calc(100vw - 20px));
        max-height: calc(100dvh - 20px);
    }

    .content-shell {
        gap: 16px;
    }

    .content-topbar {
        top: 10px;
        padding: 10px 12px;
    }

    .screen.is-active {
        gap: 16px;
    }

    .panel {
        padding: 18px;
        border-radius: 22px;
    }

    .detail-modal {
        top: 10px;
        right: 10px;
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
        padding: 18px;
        border-radius: 22px;
    }

    .scenario-chart-svg {
        min-width: 0;
    }

    .stat-grid,
    .filter-row,
    .view-summary,
    .compare-picker-grid,
    .compare-overview,
    .compare-summary,
    .compare-scenario-grid,
    .scenario-metrics,
    .detail-metric-grid {
        grid-template-columns: 1fr;
    }

    .leaderboard-table-wrap {
        display: none;
    }

    .leaderboard-cards {
        display: grid;
    }

    .section-heading h3 {
        font-size: 1.42rem;
    }

    .landing-hero h2 {
        max-width: 13ch;
        font-size: clamp(1.9rem, 11vw, 3rem);
        margin-top: 40px;
    }

    .theme-toggle,
    .swap-button {
        min-height: 42px;
    }
}

@media (max-width: 560px) {
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content-topbar,
    .panel {
        border-radius: 20px;
    }

    .content-topbar,
    .topbar-actions {
        align-items: center;
        flex-direction: row;
    }

    .content-topbar {
        justify-content: space-between;
    }

    .content-topbar .theme-toggle,
    .menu-toggle,
    .theme-toggle-icon {
        width: 42px;
        min-width: 42px;
    }

    .section-heading {
        margin-bottom: 14px;
    }

    .detail-modal {
        padding: 14px;
    }

    .detail-hero,
    .detail-section {
        padding: 14px;
    }

    .scenario-chart-svg {
        min-width: 0;
    }
}

body[data-active-section="home"] .content-topbar {
    position: sticky;
    top: 16px;
    right: auto;
    left: auto;
    width: auto;
    min-width: 0;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--surface-ink);
    box-shadow: var(--shadow);
    transform: none;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

body[data-active-section="home"] .content-topbar .topbar-copy {
    display: flex;
}

body[data-active-section="home"] .content-topbar .theme-toggle,
body[data-active-section="home"] .content-topbar .menu-toggle {
    background: var(--surface-soft);
    color: inherit;
    border-color: var(--line);
    mix-blend-mode: normal;
}

.guide-gate {
    position: fixed;
    inset: 0;
    z-index: 58;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(9, 17, 27, 0.52);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.guide-gate[hidden] {
    display: none !important;
}

.guide-card {
    width: min(560px, 100%);
    display: grid;
    gap: 18px;
    padding: 24px;
    border-radius: 26px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--surface-ink);
    box-shadow: var(--shadow);
}

.guide-card-head,
.guide-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.guide-card-head h3 {
    margin: 0;
    font-family: "Palatino Linotype", "Book Antiqua", serif;
    font-size: 1.5rem;
}

.guide-copy,
.guide-step-meta {
    margin: 0;
    color: var(--surface-muted);
    line-height: 1.7;
}

.guide-progress {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.guide-progress span {
    display: block;
    height: 8px;
    border-radius: 999px;
    background: rgba(248, 243, 235, 0.14);
}

.guide-progress span.is-active {
    background: linear-gradient(90deg, #65c8b3, #f0c279);
}

.sidebar-stat-stack {
    display: grid;
    gap: 10px;
}

.sidebar-guide-button {
    width: 100%;
    justify-content: center;
}

.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.9fr);
    gap: 20px;
    min-height: auto;
    margin: 0;
    padding: 34px;
    border-radius: 30px;
    text-align: left;
    color: var(--surface-ink);
    background:
        radial-gradient(circle at top left, rgba(105, 200, 180, 0.18), transparent 34%),
        radial-gradient(circle at bottom right, rgba(240, 194, 121, 0.22), transparent 30%),
        linear-gradient(145deg, #122033 0%, #18273d 52%, #21405f 100%);
}

body.dark-mode .landing-hero {
    color: var(--surface-ink);
    background:
        radial-gradient(circle at top left, rgba(96, 170, 154, 0.16), transparent 30%),
        radial-gradient(circle at bottom right, rgba(197, 137, 52, 0.18), transparent 30%),
        linear-gradient(145deg, #f6eee2 0%, #efe3d2 50%, #e8dbc7 100%);
}

.landing-copy-block {
    display: grid;
    align-content: center;
}

.landing-hero h2 {
    max-width: 11ch;
    font-size: clamp(2.8rem, 5vw, 5.5rem);
    line-height: 0.94;
    color: inherit;
}

.landing-hero .eyebrow,
.landing-hero .landing-text {
    margin-left: 0;
    margin-right: 0;
}

.landing-hero .landing-text {
    max-width: 54ch;
    color: var(--surface-muted);
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.hero-action {
    border: 1px solid rgba(248, 243, 235, 0.16);
    border-radius: 999px;
    min-height: 48px;
    padding: 0 18px;
    background: rgba(248, 243, 235, 0.08);
    color: var(--surface-ink);
    font-weight: 800;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.hero-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.hero-action:hover {
    transform: translateY(-1px);
}

.hero-action-primary {
    background: linear-gradient(90deg, #65c8b3, #f0c279);
    border-color: transparent;
    color: #102033;
}

.landing-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.landing-benefits span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(248, 243, 235, 0.14);
    background: rgba(248, 243, 235, 0.07);
    color: var(--surface-muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.landing-data-cluster {
    display: grid;
    gap: 12px;
    align-content: center;
}

.hero-stat-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(248, 243, 235, 0.14);
    background: rgba(248, 243, 235, 0.08);
}

.hero-stat-card span {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--surface-muted);
    font-weight: 800;
}

.hero-stat-card strong {
    font-size: 1.8rem;
    line-height: 1;
}

.hero-stat-card p {
    margin: 0;
    color: var(--surface-muted);
    line-height: 1.6;
}

.onboarding-panel,
.landing-learning-panel,
.home-sector-panel {
    display: grid;
    gap: 18px;
}

.quick-start-grid,
.landing-learning-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.landing-learning-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.9fr);
}

.quick-start-card,
.learning-card,
.guide-hint-card {
    display: grid;
    gap: 10px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.quick-start-card p,
.learning-card p,
.guide-hint-card p {
    margin: 0;
    color: var(--surface-muted);
    line-height: 1.7;
}

.step-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: linear-gradient(135deg, #65c8b3, #f0c279);
    color: #102033;
    font-weight: 800;
}

.learning-stack {
    display: grid;
    gap: 12px;
}

.learning-card span,
.quick-start-card strong,
.learning-card strong,
.guide-hint-card strong {
    color: var(--surface-ink);
}

.control-stack {
    display: grid;
    gap: 14px;
}

.presentation-switch {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
}

.switch-pill {
    background: rgba(248, 243, 235, 0.08);
    color: var(--surface-muted);
}

.switch-pill.is-active {
    background: linear-gradient(90deg, #65c8b3, #f0c279);
    color: #102033;
    border-color: transparent;
}

.score-pill {
    background: linear-gradient(90deg, #65c8b3, #f0c279);
    color: #102033;
}

.guide-hint-card {
    margin-bottom: 4px;
}

.view-summary,
.compare-summary {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.summary-chip {
    background: rgba(248, 243, 235, 0.08);
}

.signal-pill,
.risk-pill,
.mini-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.mini-tag {
    gap: 8px;
    justify-content: space-between;
    min-width: 128px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink);
}

.mini-tag-label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 800;
}

.mini-tag-value {
    color: var(--ink);
    font-weight: 800;
}

.signal-pill {
    background: rgba(101, 200, 179, 0.18);
    color: #9fe7d8;
    border: 1px solid rgba(101, 200, 179, 0.24);
}

.risk-pill {
    background: rgba(240, 194, 121, 0.16);
    color: #ffd9a3;
    border: 1px solid rgba(240, 194, 121, 0.24);
}

.risk-pill.is-high,
.mini-tag.is-warning {
    background: rgba(191, 96, 77, 0.16);
    color: #ffc4b8;
    border-color: rgba(191, 96, 77, 0.24);
}

.risk-pill.is-low,
.mini-tag.is-good {
    background: rgba(101, 200, 179, 0.16);
    color: #a4e9da;
    border-color: rgba(101, 200, 179, 0.24);
}

.thesis-text,
.thesis-subtext,
.detail-note {
    margin: 0;
    color: var(--surface-muted);
    line-height: 1.65;
}

.table-stock-main {
    display: grid;
    gap: 6px;
}

.table-stock-meta {
    font-size: 0.9rem;
    color: var(--surface-muted);
    line-height: 1.5;
}

.table-cell-stack {
    display: grid;
    gap: 8px;
}

.table-mini-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--surface-muted);
    font-size: 0.9rem;
}

.table-why {
    min-width: 280px;
}

.card-top .score-pill,
.compare-stock-head .score-pill,
.scenario-card-head .score-pill {
    min-width: 84px;
}

.card-story {
    display: grid;
    gap: 10px;
}

.card-why {
    color: var(--surface-ink);
    font-weight: 700;
    line-height: 1.55;
}

.card-story .thesis-subtext,
.compare-story {
    color: var(--surface-muted);
}

.compare-overview {
    gap: 14px;
}

.compare-stock-card {
    display: grid;
    gap: 12px;
}

.compare-stock-card.is-leading {
    box-shadow: inset 0 0 0 1px rgba(101, 200, 179, 0.32);
}

.compare-story {
    margin: 0;
    line-height: 1.7;
}

.detail-modal {
    background: var(--panel);
    color: var(--surface-ink);
}

.detail-summary-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(248, 243, 235, 0.08);
}

.detail-key-points,
.pillar-grid {
    display: grid;
    gap: 10px;
}

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

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

.key-point,
.pillar-card {
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink);
}

.key-point span,
.pillar-card span {
    display: block;
    margin-bottom: 6px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.key-point strong,
.pillar-card strong {
    display: block;
    line-height: 1.4;
}

.detail-disclosure {
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(248, 243, 235, 0.08);
    overflow: hidden;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.detail-disclosure summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 78px;
    padding: 16px 18px;
    font-weight: 800;
    -webkit-tap-highlight-color: transparent;
}

.detail-disclosure:hover,
.detail-disclosure:focus-within {
    border-color: rgba(101, 200, 179, 0.34);
    background: rgba(248, 243, 235, 0.12);
    box-shadow: 0 0 0 1px rgba(101, 200, 179, 0.12);
}

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

.detail-disclosure-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.detail-disclosure-label {
    display: block;
    color: var(--surface-ink);
    font-size: 1rem;
    line-height: 1.35;
}

.detail-disclosure-hint {
    display: block;
    color: var(--surface-muted);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.45;
}

.detail-disclosure-icon {
    position: relative;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    color: var(--surface-muted);
    transform: rotate(45deg);
    transition: transform 160ms ease, color 160ms ease;
}

.detail-disclosure:hover .detail-disclosure-icon,
.detail-disclosure:focus-within .detail-disclosure-icon {
    color: var(--surface-ink);
}

.detail-disclosure[open] summary {
    border-bottom: 1px solid var(--line);
}

.detail-disclosure[open] .detail-disclosure-icon {
    transform: rotate(225deg);
    color: var(--surface-ink);
}

.detail-disclosure-body {
    padding: 16px 18px 18px;
}

.detail-summary-title {
    font-size: 1.16rem;
    line-height: 1.45;
}

.guide-focus {
    box-shadow: 0 0 0 2px rgba(101, 200, 179, 0.42);
}

body.dark-mode .hero-action,
body.dark-mode .landing-benefits span,
body.dark-mode .hero-stat-card,
body.dark-mode .switch-pill,
body.dark-mode .guide-progress span {
    border-color: rgba(16, 32, 51, 0.14);
}

body.dark-mode .hero-action,
body.dark-mode .landing-benefits span,
body.dark-mode .hero-stat-card,
body.dark-mode .switch-pill {
    background: rgba(16, 32, 51, 0.06);
    color: #102033;
}

body.dark-mode .landing-hero .landing-text,
body.dark-mode .hero-stat-card p,
body.dark-mode .hero-stat-card span {
    color: rgba(16, 32, 51, 0.72);
}

body.dark-mode .signal-pill {
    background: rgba(30, 124, 109, 0.14);
    color: #17564d;
    border-color: rgba(30, 124, 109, 0.2);
}

body.dark-mode .mini-tag {
    background: rgba(16, 32, 51, 0.06);
    color: #102033;
    border-color: rgba(16, 32, 51, 0.14);
}

body.dark-mode .mini-tag-label {
    color: rgba(16, 32, 51, 0.64);
}

body.dark-mode .mini-tag-value {
    color: #102033;
}

body.dark-mode .risk-pill {
    background: rgba(179, 122, 34, 0.12);
    color: #83591b;
    border-color: rgba(179, 122, 34, 0.18);
}

body.dark-mode .risk-pill.is-high,
body.dark-mode .mini-tag.is-warning {
    background: rgba(191, 96, 77, 0.12);
    color: #8b3426;
    border-color: rgba(191, 96, 77, 0.18);
}

body.dark-mode .risk-pill.is-low,
body.dark-mode .mini-tag.is-good {
    background: rgba(30, 124, 109, 0.12);
    color: #17564d;
    border-color: rgba(30, 124, 109, 0.18);
}

#homeLeaderList .home-item,
#homeSectorPreview .sector-card {
    transition: transform 160ms ease, border-color 160ms ease;
}

#homeLeaderList .home-item:hover,
#homeSectorPreview .sector-card:hover {
    transform: translateY(-1px);
}

@media (max-width: 1180px) {
    .landing-hero,
    .landing-learning-grid {
        grid-template-columns: 1fr;
    }

    .landing-hero h2 {
        max-width: 13ch;
    }
}

@media (max-width: 980px) {
    .quick-start-grid,
    .detail-key-points,
    .pillar-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 820px) {
    body[data-active-section="home"] .content-topbar {
        top: 10px;
    }

    .landing-hero {
        padding: 24px;
    }

    .quick-start-grid,
    .landing-learning-grid,
    .detail-key-points,
    .pillar-grid {
        grid-template-columns: 1fr;
    }

    .guide-card {
        padding: 20px;
        border-radius: 22px;
    }
}

@media (max-width: 560px) {
    .landing-actions,
    .landing-benefits,
    .guide-footer {
        grid-template-columns: 1fr;
    }

    .landing-actions,
    .guide-footer {
        display: grid;
    }

    .hero-action,
    .guide-footer .auth-button,
    .sidebar-guide-button {
        width: 100%;
    }

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