/* Appearance control is independent of the app render and its form state. */
:root{--accent-chart:#7d9d5c;--accent-pale:#c4d3b5}
#theme-root{--theme-muted:var(--muted)}
.brand-symbol{width:32px;height:32px;flex-shrink:0}
.public-footer .brand-symbol{width:26px;height:26px}
.theme-trigger{position:fixed;z-index:62;right:24px;bottom:23px;display:flex;align-items:center;gap:9px;height:46px;padding:0 15px 0 10px;border:1px solid var(--line);border-radius:30px;background:var(--surface);color:var(--ink);font-size:12px;font-weight:560;box-shadow:0 4px 20px #172d2416;transition:box-shadow .18s,transform .18s}
.theme-trigger:hover{transform:translateY(-2px);box-shadow:0 7px 24px #172d2420}
.theme-trigger:focus-visible,.theme-close:focus-visible,.theme-choice:focus-visible,.theme-filters button:focus-visible,.theme-reset:focus-visible{outline:3px solid var(--deep);outline-offset:3px}
.theme-trigger-icon{display:grid;place-items:center;width:29px;height:29px;border-radius:50%;background:var(--mint);color:var(--deep)}
.theme-trigger-icon svg{width:18px;height:18px}
.theme-trigger-dots{display:flex;margin-left:3px;padding-left:8px;border-left:1px solid var(--line)}
.theme-trigger-dots i{width:12px;height:12px;border:2px solid #fff;border-radius:50%;display:block;background:var(--deep);margin-left:-3px}
.theme-trigger-dots i:nth-child(2){background:var(--accent-chart)}
.theme-trigger-dots i:nth-child(3){background:var(--lime)}
.theme-panel[hidden]{display:none}
.theme-panel{position:fixed;z-index:63;right:24px;bottom:82px;width:356px;max-height:min(704px,calc(100dvh - 108px));display:flex;flex-direction:column;padding:22px 20px 0;background:var(--surface);border:1px solid var(--line);border-radius:18px;box-shadow:0 16px 65px #152a2230;animation:themePanelIn .2s ease-out;isolation:isolate}
@keyframes themePanelIn{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
.theme-panel-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;flex-shrink:0}
.theme-eyebrow{display:block;color:var(--green);font-size:9px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;margin-bottom:7px}
.theme-panel h2{font-size:25px;font-weight:560;letter-spacing:-.9px;color:var(--ink);margin:0}
.theme-close{width:29px;height:29px;padding:4px;border:0;border-radius:50%;background:var(--cream);color:var(--theme-muted);display:grid;place-items:center;flex-shrink:0;margin:-5px -4px 0 0}
.theme-close:hover{background:var(--mint);color:var(--deep)}
.theme-close svg{width:20px;height:20px}
.theme-panel-description{font-size:11px;color:var(--theme-muted);margin:8px 0 17px;flex-shrink:0}
.theme-active-preview{display:flex;align-items:center;gap:11px;padding:13px;border-radius:11px;background:var(--mint);border:1px solid var(--line);margin-bottom:17px;flex-shrink:0}
.theme-active-symbol{height:35px;width:35px;display:grid;place-items:center;border-radius:9px;background:var(--deep);color:var(--on-primary);flex-shrink:0}
.theme-active-symbol svg{width:21px;height:21px}
.theme-active-preview strong{font-size:12px;font-weight:600;display:block;color:var(--ink);line-height:1.4}
.theme-active-preview div>span{font-size:9px;color:var(--theme-muted);display:block;margin-top:2px}
.theme-active-hex{margin-left:auto;font-size:9px;font-weight:550;letter-spacing:.02em;color:var(--green);font-variant-numeric:tabular-nums}
.theme-filters{display:flex;gap:4px;justify-content:space-between;margin-bottom:16px;flex-shrink:0}
.theme-filters button{font-size:9px;font-weight:500;padding:6px 8px;background:transparent;border:1px solid transparent;border-radius:6px;color:var(--theme-muted);min-height:30px}
.theme-filters button:hover{background:var(--cream)}
.theme-filters button[aria-pressed=true]{background:var(--mint);border-color:var(--line);color:var(--deep)}
.theme-options-scroll{overflow:auto;overscroll-behavior:contain;min-height:0;padding:4px 4px 7px;margin:-4px -4px 0;scrollbar-width:thin;scrollbar-color:var(--line) transparent}
.theme-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px 8px;padding:1px}
.theme-choice{display:flex;flex-direction:column;align-items:stretch;padding:4px 4px 6px;background:var(--surface);border:1px solid var(--line);border-radius:9px;min-width:0;min-height:70px;transition:border-color .15s,box-shadow .15s,transform .15s;position:relative}
.theme-choice:hover{transform:translateY(-2px);border-color:var(--choice-primary);box-shadow:0 2px 6px #172d240d}
.theme-choice.selected{border-color:var(--choice-primary);box-shadow:0 0 0 1px var(--choice-primary)}
.theme-choice-art{height:40px;border-radius:5px;background:var(--choice-wash);position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden}
.theme-choice-window{height:26px;width:39px;border-radius:4px;display:block;background:white;border:1px solid #ffffffbb;position:relative;box-shadow:0 2px 5px #172d240b;overflow:hidden}
.theme-choice-window:before{content:'';position:absolute;inset:0 auto 0 0;width:9px;background:var(--choice-primary)}
.theme-choice-window i{position:absolute;height:3px;left:13px;right:6px;top:6px;border-radius:3px;background:var(--choice-mid)}
.theme-choice-window i:nth-child(2){top:12px;right:11px;background:var(--choice-wash)}
.theme-choice-window i:nth-child(3){top:18px;right:9px;background:var(--choice-primary)}
.theme-choice-label{display:block;margin-top:5px;font-size:9px;font-weight:500;color:var(--muted);line-height:1.4;text-align:center;overflow:hidden;text-overflow:ellipsis}
.theme-choice.selected .theme-choice-label{color:var(--ink);font-weight:650}
.theme-choice-check{display:none;position:absolute;right:2px;top:2px;width:15px;height:15px;border-radius:50%;background:var(--choice-primary);color:#fff;box-shadow:0 0 0 1.5px white}
.theme-choice-check svg{width:15px;height:15px;vertical-align:top}
.theme-choice.selected .theme-choice-check{display:block}
.theme-panel-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid var(--line);padding:14px 0;margin-top:13px;flex-shrink:0}
.theme-reset{border:0;background:none;padding:4px 0;color:var(--green);font-size:10px;font-weight:550;min-height:27px}
.theme-reset:disabled{color:var(--theme-muted);opacity:.55}
.theme-saved-note{font-size:9px;color:var(--theme-muted)}
.theme-sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;clip-path:inset(50%)}
@media(max-width:1050px){.theme-trigger{bottom:80px;right:19px}.theme-panel{bottom:138px;right:19px;max-height:calc(100dvh - 162px)}}
@media(max-width:720px){.public-header .brand-symbol{width:29px;height:29px}.theme-trigger{bottom:calc(78px + env(safe-area-inset-bottom,0px));right:15px;height:42px;padding:0 12px 0 8px;font-size:11px;gap:7px}.theme-trigger-dots{display:none}.theme-trigger-icon{height:27px;width:27px}.theme-panel{right:14px;bottom:calc(131px + env(safe-area-inset-bottom,0px));width:calc(100vw - 28px);max-width:356px;max-height:calc(100dvh - 154px - env(safe-area-inset-bottom,0px));padding:19px 17px 0}.theme-panel h2{font-size:24px}.theme-active-preview{padding:11px;margin-bottom:14px}.theme-panel-description{margin-bottom:14px}.theme-filters{gap:2px;margin-bottom:14px}.theme-filters button{padding:6px 7px;min-height:32px}.theme-options{gap:10px 8px}.theme-choice{min-height:70px}.theme-panel-footer{padding:11px 0}.theme-close{width:32px;height:32px}}
@media(max-height:670px){.theme-active-preview{display:none}.theme-panel-description{margin-bottom:12px}.theme-options{gap:8px}.theme-panel-footer{margin-top:10px}}
@media(max-height:520px){.theme-panel{top:12px;bottom:12px;max-height:calc(100dvh - 24px);padding-top:15px}.theme-panel h2{font-size:21px}.theme-panel-description{display:none}.theme-filters{margin-top:11px;margin-bottom:10px}.theme-panel-footer{padding:8px 0;margin-top:8px}}
@media(prefers-reduced-motion:reduce){.theme-trigger,.theme-choice{transition:none}.theme-panel{animation:none}}

/* Header shortcut switches Light and Dark; explicit choices live in the picker. */
.mode-toggle{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;flex:0 0 42px;padding:10px;background:transparent;border:1px solid var(--line);border-radius:8px;color:var(--green);cursor:pointer}
.mode-toggle:hover{background:var(--mint);border-color:var(--deep)}
.mode-toggle svg{width:20px;height:20px;pointer-events:none}
.mode-toggle:focus-visible,.theme-modes button:focus-visible{outline:3px solid var(--deep);outline-offset:3px}
.theme-modes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:4px;background:var(--cream);border:1px solid var(--line);border-radius:10px;margin-bottom:16px;flex-shrink:0}
.theme-modes button{display:flex;align-items:center;justify-content:center;gap:7px;min-height:38px;border:1px solid transparent;border-radius:7px;background:transparent;color:var(--muted);font-size:11px}
.theme-modes svg{width:16px;height:16px}
.theme-modes button[aria-checked=true]{background:var(--surface);color:var(--green);border-color:var(--line);font-weight:650;box-shadow:0 1px 4px #00000010}
.theme-choice.selected{border-color:var(--deep);box-shadow:0 0 0 1px var(--deep)}
[data-mode=dark] .theme-choice-art{background:color-mix(in srgb,var(--choice-primary) 30%,#17212b)}
[data-mode=dark] .theme-choice-window{background:#263443;border-color:#566879}
[data-mode=dark] .theme-choice-window i:nth-child(2){background:var(--choice-mid)}
.auth-actions{position:absolute;right:35px;top:25px;display:flex;align-items:center;gap:15px}
.auth-actions .auth-back{position:static}
@media(max-width:720px){.mode-toggle{width:36px;height:36px;flex-basis:36px;padding:8px}.auth-actions{right:24px;top:27px;gap:10px}.theme-panel{max-height:calc(100dvh - 154px - env(safe-area-inset-bottom,0px))}}
@media(max-width:380px){.public-header{padding-inline:14px}.public-header .logo{font-size:19px}.public-header .brand-symbol{width:26px;height:26px}.nav-actions .btn{font-size:10px;padding-inline:7px}.nav-actions>.btn.primary .icon{display:none}.auth-actions{right:16px}}
@media(max-height:520px){.theme-panel{max-height:calc(100dvh - 24px)}.theme-modes{margin-bottom:10px}}
@media(forced-colors:active){.theme-choice.selected,.theme-modes button[aria-checked=true]{outline:2px solid Highlight}.theme-choice-check{forced-color-adjust:none}}
