:root {
    color-scheme: light;
    --bg: #efe2cd;
    --bg-deep: #d9b88f;
    --panel: rgba(255, 250, 241, 0.84);
    --panel-strong: rgba(255, 252, 245, 0.96);
    --panel-active: rgba(255, 244, 224, 0.98);
    --text: #1e1a17;
    --muted: #6c6255;
    --line: rgba(63, 46, 30, 0.14);
    --primary: #8b3d23;
    --primary-deep: #4a1c10;
    --best: #226347;
    --good: #305f89;
    --neutral: #7d6d58;
    --risky: #9c4035;
    --shadow: 0 22px 60px rgba(75, 52, 28, 0.14);
    --page-bg:
        radial-gradient(
            circle at top left,
            rgba(255, 255, 255, 0.72),
            transparent 26%
        ),
        radial-gradient(
            circle at 85% 15%,
            rgba(139, 61, 35, 0.14),
            transparent 22%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(217, 184, 143, 0.35),
            transparent 30%
        ),
        linear-gradient(135deg, #f8f0e1, #ead6b7 52%, #d8b48b);
    --font-body: "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
    --font-display:
        "Iowan Old Style", "Palatino Linotype", "Noto Serif SC", serif;
    font-family: var(--font-body);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #11161d;
    --bg-deep: #233142;
    --panel: rgba(20, 28, 38, 0.84);
    --panel-strong: rgba(25, 34, 46, 0.96);
    --panel-active: rgba(34, 47, 63, 0.98);
    --text: #ecf0f6;
    --muted: #a4b0bf;
    --line: rgba(255, 255, 255, 0.1);
    --primary: #d7925b;
    --primary-deep: #f0c89c;
    --best: #59ad85;
    --good: #77a9d3;
    --neutral: #7a8798;
    --risky: #da7a68;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
    --page-bg:
        radial-gradient(
            circle at top left,
            rgba(96, 134, 170, 0.22),
            transparent 28%
        ),
        radial-gradient(
            circle at 85% 15%,
            rgba(215, 146, 91, 0.16),
            transparent 24%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(33, 61, 88, 0.28),
            transparent 34%
        ),
        linear-gradient(145deg, #0e141a, #16202b 52%, #1d2a38);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--page-bg);
    transition:
        background 220ms ease,
        color 220ms ease;
}

button {
    font: inherit;
}

button:disabled {
    cursor: wait;
    opacity: 0.78;
}

.app-shell {
    width: min(1200px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.mode-shell {
    display: grid;
    gap: 24px;
}

.banner-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 30;
    display: grid;
    gap: 10px;
    width: min(400px, calc(100vw - 28px));
}

.banner-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px 16px;
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 34px rgba(25, 17, 11, 0.16);
    animation: banner-in 180ms ease-out;
}

.banner-card.info {
    background: rgba(255, 248, 239, 0.96);
}

.banner-card.success {
    background: rgba(236, 250, 241, 0.96);
}

.banner-card.error {
    color: #fff4ef;
    background: linear-gradient(135deg, #8f342c, #5e1e1b);
}

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

.banner-copy strong {
    display: block;
}

.banner-copy p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.banner-card.error .banner-copy p {
    color: #ffe2d9;
}

.banner-dismiss {
    flex-shrink: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.16);
    color: inherit;
    cursor: pointer;
}

.banner-dismiss:hover {
    background: rgba(255, 255, 255, 0.24);
}

@keyframes banner-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.mode-switch {
    display: grid;
    gap: 18px;
    margin-bottom: 24px;
}

.mode-switch-copy h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 2vw, 2.4rem);
    line-height: 1;
}

.mode-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.mode-tab {
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 18px;
    text-align: left;
    cursor: pointer;
    background: linear-gradient(
        180deg,
        rgba(255, 252, 246, 0.98),
        rgba(249, 240, 226, 0.96)
    );
    transition:
        transform 160ms ease,
        box-shadow 160ms ease,
        border-color 160ms ease;
}

