:root{color-scheme:dark}
.top{gap:12px;flex-wrap:wrap}
.top-actions{display:flex;align-items:center;gap:20px;margin-left:auto}
.theme-toggle{position:relative;display:grid;grid-template-columns:1fr 1fr;align-items:center;width:126px;height:38px;flex-shrink:0;padding:3px;border:1px solid #ffffff30;border-radius:999px;background:#0b1321;color:#aeb9ca;touch-action:pan-y;user-select:none;-webkit-user-select:none}
.theme-thumb{position:absolute;left:3px;top:3px;width:calc(50% - 3px);height:calc(100% - 6px);border-radius:999px;background:#34445e;box-shadow:0 1px 4px #0003;transition:transform .2s ease,background .2s ease}
.theme-option{position:relative;z-index:1;font-size:14px;line-height:1}
.theme-toggle[aria-checked=false] .theme-option:nth-of-type(2){color:#172236}
.theme-toggle[aria-checked=false] .theme-thumb{background:#fff}
.theme-toggle[aria-checked=true] .theme-thumb{transform:translateX(100%);background:#34445e}
.theme-toggle[aria-checked=true] .theme-option:last-child{color:#fff}
:root[data-theme=light]{color-scheme:light;color:#202c3e;background:#fff}
[data-theme=light] body{background:#fff}
[data-theme=light] :is(.card,.panel,.journey-workspace,.reader-paper,.review-question,.entry){background:#f7f8fa;border-color:#dce1e8}
[data-theme=light] .journey-browser{background:#f2f4f7;border-color:#dce1e8}
[data-theme=light] .journey-browser .panel{background:none;border:0}
[data-theme=light] .journey-reader{background:#fff}
[data-theme=light] :is(.top,.source-details,.todo-item,.reader-tasks li,.journey-review-row,.review-item + .review-item){border-color:#dce1e8}
[data-theme=light] :is(.top small,.lede,.date,.card p,.hint,.muted,.mini,.footer,.field .prompt,.entry small,.weekday,.reader-tasks .done,.source-details summary,.source-details .output-text,.review-period p,.review-meta,.review-prompt,.review-answer.empty,.review-history .muted){color:#59677a}
[data-theme=light] :is(.eyebrow,.section-label,.nav .num,.card .icon,.task-row span,.status,.review-link,.review-number,.review-badge){color:#86632c}
[data-theme=light] .brand span{color:#86632c!important}
[data-theme=light] :is(.nav button,.mobile-nav button){color:#59677a}
[data-theme=light] .nav button.active{background:#e9edf3;color:#18283e}
[data-theme=light] .mobile-nav{background:#fffffff5;border-color:#dce1e8}
[data-theme=light] .mobile-nav button.active{color:#77551f}
[data-theme=light] :is(.quiet,.month-bar button){color:#26364d;background:#f0f3f7;border-color:#ccd4df}
[data-theme=light] :is(textarea,input[type=text],.journey-edit-summary){color:#202c3e;background:#fff;border-color:#bac5d3}
[data-theme=light] :is(textarea,input)::placeholder{color:#69778a}
[data-theme=light] .day{color:#36465c;background:#fff;border-color:#dce1e8}
[data-theme=light] .day.has{background:#e9edf4;border-color:#8497b2}
[data-theme=light] .dot{background:#86632c}
[data-theme=light] .day.selected{outline-color:#526987}
[data-theme=light] .clarity-summary{background:#f7f8fa;border-color:#ccd4df}
[data-theme=light] :is(.review-answer,.entry){color:#202c3e}
[data-theme=light] .review-tabs{background:#edf0f5;border-color:#dce1e8}
[data-theme=light] .review-tabs button{color:#59677a}
[data-theme=light] .review-tabs button[aria-pressed=true]{background:#ddc399;color:#172236}
[data-theme=light] .todo-item.completed label span{color:#657185}
[data-theme=light] input[type=checkbox]{accent-color:#86632c}
[data-theme=light] .theme-toggle{background:#e9edf3;border-color:#ccd4df;color:#59677a}
[data-theme=light] :is(button,textarea,input):focus-visible{outline-color:#526987}
@media(max-width:700px){.top-actions{gap:12px}.top-actions small{font-size:12px}.theme-toggle{height:40px;width:120px}}
@media(prefers-reduced-motion:reduce){.theme-thumb{transition:none}}

/* Dark counterpart of the light slate surfaces and warm gold accents. */
:root[data-theme=dark]{color:#e7eaf0;background:#111a2b;--night-surface:#1c2738;--night-raised:#263347;--night-border:#3c4a60;--night-muted:#b7c2d2;--night-gold:#d4b783}
[data-theme=dark] body{background:#111a2b}
[data-theme=dark] :is(.card,.panel,.journey-workspace,.reader-paper,.review-question,.entry,.clarity-summary){background:var(--night-surface);border-color:var(--night-border)}
[data-theme=dark] .journey-browser{background:#202c3e;border-color:var(--night-border)}
[data-theme=dark] .journey-browser .panel{background:none;border:0}
[data-theme=dark] .journey-reader{background:#111a2b}
[data-theme=dark] :is(.top,.source-details,.todo-item,.reader-tasks li,.journey-review-row,.review-item + .review-item,.journey-note-toolbar,.journal-note-card){border-color:var(--night-border)}
[data-theme=dark] :is(.top small,.lede,.date,.card p,.hint,.muted,.mini,.footer,.field .prompt,.entry small,.weekday,.reader-tasks .done,.source-details summary,.source-details .output-text,.review-period p,.review-meta,.review-prompt,.review-answer.empty,.review-history .muted,.todo-item.completed label span,.journey-note-toolbar h2){color:var(--night-muted)}
[data-theme=dark] :is(.eyebrow,.section-label,.nav .num,.card .icon,.task-row span,.status,.review-link,.review-number,.review-badge,.task-priority-stars,.task-menu-label,.task-menu-options .priority-choice,.journey-month-count){color:var(--night-gold)}
[data-theme=dark] .brand span{color:var(--night-gold)!important}
[data-theme=dark] :is(.quiet,.month-bar button,.journey-date-header .journey-new-note){color:#e7eaf0;background:var(--night-raised);border-color:var(--night-border)}
[data-theme=dark] :is(textarea,input[type=text],.journey-edit-summary){color:#e7eaf0;background:#141e2e;border-color:#586780;caret-color:var(--night-gold)}
[data-theme=dark] :is(textarea,input)::placeholder{color:var(--night-muted);opacity:1}
[data-theme=dark] .journey-page-heading input[type=search]{border-color:#586780;background:#141e2e}
[data-theme=dark] .journey-page-heading input[type=search]::placeholder{color:var(--night-muted)}
[data-theme=dark] .main-btn{background:#d5be94;color:#202c3e}
[data-theme=dark] .main-btn:hover{background:#e0cba6}
[data-theme=dark] .day{color:#e7eaf0;background:var(--night-surface);border-color:var(--night-border)}
[data-theme=dark] .day.has{background:#354158;border-color:#78879e}
[data-theme=dark] .day.selected{outline-color:var(--night-gold)}
[data-theme=dark] .dot{background:var(--night-gold)}
[data-theme=dark] :is(.nav button,.mobile-nav button){color:var(--night-muted)}
[data-theme=dark] :is(.nav button.active,.mobile-nav button.active){background:#3b342a;color:#e0c28b}
[data-theme=dark] .mobile-nav{background:#111a2b!important;border-color:var(--night-border)}
[data-theme=dark] :is(#today>.record-actions,.journey-review-footer){background:#111a2b}
[data-theme=dark] .task-menu-options{background:var(--night-raised);color:#e7eaf0;border-color:#586780}
[data-theme=dark] .todo-state.is-pending{color:#c1cada;background:#2c384b}
[data-theme=dark] .todo-state.is-complete{color:#b0d9bd;background:#253d35}
[data-theme=dark] :is(.review-answer,.entry){color:#e7eaf0}
[data-theme=dark] .theme-toggle{background:#1c2738;border-color:#586780;color:var(--night-muted)}
[data-theme=dark] .theme-toggle[aria-checked=true] .theme-thumb{background:#3b495f}
[data-theme=dark] .theme-toggle[aria-checked=true] .theme-option:last-child{color:#e7eaf0}
[data-theme=dark] :is(button,textarea,input):focus-visible{outline-color:var(--night-gold)}
