/* Theme is applied in the head before the first paint. */
button{transition:transform 130ms ease,background-color 160ms ease,color 160ms ease,border-color 160ms ease;touch-action:manipulation}
button.is-pressed:not(:disabled),button:active:not(:disabled){transform:scale(.96)}
.theme-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:15px 0}
.theme-options button{display:flex;flex-direction:column;align-items:center;gap:8px;padding:14px 3px;border:1px solid var(--line);border-radius:12px;background:var(--bg);font-size:11px}
.theme-options button.selected{background:#eee7fc;border-color:#a38ace;color:#6948a4}
.scene-badge{max-width:calc(100% - 135px)}
html[data-theme=dark]{--ink:#ebe7f4;--muted:#b1a9c3;--purple:#b39bea;--pale:#342c49;--bg:#171a29;--line:#383448;--gold:#e1bf80}
html[data-theme=dark] :is(.topbar,.status-card,.header-simple,.card,.task,.item,.stats-row>div,.goal-option,.hero-option,.preset-row){background:#222435;border-color:var(--line)}
html[data-theme=dark] :is(.nav,dialog){background:#222435;border-color:var(--line)}
html[data-theme=dark] :is(.secondary,.pill,.task .check,.task-meta .cat,.tabs,.track,.task-progress,.route-dot,.badge,.selected-desc,.pet-counts span,.sync-summary,.chat-message){background:#343047;color:#c4b4df;border-color:#4b415e}
html[data-theme=dark] :is(.tabs .active,.filter-inline .active,.item.selected,.goal-option.selected,.hero-option.selected,.theme-options button.selected){background:#423557;color:#e3d2ff;border-color:#a889cd}
html[data-theme=dark] :is(.item>button,.filter-inline button,.daily-chest button){background:#393047;color:#dac8ef;border-color:#574563}
html[data-theme=dark] :is(input:not([type=checkbox]),textarea,select){background:#191c2b;border-color:#494156;color:#eee7f7}
html[data-theme=dark] :is(.card p,.item p,.note,.empty,.task-meta,.task-detail p,.stat-line span,.history-row time,.header-simple p,.onboard-body>p,.list-top,.quick-stats,.meter label,.name-line span,.chapter-route>div,.boss-card p,.celebrate p,.chat-message p){color:#b9aec9}
html[data-theme=dark] :is(.text-btn,.outline,.timer,.stats-row strong,.nav .active){color:#c5a9f0}
html[data-theme=dark] .nav button{color:#b2a5c2}
html[data-theme=dark] .nav button.active{color:#d4b7ff}
html[data-theme=dark] .primary{background:#9774d0;color:#fff}
html[data-theme=dark] :is(.daily-chest,.boss-card){background:linear-gradient(130deg,#322b46,#302e35);border-color:#4d415e}
html[data-theme=dark] .coins{background:#393128;border-color:#574931;color:#edcc90}
html[data-theme=dark] :is(.reward-line,.task-meta .gold,.celebrate .loot){color:#e0bf83}
html[data-theme=dark] .task.done .check{background:#294138;color:#b0d8bc}
html[data-theme=dark] .task.done .task-title{color:#a49bad}
html[data-theme=dark] :is(.danger,.negative){background:#4b2d3b;color:#f1aebf}
html[data-theme=dark] :is(.task-detail,.history-row){border-color:var(--line)}
html[data-theme=dark] .onboarding{background:var(--bg)}
html[data-theme=dark] .onboard-cover{background-image:linear-gradient(0deg,#171a29,transparent 90%),url('art/forest.png')}
html[data-theme=dark] .scene{background-image:linear-gradient(180deg,#171a2944,#171a2966),url('art/forest.png')}
html[data-theme=dark] :is(.scene-badge,.round-btn){background:#242437ed;color:#e4d7fa;border-color:#5b4c6b}
html[data-theme=dark] .item .item-art{background:radial-gradient(ellipse,#3a304b,transparent 70%);color:#ccb2e7}
html[data-theme=dark] .floating-reward{background:#342b48ed;border-color:#665079;color:#eed9ff}
html[data-theme=dark] .celebrate .medal{background:radial-gradient(circle,#51432d,#3c2e53)}
html[data-theme=dark] #toast{background:#e5dcef;color:#292235}
html[data-theme=dark] .error-text{color:#ffaec3!important}
html[data-motion=reduce] *,html[data-motion=reduce] *::before,html[data-motion=reduce] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
html[data-motion=reduce] button:active{transform:none}