.mode-tab strong,
.mode-tab span {
    display: block;
}

.mode-tab strong {
    font-family: var(--font-display);
    font-size: 1.12rem;
}

.mode-tab span {
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.55;
}

.mode-tab.is-active {
    border-color: rgba(139, 61, 35, 0.38);
    background: linear-gradient(
        180deg,
        var(--panel-active),
        rgba(250, 233, 205, 0.98)
    );
}

.mode-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(71, 51, 29, 0.12);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 360px);
    gap: 24px;
    align-items: stretch;
}

.hero-copy,
.hero-card,
.panel,
.footer-note {
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--panel);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

.hero-copy {
    padding: 34px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--primary);
    font-size: 0.82rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-copy h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 3.6vw, 4.3rem);
    line-height: 0.92;
    letter-spacing: -0.04em;
}

.hero-text {
    max-width: 56ch;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.7;
}

.hero-card {
    display: grid;
    gap: 12px;
    padding: 24px;
    background: linear-gradient(
        180deg,
        rgba(255, 249, 239, 0.98),
        rgba(243, 227, 203, 0.94)
    );
}

.hero-card-line {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
}

.hero-card-line strong {
    color: var(--text);
}

.hero-utility {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--text);
    background: var(--panel-strong);
    cursor: pointer;
}

.hero-utility:hover {
    background: rgba(139, 61, 35, 0.08);
}

.runtime-error,
.pending-note {
    border-radius: 16px;
    padding: 12px 14px;
    font-size: 0.92rem;
}

.runtime-error {
    color: #fff3ed;
    background: linear-gradient(135deg, #8f342c, #5e1e1b);
}

.pending-note {
    color: var(--primary-deep);
    background: rgba(139, 61, 35, 0.08);
}

.reset-button {
    margin-top: 8px;
    border: none;
    border-radius: 14px;
    padding: 12px 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-deep));
    cursor: pointer;
}

.world-strip {
    margin-top: 22px;
}

.world-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.world-card {
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 18px;
    text-align: left;
    cursor: pointer;
    background: linear-gradient(
        180deg,
        rgba(255, 252, 246, 0.98),
        rgba(249, 240, 226, 0.96)
    );
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.world-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(71, 51, 29, 0.12);
}

.world-card.is-active {
    border-color: rgba(139, 61, 35, 0.36);
    background: linear-gradient(
        180deg,
        var(--panel-active),
        rgba(250, 233, 205, 0.98)
    );
}

.world-card-top,
.world-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.world-card-label,
.world-card-count,
.world-card-meta {
    color: var(--muted);
    font-size: 0.82rem;
}

.world-card strong {
    display: block;
    margin-top: 12px;
    font-family: var(--font-display);
    font-size: 1.25rem;
}

.world-card p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.world-card-meta {
    margin-top: 14px;
}

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

.panel,
.footer-note {
    padding: 24px;
}

.panel-head {
    display: grid;
    gap: 6px;
}

.panel-head h2,
.footer-note h2 {
    margin: 0 0 6px;
    font-size: 1.15rem;
}

.panel-head p,
.footer-note p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.metric-stack,
.actions,
.timeline {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.metric-section {
    display: grid;
    gap: 12px;
}

.section-head {
    display: grid;
    gap: 4px;
}

.section-head h3 {
    margin: 0;
    font-size: 0.98rem;
}

.section-head p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.metric-grid {
    display: grid;
    gap: 12px;
}

.metric-card {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel-strong);
}

.metric-card.count {
    background: linear-gradient(
        180deg,
        rgba(255, 252, 245, 0.98),
        rgba(248, 241, 231, 0.96)
    );
}

.metric-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.metric-bar {
    overflow: hidden;
    height: 10px;
    margin-top: 10px;
    border-radius: 999px;
    background: rgba(139, 61, 35, 0.1);
}

