.app-portal-nav {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1;
    min-width: 0;
}

.portal-link,
.portal-menu summary {
    list-style: none;
    border: 1px solid rgba(93, 120, 163, 0.55);
    border-radius: 999px;
    padding: 0.42rem 0.78rem;
    color: #dbe7ff;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.03);
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    cursor: pointer;
    white-space: nowrap;
}

.portal-link:hover,
.portal-link.is-active,
.portal-menu[open] summary,
.portal-menu summary.is-active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(188, 208, 238, 0.7);
}

.portal-menu {
    position: relative;
}

.portal-menu summary::-webkit-details-marker {
    display: none;
}

.portal-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    z-index: 120;
    min-width: 12rem;
    border: 1px solid #d7e0ef;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 18px 40px rgba(9, 18, 30, 0.2);
    padding: 0.45rem;
    display: grid;
    gap: 0.2rem;
}

.portal-dropdown-link {
    text-decoration: none;
    color: #24334c;
    border-radius: 12px;
    padding: 0.55rem 0.65rem;
    font-size: 0.84rem;
    font-weight: 600;
}

.portal-dropdown-link:hover {
    background: #f1f5fd;
}

.portal-home,
.portal-page-shell {
    width: min(1240px, 94vw);
    margin: 0 auto;
    padding: 1rem 0 2.8rem;
    display: grid;
    gap: 1rem;
}

.portal-hero,
.portal-panel,
.portal-slab {
    border: 1px solid rgba(197, 208, 227, 0.9);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 60px rgba(16, 24, 40, 0.12);
}

.portal-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 1rem;
    padding: 1.2rem;
    background:
        radial-gradient(circle at top left, rgba(255, 91, 109, 0.14), transparent 36%),
        linear-gradient(145deg, rgba(15, 29, 51, 0.98), rgba(24, 41, 70, 0.94));
    color: #f3f7ff;
    border-color: rgba(60, 88, 130, 0.72);
}

.portal-kicker,
.portal-category-access,
.portal-product-type {
    margin: 0;
    color: #6d7c97;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.portal-hero .portal-kicker,
.portal-slab-dark .portal-kicker {
    color: #c8d5eb;
}

.portal-hero h1,
.portal-panel h1,
.portal-slab h2 {
    margin: 0.22rem 0 0;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 0.96;
}

.portal-hero-text,
.portal-lead,
.portal-feature-card p,
.portal-shop-card p,
.portal-thread-card p,
.portal-category-card p,
.portal-product-copy p,
.portal-empty-card p,
.portal-reply-card p {
    margin: 0.55rem 0 0;
    color: #61708a;
    line-height: 1.65;
}

.portal-hero-text {
    color: #d2ddf0;
    max-width: 70ch;
}

.portal-highlight {
    color: #ff7b8a;
}

.portal-hero-visual,
.portal-card-stack,
.portal-legend-grid,
.portal-shop-grid,
.portal-category-grid,
.portal-thread-list,
.portal-reply-list,
.portal-product-grid,
.portal-feature-grid,
.portal-feature-grid-wide,
.portal-section-grid {
    display: grid;
    gap: 0.9rem;
}

.portal-logo-card,
.portal-hero-panel,
.portal-feature-card,
.portal-stack-card,
.portal-legend-card,
.portal-shop-card,
.portal-category-card,
.portal-thread-card,
.portal-empty-card,
.portal-reply-card,
.portal-product-card {
    border: 1px solid #dbe3f2;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.94));
    padding: 1rem;
}

.portal-logo-card {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(121, 145, 181, 0.45);
    display: grid;
    place-items: center;
    min-height: 13rem;
}

.portal-logo-card img {
    width: min(480px, 100%);
    height: auto;
    display: block;
}

.portal-hero-panel {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(121, 145, 181, 0.35);
    color: #eff5ff;
}

.portal-list {
    margin: 0.75rem 0 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.42rem;
    line-height: 1.5;
    color: #dbe5f7;
}

.portal-stat-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    margin-top: 1rem;
}

.portal-stat-strip article {
    border: 1px solid rgba(121, 145, 181, 0.38);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.85rem;
    display: grid;
    gap: 0.18rem;
}

