/* Time Tracker Web — styles. Tokens from the approved mockup
   (Approved_Mockups/01_WebVersion.html), which follows the TaskNotes web
   companion and design guide §4. The web draws no glass: every surface is
   solid (DL-075, DL-080 carried over). Light and dark follow the system. */

:root {
  color-scheme: light dark;
  --bg: #fff; --surface: hsl(240 5% 96%); --raised: #fff; --sunken: hsl(240 5% 98%);
  --text: hsl(240 10% 15%); --text2: hsl(240 4% 42%); --text3: hsl(240 4% 55%);
  --sep: hsl(240 5% 88%); --sep2: hsl(240 5% 92%); --ctl: hsl(240 5% 80%);
  --hover: rgba(0,0,0,.04);
  --accent: hsl(211 100% 50%); --accent-strong: hsl(211 100% 40%); --accent-tint: hsl(211 100% 50% / .12); --accent-on-tint: hsl(211 100% 32%);
  --success: hsl(152 69% 26%);
  --untracked: hsl(32 100% 32%); --untracked-tint: hsl(36 100% 50% / .14); --untracked-line: hsl(32 100% 45%);
  --danger: hsl(3 80% 46%);
  --fill3: rgba(118,118,128,.12); --band: rgba(118,118,128,.08);
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, SFMono-Regular, Menlo, monospace;
  /* The iOS system colours ClientColor's swatches draw (ColorTokens.swift). */
  --sw-red: #FF3B30; --sw-orange: #FF9500; --sw-yellow: #FFCC00; --sw-green: #34C759; --sw-blue: #007AFF; --sw-indigo: #5856D6;
  --sw-purple: #AF52DE; --sw-pink: #FF2D55; --sw-teal: #30B0C7; --sw-brown: #A2845E; --sw-graphite: #8E8E93; --sw-neutral: #000;
  --logo-plate: #F2F2F7; --logo-a1: #0A6CFF; --logo-a2: #30B0C7; --logo-a3: #5856D6; --logo-mk: #1C1C1E; --logo-edge: rgba(0,0,0,.08);
  --pph: 88px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e; --surface: #141416; --raised: #2c2c2e; --sunken: #18181a;
    --text: hsl(240 10% 94%); --text2: hsl(240 5% 68%); --text3: hsl(240 4% 56%);
    --sep: #38383a; --sep2: #2c2c2e; --ctl: #58585a; --hover: rgba(255,255,255,.05);
    --accent: hsl(211 100% 60%); --accent-strong: hsl(211 100% 45%); --accent-tint: hsl(211 100% 55% / .18); --accent-on-tint: hsl(211 100% 78%);
    --success: hsl(145 60% 55%);
    --untracked: hsl(36 100% 62%); --untracked-tint: hsl(36 100% 50% / .14); --untracked-line: hsl(36 100% 55%);
    --danger: hsl(3 100% 66%);
    --fill3: rgba(118,118,128,.24); --band: rgba(118,118,128,.14);
    --sw-red: #FF453A; --sw-orange: #FF9F0A; --sw-yellow: #FFD60A; --sw-green: #30D158; --sw-blue: #0A84FF; --sw-indigo: #5E5CE6;
    --sw-purple: #BF5AF2; --sw-pink: #FF375F; --sw-teal: #40C8E0; --sw-brown: #AC8E68; --sw-graphite: #8E8E93; --sw-neutral: #fff;
    --logo-plate: #1C1C1E; --logo-a1: #3A8BFF; --logo-a2: #44C7DC; --logo-a3: #7D7BE8; --logo-mk: #F2F2F7; --logo-edge: rgba(255,255,255,.14);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.defs { position: absolute; }
.logo-plate { fill: var(--logo-plate); stroke: var(--logo-edge); }
.logo-a1 { fill: var(--logo-a1); } .logo-a2 { fill: var(--logo-a2); } .logo-a3 { fill: var(--logo-a3); } .logo-mk { fill: var(--logo-mk); }
.mark { width: 28px; height: 28px; flex: none; display: block; }
.mark-lg { width: 72px; height: 72px; margin: 0 auto 12px; }
.small { font-size: 12px; color: var(--text2); }
.muted { color: var(--text2); }
.mono { font-variant-numeric: tabular-nums; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { margin: 0; font-size: inherit; }

/* buttons */
.btn { background: var(--raised); border: 1px solid var(--ctl); border-radius: 8px; padding: 6px 11px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; min-height: 32px; cursor: pointer; font-size: 13px; }
.btn:hover { background: var(--hover); }
.btn.pri { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; font-weight: 600; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.icon { padding: 6px 9px; }
.btn:disabled { opacity: .4; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; }
.seg { display: inline-flex; background: var(--fill3); border-radius: 9px; padding: 2px; }
.seg-b { border: 0; background: transparent; padding: 5px 14px; border-radius: 7px; font-size: 13px; cursor: pointer; min-height: 30px; }
.seg-b.on { background: var(--raised); box-shadow: 0 1px 3px rgba(0,0,0,.14); font-weight: 600; }
.badge { font-size: 11px; font-weight: 600; border-radius: 5px; padding: 1px 6px; background: var(--fill3); color: var(--text2); margin-left: 6px; }
.sw { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; }

/* gate */
.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--surface); padding: 16px; }
.gatecard { width: 380px; max-width: 100%; background: var(--raised); border-radius: 16px; border: 1px solid var(--sep2); padding: 28px 26px; text-align: center; }
.gate-title { font-size: 20px; margin: 0 0 6px; }
.btn-apple { display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px; background: var(--text); color: var(--bg); border: 0; border-radius: 10px; padding: 11px; font-weight: 600; margin-top: 18px; cursor: pointer; min-height: 44px; }
.gate-status { margin: 14px 0 6px; font-size: 13px; }
.gate-status[data-kind=error] { color: var(--danger); }
.gate-status[data-kind=warn] { color: var(--untracked); }

/* app frame */
.app { display: flex; flex-direction: column; height: 100vh; }
.tb { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--sep); background: var(--bg); flex: none; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.env-tag { font-size: 11px; font-weight: 600; color: var(--untracked); background: var(--untracked-tint); border-radius: 5px; padding: 1px 6px; }
.sp { flex: 1; }
.sync { font-size: 12px; color: var(--text2); white-space: nowrap; margin: 0; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sync[data-kind=ok] { color: var(--success); } .sync[data-kind=error] { color: var(--danger); }
.narrowtitle { display: none; flex: 1; text-align: center; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back { background: none; border: 0; color: var(--accent); cursor: pointer; min-height: 44px; padding: 0 4px; white-space: nowrap; }
.body { flex: 1; display: flex; min-height: 0; position: relative; }
.workspace { flex: 1; display: flex; min-width: 0; min-height: 0; outline: none; }
.side { width: 208px; flex: none; background: var(--surface); border-right: 1px solid var(--sep); padding: 10px 8px; overflow: auto; }
.side .it { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 8px; margin: 1px 0; color: var(--text); text-decoration: none; min-height: 34px; }
.side .it:hover { background: var(--hover); }
.side .it .g { width: 18px; text-align: center; color: var(--accent); }
.side .it.on { background: var(--accent-strong); color: #fff; font-weight: 600; }
.side .it.on .g { color: #fff; }
.side .hd { font-size: 11.5px; font-weight: 600; color: var(--text2); margin: 16px 10px 4px; }
.drawer-head { display: none; align-items: center; justify-content: space-between; padding: 0 4px 6px 10px; }
.drawer-title { font-weight: 600; }
.drawer-foot { margin-top: 16px; }
.scrim { position: absolute; inset: 0; background: rgba(0,0,0,.28); z-index: 14; }

/* columns */
.col { min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.colhd { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-bottom: 1px solid var(--sep2); flex: none; }
.colhd .t { font-weight: 600; font-size: 15px; }
.scroll { flex: 1; overflow: auto; padding: 10px 12px; min-height: 0; }
.agenda-col { width: 340px; flex: none; border-right: 1px solid var(--sep); background: var(--sunken); }
.review-col { flex: 1; }
.centred { max-width: 680px; margin: 0 auto; width: 100%; }

/* running card */
.card { background: var(--raised); border-radius: 12px; padding: 12px 14px; border: 1px solid var(--sep2); }
.run .lbl { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.run .fig { font: 600 30px/1.1 var(--font); font-variant-numeric: tabular-nums; margin: 6px 0 2px; }
.run .fig .fig-unit { font-size: 17px; margin-left: 3px; font-weight: 500; }
.run .act { font-weight: 600; font-size: 16px; }
.run .who { color: var(--text2); font-size: 13px; }
.run .row { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.idle-line { margin: 0; color: var(--text2); }

/* agenda */
.dh { margin: 14px 0 6px; }
.dh-btn { display: flex; width: 100%; justify-content: space-between; align-items: baseline; gap: 8px; background: none; border: 0; padding: 4px 4px 4px 8px; font-size: 12.5px; font-weight: 600; color: var(--text2); cursor: pointer; text-align: left; border-left: 3px solid transparent; min-height: 30px; }
.dh-btn.sel { color: var(--accent-on-tint); border-left-color: var(--accent); }
.dh .tot { font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.dh-btn.sel .tot { color: var(--accent-on-tint); }
.banner { display: block; width: 100%; text-align: left; background: var(--accent-tint); color: var(--accent-on-tint); border: 0; border-radius: 8px; padding: 6px 10px; margin-bottom: 6px; font-weight: 600; font-size: 13px; cursor: pointer; }
.list { background: var(--raised); border-radius: 10px; border: 1px solid var(--sep2); overflow: hidden; }
.e { border-bottom: 1px solid var(--sep2); }
.e:last-child { border-bottom: 0; }
.e-btn { display: flex; gap: 10px; align-items: center; padding: 8px 10px; min-height: 48px; width: 100%; background: none; border: 0; text-align: left; cursor: pointer; }
.e-btn:hover { background: var(--hover); }
.e.sel .e-btn { background: var(--accent-tint); }
.e .tm { width: 62px; flex: none; display: flex; flex-direction: column; font-size: 12px; line-height: 1.3; font-variant-numeric: tabular-nums; color: var(--text2); white-space: nowrap; }
.e .bar { width: 4px; align-self: stretch; border-radius: 2px; flex: none; }
.e .nm { flex: 1; min-width: 0; }
.e .nm b, .e .nm small, .e .nm i { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.e .nm b { font-weight: 500; }
.e .nm b .eng { font-weight: 400; color: var(--text2); }
.e .nm small, .e .nm i { font-size: 12px; color: var(--text2); }
.e .hrs { font-weight: 600; font-variant-numeric: tabular-nums; }
.gaprow { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--sep2); color: var(--untracked); font-weight: 600; font-size: 13px; background: repeating-linear-gradient(135deg, var(--untracked-tint) 0 6px, transparent 6px 12px); }
.gaprow:last-child { border-bottom: 0; }
.empty { color: var(--text2); padding: 8px 4px; margin: 0; }
.older { text-align: center; padding: 14px 0; }

/* review day */
.centred-hd { justify-content: center; position: relative; }
.dayctl { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; width: min(340px, 100%); }
.dayctl .nm { text-align: center; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dayctl .btn { justify-content: center; font-size: 18px; min-height: 36px; }
.today-btn { position: absolute; right: 10px; }
.meta { display: flex; justify-content: space-between; align-items: flex-end; padding: 8px 18px 10px; border-bottom: 1px solid var(--sep2); flex: none; gap: 10px; }
.rd-title { font-weight: 600; }
.meta .short { color: var(--untracked); font-size: 13px; font-weight: 600; }
.meta .tot { font: 600 22px var(--font); font-variant-numeric: tabular-nums; }
.column-scroll { padding: 10px 18px 24px 0; }
.timeline { position: relative; margin-left: 84px; }
.hr { position: absolute; left: -78px; width: 68px; text-align: right; font-size: 11px; color: var(--text3); font-variant-numeric: tabular-nums; transform: translateY(-8px); }
.hl { position: absolute; left: 0; right: 0; border-top: 1px solid var(--sep2); }
.hl.half { border-top-style: dotted; }
.band { position: absolute; left: 0; right: 0; background: var(--band); }
.band span { position: absolute; right: 8px; top: 4px; font-size: 11px; color: var(--text3); }
.edge { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--text3); }
.blk { position: absolute; left: 0; right: 0; border-radius: 6px; padding: 4px 56px 4px 9px; font-size: 13px; overflow: hidden; border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 16%, var(--raised)); }
.blk b { font-weight: 600; }
.blk .eng { color: var(--text2); }
.blk small { display: block; color: var(--text2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk.sel { outline: 2px solid var(--accent); outline-offset: 1px; z-index: 2; }
.blk .hrs { position: absolute; right: 9px; top: 4px; font-weight: 600; font-variant-numeric: tabular-nums; }
.run-word { color: var(--danger); font-weight: 600; }
.gap { position: absolute; left: 0; right: 0; border: 1.5px dashed var(--untracked-line); border-radius: 6px; color: var(--untracked); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; justify-content: center; background: repeating-linear-gradient(135deg, var(--untracked-tint) 0 6px, transparent 6px 12px); }
.nowline { position: absolute; left: -6px; right: 0; border-top: 2px solid var(--danger); z-index: 3; }
.nowline::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

/* reports */
.rsec { font-size: 12px; font-weight: 600; color: var(--text2); margin: 18px 4px 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rsec-t { font-size: 13px; color: var(--text); }
section:first-child > .rsec:first-child { margin-top: 4px; }
.export-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 4px 2px; }
.export-row + .hint { margin: 4px 4px 10px; }
.field { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text2); }
.field input.in { border: 1px solid var(--ctl); border-radius: 6px; padding: 4px 8px; color: var(--text); background: var(--bg); width: 9em; min-height: 28px; font-family: var(--mono); font-size: 12px; }
.fr > .field { flex: 1; justify-content: space-between; color: var(--text); font-size: inherit; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.gridwrap { overflow-x: auto; border: 1px solid var(--sep2); border-radius: 10px; background: var(--raised); }
table.ts { border-collapse: collapse; width: 100%; font-size: 13px; table-layout: fixed; }
.ts th, .ts td { padding: 8px 8px; border-bottom: 1px solid var(--sep2); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ts thead th { font-size: 12px; color: var(--text2); font-weight: 600; background: var(--sunken); }
.ts thead th.today { color: var(--accent-on-tint); }
.ts.stacked thead th .wd, .ts.stacked thead th .dn { display: block; }
.ts .id { text-align: left; white-space: normal; border-right: 1px solid var(--sep2); }
.ts tbody th.id { font-weight: 400; }
.ts .idwrap { display: flex; gap: 8px; align-items: baseline; }
.ts .id b { font-weight: 500; display: block; }
.ts .id small { display: block; color: var(--text2); font-size: 12px; }
.ts td.z { color: var(--text3); }
.ts .tot { font-weight: 600; border-left: 1px solid var(--sep2); }
.ts tr.daytotals th, .ts tr.daytotals td { background: var(--sunken); font-weight: 600; border-bottom: 0; }
.ts.scrolls { width: auto; }
.warn-line { color: var(--untracked); font-weight: 600; font-size: 13px; margin: 8px 4px; }
.warn-line .muted { font-weight: 400; }
.reportsplit { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
.chart { background: var(--raised); border: 1px solid var(--sep2); border-radius: 10px; padding: 12px 14px; }
.chart-hd { display: flex; align-items: baseline; gap: 6px; }
.ctot { font: 600 22px var(--font); font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; margin-top: 10px; }
.barcol { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; background: none; border: 0; padding: 0; cursor: pointer; min-width: 0; }
.barcol .stack { display: flex; flex-direction: column; gap: 1px; width: 100%; max-width: 34px; }
.barcol .stack i { display: block; width: 100%; border-radius: 2px; }
.barcol .stack i.zero { height: 2px; background: var(--text3); opacity: .6; }
.barcol .blabel { font-size: 11px; color: var(--text2); margin-top: 4px; }
.barcol.on .blabel { color: var(--accent); font-weight: 700; }
.custom { display: inline-flex; gap: 8px; flex-wrap: wrap; font-weight: 400; }
.custom input { border: 1px solid var(--ctl); border-radius: 6px; padding: 2px 6px; background: var(--bg); }
.roll { background: var(--raised); border: 1px solid var(--sep2); border-radius: 10px; overflow: hidden; }
.roll .r { border-bottom: 1px solid var(--sep2); font-size: 13px; }
.roll .r:last-child { border-bottom: 0; }
.r-btn, .roll .l3 { display: flex; align-items: center; gap: 8px; padding: 8px 12px; width: 100%; background: none; border: 0; text-align: left; cursor: pointer; min-height: 40px; }
.roll .n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roll .h { font-weight: 600; font-variant-numeric: tabular-nums; }
.roll .chev { width: 12px; color: var(--text3); }
.roll .share { display: block; height: 4px; border-radius: 2px; margin: 0 12px 8px 31px; }
.roll .l2 .r-btn { padding-left: 30px; }
.roll .l3 { padding-left: 48px; color: var(--text2); cursor: default; }
.filter { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.empty-state { background: var(--raised); border: 1px solid var(--sep2); border-radius: 10px; padding: 16px; text-align: center; }
.empty-state p { margin: 4px 0 0; }

/* timers */
.timers-hd { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.tlist { margin-top: 12px; }
.trow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--sep2); min-height: 56px; }
.trow:last-child { border-bottom: 0; }
.trow .nm { flex: 1; min-width: 0; }
.trow .nm b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .nm b .eng { font-weight: 400; color: var(--text2); }
.trow .nm small { color: var(--text2); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .trail { color: var(--text2); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.trow .trail.dur { font-size: 14px; font-weight: 600; color: var(--text); }
.grip { color: var(--text3); letter-spacing: -2px; width: 14px; }
.fav { width: 14px; color: var(--untracked-line); }
.capfoot { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px; }

/* clients and settings */
.tl-col { width: 300px; flex: none; border-right: 1px solid var(--sep); background: var(--sunken); }
.detail-col { flex: 1; }
.tlist-plain .ti { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--sep2); width: 100%; background: none; text-align: left; cursor: pointer; min-height: 48px; }
.tlist-plain li > .ti:hover { background: var(--hover); }
.tlist-plain .ti.on { background: var(--accent-tint); }
.ti .nm { flex: 1; }
.ti small { color: var(--text2); font-size: 12px; }
.sec { font-size: 12px; font-weight: 600; color: var(--text2); margin: 14px 4px 6px; }
.fg { background: var(--raised); border-radius: 10px; border: 1px solid var(--sep2); overflow: hidden; }
.fr { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--sep2); min-height: 40px; }
.fr:last-child { border-bottom: 0; }
.fr .l { color: var(--text2); }
.fr .v { text-align: right; min-width: 0; }
.hint { font-size: 12px; color: var(--text2); margin: 6px 4px 0; line-height: 1.4; }
.radios { display: inline-flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.radio { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.settings-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; align-items: start; }

/* running strip (DL-246) */
.strip { border-bottom: 1px solid var(--sep); background: var(--sunken); flex: none; display: flex; align-items: center; gap: 8px; padding-right: 14px; }
.strip .strip-btn { flex: 1; min-width: 0; }
.strip-btn { display: flex; align-items: center; gap: 10px; padding: 6px 14px; width: 100%; min-height: 44px; background: none; border: 0; text-align: left; cursor: pointer; font-size: 13px; }
.strip-btn b { font-weight: 600; white-space: nowrap; }
.strip-btn .who { color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.strip-btn .fig { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.strip-btn .lbl { display: inline-flex; }

/* ---- medium (760–1099): the sidebar folds into the Views drawer -------- */
body[data-layout=medium] .side, body[data-layout=narrow] .side { position: absolute; left: 0; top: 0; bottom: 0; width: 260px; z-index: 15; box-shadow: 8px 0 30px rgba(0,0,0,.18); display: none; }
body[data-drawer=open] .side { display: block !important; }
body[data-layout=narrow] .side { width: min(300px, 88vw); }
body[data-layout=medium] .drawer-head, body[data-layout=narrow] .drawer-head { display: flex; }
body[data-layout=wide] #nav-toggle { display: none; }
body[data-layout=medium] .agenda-col { width: 320px; }
body[data-layout=medium] .tl-col { width: 270px; }
body[data-layout=medium] .reportsplit { grid-template-columns: 1fr; }

/* ---- narrow (< 760): one screen at a time ------------------------------ */
body[data-layout=narrow] .tb { padding: 0 8px; gap: 4px; }
body[data-layout=narrow] .brand, body[data-layout=narrow] #start-timer, body[data-layout=narrow] .sync, body[data-layout=narrow] .tb .signout-home { display: none; }
body[data-layout=narrow] .narrowtitle { display: block; }
body[data-layout=narrow] .field input.in { min-height: 44px; }
body[data-layout=narrow] .btn, body[data-layout=narrow] .seg-b, body[data-layout=narrow] .fr, body[data-layout=narrow] .side .it { min-height: 44px; }
body[data-layout=narrow] .btn.icon { min-width: 44px; justify-content: center; }
body[data-layout=narrow] .agenda-col, body[data-layout=narrow] .tl-col { width: 100%; border-right: 0; }
body[data-layout=narrow] .reportsplit, body[data-layout=narrow] .settings-cols { grid-template-columns: 1fr; }
body[data-layout=narrow] .e .nm b .eng, body[data-layout=narrow] .blk .eng { display: none; }
body[data-layout=narrow] .drawer-foot .sync { display: block; white-space: normal; padding: 6px 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* fitGrid's probes: the cells' own fonts */
.ts-probe { font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 600; }
.ts-probe-th { font-size: 12px; font-weight: 600; }

/* ---- T4: editing (the mockup's status line, dialog and swatch row) ---- */
:root { --success-tint: hsl(152 69% 26% / .10); --danger-tint: hsl(3 80% 46% / .10); }
@media (prefers-color-scheme: dark) { :root { --success-tint: hsl(145 60% 55% / .14); --danger-tint: hsl(3 100% 66% / .14); } }
.sync[data-kind=warn] { color: var(--untracked); } .sync[data-kind=busy] { color: var(--text2); }
.status { margin: 0 0 12px; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; }
.status.idle { display: none; }
.status.ok { color: var(--success); background: var(--success-tint); }
.status.busy { color: var(--text2); background: var(--fill3); }
.status.err { color: var(--danger); background: var(--danger-tint); }
.status.warn { color: var(--untracked); background: var(--untracked-tint); }
.status.info { color: var(--accent-on-tint); background: var(--accent-tint); }
.status p { margin: 0; }
.status .acts { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.status .acts .btn { font-size: 12px; min-height: 28px; padding: 3px 9px; }
.cmp { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0; color: var(--text); }
.cmp span:nth-child(odd) { color: var(--text2); }
.inp { flex: 1; min-width: 0; max-width: 360px; border: 1px solid var(--ctl); border-radius: 6px; padding: 5px 8px; background: var(--bg); text-align: right; }
.inp.search { text-align: left; max-width: none; width: 100%; }
.mono-code { font-family: var(--mono); }
.fr .inp { margin-left: auto; }
.searchrow { padding: 8px 12px; }
.sub-hd { display: flex; gap: 12px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--sep2); }
.archived-row .nm { color: var(--text); }
.fr-btn { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--sep2); text-align: left; cursor: pointer; font: inherit; color: inherit; }
.fr-btn:hover { background: var(--hover); }
.fr-btn .v { margin-left: auto; }
.chev { color: var(--text3); }
.checkrow { justify-content: flex-start; cursor: pointer; }
.checkrow input { width: 18px; height: 18px; margin: 0 6px 0 0; }
.linkbtn.danger { color: var(--danger); }
.linkbtn:disabled { opacity: .45; cursor: default; }
.warn-text { color: var(--untracked); font-size: 12.5px; margin: 6px 2px 0; }
.colour-row { flex-wrap: wrap; align-items: flex-start; }
.swrow { display: flex; gap: 6px 10px; flex-wrap: wrap; justify-content: flex-end; flex: 1; }
.swopt { display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.swopt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swopt .sw { width: 16px; height: 16px; }
.swopt.on { background: var(--accent-tint); font-weight: 600; }
.swopt:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn.dan { color: var(--danger); }
.btn:disabled { opacity: .35; cursor: default; }
.btn.small-btn { min-height: 28px; padding: 3px 9px; font-size: 12px; }
.fav-btn { background: none; border: 0; font-size: 18px; width: 44px; height: 44px; flex: none; cursor: pointer; color: var(--text2); }
.fav-btn.on { color: var(--accent); }
.reorder { display: inline-flex; gap: 4px; align-items: center; margin-left: 6px; }
.trow.dragging { opacity: .5; }
/* The drop line: where a dragged favourite will land. */
.trow.drop-before { box-shadow: inset 0 3px 0 var(--accent); }
.trow.drop-after { box-shadow: inset 0 -3px 0 var(--accent); }
.grip[draggable=true] { cursor: grab; }
dialog.dialog { width: min(340px, calc(100vw - 32px)); background: var(--raised); color: var(--text); border: 0; border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.3); padding: 18px 18px 12px; text-align: center; }
dialog.dialog::backdrop { background: rgba(0,0,0,.32); }
.dialog h3 { margin: 0 0 6px; font-size: 16px; }
.dialog .dialog-msg { margin: 0 0 6px; color: var(--text2); font-size: 13px; white-space: pre-line; }
.dialog .acts { display: flex; gap: 8px; margin-top: 14px; }
.dialog .acts .btn { flex: 1; justify-content: center; }
dialog.sheet { width: min(460px, calc(100vw - 32px)); text-align: left; padding: 0; }
.sheet-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--sep2); }
.sheet-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.sheet-body .fr { border: 1px solid var(--sep2); border-radius: 8px; }
.sheet-body .inp { text-align: left; max-width: none; }
body[data-layout=narrow] .inp, body[data-layout=narrow] .swopt, body[data-layout=narrow] .btn, body[data-layout=narrow] .linkbtn { min-height: 44px; }
body[data-layout=narrow] .fr .linkbtn { min-width: 44px; text-align: left; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- T5: the entry editor (DL-305; the mockup's .pane) ---------------------------- */
.col.pane { width: 360px; flex: none; border-left: 1px solid var(--sep); background: var(--sunken); display: flex; flex-direction: column; min-height: 0; }
.pane .edh { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-bottom: 1px solid var(--sep2); }
.pane .edt { font-size: 15px; font-weight: 600; margin: 0; text-align: center; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane-scroll { padding: 0 12px 16px; flex: 1; overflow: auto; }
.pane .sec { font-size: 12px; font-weight: 600; color: var(--text2); margin: 14px 4px 6px; }
.pane .ta { display: block; width: 100%; box-sizing: border-box; border: 0; background: transparent; color: var(--text); font: inherit; padding: 9px 12px; min-height: 58px; resize: vertical; }
.pane .cnt { text-align: right; font-size: 11px; color: var(--text3); padding: 0 12px 6px; font-variant-numeric: tabular-nums; }
.pane .fr-btn { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pane .fr-btn.danger { color: var(--danger); justify-content: flex-start; }
.pane .del { margin-top: 14px; }
.pane .hint.danger { color: var(--danger); }
.pane .v.link { color: var(--accent); }
.pane .muted, .muted { color: var(--text2); }
.time-ctl { display: inline-flex; align-items: center; gap: 6px; }
.time-pick { font: inherit; font-variant-numeric: tabular-nums; color: var(--accent); background: var(--raised); border: 1px solid var(--sep2); border-radius: 6px; padding: 3px 4px; }
.btn.step { min-width: 32px; justify-content: center; padding: 2px 8px; }
.hours { display: inline-flex; align-items: center; gap: 6px; }
.hours-inp { width: 76px; text-align: right; }
.fr.sub { min-height: 0; padding-top: 4px; padding-bottom: 6px; }
#editor-strip { margin: 8px 4px 0; font-size: 12px; font-variant-numeric: tabular-nums; display: grid; gap: 3px; }
.strip-clamp { color: var(--untracked); }
/* Under the agenda as the mockup draws it, and kept in view at the column's foot however long the agenda is. */
.agenda-status { position: sticky; bottom: 0; padding: 6px 12px 12px; background: var(--sunken); z-index: 3; }
.pick-list { list-style: none; margin: 0 0 6px; padding: 0; }
.pick { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--sep2); padding: 9px 4px; font: inherit; color: var(--text); cursor: pointer; min-height: 40px; }
.pick:hover { background: var(--hover); }
.pick.link { color: var(--accent); }
.picker-body { max-height: 60vh; overflow: auto; }
.blk-hit { position: absolute; inset: 0; width: 100%; background: transparent; border: 0; cursor: pointer; border-radius: 6px; }
.blk-hit:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.gap .fill { margin-left: 8px; min-height: 0; padding: 0 6px; font-weight: 600; }
body[data-layout=medium] .col.pane { width: 340px; }
/* Narrow: the editor is a full-screen sheet with its own Cancel and Save; the page toolbar steps away. */
body[data-layout=narrow][data-editing=open] .tb, body[data-layout=narrow][data-editing=open] #strip-slot { display: none; }
body[data-layout=narrow] .col.pane { width: 100%; border-left: 0; }
body[data-layout=narrow] .btn.step, body[data-layout=narrow] .time-pick, body[data-layout=narrow] .hours-inp, body[data-layout=narrow] .pick, body[data-layout=narrow] .fill { min-height: 44px; }
body[data-layout=narrow] .btn.step { min-width: 44px; }
body[data-layout=narrow] .wide-label { display: none; }
body[data-layout=narrow] #new-entry { min-width: 44px; justify-content: center; }
.blk-hit { z-index: 1; }
/* The pickers' search (DL-309 addendum item 11, TT-623). */
.picker-search-row { padding: 8px 12px; border-bottom: 1px solid var(--sep2); }
.picker-search { width: 100%; box-sizing: border-box; text-align: left; margin: 0; }
.pick-empty { padding: 12px 4px; margin: 0; }
body[data-layout=narrow] .picker-search { min-height: 44px; }

/* T6 — timers and alerts */
.btn.stopbtn { color: #fff; border-color: transparent; font-weight: 600; }
.btn.stopbtn:hover { filter: brightness(1.08); }
.strip .stopbtn { padding: 4px 12px; min-height: 32px; }
.run .row .snaps { margin-left: auto; color: var(--text2); }
.btn.bold { font-weight: 600; }
.play { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 1px solid var(--ctl); background: var(--raised); color: var(--accent); cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.play:hover { background: var(--hover); }
.play.stop { color: #fff; border-color: transparent; }
.play:disabled { opacity: .4; cursor: default; }
body[data-layout=narrow] .play { width: 44px; height: 44px; }
.timer-status { margin: 8px 0 0; }
.btn.bell { gap: 5px; }
.btn.bell[aria-pressed=true] { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-on-tint); }
.btn.bell[data-state=blocked] { color: var(--text2); }
body[data-layout=medium] .bell .bell-label, body[data-layout=narrow] .bell .bell-label { display: none; }
.wd-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; min-height: 40px; background: none; border: 0; border-bottom: 1px solid var(--sep2); text-align: left; cursor: pointer; font: inherit; color: inherit; }
.wd-row:hover { background: var(--hover); }
.wd-row .v { margin-left: auto; font-variant-numeric: tabular-nums; }
.wd-row .chev { color: var(--text3, var(--text2)); }
body[data-layout=narrow] .wd-row { min-height: 44px; }
.wd-edit { padding: 4px 12px 10px 24px; border-bottom: 1px solid var(--sep2); background: var(--sunken); }
.wd-edit .fr { padding-left: 0; padding-right: 0; border-bottom: 1px solid var(--sep2); }
.wd-edit .hint { margin-left: 0; }
.time-inp { font: inherit; font-variant-numeric: tabular-nums; color: var(--text); background: var(--raised); border: 1px solid var(--ctl); border-radius: 6px; padding: 3px 6px; }
.switch { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 12px; background: var(--ctl); position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: left .15s; }
.switch:checked { background: var(--success, #34c759); }
.switch:checked::after { left: 18px; }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .switch, .switch::after { transition: none; } }
.perm-row { padding: 9px 12px; border-bottom: 1px solid var(--sep2); font-size: 12px; color: var(--text2); display: grid; gap: 7px; justify-items: start; }
.fr .v.ok { color: var(--success, #34c759); }
/* T7's walk at 390 px (TT-617, Acceptance 35): 44 px targets at narrow width
   for the controls measured short. A row's control and its label fill the
   row's full height (the row's 9 px padding taken back), and a switch's label
   stretches across its row, so a click anywhere in the row toggles it. */
body[data-layout=narrow] .dh-btn, body[data-layout=narrow] .banner, body[data-layout=narrow] .r-btn { min-height: 44px; }
body[data-layout=narrow] .btn.bell { min-width: 44px; justify-content: center; }
body[data-layout=narrow] .fr > select, body[data-layout=narrow] .fr > .time-inp, body[data-layout=narrow] .fr .radio { min-height: 44px; margin-top: -9px; margin-bottom: -9px; }
body[data-layout=narrow] .fr > label[for] { flex: 1; align-self: stretch; display: flex; align-items: center; min-height: 44px; margin-top: -9px; margin-bottom: -9px; cursor: pointer; }
body[data-layout=narrow] .bars { gap: 2px; }
body[data-layout=narrow] .custom input[type=date] { min-height: 44px; }