.metric-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #ce9860);
}

.metric-description {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.signal-section {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.signal-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.signal-pill,
.signal-empty {
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.88rem;
}

.signal-pill {
    color: var(--primary-deep);
    background: rgba(139, 61, 35, 0.08);
}

.signal-pill.flag {
    color: #fff;
    background: linear-gradient(135deg, #6f2f1f, #4b1f15);
}

.signal-empty {
    margin-top: 14px;
    color: var(--muted);
    background: rgba(74, 28, 16, 0.06);
}

.action-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    text-align: left;
    cursor: pointer;
    background: var(--panel-strong);
    transition:
        transform 140ms ease,
        box-shadow 140ms ease,
        border-color 140ms ease;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(53, 43, 32, 0.12);
}

.action-card:disabled:hover {
    transform: none;
    box-shadow: none;
}

.action-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.action-card p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.timing-badge {
    flex-shrink: 0;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.75rem;
    color: #fff;
    background: var(--primary-deep);
}

.timing-badge.muted {
    background: var(--neutral);
}

.tone-best {
    border-color: rgba(31, 111, 80, 0.32);
}

.tone-good {
    border-color: rgba(71, 109, 158, 0.3);
}

.tone-risky {
    border-color: rgba(165, 69, 61, 0.32);
}

.timeline-empty,
.world-end {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(81, 39, 15, 0.08);
    color: var(--muted);
}

.timeline-entry {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel-strong);
}

.timeline-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.82rem;
}

.timeline-entry strong {
    display: block;
    margin-top: 8px;
}

.timeline-entry p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.entry-note,
.change-list {
    margin-top: 10px;
    font-size: 0.9rem;
}

.entry-note {
    color: var(--primary);
}

.change-list {
    color: var(--primary-deep);
}

.footer-note {
    margin-top: 24px;
}

.legacy-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(300px, 0.95fr);
    gap: 20px;
    align-items: start;
}

.legacy-main,
.legacy-aside {
    display: grid;
    gap: 18px;
}

.home-hero,
.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.home-status-card,
.shortcut-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    background: var(--panel-strong);
}

.home-status-card span,
.shortcut-card strong {
    display: block;
    color: var(--muted);
}

.home-status-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.28rem;
}

.home-status-card p,
.shortcut-card p {
    margin: 8px 0 0;
    color: var(--primary-deep);
    line-height: 1.55;
}

.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.home-shortcuts {
    margin-top: 4px;
}

.legacy-stage {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.stage-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.secondary-button,
.allocation-button {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 14px;
    background: var(--panel-strong);
    color: var(--text);
    cursor: pointer;
}

.secondary-button:hover,
.allocation-button:hover {
    background: rgba(139, 61, 35, 0.08);
}

.helper-copy,
.allocation-total,
.empty-block {
    border-radius: 16px;
    padding: 14px 16px;
    color: var(--muted);
    background: rgba(74, 28, 16, 0.06);
}

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

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

.talent-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    text-align: left;
    cursor: pointer;
    background: var(--panel-strong);
    transition:
        transform 160ms ease,
        box-shadow 160ms ease,
        border-color 160ms ease;
}

.talent-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(53, 43, 32, 0.12);
}

.talent-card.selected {
    border-color: rgba(139, 61, 35, 0.42);
    box-shadow: 0 0 0 2px rgba(139, 61, 35, 0.12);
}

.talent-card-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.talent-card p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.grade-0 {
    background: linear-gradient(
        180deg,
        rgba(245, 244, 239, 0.98),
        rgba(233, 231, 223, 0.96)
    );
}

.grade-1 {
    background: linear-gradient(
        180deg,
        rgba(233, 242, 255, 0.98),
        rgba(210, 227, 252, 0.96)
    );
}

.grade-2 {
    background: linear-gradient(
        180deg,
        rgba(247, 235, 255, 0.98),
        rgba(235, 213, 255, 0.96)
    );
}

