/* Dashboard theme controls and dark palette. The login screen is deliberately excluded. */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.install-app-toggle,
.theme-toggle {
    display: inline-flex;
    width: 32px;
    min-height: 32px;
    min-width: 32px;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 6px;
    border: 1px solid #dbe2f0;
    border-radius: 100px;
    background: #f8faff;
    color: #4338ca;
    font: inherit;
    font-size: 10.5px;
    font-weight: 800;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, color .2s ease, transform .15s ease;
    -webkit-tap-highlight-color: transparent;
}

.install-app-toggle[hidden],
.theme-toggle[hidden] { display: none; }
.install-app-toggle svg { width: 16px; height: 16px; }
.install-app-toggle:hover { background: #eef2ff; border-color: #c7d2fe; }
.install-app-toggle:active { transform: scale(.96); }
.install-app-toggle:focus-visible { outline: 3px solid rgba(99,102,241,.35); outline-offset: 2px; }
.install-app-toggle:disabled { opacity: .55; cursor: wait; }

.theme-toggle:hover { background: #eef2ff; border-color: #c7d2fe; }
.theme-toggle:active { transform: scale(.96); }
.theme-toggle:focus-visible { outline: 3px solid rgba(99,102,241,.35); outline-offset: 2px; }
.theme-toggle-icon { width: 15px; height: 15px; flex: 0 0 auto; }

.option-select-row { padding: 15px; border-bottom: 1px solid var(--line); }
.option-select-row:last-child { border-bottom: 0; }
.choice-heading { display: grid; gap: 3px; }
.choice-heading .toggle-sub,
.option-select-row > .toggle-sub { line-height: 1.65; }
.choice-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.choice-chip {
    min-height: 37px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #e3e8f3;
    border-radius: 999px;
    background: #fff;
    color: #64748b;
    font: inherit;
    font-size: 11.5px;
    font-weight: 750;
    line-height: 1.35;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease, transform .16s ease;
    -webkit-tap-highlight-color: transparent;
}
.choice-chip::before {
    content: '';
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #cbd5e1;
    transition: background .2s ease, box-shadow .2s ease;
}
.choice-chip:hover { border-color: #c7d2fe; color: #4338ca; }
.choice-chip.is-selected {
    border-color: #a5b4fc;
    background: linear-gradient(135deg,#f5f6ff,#eef2ff);
    color: #4338ca;
    box-shadow: 0 3px 10px rgba(79,70,229,.1), inset 0 1px 0 rgba(255,255,255,.9);
}
.choice-chip.is-selected::before { background: #5b55e8; box-shadow: 0 0 0 3px rgba(99,102,241,.13); }
.choice-chip:active { transform: scale(.97); }
.choice-chip:focus-visible { outline: 3px solid rgba(99,102,241,.28); outline-offset: 2px; }
.choice-chip:disabled { opacity: .55; cursor: wait; }

.supplemental-checks { display: grid; gap: 8px; margin-top: 12px; }
.check-option {
    position: relative;
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid #e7eaf2;
    border-radius: 14px;
    background: rgba(255,255,255,.72);
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .16s ease;
}
.check-option:hover { border-color: #c7d2fe; background: #fff; }
.check-option.is-selected {
    border-color: #a5b4fc;
    background: linear-gradient(110deg,rgba(238,242,255,.94),rgba(248,247,255,.96));
    box-shadow: 0 3px 11px rgba(79,70,229,.08);
}
.check-option:active { transform: scale(.99); }
.check-option-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.check-option-mark {
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1.5px solid #cbd5e1;
    border-radius: 7px;
    background: #fff;
    color: #fff;
    transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.check-option-mark svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.65); transition: opacity .16s ease, transform .16s ease; }
.check-option-input:checked + .check-option-mark { border-color: #5b55e8; background: linear-gradient(145deg,#7376f4,#5146dd); box-shadow: 0 3px 8px rgba(79,70,229,.25); }
.check-option-input:checked + .check-option-mark svg { opacity: 1; transform: scale(1); }
.check-option-input:focus-visible + .check-option-mark { outline: 3px solid rgba(99,102,241,.28); outline-offset: 2px; }
.check-option-input:disabled + .check-option-mark { opacity: .55; }
.check-option-copy { display: grid; gap: 2px; color: var(--ink); }
.check-option-copy strong { font-size: 11.5px; font-weight: 800; }
.check-option-copy small { color: var(--ink-soft); font-size: 10px; font-weight: 600; line-height: 1.45; }

.toggle-list .toggle-item { min-height: 60px; transition: background .18s ease, transform .16s ease; }
.toggle-list .toggle-item:hover { background: rgba(99,102,241,.045); }
.toggle-list .toggle-item:active { transform: scale(.995); }
.toggle-list .toggle-item[role="switch"]:focus-visible { position: relative; z-index: 1; outline: 3px solid rgba(99,102,241,.26); outline-offset: -3px; }
.toggle-list .toggle-switch {
    width: 44px;
    height: 26px;
    border: 1px solid #d2d9e6;
    background: #e4e8f0;
    box-shadow: inset 0 1px 2px rgba(15,23,42,.08);
    transition: background .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.toggle-list .toggle-switch::after {
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    box-shadow: 0 2px 5px rgba(15,23,42,.2);
    transition: transform .22s cubic-bezier(.2,.8,.2,1), width .18s ease;
}
.toggle-list .toggle-switch.on { border-color: #5b55e8; background: linear-gradient(110deg,#7779f2,#5146dd); box-shadow: inset 0 1px 2px rgba(35,28,130,.16), 0 2px 7px rgba(79,70,229,.16); }
.toggle-list .toggle-switch.on::after { transform: translateX(-18px); }

.bottom-nav {
    position: relative;
    display: flex;
    flex-direction: row;
    direction: rtl;
    align-items: center;
    justify-content: center;
    width: min(100%, 360px);
    min-height: 64px;
    margin-inline: auto;
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: transparent;
    box-shadow: 0 8px 24px rgba(28,31,66,.12);
    isolation: isolate;
}
.bottom-nav::before {
    content: '';
    position: absolute;
    z-index: -1;
    right: 8%;
    bottom: -10px;
    left: 8%;
    height: 0;
    box-shadow: 0 0 25px 9px rgba(255,0,0,.25),
        50px 10px 25px 8px rgba(18,255,0,.25),
        -40px 8px 25px 9px rgba(242,255,0,.25);
    pointer-events: none;
}
.nav-radio {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    clip-path: inset(50%);
    white-space: nowrap;
}
.nav-tab {
    position: relative;
    z-index: 2;
    flex: 1 1 0;
    min-width: 0;
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .24s ease, transform .2s ease;
}
.nav-tab svg {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 25px;
    height: 25px;
    margin: auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .2s .1s cubic-bezier(.14,-.08,.74,1.4), color .24s ease;
}
.nav-tab:active { transform: scale(.9); }
.nav-circle {
    position: absolute;
    z-index: 1;
    top: -43px;
    left: 50%;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #000;
    box-shadow: 0 82px 20px rgba(128,128,128,.29);
    transform: translateX(-50%);
    pointer-events: none;
    transition: left .2s cubic-bezier(.14,-.08,.74,1.4);
}
.phone_content {
    position: absolute;
    z-index: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 66px;
    overflow: hidden;
    border-radius: 20px;
    background: #fff;
    filter: contrast(20);
    pointer-events: none;
}
.phone_bottom {
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
    height: 66px;
    background: #000;
    filter: blur(10px);
}
.phone_content .indicator {
    position: absolute;
    top: -42px;
    left: 50%;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-image: linear-gradient(0deg,rgba(247,176,176,.9),rgba(183,255,154,0)),
        linear-gradient(0deg,rgba(158,255,151,.75),rgba(183,255,154,0)),
        linear-gradient(0deg,rgba(180,255,251,.85),rgba(183,255,154,0));
    background-size: cover;
    background-position: 0 10px;
    transform: translateX(-50%);
    transition: left .2s cubic-bezier(.14,-.08,.74,1.4);
}
#navHistory:checked ~ .nav-circle { left: 83.333%; }
#navCreate:checked ~ .nav-circle { left: 50%; }
#navProfile:checked ~ .nav-circle { left: 16.667%; }
#navHistory:checked ~ .phone_content .indicator { left: 83.333%; }
#navCreate:checked ~ .phone_content .indicator { left: 50%; }
#navProfile:checked ~ .phone_content .indicator { left: 16.667%; }
#navHistory:checked ~ .nav-tab[for="navHistory"],
#navCreate:checked ~ .nav-tab[for="navCreate"],
#navProfile:checked ~ .nav-tab[for="navProfile"] { color: #fff; }
#navHistory:checked ~ .nav-tab[for="navHistory"] svg,
#navCreate:checked ~ .nav-tab[for="navCreate"] svg,
#navProfile:checked ~ .nav-tab[for="navProfile"] svg { transform: translateY(-46px); }
#navHistory:focus-visible ~ .nav-tab[for="navHistory"],
#navCreate:focus-visible ~ .nav-tab[for="navCreate"],
#navProfile:focus-visible ~ .nav-tab[for="navProfile"] { outline: 2px solid #6366f1; outline-offset: -4px; border-radius: 15px; }
.nav-tab.nav-create .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nav-tab.nav-create .spinner { display: none; width: 21px; height: 21px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.nav-tab.nav-create.loading .create-icon { display: none; }
.nav-tab.nav-create.loading .spinner { display: block; }

.install-prompt-overlay,
.dashboard-panel-overlay,
.generation-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(10,15,35,.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .24s ease, visibility .24s ease;
}
.install-prompt-overlay.show,
.dashboard-panel-overlay.show,
.generation-confirm-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.install-prompt-card {
    position: relative;
    width: min(100%, 360px);
    padding: 28px 24px 20px;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 28px;
    background: linear-gradient(150deg,#fff 0%,#f5f6ff 100%);
    color: #172033;
    text-align: center;
    box-shadow: 0 24px 80px rgba(15,23,42,.28);
    transform: translateY(14px) scale(.97);
    transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.install-prompt-overlay.show .install-prompt-card { transform: translateY(0) scale(1); }
.install-prompt-dismiss {
    position: absolute;
    top: 12px;
    inset-inline-end: 14px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: #eef0fa;
    color: #64748b;
    font: inherit;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
}
.install-prompt-icon {
    position: relative;
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    margin: 2px auto 16px;
    border-radius: 22px;
    background: linear-gradient(145deg,#6366f1,#4338ca);
    color: #fff;
    font-size: 30px;
    font-weight: 900;
    box-shadow: 0 12px 25px rgba(79,70,229,.32);
}
.install-prompt-icon i { position: absolute; inset-inline-end: -6px; top: -7px; color: #fbbf24; font-size: 22px; font-style: normal; }
.install-prompt-eyebrow { margin-bottom: 8px; color: #6366f1; font-size: 10px; font-weight: 850; letter-spacing: .5px; }
.install-prompt-card h2 { margin: 0 0 8px; font-size: 21px; font-weight: 900; letter-spacing: -.4px; }
.install-prompt-card p { margin: 0 auto 20px; max-width: 285px; color: #64748b; font-size: 13px; font-weight: 550; line-height: 1.9; }
.install-prompt-action {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: 15px;
    background: linear-gradient(110deg,#6366f1,#4f46e5);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(79,70,229,.26);
}
.install-prompt-action svg { width: 19px; height: 19px; }
.install-prompt-action:disabled { opacity: .65; cursor: wait; }
.install-prompt-later { margin-top: 12px; padding: 7px 14px; border: 0; background: transparent; color: #94a3b8; font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }

.generation-confirm-overlay { z-index: 2700; }
.generation-confirm-card {
    width: min(100%, 380px);
    padding: 25px 22px 20px;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 26px;
    background: linear-gradient(155deg,#fff 0%,#f7f7ff 100%);
    color: #172033;
    box-shadow: 0 24px 80px rgba(15,23,42,.3);
    text-align: center;
    transform: translateY(12px) scale(.97);
    transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.generation-confirm-overlay.show .generation-confirm-card { transform: translateY(0) scale(1); }
.generation-confirm-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin: 0 auto 10px;
    border: 1px solid #e0e7ff;
    border-radius: 16px;
    background: linear-gradient(145deg,#eef2ff,#e9e7ff);
    color: #5146e8;
    font-size: 25px;
    font-weight: 900;
}
.generation-confirm-eyebrow { margin-bottom: 5px; color: #6366f1; font-size: 10px; font-weight: 850; }
.generation-confirm-card h2 { margin: 0 0 6px; font-size: 18px; font-weight: 900; line-height: 1.6; }
.generation-confirm-card p { margin: 0 auto 14px; max-width: 310px; color: #64748b; font-size: 12px; font-weight: 550; line-height: 1.8; }
.generation-confirm-topic { padding: 11px 13px; border: 1px solid #e6e9f5; border-radius: 13px; background: #fff; color: #26324a; font-size: 13px; font-weight: 800; line-height: 1.7; overflow-wrap: anywhere; text-align: start; }
.generation-confirm-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.generation-confirm-meta span { padding: 5px 9px; border-radius: 100px; background: #eef2ff; color: #4f46e5; font-size: 10px; font-weight: 750; }
.generation-confirm-actions { display: grid; grid-template-columns: .85fr 1.35fr; gap: 9px; margin-top: 17px; }
.generation-confirm-actions button { min-height: 46px; border-radius: 13px; font: inherit; font-size: 12px; font-weight: 850; cursor: pointer; transition: transform .15s ease, background .2s ease; }
.generation-confirm-actions button:active { transform: scale(.97); }
.generation-confirm-cancel { border: 1px solid #e2e8f0; background: #fff; color: #64748b; }
.generation-confirm-submit { border: 0; background: linear-gradient(110deg,#6366f1,#4f46e5); color: #fff; box-shadow: 0 7px 16px rgba(79,70,229,.22); }
.generation-confirm-submit:disabled { opacity: .65; cursor: wait; }

.dashboard-panel-overlay { align-items: flex-end; padding: 0; z-index: 2200; }
.dashboard-panel {
    width: min(100%, 440px);
    max-height: min(78dvh, 640px);
    padding: 12px 20px calc(22px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    border-radius: 26px 26px 0 0;
    background: #fff;
    color: #0f172a;
    box-shadow: 0 -16px 50px rgba(15,23,42,.18);
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.32,.72,0,1);
}
.dashboard-panel-overlay.show .dashboard-panel { transform: translateY(0); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.panel-heading h2 { font-size: 18px; font-weight: 850; }
.panel-close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f1f5f9; color: #64748b; font: inherit; font-size: 22px; cursor: pointer; }
.history-empty { padding: 30px 12px; color: #94a3b8; text-align: center; font-size: 13px; line-height: 1.8; }
.history-list { display: grid; gap: 10px; }
.history-card { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid #e8ecf4; border-radius: 16px; background: #fafbff; }
.history-card-icon { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; background: #eef2ff; font-size: 20px; }
.history-card-info { min-width: 0; flex: 1; }
.history-card-title { overflow: hidden; color: #1e293b; font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.history-card-meta { margin-top: 4px; color: #94a3b8; font-size: 10px; font-weight: 650; }
.history-open { flex: 0 0 auto; padding: 8px 11px; border: 0; border-radius: 10px; background: #eef2ff; color: #4338ca; font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
.profile-card { padding: 18px; border-radius: 20px; background: linear-gradient(135deg,#eef2ff,#f5f3ff); }
.profile-avatar { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 18px; background: linear-gradient(145deg,#6366f1,#4338ca); color: #fff; font-size: 22px; font-weight: 850; }
.profile-name { color: #1e293b; font-size: 17px; font-weight: 850; }
.profile-email { margin-top: 3px; color: #64748b; font-size: 11px; direction: ltr; text-align: right; }
.subscription-card { margin-top: 12px; padding: 16px; border: 1px solid #e8ecf4; border-radius: 18px; }
.subscription-label { color: #64748b; font-size: 11px; font-weight: 750; }
.subscription-value { margin-top: 5px; color: #4338ca; font-size: 18px; font-weight: 900; }
.subscription-note { margin-top: 5px; color: #94a3b8; font-size: 11px; line-height: 1.7; }
.profile-loading { padding: 26px 8px; color: #94a3b8; text-align: center; font-size: 13px; }

@media (max-width: 360px) {
    .bottom-nav { min-height: 64px; }
    .install-prompt-card { padding-inline: 20px; }
}

.app[data-dashboard-theme="dark"] {
    --bg: #0b1020;
    --bg-soft: #151d30;
    --ink: #e8edf7;
    --ink-soft: #a5b1c7;
    --ink-faint: #7f8ba3;
    --line: #2b354a;
    --accent: #818cf8;
    --accent-soft: #24264a;
    --accent-ink: #c7d2fe;
    --success: #34d399;
    color: var(--ink);
    color-scheme: dark;
    background: #0b1020;
}

body.dashboard-theme-dark { background: #0b1020; }

.app[data-dashboard-theme="dark"] .logo-mark {
    background: linear-gradient(145deg, #6366f1, #4f46e5);
    box-shadow: 0 4px 14px rgba(99,102,241,.35);
}

.app[data-dashboard-theme="dark"] .header-badge {
    background: #102a27;
    color: #6ee7b7;
}

.app[data-dashboard-theme="dark"] .header-badge .dot {
    background: #34d399;
    box-shadow: 0 0 7px rgba(52,211,153,.75);
}

.app[data-dashboard-theme="dark"] .install-app-toggle,
.app[data-dashboard-theme="dark"] .theme-toggle {
    border-color: #35415a;
    background: #182238;
    color: #c7d2fe;
}
.app[data-dashboard-theme="dark"] .install-app-toggle:hover { background: #242d48; border-color: #525f80; }
.app[data-dashboard-theme="dark"] .theme-toggle:hover { background: #242d48; border-color: #525f80; }
.app[data-dashboard-theme="dark"] .install-app-toggle:focus-visible { outline-color: rgba(165,180,252,.55); }
.app[data-dashboard-theme="dark"] .theme-toggle:focus-visible { outline-color: rgba(165,180,252,.55); }

.app[data-dashboard-theme="dark"] .input:focus {
    background: #10182a;
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(129,140,248,.16);
}

.app[data-dashboard-theme="dark"] .stepper-btn,
.app[data-dashboard-theme="dark"] .type-card.active,
.app[data-dashboard-theme="dark"] .type-icon,
.app[data-dashboard-theme="dark"] .format-btn.active,
.app[data-dashboard-theme="dark"] .standard-card.active {
    background: #1b253a;
    color: var(--ink);
}

.app[data-dashboard-theme="dark"] .type-card.active,
.app[data-dashboard-theme="dark"] .standard-card.active {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(99,102,241,.18);
}

.app[data-dashboard-theme="dark"] .type-card.active .type-name,
.app[data-dashboard-theme="dark"] .type-card.active .type-desc {
    color: var(--ink);
}

.app[data-dashboard-theme="dark"] .type-card.active .type-icon {
    background: #2a2e58;
    color: #c7d2fe;
}

.app[data-dashboard-theme="dark"] .standard-card.recommended { border-color: #34d399; }
.app[data-dashboard-theme="dark"] .toggle-item:active { background: #202a3e; }
.app[data-dashboard-theme="dark"] .toggle-list .toggle-switch { border-color: #46516a; background: #303b52; }
.app[data-dashboard-theme="dark"] .toggle-list .toggle-switch.on { border-color: #7375ee; background: linear-gradient(110deg,#7779f2,#5146dd); }
.app[data-dashboard-theme="dark"] .toggle-list .toggle-switch::after { background: #f8fafc; }
.app[data-dashboard-theme="dark"] .choice-chip { border-color: #35415a; background: #151d30; color: #b0bbcf; }
.app[data-dashboard-theme="dark"] .choice-chip:hover { border-color: #6266bb; color: #d6d8ff; }
.app[data-dashboard-theme="dark"] .choice-chip.is-selected { border-color: #7375ee; background: linear-gradient(135deg,#292b53,#242746); color: #e2e3ff; box-shadow: 0 3px 12px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.04); }
.app[data-dashboard-theme="dark"] .choice-chip.is-selected::before { background: #9698ff; box-shadow: 0 0 0 3px rgba(129,140,248,.16); }
.app[data-dashboard-theme="dark"] .check-option { border-color: #303b52; background: rgba(21,29,48,.84); }
.app[data-dashboard-theme="dark"] .check-option:hover { border-color: #6266bb; background: #192238; }
.app[data-dashboard-theme="dark"] .check-option.is-selected { border-color: #7375ee; background: linear-gradient(110deg,rgba(41,43,83,.94),rgba(31,35,62,.96)); box-shadow: 0 3px 11px rgba(0,0,0,.16); }
.app[data-dashboard-theme="dark"] .check-option-mark { border-color: #58637a; background: #10182a; }
.app[data-dashboard-theme="dark"] .check-option-input:checked + .check-option-mark { border-color: #818cf8; background: linear-gradient(145deg,#7779f2,#5146dd); }

.app[data-dashboard-theme="dark"] .hint-box {
    background: #202444;
    color: #c7d2fe;
}
.app[data-dashboard-theme="dark"] .detect-badge {
    background: #10352e;
    color: #6ee7b7;
}
.app[data-dashboard-theme="dark"] .detect-badge.unknown {
    background: #3a2b16;
    color: #fcd34d;
}

.app[data-dashboard-theme="dark"] .generate-btn {
    background: linear-gradient(145deg, #6366f1, #4f46e5);
    box-shadow: 0 8px 22px rgba(79,70,229,.34);
}

body.dashboard-theme-dark .overlay {
    background: rgba(3,7,18,.74);
}
body.dashboard-theme-dark .overlay .sheet {
    --ink: #e8edf7;
    --ink-soft: #a5b1c7;
    --ink-faint: #7f8ba3;
    --bg-soft: #151d30;
    --line: #2b354a;
    background: #111827;
    color: var(--ink);
}
body.dashboard-theme-dark .sheet-handle { background: #3b465c; }
body.dashboard-theme-dark .sheet-icon,
body.dashboard-theme-dark .file-card-icon { background: #202444; color: #a5b4fc; }
body.dashboard-theme-dark .sheet-btn-outline {
    border-color: #3c4663;
    background: linear-gradient(145deg, #252b49, #1c233b);
    color: #dbe4ff;
    box-shadow: 0 5px 14px rgba(0,0,0,.2);
}
body.dashboard-theme-dark .sheet-btn-outline:hover { box-shadow: 0 8px 18px rgba(0,0,0,.32); }
body.dashboard-theme-dark .sheet-close:active { color: #fff; }
body.dashboard-theme-dark .dashboard-panel { background: #111827; color: #e8edf7; }
body.dashboard-theme-dark .panel-close { background: #202a3e; color: #a5b1c7; }
body.dashboard-theme-dark .history-card { border-color: #2b354a; background: #151d30; }
body.dashboard-theme-dark .history-card-title,
body.dashboard-theme-dark .profile-name { color: #e8edf7; }
body.dashboard-theme-dark .history-card-icon,
body.dashboard-theme-dark .history-open { background: #24264a; color: #c7d2fe; }
body.dashboard-theme-dark .profile-card { background: linear-gradient(135deg,#202444,#1b253a); }
body.dashboard-theme-dark .subscription-card { border-color: #2b354a; }
body.dashboard-theme-dark .subscription-value { color: #a5b4fc; }
body.dashboard-theme-dark .install-prompt-card { border-color: #35415a; background: linear-gradient(150deg,#182238,#111827); color: #e8edf7; }
body.dashboard-theme-dark .install-prompt-card p,
body.dashboard-theme-dark .profile-email { color: #a5b1c7; }
body.dashboard-theme-dark .install-prompt-dismiss { background: #242d48; color: #cbd5e1; }
body.dashboard-theme-dark .install-prompt-later { color: #9aa7bd; }
body.dashboard-theme-dark .subscription-label { color: #a5b1c7; }
body.dashboard-theme-dark .generation-confirm-card { border-color: #35415a; background: linear-gradient(155deg,#182238,#111827); color: #e8edf7; }
body.dashboard-theme-dark .generation-confirm-icon { border-color: #353966; background: #24264a; color: #c7d2fe; }
body.dashboard-theme-dark .generation-confirm-card p { color: #a5b1c7; }
body.dashboard-theme-dark .generation-confirm-topic { border-color: #35415a; background: #151d30; color: #e8edf7; }
body.dashboard-theme-dark .generation-confirm-meta span { background: #24264a; color: #c7d2fe; }
body.dashboard-theme-dark .generation-confirm-cancel { border-color: #3c4663; background: #182238; color: #cbd5e1; }

@media (prefers-reduced-motion: reduce) {
    .install-prompt-overlay, .install-prompt-card, .dashboard-panel, .dashboard-panel-overlay,
    .generation-confirm-overlay, .generation-confirm-card { transition-duration: .01ms; }
}

@media (max-width: 360px) {
    .header-actions { gap: 5px; }
    .theme-toggle { width: 30px; min-width: 30px; min-height: 30px; padding: 5px; }
    .header-badge { padding-inline: 8px; }
}
