:root{color-scheme:dark;--ink:#171724;--paper:#fff8e6;--line:#4b465a;--panel:#262435;--accent:#e39a46;--pad:clamp(10px,3vw,25px);font-family:ui-rounded,"Avenir Next",system-ui,sans-serif;background:var(--ink);color:var(--paper)}
*{box-sizing:border-box}body{margin:0}button{font:inherit;cursor:pointer;touch-action:manipulation;color:inherit;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:3px solid currentColor;outline-offset:-5px}button:disabled{opacity:.46;cursor:default}[hidden]{display:none!important}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.app{height:100vh;height:100dvh;min-height:285px;display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden;max-width:1200px;margin:auto}
.mast{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:calc(3px + env(safe-area-inset-top)) max(var(--pad),env(safe-area-inset-right)) 3px max(var(--pad),env(safe-area-inset-left))}
h1{margin:0;font-size:clamp(16px,4.4vw,21px);font-weight:800;letter-spacing:-.04em}.head-actions,.actions{display:flex;gap:5px}
.head-actions button,.actions button{border:1px solid var(--line);background:transparent;min-height:44px;border-radius:24px;padding:0 11px;font-size:13px;font-weight:700}
.tiles{display:grid;min-height:0;gap:2px;grid-template-columns:repeat(var(--cols,1),minmax(0,1fr));grid-template-rows:repeat(var(--rows,1),minmax(0,1fr));overflow:hidden}
.tile{border:0;position:relative;display:grid;align-content:center;justify-items:center;gap:3px;min-width:0;min-height:0;overflow:hidden;isolation:isolate;container-type:size;background:var(--tile);color:var(--pip);border-radius:0;padding:5px;transition:background-color .25s,color .25s}
.tile::before{content:"";position:absolute;z-index:-1;inset:0;background:currentColor;opacity:.23;transform:scaleY(calc(1 - var(--fraction,1)));transform-origin:top;transition:transform .16s linear;pointer-events:none}
.tile[aria-pressed=true]::after{content:"";position:absolute;inset:3px;border:2px solid currentColor;border-radius:9px;pointer-events:none;opacity:.86}
.tile[data-phase=soon]{background:#e8b050;color:#442605}.tile[data-phase=final],.tile[data-phase=done]{background:#ed9a97;color:#4b242c}.tile[data-phase=done]::before{transform:scaleY(0)}.tile[data-phase=done] .caption{font-weight:900}
.caption,.phase-copy{font-size:clamp(10px,8cqh,15px);line-height:1.1;font-weight:750;white-space:nowrap}.phase-copy{font-size:clamp(9px,7cqh,13px);opacity:.88}
.time{font-size:clamp(16px,min(25cqw,52cqh),142px);line-height:.99;font-weight:850;letter-spacing:-.077em;font-variant-numeric:tabular-nums;white-space:nowrap}
.tile[data-phase=done] .time{animation:pulse .33s ease-out}@keyframes pulse{50%{transform:scale(1.045)}}
.controls{width:min(100%,570px);justify-self:center;padding:6px max(var(--pad),env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(var(--pad),env(safe-area-inset-left));display:grid;gap:6px}
.editbar{display:flex;align-items:center;justify-content:space-between;gap:6px}.stepper{display:flex;align-items:center;justify-content:space-between;border-radius:24px;border:1px solid var(--line);min-width:120px;gap:2px}.stepper span{font-size:12px;white-space:nowrap}.stepper output{font-weight:850;font-size:15px}.stepper button{background:transparent;border:0;width:44px;height:44px;border-radius:50%;font-size:26px;line-height:1}
.presets{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.presets button{min-height:48px;border:0;border-radius:12px;background:var(--accent);color:#362010;font-size:24px;font-weight:850;letter-spacing:-.045em}.presets button span{font-size:13px;margin-left:2px}.presets button:nth-child(2){background:#d9cc54}.presets button:nth-child(3){background:#71c4af}.presets button:nth-child(4){background:#a782d1}.presets button:active{transform:scale(.97)}
dialog{width:min(calc(100% - 28px),380px);background:var(--panel);color:var(--paper);border:1px solid var(--line);border-radius:18px;padding:14px}dialog::backdrop{background:#11101abf}.dialog-head{display:flex;align-items:center;justify-content:space-between}.dialog-head h2{font-size:20px;margin:0}.close{height:44px;width:44px;border:0;border-radius:50%;background:transparent;font-size:25px}.options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:9px}.options button{min-height:46px;border:1px solid var(--line);border-radius:12px;background:transparent}.options button[aria-pressed=true]{background:var(--accent);color:#362010;font-weight:800}.fine{margin-bottom:0;font-size:13px;line-height:1.45}
/* Each timer owns its extension shortcut. It is not nested inside the selection button. */
.timer-slot{position:relative;container-type:size;display:grid;min-width:0;min-height:0;isolation:isolate}
.timer-slot[data-live=true] .tile{padding-bottom:53px}
.timer-slot[data-live=true] .time{font-size:clamp(15px,min(21cqw,50cqh,calc((100cqh - 58px)*.78)),142px)}
.extend{position:absolute;z-index:2;bottom:7px;left:50%;transform:translateX(-50%);min-height:44px;min-width:74px;padding:0 10px;border:0;border-radius:28px;background:#171724;color:#fff8e6;white-space:nowrap;font-size:13px;font-weight:800}
.extend:active{transform:translateX(-50%) scale(.96)}
.tiles:has(.timer-slot:nth-child(3)) .tile{gap:1px}
.tiles:has(.timer-slot:nth-child(7)) .extend{bottom:4px;min-width:63px;font-size:12px}
.tiles:has(.timer-slot:nth-child(7)) .timer-slot[data-live=true] .tile{padding-bottom:46px}
.tiles:has(.timer-slot:nth-child(7)) .timer-slot[data-live=true] .phase-copy{display:none}

:root[data-theme=bluey]{color-scheme:light;--ink:#d4f1fc;--paper:#133c67;--line:#71a7c6;--panel:#effaff;--accent:#ffc568}
[data-theme=bluey] h1{font-weight:900}
[data-theme=bluey] .mast button,[data-theme=bluey] .actions button,[data-theme=bluey] .stepper{background:#fff9e9;border-color:#8fbdd1}
[data-theme=bluey] .tile{border-radius:13px;background:var(--blue);color:#163c62}
[data-theme=bluey] .tiles{gap:5px;padding-inline:7px}
[data-theme=bluey] .tile[data-phase=soon]{background:#ffd17a;color:#493418}
[data-theme=bluey] .tile[data-phase=final],[data-theme=bluey] .tile[data-phase=done]{background:#ffab8b;color:#502b2b}
[data-theme=bluey] .tile::before{opacity:.18}
[data-theme=bluey] .presets button{background:#ffc568}
[data-theme=bluey] .presets button:nth-child(2){background:#ffdf97}
[data-theme=bluey] .presets button:nth-child(3){background:#b9de96}
[data-theme=bluey] .presets button:nth-child(4){background:#a5d6ef}
[data-theme=bluey] .extend{background:#164c78;color:#fff9e9}
@media(max-aspect-ratio:1/1) and (min-height:450px){
 [data-theme=bluey] .tiles:has(.timer-slot:only-child){padding-inline:0}
 [data-theme=bluey] .timer-slot:only-child .tile{border-radius:0;background:#33b9ec url('backyard-v2.webp') center bottom/cover no-repeat;align-content:start;padding-top:clamp(29px,16cqh,155px);color:#143967}
 [data-theme=bluey] .timer-slot:only-child .caption{font-size:15px}
 [data-theme=bluey] .timer-slot:only-child .time{font-size:clamp(48px,25cqw,142px);line-height:1.12;text-shadow:0 2px #b0e4f899}
 [data-theme=bluey] .timer-slot:only-child .tile::after{display:none}
 [data-theme=bluey] .timer-slot:only-child .tile::before{inset:0 0 auto;height:6px;background:#0c4d77;opacity:.7;transform:scaleX(var(--fraction,1));transform-origin:left;transition:transform .2s linear}
 [data-theme=bluey] .timer-slot:only-child .tile:is([data-phase=soon],[data-phase=final],[data-phase=done]) .time{background:#ffda8b;border-radius:19px;padding-inline:.13em;text-shadow:none;color:#573514}
 [data-theme=bluey] .timer-slot:only-child .tile:is([data-phase=final],[data-phase=done]) .time{background:#ffab8b;color:#502b2b}
 [data-theme=bluey] .timer-slot:only-child .extend{bottom:auto;top:calc(clamp(29px,16cqh,155px) + 151px)}
}
@media(max-width:370px) and (max-aspect-ratio:1/1) and (min-height:450px){[data-theme=bluey] .timer-slot:only-child .extend{top:calc(clamp(29px,16cqh,155px) + 133px)}}
@media(max-height:550px){.tiles:has(.timer-slot:nth-child(7)) .extend{min-height:34px}.tiles:has(.timer-slot:nth-child(7)) .timer-slot[data-live=true] .tile{padding-bottom:36px}}
@media(max-width:355px){.head-actions button,.actions button{padding-inline:9px}.stepper button{width:40px}.time{letter-spacing:-.08em}}
@media(max-height:375px){.controls{padding-block:2px calc(3px + env(safe-area-inset-bottom));gap:3px}.mast{padding-block:env(safe-area-inset-top) 1px}.presets button{min-height:44px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