.grade-3 {
    background: linear-gradient(
        180deg,
        rgba(255, 236, 224, 0.98),
        rgba(255, 217, 197, 0.96)
    );
}

.allocation-grid {
    display: grid;
    gap: 12px;
}

.allocation-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel-strong);
}

.allocation-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.allocation-input {
    width: 64px;
    padding: 10px 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    color: var(--text);
    text-align: center;
}

.legacy-timeline {
    display: grid;
    gap: 12px;
}

.legacy-timeline-entry,
.notification-card,
.legacy-meta-card,
.summary-card,
.activity-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    background: var(--panel-strong);
}

.legacy-timeline-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.84rem;
}

.legacy-timeline-lines {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.legacy-line strong {
    display: block;
}

.legacy-line p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.legacy-post-event {
    color: var(--primary);
}

.summary-grid,
.legacy-meta,
.notification-list,
.activity-list,
.achievement-total-grid,
.achievement-list {
    display: grid;
    gap: 12px;
}

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

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

.summary-card span,
.legacy-meta-card span {
    display: block;
    color: var(--muted);
}

.summary-card strong,
.legacy-meta-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.35rem;
}

.summary-card p,
.legacy-meta-card p,
.thanks-card p,
.achievement-row p {
    margin: 8px 0 0;
    color: var(--primary-deep);
    line-height: 1.55;
}

.extend-head {
    margin-top: 8px;
}

.legacy-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

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

.activity-card.tone-info {
    border-color: rgba(139, 61, 35, 0.18);
}

.activity-card.tone-success {
    border-color: rgba(34, 99, 71, 0.28);
}

.activity-card.tone-error {
    border-color: rgba(156, 64, 53, 0.32);
}

.activity-card-top,
.activity-badges {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.activity-time {
    color: var(--muted);
    font-size: 0.82rem;
}

.activity-badge {
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.76rem;
}

.activity-badge.source {
    color: var(--primary-deep);
    background: rgba(139, 61, 35, 0.08);
}

.activity-badge.tone-info {
    color: var(--primary-deep);
    background: rgba(139, 61, 35, 0.1);
}

.activity-badge.tone-success {
    color: #17402f;
    background: rgba(83, 170, 124, 0.18);
}

.activity-badge.tone-error {
    color: #fff2ec;
    background: linear-gradient(135deg, #8f342c, #5e1e1b);
}

.activity-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.panel-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.panel-tab {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px 16px;
    text-align: left;
    cursor: pointer;
    background: var(--panel-strong);
    transition:
        transform 140ms ease,
        box-shadow 140ms ease,
        border-color 140ms ease;
}

.panel-tab:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(53, 43, 32, 0.1);
}

.panel-tab strong,
.panel-tab span {
    display: block;
}

.panel-tab span {
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.5;
}

.panel-tab.is-active {
    border-color: rgba(139, 61, 35, 0.36);
    background: linear-gradient(
        180deg,
        var(--panel-active),
        rgba(250, 233, 205, 0.98)
    );
}

.achievement-head {
    margin-top: 4px;
}

.achievement-row,
.thanks-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    background: var(--panel-strong);
}

.achievement-row.is-locked {
    opacity: 0.88;
}

.achievement-row-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.achievement-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.status-badge,
.opportunity-badge {
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.78rem;
}

.opportunity-badge {
    color: var(--primary-deep);
    background: rgba(139, 61, 35, 0.08);
}

