/* Shared sidebar and standalone timer. The browser owns horizontal gestures. */
.timer-workflow-slot { position:relative; display:grid; margin:12px 0 8px; overflow:clip; }
.timer-workflow-slot > * { grid-area:1 / 1; min-width:0; box-sizing:border-box; }
.timer-workflow-card { position:relative; padding:12px; align-self:start; }
.timer-workflow-card:has([data-workflow-popout]) .timer-workflow-heading { padding-right:32px; }
.timer-workflow-heading { display:flex; align-items:center; gap:5px; max-height:44px; overflow:hidden; opacity:1; transition:max-height .38s cubic-bezier(.22,1,.36,1),opacity .18s; }
.timer-workflow-heading input { width:100%; min-width:0; border:0; background:transparent; padding:8px 0; font:inherit; font-size:12px; color:#2d332a; }
.timer-workflow-heading input::placeholder { color:#63685e; opacity:1; }
.timer-workflow-heading input:focus-visible { outline:2px solid #708567; outline-offset:1px; }
.timer-workflow-expanded .timer-workflow-heading { max-height:0; opacity:0; pointer-events:none; }
.timer-workflow-expansion { display:grid; grid-template-rows:0fr; opacity:0; transition:grid-template-rows .38s cubic-bezier(.22,1,.36,1),opacity .28s; }
.timer-workflow-fields { min-height:0; overflow:hidden; display:flex; flex-direction:column; gap:12px; }
.timer-workflow-expanded .timer-workflow-expansion { grid-template-rows:1fr; opacity:1; }
.timer-workflow-fields label { color:#2d332a; display:flex; flex-direction:column; gap:5px; font-size:12px; font-weight:500; }
.timer-workflow-fields label:first-child { margin-top:4px; }
.timer-workflow-fields label:last-child { margin-bottom:10px; }
.timer-workflow-fields select { width:100%; min-width:0; box-sizing:border-box; border:1px solid #d6d3d1; border-radius:6px; padding:8px 5px; background:#fffef9; color:#2d332a; font:inherit; font-size:13px; }
.timer-workflow-fields select:disabled { background:#f7f4ec; color:#63685e; }
.timer-workflow-fields select[aria-invalid=true] { border-color:#a43e35; }
.timer-workflow-readout { gap:3px; flex-wrap:nowrap; margin:10px 0; }
.timer-workflow-readout .num { font-size:18px; letter-spacing:-.04em; }
.timer-workflow-controls { display:flex; flex-shrink:0; gap:1px; }
.timer-workflow-controls button { width:26px; height:28px; padding:5px; border-radius:6px; }
.timer-workflow-card[data-running=true] .timer-clock-digits > span:not([data-clock-seconds]) { color:#397848; animation:timer-colon-pulse 2.4s ease-in-out infinite; }
.timer-workflow-card[data-running=false] .timer-clock-digits > span:not([data-clock-seconds]) { color:#ad610e; }
@keyframes timer-colon-pulse { 0%,100% { opacity:1; } 50% { opacity:.98; } }
.timer-workflow-notes { display:block; width:100%; box-sizing:border-box; min-height:64px; max-height:180px; resize:vertical; padding:8px; border:1px solid #b8c1af; border-radius:6px; background:transparent; font:inherit; font-size:12px; line-height:1.6; color:#63685e; }
.timer-workflow-notes:focus-visible { outline:2px solid #708567; outline-offset:2px; }
.timer-workflow-idle,.timer-workflow-notice { min-height:56px; align-self:start; }
.timer-workflow-idle { display:flex; align-items:center; }
.timer-workflow-idle form { width:100%; }
.timer-workflow-notice { display:flex; align-items:center; justify-content:center; gap:7px; color:#526549; font-size:12px; }
.timer-workflow-settled > .timer-workflow-card,.timer-workflow-settled > .timer-workflow-idle,.timer-workflow-settled > .timer-workflow-notice { position:absolute; top:0; left:0; width:100%; margin:0; }
.timer-workflow-error { margin:8px 0; color:#a43e35; font-size:12px; overflow-wrap:anywhere; }
.timer-workflow-popout { position:absolute; top:15px; right:12px; width:28px; height:28px; }
.timer-workflow-slot [hidden],.timer-workflow-error[hidden] { display:none!important; }
#timer-window-content[data-controller=timer-workflow] { padding:0 20px 20px; }
#timer-window-content .timer-workflow-slot { margin-top:6px; }
#timer-window-content .timer-workflow-readout .num { font-size:18px; }
#timer-window-content .timer-workflow-controls button { width:26px; height:28px; }
@media(pointer:coarse) {
  .timer-workflow-readout .num { font-size:16px; }
  .timer-workflow-controls button { width:32px; height:44px; padding:6px; }
  .timer-workflow-heading button { min-width:44px; min-height:44px; }
  .timer-workflow-fields select,.timer-workflow-notes { font-size:16px; }
}
@media(prefers-reduced-motion:reduce) {
  .timer-workflow-heading,.timer-workflow-expansion { transition:none; }
  .timer-workflow-card .timer-clock-digits > span { animation:none!important; }
}

#timer-window-content .timer-workflow-popout { display:none; }

.timer-clock[data-clock-colored=true]:not([data-clock-editing=true]) .timer-clock-digits :is(input,span) { color:transparent; }
.timer-clock[data-clock-colored=true][data-clock-editing=true] .timer-clock-digits :is(input,span) { color:#2d332a; }
.timer-clock[data-clock-colored=true][data-clock-editing=true] .timer-clock-digits [data-clock-seconds] { color:#78716c; }
.timer-clock-colored { position:absolute; left:0; top:0; display:flex; align-items:baseline; pointer-events:none; padding:1px 0; font:inherit; letter-spacing:inherit; }
.timer-clock-colored[hidden] { display:none; }
.timer-clock[data-clock-running=true] .timer-clock-colon { color:#397848; animation:timer-colon-pulse 2.4s ease-in-out infinite; }
.timer-clock[data-clock-running=false] .timer-clock-colon { color:#ad610e; }
@media(prefers-reduced-motion:reduce) { .timer-clock-colon { animation:none!important; } }

.timer-workflow-notes[aria-invalid=true] { border-color:#a43e35; }

.timer-workflow-fields select { appearance:none; min-height:38px; padding-right:30px; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23a8a29e'%3E%3Cpath fill-rule='evenodd' d='M5.2 7.5 10 12.3l4.8-4.8 1.2 1.2-6 6-6-6 1.2-1.2Z' clip-rule='evenodd'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 8px center; background-size:16px; }

/* Match the popout: rearrange controls without shrinking digits or icons. */
.app-sidebar .timer-workflow-readout { align-items:center; gap:8px!important; }
.app-sidebar .timer-workflow-readout > [aria-label="Timer controls"] { margin-top:0; gap:1px; }
.app-sidebar .timer-workflow-readout .timer-clock-flexible { flex:1; max-width:calc(100% - 88px)!important; }
.app-sidebar .timer-workflow-readout .timer-clock-digits { font-size:18px!important; }
.app-sidebar .timer-workflow-readout .sidebar-timer-transport { width:26px; height:28px; padding:5px; }
.app-sidebar .timer-workflow-readout .timer-clock-colored { max-width:100%; overflow:hidden; }
.timer-clock-colored-seconds { display:flex; min-width:0; max-width:3ch; overflow:hidden; opacity:1; }
.timer-clock-colored-seconds [data-clock-colored-seconds] { color:#78716c; }
#sidebar-timer-region { container-type:inline-size; }
@media(pointer:coarse) {
  .app-sidebar .timer-workflow-readout .timer-clock-digits { font-size:16px!important; }
  .app-sidebar .timer-workflow-readout .sidebar-timer-transport { width:32px; height:44px; padding:6px; }
  .app-sidebar .timer-workflow-readout .timer-clock-flexible { max-width:calc(100% - 106px)!important; }
}

/* Match the shared control row, without legacy sidebar clock sizing. */
#timer-window-content .timer-workflow-readout { align-items:center; margin-top:4px; }
#timer-window-content .timer-workflow-heading input { padding-block:4px; }
#timer-window-content .timer-workflow-readout .timer-clock-digits { font-size:18px!important; }
#timer-window-content .timer-clock-colored { top:50%; transform:translateY(-50%); }

#timer-window-content .timer-workflow-controls { margin-top:0; }
@media(pointer:coarse) {
  #timer-window-content .timer-workflow-readout .num,
  #timer-window-content .timer-workflow-readout .timer-clock-digits { font-size:16px!important; }
  #timer-window-content .timer-workflow-controls button { width:32px; height:44px; padding:6px; }
}

@media(pointer:coarse) { .timer-workflow-popout { top:12px; min-width:44px; height:44px; } .timer-workflow-card:has([data-workflow-popout]) .timer-workflow-heading { padding-right:48px; } }

.timer-workflow-card:has([data-workflow-popout]) .timer-workflow-client-label { display:flex; align-items:center; min-height:28px; padding-right:32px; }
@media(pointer:coarse) { .timer-workflow-card:has([data-workflow-popout]) .timer-workflow-client-label { min-height:44px; padding-right:48px; } }

.timer-workflow-fields select:focus-visible { outline:2px solid #526549; outline-offset:2px; }
.timer-workflow-fields select[aria-invalid=true]:focus { border-color:#a43e35; }
.app-sidebar .timer-workflow-heading input { padding-block:2px; }
.app-sidebar .timer-workflow-readout { margin-top:0; }
.app-sidebar .timer-workflow-popout { top:12px; }
.timer-window-brand { text-decoration:none; }
#timer-window-content details[data-workflow-history] { margin-block:8px 0; }
#timer-window-content summary.timer-workflow-recent-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; list-style:none; margin:0; padding:6px; cursor:pointer; }
#timer-window-content summary::-webkit-details-marker { display:none; }
#timer-window-content summary svg { transition:transform .25s ease; }
#timer-window-content details[open] summary svg { transform:rotate(90deg); }
@media(prefers-reduced-motion:reduce) { #timer-window-content summary svg { transition:none; } }

/* Popout frame: card presentation lives in shared timer_responsive.css. */
.timer-window { overflow:hidden; }
.timer-window .timer-window-shell { width:100%; height:100dvh; overflow:hidden; position:relative; }
.timer-window .timer-window-header { position:absolute; inset:0 0 auto; height:44px; min-height:0; padding:10px 12px 0; align-items:flex-start; opacity:var(--pop-header-opacity,1); overflow:hidden; pointer-events:var(--pop-header-events,auto); border-color:rgb(231 229 228 / var(--pop-header-opacity,1)); }
.timer-window .timer-window-brand { height:24px; flex-shrink:0; }
.timer-window .timer-window-shell > main { height:100%; padding:var(--pop-top,50px) 10px 8px; overflow:hidden; }
#timer-window-content[data-controller=timer-workflow] { padding:0; }
#timer-window-content .timer-workflow-slot { margin:0; overflow:clip; }
#timer-window-content details[data-workflow-history] { margin:var(--pop-recent-gap,8px) 0 0; max-height:var(--pop-recent-height,200px); overflow:hidden; opacity:var(--pop-recent-opacity,1); visibility:var(--pop-recent-visible,visible); }
#timer-window-content .timer-workflow-recent-list { max-height:var(--pop-recent-list-height,170px); overflow-y:auto; scrollbar-gutter:stable; }
.timer-window[data-popout-editing=true] .timer-window-shell > main { padding-top:8px; overflow-y:auto; scrollbar-gutter:stable; }
.timer-window[data-popout-editing=true] .timer-window-header { opacity:0; pointer-events:none; }

html:has(body.timer-window) { scrollbar-gutter:auto; overflow:hidden; }

.app-sidebar .timer-workflow-recent-list { max-height:none; overflow-y:visible; }

/* Keep an empty history available for live replacement without showing its heading. */
.timer-workflow-recent[hidden] { display:none!important; }
