/* Palette overrides keep every visible control legible and on-theme. */
[data-theme="white"]{--accent:#287b64;--accent-strong:#1d604d;--surface:#fff;--surface-muted:#eef7f2;--control:#fff;--focus:#72a992}
[data-theme="gray"]{--accent:#59636b;--accent-strong:#414b53;--surface:#fff;--surface-muted:#eef0f2;--control:#fff;--focus:#89949c}
[data-theme="blue"]{--accent:#397ca8;--accent-strong:#286184;--surface:#fff;--surface-muted:#eaf3fb;--control:#fff;--focus:#6ea4c8}
[data-theme="green"]{--accent:#397a62;--accent-strong:#2a604d;--surface:#fff;--surface-muted:#e8f3ec;--control:#fff;--focus:#78ae94}
[data-theme="yellow"]{--accent:#9a771e;--accent-strong:#765a12;--surface:#fffef8;--surface-muted:#fff8df;--control:#fffef8;--focus:#c7a848}
[data-theme="orange"]{--accent:#c66b35;--accent-strong:#9c4f24;--surface:#fffdfa;--surface-muted:#fff1e7;--control:#fffdfa;--focus:#d9946a}
[data-theme="pink"]{--accent:#b45c83;--accent-strong:#8e4165;--surface:#fffafd;--surface-muted:#fff0f6;--control:#fffafd;--focus:#d28eac}
[data-theme="purple"]{--accent:#7658a7;--accent-strong:#5a4088;--surface:#fff;--surface-muted:#f2edfb;--control:#fff;--focus:#aa94ce}
body[data-theme]{background:var(--mint)!important;color:var(--ink)!important}
body[data-theme] .panel,body[data-theme] .topbar,body[data-theme] .primary-nav,body[data-theme] .access-card,body[data-theme] .home-stats>div,body[data-theme] .home-event-card,body[data-theme] .settings-panel,body[data-theme] .analytics-panel,body[data-theme] dialog{background:var(--surface)!important;color:var(--ink)!important;border-color:var(--line)!important}
body[data-theme] .primary-nav button[aria-current=page],body[data-theme] .primary-button{background:var(--accent-strong)!important;color:#fff!important}
body[data-theme] .outline-button,body[data-theme] .text-button,body[data-theme] .quiet-button,body[data-theme] a{color:var(--accent)!important}
body[data-theme] input,body[data-theme] select,body[data-theme] textarea{background:var(--control)!important;color:var(--ink)!important;border-color:var(--line)!important}
body[data-theme] input::placeholder,body[data-theme] textarea::placeholder{color:var(--muted)!important}
body[data-theme] .setting-toggle,body[data-theme] .preference-settings>*,body[data-theme] .settings-notice,body[data-theme] .empty-note,body[data-theme] .context-note,body[data-theme] .home-priority,body[data-theme] .start-system-intro,body[data-theme] .start-choice,body[data-theme] .help-grid article,body[data-theme] .help-note{background:var(--surface-muted)!important;border-color:var(--line)!important;color:var(--ink)!important}
body[data-theme] input[type="checkbox"],body[data-theme] input[type="radio"]{accent-color:var(--accent)!important}
body[data-theme] button:focus-visible,body[data-theme] a:focus-visible,body[data-theme] input:focus-visible,body[data-theme] select:focus-visible,body[data-theme] textarea:focus-visible{outline-color:var(--focus)!important}
 .settings-primary-actions{display:flex;align-items:flex-start;gap:16px;flex-wrap:wrap}
.settings-primary-actions>.font-setting,.settings-primary-actions>.field{display:grid;align-content:start;gap:6px;min-width:150px;color:var(--muted);font-size:.9rem}
.settings-primary-actions>.font-setting select,.settings-primary-actions>.field select{width:100%;box-sizing:border-box;min-height:48px}
.primary-nav button[aria-current="page"]{border:2px solid var(--accent)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 28%,transparent)!important}
.primary-nav .nav-count{display:inline-grid;place-items:center;min-width:22px;min-height:22px;margin-left:auto;padding:0 5px;border:1px solid var(--accent)!important;border-radius:6px;background:var(--surface)!important;color:var(--accent-strong)!important;font-weight:800;line-height:1}
body[data-theme] .primary-nav button:not([aria-current="page"]){border-color:transparent}
/* CalmHome mark: shared by the sign-in header and workspace navigation. */
.brand-symbol,.brand-mark{position:relative;overflow:hidden;background:#fff!important;color:transparent!important}
.brand-symbol svg{display:none!important}
.brand-symbol::before,.brand-mark::before{content:"";position:absolute;inset:0;background-repeat:no-repeat;background-position:center;background-size:125%;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 160'%3E%3Cpath d='M25 20v113' stroke='%232b6657' stroke-width='16' stroke-linecap='round'/%3E%3Cpath d='M25 20h108v35H52v48' fill='none' stroke='%232b6657' stroke-width='16' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M62 78h62M62 113h35' stroke='%232b6657' stroke-width='12' stroke-linecap='round'/%3E%3Ccircle cx='132' cy='113' r='14' fill='%23df7600'/%3E%3Cpath d='M52 145h83' stroke='%231d2b44' stroke-width='13' stroke-linecap='round'/%3E%3C/svg%3E")}
.brand-symbol::before,.brand-mark::before{z-index:1;display:block}
.brand-mark{border-radius:10px!important}
.sidebar-brand small{display:none!important}
.sidebar-brand .brand-symbol{display:grid!important;flex:0 0 52px!important;width:52px!important;height:52px!important;border-radius:13px!important}
.sidebar-brand{align-items:center!important;gap:12px!important;white-space:normal!important}
.sidebar-brand>span:last-child{white-space:normal!important;min-width:0;width:150px}
.sidebar-brand strong{font-size:1.05rem!important;letter-spacing:.02em!important;line-height:1.35!important}
.access-brand .brand-mark{width:48px!important;height:48px!important;border-radius:12px!important}
.theme-spacer-placeholder{display:none}
.settings-advanced>summary{display:flex;align-items:center;justify-content:space-between;gap:16px;white-space:normal;line-height:1.45}
.settings-advanced>summary::after{float:none!important;flex:0 0 auto;margin-left:auto}
.access-brand{position:relative;min-height:86px}
.access-brand>span{visibility:hidden}
.access-brand::before{content:"";position:absolute;inset:0;max-width:520px;background:url('calmhome-logo.svg') left center/contain no-repeat}
.sidebar-brand{min-height:64px;background:url('calmhome-logo.svg') left center/100% auto no-repeat}
.sidebar-brand>span{visibility:hidden}
.sidebar-brand .brand-symbol{visibility:hidden}
.access-brand::before{background-image:url('calmhome-logo.png')}
.sidebar-brand{background-image:url('calmhome-logo.png')}
body[data-page="events"] #eventWorkflow{margin:0 6px 24px!important;padding:24px!important;border:1px solid var(--border)!important;border-radius:16px!important;background:var(--surface)!important;box-shadow:0 2px 8px rgba(32,56,46,.04)!important}
body[data-page="events"] #eventWorkflow>.page-heading{padding:0!important}
@media(max-width:580px){body[data-page="events"] #eventWorkflow{margin:0 2px 18px!important;padding:16px!important}}
