* { box-sizing: border-box; }
html { font-family: var(--font); font-size: var(--text-sm); color: var(--ink); background: var(--surface); }
body { margin: 0; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
textarea { word-break: keep-all; overflow-wrap: break-word; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
button, summary, select, input[type="submit"] { cursor: pointer; }
button { border: 0; background: transparent; }
a { color: inherit; text-decoration: none; }
button, a { transition: background var(--fast), color var(--fast); }
button:disabled { cursor: wait; opacity: .55; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[data-focus-quiet]:focus-visible { outline: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--heading); line-height: var(--heading-line); letter-spacing: var(--heading-tracking); font-weight: 700; }
h2 { font-size: var(--text-base); line-height: 20px; font-weight: 700; }
h3 { font-size: var(--text-base); font-weight: 600; }
p, h1, h2, h3, a { overflow-wrap: anywhere; word-break: keep-all; }
p { text-wrap: pretty; }
small, .muted { color: var(--muted); }
small { font-size: var(--text-xs); }
strong { font-weight: 600; }
svg.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 100; padding: 12px 20px; background: var(--surface); border: 1px solid var(--accent); }
.skip-link:focus { top: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--control); padding: var(--space-1) var(--space-3); border: 1px solid transparent; border-radius: var(--radius); font-size: var(--text-sm); line-height: 22px; font-weight: 600; white-space: nowrap; }
.button-primary { color: var(--on-accent); background: var(--accent); }
.button-primary:hover { background: var(--accent-hover); }
.button-secondary { background: var(--subtle); border: 1px solid var(--line); }
.button-secondary:hover { background: var(--line); }
.button-plain { color: var(--secondary); }
.button-plain:hover, .icon-button:hover { background: var(--subtle); color: var(--ink); }
.button-danger { color: var(--danger); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: var(--control); height: var(--control); border-radius: var(--radius); color: var(--secondary); flex: none; }
.text-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.project-mark { color: var(--project-color, var(--gray)); font-size: 22px; line-height: 1; flex: none; font-weight: 600; }
.color-olive { --project-color: var(--olive); }
.color-blue { --project-color: var(--blue); }
.color-coral { --project-color: var(--coral); }
.color-amber { --project-color: var(--amber); }
.color-purple { --project-color: var(--purple); }
.color-gray { --project-color: var(--gray); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-xs); color: var(--secondary); }
.pill svg.icon { width: 14px; height: 14px; }
.divider { height: 1px; background: var(--line); border: 0; margin: var(--space-6) 0; }
.flash { position: fixed; left: calc(var(--rail) + (100vw - var(--rail)) / 2); top: calc(var(--topbar-height) + 12px); transform: translateX(-50%); max-width: calc(100vw - var(--rail) - 64px); background: var(--ink); color: var(--surface); border-radius: var(--radius-lg); padding: 12px 20px; z-index: 80; box-shadow: var(--shadow); display: flex; align-items: center; gap: 20px; }
.flash button { color: inherit; }
.flash.alert { background: var(--danger); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* motion */
@keyframes rise-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.turbo-progress-bar { height: 2px; background: var(--accent); }
dialog[open] { animation: pop-in 160ms ease-out; }
dialog[open]::backdrop { animation: fade-in 160ms ease-out; }
.flash { animation: rise-in 200ms ease-out; transition: opacity var(--fast), transform var(--fast); }
.flash.is-leaving { opacity: 0; transform: translate(-50%, -8px); }
.icon-button, .pill, .task-chip, .nav-link, .picker-option { transition: background var(--fast), color var(--fast), opacity var(--fast); }
.confirm-dialog { width: min(380px, calc(100vw - 32px)); }
.confirm-panel { display: grid; gap: var(--space-4); padding: var(--space-5); }
.confirm-panel p { font-size: var(--text-base); line-height: 1.55; white-space: pre-line; }
.confirm-actions { display: flex; justify-content: flex-end; gap: var(--space-2); }
.empty-hint { padding-block: var(--space-6); text-align: center; }
