/* Shared control geometry, with creation anchored at bottom center. */
.capture-actions{position:fixed;z-index:10;left:50%;bottom:max(16px,env(safe-area-inset-bottom));transform:translateX(-50%);display:flex;align-items:center;gap:8px}
.shelf-icon,#theme-toggle{display:flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border-radius:10px;transition:background-color 120ms ease,color 120ms ease}
.shelf-icon:hover,#theme-toggle:hover{color:var(--ink);background:var(--surface-hover)}
.shelf-icon:active,#theme-toggle:active{background:var(--surface-pressed)}
.capture-actions .shelf-icon{position:relative;inset:auto;flex:none}
#add-toggle{background:var(--surface-control);color:var(--ink)}
#add-toggle:hover{background:var(--surface-hover)}
#add-toggle:active{background:var(--surface-pressed)}
#dictate-toggle{width:132px;gap:8px;padding:0 16px;border-radius:24px;background:var(--ink);color:var(--paper);font:14px/1 Arial,Helvetica,sans-serif}
#dictate-toggle:hover{background:var(--surface-pressed)}
#dictate-toggle:active{background:var(--surface-pressed)}
#dictate-toggle svg{flex:none}
#ai-settings-toggle{left:auto;right:24px;bottom:max(16px,env(safe-area-inset-bottom))}
#shelf-toggle{top:16px;right:76px;bottom:auto}
#theme-toggle{top:16px;right:24px;bottom:auto}
.task-shelf{inset:68px 20px auto auto;max-height:calc(100dvh - 88px)}
body{padding-bottom:104px}
@media(max-width:480px){body{padding-top:80px}#ai-settings-toggle{right:16px}#theme-toggle{right:16px}#shelf-toggle{right:68px}}
@media(prefers-reduced-motion:reduce){.shelf-icon,#theme-toggle{transition:none}}
@media print{.capture-actions{display:none!important}body{padding-bottom:0}}
/* Entry rows inherit the exact checklist font, checkbox, spacing and wrapping. */
.task-entry .task-editor{display:inline-block;min-width:1ch;min-height:1em;max-width:100%;outline:none!important;border:0;background:none;padding:0;margin:0;font:inherit;letter-spacing:inherit;line-height:inherit;cursor:text;white-space:pre-wrap;overflow-wrap:anywhere;-webkit-user-select:text;user-select:text;text-decoration:none}
.task-entry label>span{flex:1;min-width:0}.task-entry .task-editor:empty::before{content:'\200b'}
#dictate-toggle[data-state=recording]{color:var(--record-accent)}
#dictate-toggle:disabled{cursor:default}#ai-settings-toggle:disabled{opacity:.35;cursor:default}
#dictate-toggle[aria-busy=true] svg{visibility:hidden}
#dictate-toggle[aria-busy=true]::after{content:"";position:absolute;width:15px;height:15px;left:19px;top:14px;border:1.5px solid currentColor;border-right-color:transparent;border-radius:50%;animation:voice-spin .8s linear infinite}
#voice-surface{position:fixed;z-index:9;bottom:calc(max(16px,env(safe-area-inset-bottom)) + 60px);left:50%;transform:translateX(-50%);width:450px;max-width:calc(100vw - 40px);color:var(--text-muted);text-align:center;font:15px/1.5 Arial,Helvetica,sans-serif;pointer-events:none}
#voice-lines{max-height:3em;overflow:hidden;overflow-wrap:anywhere;white-space:pre-wrap;text-wrap:pretty}
#voice-text{color:var(--text-muted)}
#voice-surface[data-mode=loading] #voice-text{animation:voice-breathe 1.4s ease-in-out infinite}
#voice-retry{pointer-events:auto;border:0;background:transparent;color:var(--text-muted);font:13px Arial,Helvetica,sans-serif;text-decoration:underline;text-underline-offset:3px;padding:4px 8px;margin-top:4px}
.ai-settings{position:fixed;inset:auto 20px 76px auto;margin:0;width:min(380px,calc(100vw - 32px));max-height:calc(100dvh - 90px);overflow:auto;padding:22px;border:1px solid var(--border-control);background:var(--paper);color:var(--ink);font:14px/1.5 Arial,Helvetica,sans-serif}
.ai-settings::backdrop{background:transparent}
.ai-settings header{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px;gap:12px}
.ai-settings h2{font-size:17px;letter-spacing:0;font-weight:500}
.ai-settings button{font:inherit;padding:7px 0;background:transparent;color:var(--ink);border:0}
.ai-settings header button{font-size:22px;padding:0 4px;color:var(--text-muted)}
.ai-settings p{font-size:14px;color:var(--ink);margin:12px 0}.ai-settings p:empty{display:none}
.ai-settings label{display:block;pointer-events:auto;cursor:default;min-height:0;font-size:13px}
.ai-settings input:not([type=checkbox]),.ai-settings select{appearance:auto;display:block;width:100%;height:auto;min-width:0;flex:initial;margin:6px 0 14px;padding:8px;border:1px solid var(--border-control);border-radius:0;background:var(--paper);color:var(--ink);font:14px/1.5 Arial,Helvetica,sans-serif;transform:none;transition:none;user-select:text;-webkit-user-select:text;cursor:text;max-width:none}
.ai-settings select{cursor:pointer}.ai-settings input::after{display:none}.ai-settings section{margin:0}
.ai-settings .remember{display:flex;align-items:center;gap:8px;margin:8px 0}.ai-settings input[type=checkbox]{appearance:auto;min-width:14px;width:14px;height:14px;margin:0;transform:none;cursor:pointer}
.settings-actions{display:flex;gap:20px;flex-wrap:wrap;margin-top:12px}
html[data-theme=night] .ai-settings{color-scheme:dark}html[data-theme=day] .ai-settings{color-scheme:light}
@keyframes voice-spin{to{transform:rotate(360deg)}}@keyframes voice-breathe{50%{opacity:.45}}
@media(prefers-reduced-motion:reduce){#dictate-toggle[aria-busy=true]::after,#voice-surface[data-mode=loading] #voice-text{animation:none}}
@media print{#quick-add,.ai-settings,#voice-surface,#add-toggle,#dictate-toggle,#ai-settings-toggle{display:none!important}}

/* Quiet, site-native controls without browser focus boxes. */
button:focus,button:focus-visible,input:focus,input:focus-visible,select:focus,select:focus-visible,[contenteditable]:focus{outline:none!important;box-shadow:none!important}
.shelf-icon:focus-visible,#theme-toggle:focus-visible{color:var(--text-muted)}
#dictate-toggle:focus-visible{color:var(--paper)}
#dictate-toggle[data-state=recording]{color:var(--record-accent)}
.provider-field{position:relative;margin-bottom:14px;font-size:13px}
.ai-settings #capture-provider{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;min-height:39px;margin-top:6px;padding:8px 12px;text-align:left;border:1px solid var(--border-control);font-size:14px;line-height:1.5}
#capture-provider svg{flex:none;margin-right:1px}
#provider-options{position:absolute;left:0;right:0;top:100%;margin-top:4px;padding:4px;background:var(--paper);border:1px solid var(--border-control);z-index:30}
.ai-settings #provider-options button{display:flex;align-items:center;justify-content:space-between;width:100%;padding:9px 8px;text-align:left;font-size:14px;line-height:1.4}
#provider-options [aria-selected=true]::after{content:'✓';font-size:12px;margin-left:16px}
#provider-options button:hover{background:var(--surface-hover)}
.settings-actions{gap:8px}
.ai-settings .settings-actions button,.task-row-actions button{border:1px solid var(--border-control);padding:8px 12px;font:13px/1.3 Arial,Helvetica,sans-serif;color:var(--ink);background:var(--paper);cursor:pointer}
.ai-settings .settings-actions button[id^=capture-save]{background:var(--ink);color:var(--paper);border-color:var(--ink)}
.ai-settings .settings-actions button:hover,.task-row-actions button:hover{border-color:var(--ink);background:var(--surface-hover)}
.ai-settings .settings-actions button[id^=capture-save]:hover{background:var(--surface-pressed)}
li[data-task-actions]{position:relative}
.task-row-actions{position:absolute;top:100%;display:flex;gap:6px;padding:5px 0;background:var(--paper);z-index:25;white-space:nowrap}
@media print{.task-row-actions{display:none!important}}

/* Reusable favorites and a fresh-list action stay inside Archive. */
.task-shelf h3{margin:22px 0 8px;font:500 13px/1.4 Arial,Helvetica,sans-serif;color:var(--text-muted)}
.task-shelf #carry-over{width:100%;padding:10px 12px;border:1px solid var(--border-control);border-radius:10px;text-align:center;font-size:14px}
.task-shelf #carry-over:hover{background:var(--surface-hover)}
.task-shelf #carry-over:active{background:var(--surface-pressed)}
.task-shelf #carry-over:disabled{opacity:.4;cursor:default}
.favorite-items button{padding:8px;border-radius:8px;margin:0 -8px;width:calc(100% + 16px)}
.favorite-items button:not([aria-disabled=true]):hover{background:var(--surface-hover)}
.favorite-items button:not([aria-disabled=true]):active{background:var(--surface-pressed)}
.favorite-items button[aria-disabled=true]{color:var(--text-muted);cursor:default}
#shelf-notice{font-size:14px;margin:18px 0 0}

.shelf-icon,#theme-toggle{width:36px;height:36px;border-radius:9px}
.shelf-icon svg,#theme-toggle svg{width:16px;height:16px}
#shelf-toggle{right:68px}
#dictate-toggle{height:36px}
#dictate-toggle[aria-busy=true]::after{top:10px}
@media(max-width:480px){#shelf-toggle{right:60px}}
.favorite-row{display:flex;align-items:center;gap:8px}
.favorite-items .favorite-row>button:first-child{flex:1;min-width:0;margin:0;width:auto}
.favorite-items .favorite-row>.remove-favorite{flex:none;width:36px;height:36px;padding:10px;margin:0;justify-content:center}
.task-row-actions{flex-wrap:wrap;max-width:calc(100vw - 32px)}

/* Compact utilities, aligned list headings, and a shared date. */
#theme-toggle{top:16px;right:24px;bottom:auto}
#ai-settings-toggle{top:16px;right:64px;bottom:auto;left:auto}
#shelf-toggle{top:16px;right:104px;bottom:auto}
.ai-settings{inset:60px 20px auto auto;max-height:calc(100dvh - 80px)}
.task-shelf{top:60px}
.day-heading{margin:0 160px 28px 0}
main{height:auto;align-items:start}
aside{padding-top:0}
.primary>h2,aside>h2{font-size:clamp(14px,1.9vh,27px);font-weight:700;letter-spacing:.04em;margin:0 0 2vh}
#dictate-toggle{width:112px;padding:0 10px;gap:6px}
#dictate-toggle[aria-busy=true]::after{left:10px}
@media(max-width:480px){#theme-toggle{right:16px}#ai-settings-toggle{right:56px}#shelf-toggle{right:96px}.day-heading{margin-right:0;font-size:30px}}
@media(min-width:601px){main{grid-template-columns:1.55fr 1fr;gap:6vw}body{padding:5vh 4.6vw 104px}}
/* Preserve the primary heading's layout while hiding its label. */
.primary>h2{visibility:hidden}
#theme-toggle{right:16px}
#ai-settings-toggle{right:56px}
#shelf-toggle{right:96px}

#ai-settings-toggle{right:16px}#shelf-toggle{right:56px}
.ai-settings header #theme-toggle{position:static;flex:none;width:36px;height:36px;padding:0;display:flex;align-items:center;justify-content:center}
.provider-row{display:flex;gap:12px;align-items:flex-end;margin-bottom:18px}
.provider-row .provider-field{flex:1;min-width:0;margin:0}
.ai-settings .configure-button,.ai-settings #sound-toggle{border:1px solid var(--border-control);border-radius:8px;padding:8px 12px;min-height:39px}
.ai-settings label,#provider-label,.sound-row>span{color:var(--text-muted)}
.sound-row{display:flex;align-items:center;gap:12px;margin-bottom:20px;font-size:13px}
.ai-settings #sound-toggle{min-height:36px;width:48px;padding:6px}
.ai-settings #sound-volume{appearance:auto;flex:1;min-width:0;width:100%;height:20px;margin:0;padding:0;border:0;accent-color:var(--ink);cursor:pointer}
.ai-settings #sound-volume::after{display:none}
.sound-row output{min-width:34px;text-align:right;font-size:13px}
.ai-settings .configure-button:hover,.ai-settings #sound-toggle:hover{background:var(--surface-hover)}

aside>h2{color:var(--text-muted)}
#add-tooltip{position:absolute;bottom:calc(100% + 10px);left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 40px);padding:8px 10px;border:1px solid var(--border-control);border-radius:6px;background:var(--paper);color:var(--ink);font:12px/1.4 Arial,Helvetica,sans-serif;pointer-events:none;opacity:0;visibility:hidden;transition:opacity 100ms ease,visibility 100ms ease}
#add-toggle:hover #add-tooltip,#add-toggle:focus-visible #add-tooltip{visibility:visible;opacity:1;transition-delay:450ms}
.sound-row{display:block;margin:18px 0 0}
.sound-row>span{display:block;margin-bottom:6px}
.sound-control{display:flex;align-items:center;gap:12px;border:1px solid var(--border-control);border-radius:9px;padding:0 12px 0 0;height:40px;background:var(--surface-control)}
.ai-settings .sound-control #sound-toggle{border:0;border-right:1px solid var(--border-control);border-radius:8px 0 0 8px;width:52px;height:38px;flex:none}
.ai-settings #sound-volume{appearance:none;-webkit-appearance:none;background:transparent;height:32px;padding:0;outline:none;--volume:70%}
.ai-settings #sound-volume::-webkit-slider-runnable-track{height:4px;border-radius:4px;background:linear-gradient(to right,var(--ink) var(--volume),var(--border-control) var(--volume))}
.ai-settings #sound-volume::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:12px;height:20px;margin-top:-8px;border:1px solid var(--paper);border-radius:4px;background:var(--ink);box-shadow:none;transition:height 100ms,margin-top 100ms}
.ai-settings #sound-volume:active::-webkit-slider-thumb{height:24px;margin-top:-10px}
.ai-settings #sound-volume::-moz-range-track{height:4px;border-radius:4px;background:var(--border-control)}
.ai-settings #sound-volume::-moz-range-progress{height:4px;background:var(--ink)}
.ai-settings #sound-volume::-moz-range-thumb{width:10px;height:18px;border:1px solid var(--paper);border-radius:4px;background:var(--ink)}
.sound-row[data-muted=true] input,.sound-row[data-muted=true] output{opacity:.45}
.sound-control output{font-variant-numeric:tabular-nums}
@media(prefers-reduced-motion:reduce){#add-tooltip,.ai-settings #sound-volume::-webkit-slider-thumb{transition:none}}

.fresh-list-footer{border-top:1px solid var(--border-subtle);margin-top:18px;padding-top:16px}

#add-tooltip{white-space:pre-line;text-align:left;border-radius:8px;background:var(--surface-control)}
aside>h2{visibility:hidden}

.favorite-with-tip{position:relative}
.favorite-tooltip{position:absolute;z-index:40;right:8px;bottom:calc(100% + 6px);width:max-content;max-width:calc(100vw - 80px);white-space:pre-line;text-align:left;padding:8px 10px;border:1px solid var(--border-control);border-radius:8px;background:var(--surface-control);color:var(--ink);font:12px/1.4 Arial,Helvetica,sans-serif;pointer-events:none;opacity:0;visibility:hidden;transition:opacity 100ms ease,visibility 100ms ease}
.favorite-with-tip:hover .favorite-tooltip,.favorite-with-tip:focus-visible .favorite-tooltip{visibility:visible;opacity:1;transition-delay:450ms}
@media(prefers-reduced-motion:reduce){.favorite-tooltip{transition:none}}

#add-tooltip,.favorite-tooltip,#add-toggle:hover #add-tooltip,#add-toggle:focus-visible #add-tooltip,.favorite-with-tip:hover .favorite-tooltip,.favorite-with-tip:focus-visible .favorite-tooltip{transition:none;transition-delay:0s}
.ai-settings{padding:20px}
.provider-row{margin-bottom:0}
.sound-row,.appearance-field{margin-top:16px}
.appearance-field>span{display:block;color:var(--text-muted);font-size:13px;margin-bottom:6px}
.theme-segments{display:flex;width:100%;border:1px solid var(--border-control);border-radius:9px;padding:3px;gap:3px}
.ai-settings .theme-segments button{flex:1;border-radius:6px;padding:7px 12px;font-size:14px}
.ai-settings .theme-segments button[aria-pressed=true]{background:var(--surface-hover)}
.ai-settings .theme-segments button:hover{background:var(--surface-hover)}
#connection-fields:not([hidden]){margin-top:16px}