.portal-stat-strip strong,
.portal-feature-card h3,
.portal-stack-card strong,
.portal-legend-card strong,
.portal-shop-card strong,
.portal-category-card strong,
.portal-thread-card strong,
.portal-product-copy strong,
.portal-reply-card strong {
    font-size: 1rem;
}

.portal-stat-strip span {
    color: #d4deef;
    font-size: 0.86rem;
    line-height: 1.5;
}

.portal-section {
    display: grid;
    gap: 0.9rem;
}

.section-head-stack {
    align-items: end;
}

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

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

.portal-slab {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
    gap: 1rem;
    padding: 1.1rem;
}

.portal-slab-dark {
    background:
        radial-gradient(circle at top right, rgba(255, 91, 109, 0.14), transparent 36%),
        linear-gradient(145deg, rgba(15, 29, 51, 0.98), rgba(19, 39, 69, 0.95));
    border-color: rgba(57, 83, 124, 0.8);
}

.portal-slab-dark h2,
.portal-slab-dark p,
.portal-slab-dark span,
.portal-slab-dark strong {
    color: #eff5ff;
}

.portal-card-stack,
.portal-legend-grid {
    align-content: start;
}

.portal-legend-grid {
    grid-template-columns: 1fr;
}

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

.portal-page-shell {
    gap: 1rem;
}

.portal-panel {
    padding: 1.1rem;
}