.status-badge.is-achieved {
    color: #fff;
    background: linear-gradient(135deg, #2b6c4f, #194531);
}

.status-badge.is-locked {
    color: var(--primary-deep);
    background: rgba(74, 28, 16, 0.08);
}

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

.special-thanks-column {
    display: grid;
    gap: 12px;
}

.thanks-card strong {
    display: block;
    font-size: 1rem;
}

:root[data-theme="dark"] .mode-tab,
:root[data-theme="dark"] .world-card,
:root[data-theme="dark"] .hero-card,
:root[data-theme="dark"] .banner-card.info,
:root[data-theme="dark"] .banner-card.success,
:root[data-theme="dark"] .metric-card.count,
:root[data-theme="dark"] .activity-card,
:root[data-theme="dark"] .panel-tab,
:root[data-theme="dark"] .achievement-row,
:root[data-theme="dark"] .thanks-card,
:root[data-theme="dark"] .home-status-card,
:root[data-theme="dark"] .shortcut-card {
    background: linear-gradient(
        180deg,
        rgba(31, 43, 57, 0.96),
        rgba(22, 31, 42, 0.94)
    );
}

:root[data-theme="dark"] .mode-tab.is-active,
:root[data-theme="dark"] .world-card.is-active,
:root[data-theme="dark"] .panel-tab.is-active {
    background: linear-gradient(
        180deg,
        rgba(44, 61, 79, 0.98),
        rgba(31, 44, 58, 0.96)
    );
}

:root[data-theme="dark"] .grade-0 {
    background: linear-gradient(
        180deg,
        rgba(70, 77, 89, 0.92),
        rgba(52, 58, 68, 0.92)
    );
}

:root[data-theme="dark"] .grade-1 {
    background: linear-gradient(
        180deg,
        rgba(43, 73, 112, 0.92),
        rgba(33, 57, 89, 0.92)
    );
}

:root[data-theme="dark"] .grade-2 {
    background: linear-gradient(
        180deg,
        rgba(86, 58, 112, 0.92),
        rgba(65, 43, 86, 0.92)
    );
}

:root[data-theme="dark"] .grade-3 {
    background: linear-gradient(
        180deg,
        rgba(110, 62, 45, 0.94),
        rgba(84, 45, 31, 0.94)
    );
}

:root[data-theme="dark"] .helper-copy,
:root[data-theme="dark"] .allocation-total,
:root[data-theme="dark"] .empty-block,
:root[data-theme="dark"] .signal-empty,
:root[data-theme="dark"] .pending-note,
:root[data-theme="dark"] .signal-pill,
:root[data-theme="dark"] .activity-badge.source,
:root[data-theme="dark"] .activity-badge.tone-info,
:root[data-theme="dark"] .opportunity-badge,
:root[data-theme="dark"] .hero-utility:hover,
:root[data-theme="dark"] .secondary-button:hover,
:root[data-theme="dark"] .allocation-button:hover {
    background: rgba(240, 200, 156, 0.1);
}

:root[data-theme="dark"] .signal-pill.flag,
:root[data-theme="dark"] .status-badge.is-achieved {
    color: #081117;
    background: linear-gradient(135deg, #d8b185, #f0c89c);
}

:root[data-theme="dark"] .banner-dismiss {
    background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .banner-dismiss:hover {
    background: rgba(255, 255, 255, 0.14);
}

:root[data-theme="dark"] .activity-badge.tone-success {
    color: #081117;
    background: rgba(216, 177, 133, 0.26);
}

:root[data-theme="dark"] .summary-card p,
:root[data-theme="dark"] .legacy-meta-card p,
:root[data-theme="dark"] .thanks-card p,
:root[data-theme="dark"] .achievement-row p,
:root[data-theme="dark"] .home-status-card p,
:root[data-theme="dark"] .shortcut-card p,
:root[data-theme="dark"] .banner-copy p,
:root[data-theme="dark"] .activity-card p,
:root[data-theme="dark"] .activity-time,
:root[data-theme="dark"] .legacy-post-event,
:root[data-theme="dark"] .entry-note,
:root[data-theme="dark"] .change-list {
    color: var(--primary-deep);
}

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

    .legacy-grid,
    .special-thanks-grid {
        grid-template-columns: 1fr;
    }

    .app-shell {
        width: min(100vw - 20px, 1200px);
        padding-top: 20px;
    }
}