.portal-panel-centered {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.portal-centered-actions {
    justify-content: center;
}

.portal-form-panel {
    max-width: 760px;
    margin: 0 auto;
}

.portal-form {
    display: grid;
    gap: 0.5rem;
}

.portal-form label {
    color: #37455f;
    font-size: 0.82rem;
    font-weight: 600;
}

.portal-form input,
.portal-form textarea,
.portal-form select {
    width: 100%;
    border: 1px solid #d7dfed;
    border-radius: 14px;
    padding: 0.75rem 0.82rem;
    font: inherit;
    background: #fff;
}

.portal-form ul.errorlist,
.auth-form ul.errorlist {
    margin: 0;
    padding: 0;
    list-style: none;
    color: #b0233d;
    font-size: 0.76rem;
}

.portal-section-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.portal-section-grid-tight {
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
}

.portal-community-hero,
.portal-shop-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.portal-chip-row,
.portal-inline-actions,
.portal-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

.section-chip.is-success {
    border-color: #c7ecd5;
    background: #eff9f2;
    color: #225b3d;
}

.section-chip.section-chip-link {
    text-decoration: none;
}

.section-chip.section-chip-link.is-active {
    border-color: #d04a5d;
    background: #fff1f4;
    color: #8d263c;
}

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

.portal-category-card,
.portal-thread-card {
    text-decoration: none;
    color: inherit;
    display: grid;
    gap: 0.28rem;
}

.portal-thread-card-wide {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.portal-thread-card:hover,
.portal-category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(20, 32, 51, 0.08);
}

.portal-thread-meta {
    display: grid;
    gap: 0.2rem;
    text-align: right;
    color: #6d7b94;
}

.portal-thread-detail {
    display: grid;
    gap: 1rem;
}

.portal-thread-detail-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.portal-post-body {
    color: #22344f;
    line-height: 1.75;
}

.portal-post-body p:first-child {
    margin-top: 0;
}

.portal-post-body p:last-child {
    margin-bottom: 0;
}

.portal-post-body-compact {
    margin-top: 0.45rem;
}

.portal-reply-card header {
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
    align-items: baseline;
}

.portal-reply-card small,
.portal-thread-card small,
.portal-category-card small {
    color: #6d7b94;
}

.portal-link-button {
    border: 0;
    background: transparent;
    color: #203a61;
    font: inherit;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
}

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

.portal-product-card {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 0.85rem;
    align-items: stretch;
}

.portal-product-media {
    border-radius: 18px;
    background: #eef3fb;
    overflow: hidden;
    min-height: 132px;
}

.portal-product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.portal-product-placeholder {
    width: 100%;
    height: 100%;
    min-height: 132px;
    display: grid;
    place-items: center;
    color: #52627b;
    font-weight: 700;
    text-align: center;
    padding: 0.75rem;
}

.portal-product-copy {
    display: grid;
    gap: 0.3rem;
    align-content: start;
}

.portal-product-meta {
    justify-content: space-between;
    margin-top: 0.25rem;
}

.google-auth-panel {
    display: grid;
    gap: 0.45rem;
    margin-top: 1rem;
}

.auth-helper {
    margin: 0;
    color: #61708a;
    font-size: 0.82rem;
    line-height: 1.5;
}

.auth-error {
    margin: 0;
    border: 1px solid #ffd3db;
    background: rgba(255, 244, 246, 0.95);
    color: #81233a;
    border-radius: 12px;
    padding: 0.68rem 0.78rem;
    font-size: 0.82rem;
}

@media (max-width: 1080px) {
    .portal-hero,
    .portal-slab,
    .portal-section-grid,
    .portal-section-grid-tight,
    .portal-feature-grid,
    .portal-feature-grid-wide,
    .portal-category-grid,
    .portal-shop-preview .portal-shop-grid,
    .portal-product-grid {
        grid-template-columns: 1fr;
    }

    .portal-community-hero,
    .portal-shop-hero,
    .portal-thread-detail-head {
        flex-direction: column;
    }
}

@media (max-width: 860px) {
    .app-topbar {
        flex-wrap: wrap;
        justify-content: center;
    }

    .app-topbar-brand {
        width: 100%;
        justify-content: center;
    }

    .app-portal-nav,
    .app-topbar-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .portal-stat-strip {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .portal-link,
    .portal-menu summary {
        font-size: 0.76rem;
    }

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

:root {
    color-scheme: light;
    --site-bg-solid: #f4f7fb;
    --site-bg-layer:
        radial-gradient(circle at top left, rgba(255, 91, 109, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 30%),
        linear-gradient(180deg, #f8fbff 0%, #eef3f9 45%, #f5f7fb 100%);
    --site-text-strong: #142033;
    --site-text-medium: #2d3f58;
    --site-text-soft: #54657f;
    --site-text-subtle: #667894;
    --site-border: #d4deec;
    --site-border-strong: #bccbe0;
    --site-surface: rgba(255, 255, 255, 0.94);
    --site-surface-elevated: rgba(255, 255, 255, 0.98);
    --site-surface-soft: #f3f7ff;
    --site-surface-soft-2: #eaf1fb;
    --site-link: #123e70;
    --site-link-hover: #0d2c52;
    --site-shadow-strong: 0 22px 52px rgba(13, 23, 37, 0.12);
    --theme-toggle-bg: rgba(255, 255, 255, 0.92);
    --theme-toggle-border: #d3ddec;
    --theme-toggle-text: #223149;
    --theme-toggle-track: linear-gradient(90deg, #ffd57a, #ff8f70);
    --theme-toggle-thumb: #ffffff;
    --success-bg: #eff9f2;
    --success-border: #c7ecd5;
    --success-text: #225b3d;
    --danger-bg: #fff1f4;
    --danger-border: #f5c6cf;
    --danger-text: #8d263c;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --site-bg-solid: #07111f;
    --site-bg-layer:
        radial-gradient(circle at top left, rgba(255, 91, 109, 0.18), transparent 30%),
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.14), transparent 32%),
        linear-gradient(180deg, #09101d 0%, #0d1523 45%, #0b1320 100%);
    --site-text-strong: #eef4ff;
    --site-text-medium: #d5def0;
    --site-text-soft: #a9b9d3;
    --site-text-subtle: #95a8c7;
    --site-border: #29384f;
    --site-border-strong: #3a4d6c;
    --site-surface: rgba(12, 22, 37, 0.92);
    --site-surface-elevated: rgba(15, 26, 43, 0.98);
    --site-surface-soft: #122033;
    --site-surface-soft-2: #17283e;
    --site-link: #9ec9ff;
    --site-link-hover: #d2e7ff;
    --site-shadow-strong: 0 24px 56px rgba(0, 0, 0, 0.34);
    --theme-toggle-bg: rgba(10, 17, 29, 0.95);
    --theme-toggle-border: #304666;
    --theme-toggle-text: #edf3ff;
    --theme-toggle-track: linear-gradient(90deg, #14233a, #304a70);
    --theme-toggle-thumb: #f8fbff;
    --success-bg: rgba(58, 147, 96, 0.16);
    --success-border: rgba(95, 214, 146, 0.36);
    --success-text: #98efb9;
    --danger-bg: rgba(185, 57, 85, 0.16);
    --danger-border: rgba(255, 120, 148, 0.34);
    --danger-text: #ffb4c2;
}

body {
    background: var(--site-bg-layer);
    background-color: var(--site-bg-solid);
    color: var(--site-text-strong);
    transition: background-color 0.25s ease, color 0.25s ease;
}

body.app-authenticated::before {
    background:
        radial-gradient(circle at 8% 10%, rgba(255, 91, 109, 0.1), transparent 24%),
        radial-gradient(circle at 92% 4%, rgba(56, 189, 248, 0.12), transparent 22%);
}

html[data-theme="dark"] body.app-authenticated::before {
    background:
        radial-gradient(circle at 8% 10%, rgba(255, 91, 109, 0.12), transparent 24%),
        radial-gradient(circle at 92% 4%, rgba(56, 189, 248, 0.14), transparent 22%);
}

.site-header {
    border-bottom-color: var(--site-border);
}

.site-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.8rem;
    flex: 1;
    min-width: 0;
}

.theme-toggle {
    border: 1px solid var(--theme-toggle-border);
    background: var(--theme-toggle-bg);
    color: var(--theme-toggle-text);
    border-radius: 999px;
    min-height: 2.45rem;
    padding: 0.28rem 0.8rem 0.28rem 0.34rem;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(10, 20, 36, 0.1);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--site-border-strong);
}

.theme-toggle-track {
    width: 2.45rem;
    height: 1.38rem;
    border-radius: 999px;
    background: var(--theme-toggle-track);
    padding: 0.2rem;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.theme-toggle-thumb {
    width: 0.98rem;
    height: 0.98rem;
    border-radius: 999px;
    background: var(--theme-toggle-thumb);
    box-shadow: 0 3px 10px rgba(7, 15, 28, 0.28);
    transform: translateX(0);
    transition: transform 0.2s ease;
}

html[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(1.05rem);
}

.app-theme-toggle {
    background: rgba(255, 255, 255, 0.08);
    color: #ecf3ff;
    border-color: rgba(125, 149, 186, 0.38);
}

.app-theme-toggle:hover {
    border-color: rgba(188, 208, 238, 0.7);
}

.site-nav a,
.site-nav .nav-link-strong,
.btn-secondary,
.btn-ghost,
.social-btn,
.profile-trigger,
.profile-dropdown,
.profile-logout,
.portal-dropdown,
.portal-dropdown-link,
.section-chip,
.portal-form input,
.portal-form textarea,
.portal-form select,
.auth-form input,
.auth-form select,
.auth-form textarea,
.field-stack select,
.field-stack textarea,
.checkin-field input,
.app-input {
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.site-nav a {
    color: var(--site-text-medium);
    border-color: var(--site-border);
    background: var(--site-surface-elevated);
}

.site-nav a:hover {
    border-color: var(--site-border-strong);
    background: var(--site-surface-soft);
}

.site-nav .nav-link-strong {
    border-color: var(--site-border-strong);
    background: var(--site-surface-soft);
    color: var(--site-text-strong);
}

.profile-trigger {
    border-color: var(--site-border);
    background: linear-gradient(180deg, var(--site-surface-elevated), var(--site-surface-soft));
    color: var(--site-text-strong);
}

.profile-avatar {
    background: linear-gradient(180deg, #e7eefb, #d4e1f4);
    border-color: #bfd0ec;
    color: #203248;
}

.profile-trigger-caret,
.profile-name,
.portal-thread-meta,
.portal-reply-card small,
.portal-thread-card small,
.portal-category-card small,
.portal-kicker,
.portal-category-access,
.portal-product-type,
.auth-helper,
.auth-subtle,
.auth-foot,
.portal-form label,
.section-kicker,
.metric-label,
.history-metrics-grid p,
.mini-history-card p,
.metric-chart-head p,
.portal-feature-card p,
.portal-shop-card p,
.portal-thread-card p,
.portal-category-card p,
.portal-product-copy p,
.portal-empty-card p,
.portal-reply-card p,
.portal-hero-text,
.portal-lead {
    color: var(--site-text-soft);
}

.profile-dropdown,
.portal-dropdown {
    background: var(--site-surface-elevated);
    border-color: var(--site-border);
    box-shadow: var(--site-shadow-strong);
}

.profile-logout,
.portal-dropdown-link {
    color: var(--site-text-strong);
}

.profile-logout {
    border-color: var(--site-border);
    background: var(--site-surface-soft);
}

.profile-logout:hover,
.portal-dropdown-link:hover {
    background: var(--site-surface-soft-2);
}

.portal-panel,
.portal-slab,
.portal-logo-card,
.portal-feature-card,
.portal-stack-card,
.portal-legend-card,
.portal-shop-card,
.portal-category-card,
.portal-thread-card,
.portal-empty-card,
.portal-reply-card,
.portal-product-card,
.portal-product-media,
.hero-content,
.value-card,
.auth-card,
.pricing-card,
.prose-shell,
.support-card,
.panel,
.launch-card,
.stage-panel,
.stage-card,
.measurement-card,
.report-card,
.history-item,
.task-row,
.metric-chart-card,
.mini-history-card,
.chart-host,
.mini-chart,
.checkin-fieldset {
    background: var(--site-surface);
    border-color: var(--site-border);
    box-shadow: var(--site-shadow-strong);
}

.portal-hero,
.portal-slab-dark,
.portal-hero-panel,
.portal-logo-card,
.portal-stat-strip article,
.analytics-cta-card,
.launch-hero {
    box-shadow: 0 24px 54px rgba(8, 16, 31, 0.2);
}

.portal-panel h1,
.portal-panel h2,
.portal-panel h3,
.portal-slab h2,
.portal-feature-card h3,
.portal-stack-card strong,
.portal-legend-card strong,
.portal-shop-card strong,
.portal-category-card strong,
.portal-thread-card strong,
.portal-product-copy strong,
.portal-reply-card strong,
.portal-post-body,
.portal-link-button,
.section-link,
.hero-content h1,
.value-card h2,
.auth-card h1,
.pricing-card h1,
.pricing-card .price,
.prose-shell h1,
.prose-shell h2,
.support-card h1,
.support-card h2,
.stage-card h2,
.stage-card h3,
.stage-header h1,
.measurement-card strong,
.report-card h3,
.history-item,
.mini-history-card strong,
.metric-chart-head strong,
.legend-item,
.chart-axis,
.chart-empty,
.field-stack,
.checkin-field,
.app-label {
    color: var(--site-text-strong);
}

.section-chip {
    background: var(--site-surface-soft);
    color: var(--site-text-medium);
    border-color: var(--site-border);
}

.section-chip.is-success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success-text);
}

.section-chip.section-chip-link.is-active {
    border-color: var(--danger-border);
    background: var(--danger-bg);
    color: var(--danger-text);
}

.section-link,
.portal-link-button,
.auth-foot a,
.auth-helper a,
.prose-shell a,
.support-card a,
.price span {
    color: var(--site-link);
}

.section-link:hover,
.portal-link-button:hover,
.auth-foot a:hover,
.auth-helper a:hover,
.prose-shell a:hover,
.support-card a:hover {
    color: var(--site-link-hover);
}

.btn-secondary {
    background: var(--site-surface-soft);
    color: var(--site-text-strong);
    border-color: var(--site-border);
}

.btn-ghost {
    background: transparent;
    color: var(--site-text-strong);
    border-color: var(--site-border-strong);
}

.btn-secondary:hover,
.btn-ghost:hover {
    background: var(--site-surface-soft-2);
}

.social-btn,
.portal-product-media,
.portal-product-placeholder,
.chart-host,
.mini-chart,
.task-row,
.measurement-card,
.report-card,
.history-item,
.stage-card,
.value-card,
.panel,
.support-card,
.portal-form input,
.portal-form textarea,
.portal-form select,
.auth-form input,
.auth-form select,
.auth-form textarea,
.field-stack select,
.field-stack textarea,
.checkin-field input,
.app-input {
    background: var(--site-surface-elevated);
    color: var(--site-text-strong);
    border-color: var(--site-border);
}

.portal-product-placeholder,
.stage-card p,
.support-card p,
.prose-shell p,
.value-card p,
.hero-content p,
.support-form label,
.launch-copy,
.launch-metrics span,
.calendar-subtitle {
    color: var(--site-text-soft);
}

.history-item.completed span,
.status-pill.complete,
.submit-ok {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success-text);
}

.history-item.missed span,
.auth-error,
.flash-message.error {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger-text);
}

html[data-theme="dark"] .portal-panel,
html[data-theme="dark"] .portal-slab,
html[data-theme="dark"] .portal-feature-card,
html[data-theme="dark"] .portal-stack-card,
html[data-theme="dark"] .portal-legend-card,
html[data-theme="dark"] .portal-shop-card,
html[data-theme="dark"] .portal-category-card,
html[data-theme="dark"] .portal-thread-card,
html[data-theme="dark"] .portal-empty-card,
html[data-theme="dark"] .portal-reply-card,
html[data-theme="dark"] .portal-product-card,
html[data-theme="dark"] .hero-content,
html[data-theme="dark"] .value-card,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .pricing-card,
html[data-theme="dark"] .prose-shell,
html[data-theme="dark"] .support-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .launch-card,
html[data-theme="dark"] .stage-panel,
html[data-theme="dark"] .stage-card,
html[data-theme="dark"] .measurement-card,
html[data-theme="dark"] .report-card,
html[data-theme="dark"] .history-item,
html[data-theme="dark"] .task-row,
html[data-theme="dark"] .metric-chart-card,
html[data-theme="dark"] .mini-history-card,
html[data-theme="dark"] .chart-host,
html[data-theme="dark"] .mini-chart,
html[data-theme="dark"] .checkin-fieldset,
html[data-theme="dark"] .portal-product-media,
html[data-theme="dark"] .social-btn,
html[data-theme="dark"] .portal-form input,
html[data-theme="dark"] .portal-form textarea,
html[data-theme="dark"] .portal-form select,
html[data-theme="dark"] .auth-form input,
html[data-theme="dark"] .auth-form select,
html[data-theme="dark"] .auth-form textarea,
html[data-theme="dark"] .field-stack select,
html[data-theme="dark"] .field-stack textarea,
html[data-theme="dark"] .checkin-field input,
html[data-theme="dark"] .app-input {
    background: linear-gradient(180deg, rgba(17, 31, 50, 0.98), rgba(10, 21, 35, 0.96));
}

html[data-theme="dark"] .portal-product-placeholder,
html[data-theme="dark"] .site-nav a,
html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .section-chip,
html[data-theme="dark"] .profile-logout,
html[data-theme="dark"] .portal-dropdown-link:hover {
    background: var(--site-surface-soft);
}

html[data-theme="dark"] .site-header {
    border-bottom-color: rgba(59, 77, 107, 0.6);
}

html[data-theme="dark"] .portal-dropdown-link,
html[data-theme="dark"] .profile-logout,
html[data-theme="dark"] .profile-name,
html[data-theme="dark"] .profile-trigger-caret,
html[data-theme="dark"] .portal-link-button,
html[data-theme="dark"] .section-link,
html[data-theme="dark"] .auth-foot a,
html[data-theme="dark"] .auth-helper a,
html[data-theme="dark"] .prose-shell a,
html[data-theme="dark"] .support-card a,
html[data-theme="dark"] .price span {
    color: var(--site-link);
}

html[data-theme="dark"] .portal-link,
html[data-theme="dark"] .portal-menu summary {
    background: rgba(255, 255, 255, 0.06);
    color: #eef4ff;
}

html[data-theme="dark"] .portal-link:hover,
html[data-theme="dark"] .portal-link.is-active,
html[data-theme="dark"] .portal-menu[open] summary,
html[data-theme="dark"] .portal-menu summary.is-active,
html[data-theme="dark"] .app-topbar-link:hover,
html[data-theme="dark"] .app-topbar-link.is-active {
    background: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] .calendar-sheet,
html[data-theme="dark"] .calendar-table-wrap {
    background: #05070b;
}

@media (max-width: 1020px) {
    .site-header-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .site-nav {
        width: 100%;
        order: 2;
        justify-content: flex-start;
    }
}

@media (max-width: 620px) {
    .site-header-actions {
        gap: 0.6rem;
    }

    .theme-toggle {
        width: 100%;
        justify-content: center;
    }

    .app-theme-toggle {
        width: auto;
    }
}
