:root {
  --bg: #f1f4fa; --panel: #ffffff; --well: #e6ebf5;
  --border: #dbe2ef; --border-strong: #c3cde0;
  --text: #1b2540; --muted: #4a5470; --faint: #5b6580;
  --accent: #2f68e0; --accent-soft: #dbe8ff;
  --green: #2f8a5b; --red: #c24a4a;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --title: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "JetBrains Mono", monospace;
  --c-inbox: #3f78ee; --c-today: #e3a008; --c-upcoming: #e04860; --c-all: #1f9d8f; --c-board: #9a7cf0; --c-done: #2f9e5f; --c-week: #e0791f;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #24272f; --panel: #2d313b; --well: #1d2027;
  --border: #3b3f4b; --border-strong: #505462;
  --text: #f2f3f7; --muted: #bdc0cc; --faint: #a4a8b6;
  --accent: #72b4ff; --accent-soft: #2c3652;
  --green: #7fd1a0; --red: #ff8f8f;
  --c-inbox: #72b4ff; --c-today: #f5c84b; --c-upcoming: #ff7b8a; --c-all: #4fd1c0; --c-board: #b9a2ff; --c-done: #7fd1a0; --c-week: #f5a14b;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; } /* no double-tap zoom; the page keeps its elastic overscroll, like a native app */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } /* app feel: no selecting UI text */
input, [contenteditable] { -webkit-user-select: text; user-select: text; } /* but typing and editing still work */
.iconbtn.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--sans); min-height: 100dvh; }
.app { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100dvh; }
main { width: 100%; max-width: 680px; margin: 0 auto; padding: 0 max(20px, env(safe-area-inset-right)) calc(48px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }

/* Things-style sidebar: fixed column on wide screens, a drawer on narrow ones */
#side { position: sticky; top: 0; height: 100dvh; overflow-y: auto; background: var(--panel); border-right: 1px solid var(--border); padding: calc(20px + env(safe-area-inset-top)) 12px calc(20px + env(safe-area-inset-bottom)); }
.brand { font: 700 15px var(--title); color: var(--muted); padding: 0 10px 18px; }
#tabs { display: flex; flex-direction: column; gap: 2px; }
.gap { height: 14px; }
.nav { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; background: none; border: 0; border-radius: 8px; color: var(--text); font: 500 15px var(--sans); text-align: left; cursor: pointer; }
.nav svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav .nl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .n { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.nav:hover { background: var(--well); }
.nav[aria-current=true] { background: var(--well); font-weight: 650; }
.nav.new { color: var(--muted); margin-top: 6px; }
#menu, #scrim { display: none; }
@media (max-width: 767px) {
  .app { display: block; }
  #side { position: fixed; inset: 0 auto 0 0; width: min(300px, 84vw); z-index: 20; transform: translateX(-100%); transition: transform .2s; }
  body.menu #side { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
  body.menu #scrim { display: block; position: fixed; inset: 0; z-index: 15; background: rgba(0, 0, 0, .35); }
  #menu { display: grid; }
  /* reachability: the header sits lower, and a floating button under the thumb focuses the capture field */
  .top { padding-top: calc(44px + env(safe-area-inset-top)); }
  .head { margin-bottom: 14px; }
  main { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { #side { transition: none; } }

/* sticky header keeps quick capture in reach while the list scrolls */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: calc(20px + env(safe-area-inset-top)) 0 4px; }
.head { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; }
h1 { font: 700 28px var(--title); letter-spacing: -0.005em; margin: 0; flex: 1; }
.lastsync { min-width: 0; text-align: right; font: 12px/1.3 var(--sans); color: var(--faint); font-variant-numeric: tabular-nums; }
dialog p.sub.first { margin-top: 0; }
.iconbtn { width: 40px; height: 40px; display: grid; place-items: center; background: var(--panel); color: var(--muted); border: 1px solid var(--border); border-radius: 999px; cursor: pointer; }
.iconbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn:hover { color: var(--text); border-color: var(--border-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .iconbtn.spin { animation: none; opacity: .5; } }

form { display: flex; gap: 8px; }
#in { flex: 1; min-width: 0; height: 48px; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 0 16px; font: 16px var(--sans); outline: none; transition: border-color .15s, box-shadow .15s; }
#in::placeholder { color: var(--faint); }
#in:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
form button { height: 48px; background: var(--text); color: var(--bg); border: 0; border-radius: 12px; padding: 0 20px; font: 600 15px var(--sans); cursor: pointer; }
kbd { font: 12px var(--mono); background: var(--well); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; }
.hint { color: var(--faint); font-size: 13px; margin: 8px 2px 16px; }
@media (hover: none) { .hint { display: none; } form { margin-bottom: 12px; } }

ul { list-style: none; margin: 0; padding: 0; }
li { display: flex; align-items: flex-start; gap: 10px; min-height: 32px; padding: 7px 4px 7px 0; font-size: 16px; line-height: 1.4; background: var(--bg); }
li input[type=checkbox] { appearance: none; flex: none; width: 18px; height: 18px; margin: 2px 0 0; border: 1.5px solid var(--border-strong); border-radius: 5px; cursor: pointer; display: grid; place-items: center; transition: background .15s, border-color .15s; }
li input[type=checkbox]:hover { border-color: var(--accent); }
li input[type=checkbox]:checked { background: var(--green); border-color: var(--green); }
li input[type=checkbox]:checked::after { content: ""; width: 12px; height: 12px; background: var(--bg); -webkit-mask: var(--tick) center / contain no-repeat; mask: var(--tick) center / contain no-repeat; }
.body { flex: 1; min-width: 0; }
.t { display: block; min-width: 0; overflow-wrap: anywhere; outline: none; border-radius: 4px; cursor: pointer; padding-top: 1px; }
li.done .t { text-decoration: line-through; color: var(--faint); }
.t a { color: var(--accent); text-decoration: none; background: var(--accent-soft); border-radius: 6px; padding: 0 8px; font-size: 13px; white-space: nowrap; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.t a:hover { text-decoration: underline; text-underline-offset: 3px; }
li:not(.future) { cursor: grab; }
li.drag { cursor: grabbing; }
.when { flex: none; min-height: 28px; margin: -2px 0 0; padding: 0 8px; display: inline-flex; align-items: center; background: none; border: 0; border-radius: 8px; color: var(--faint); font: 600 12px var(--sans); cursor: pointer; white-space: nowrap; }
.when svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip { background: var(--accent-soft); color: var(--accent); }
li.future { opacity: .55; }
li.sec { min-height: 0; padding: 18px 0 6px; border-bottom: 0; background: none; font: 600 12px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
li.sec button { background: none; border: 0; padding: 6px 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; }
li.sec button:hover { color: var(--text); }
li.sec.head { margin: 0; display: flex; align-items: center; gap: 10px; }
li.sec.head .hn { font: inherit; }
li.sec.sub { margin: 0; display: flex; align-items: center; gap: 4px; padding-top: 22px; color: var(--text); font: 700 16px var(--title); letter-spacing: 0; text-transform: none; }
li.sec.sub .hn { font: inherit; }
li.sec.sub .hx, li.sec.head .hx, li.sec .ha { opacity: 0; font-size: 20px; padding: 6px 10px; }
li.sec.sub:hover .hx, li.sec.sub:hover .ha, li.sec.head:hover .ha { opacity: 1; }
@media (hover: none) { li.sec.sub .hx, li.sec .ha { opacity: 1; } }
li.sec.head { padding-top: 14px; font: 600 12px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
li.sec.head .hx { opacity: 0; font-size: 20px; padding: 6px 10px; }
li.sec.head:hover .hx { opacity: 1; }
@media (hover: none) { li.sec.head .hx { opacity: 1; } }
/* Projects read as blocks (a line and room above each); a heading inside one is a divider (its name, then a hairline to the edge) */
#list:not(.board) li.sec.sub:not(:first-child) { margin-top: 22px; padding-top: 26px; border-top: 1px solid var(--border); }
#list:not(.board) li.sec.head.in .hn { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-align: left; }
#list:not(.board) li.sec.head.in .hn::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }
li.sec + li { border-top: 0; }
/* Calendar events: read-only rows, a coloured bar in the checkbox column marks the calendar */
#list > li.calh { align-items: center; gap: 10px; min-height: 0; padding: 2px 0 8px; background: none; cursor: pointer; color: var(--text); font: 700 16px var(--title); }
#list > li.calh .ic { flex: none; width: 18px; display: grid; place-items: center; color: var(--muted); }
#list > li.calh svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#list > li.calh .n, #list > li.calh .sum { font: 500 13px var(--sans); color: var(--faint); }
#list > li.calh .sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#list > li.calh .chev { margin-left: auto; color: var(--faint); display: grid; transform: rotate(90deg); transition: transform .15s; }
#list > li.calh.shut .chev { transform: none; }
#list > li.ev { align-items: center; gap: 10px; min-height: 34px; padding: 4px 0; background: none; cursor: default; font-size: 15px; }
#list > li.ev .bar { flex: none; width: 18px; display: grid; place-items: center; }
#list > li.ev .bar i { display: block; width: 4px; height: 18px; border-radius: 2px; background: var(--c); }
#list > li.ev .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#list > li.ev .w { flex: none; color: var(--muted); font: 500 13px var(--sans); font-variant-numeric: tabular-nums; }
#list > li.ev.allday .t { font-weight: 600; }
#list > li.ev.past { opacity: .45; }
#list > li.ev.now .w { color: var(--accent); font-weight: 700; }
#list > li.ev.up { min-height: 30px; }
#list > li.ev.up .w { margin-right: 51px; } /* lines up with the date chips of the tasks below */
#list > li.calend { min-height: 0; height: 0; margin: 10px 0 12px; padding: 0; background: none; border-top: 1px solid var(--border); }
#list > li.calend.up { margin: 6px 0 6px 28px; } /* within a day: starts at the titles, lighter than the day break */
/* Settings: one card per section; a header row (icon, name, state, chevron) opens it, one at a time */
#dlg .ss { margin: 0 0 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); overflow: hidden; }
#dlg .sh { display: flex; align-items: center; gap: 12px; width: 100%; height: auto; margin: 0; padding: 12px 14px; background: none; border: 0; border-radius: 0; color: var(--text); font: 600 15px var(--sans); text-align: left; cursor: pointer; }
#dlg .sh:hover { background: var(--well); }
#dlg .sh .si { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#dlg .sh .stt { margin-left: auto; font: 500 13px var(--sans); color: var(--faint); }
#dlg .sh .stt.on { color: var(--green); }
#dlg .sh .stt.bad { color: var(--red); }
#dlg .sh .sc { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--faint); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
#dlg .ss.open .sh .sc { transform: rotate(90deg); }
#dlg .sb { display: none; padding: 2px 14px 14px 46px; }
#dlg .ss.open .sb { display: block; }
#dlg .sb p { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
#dlg .sb p.hint, #dlg .sb details { margin: 10px 0 0; font-size: 13px; color: var(--faint); }
#dlg .sb details summary { cursor: pointer; }
#dlg .sb details p { margin: 6px 0 8px; font-size: 13px; color: var(--faint); }
#dlg .sb .danger { margin-top: 14px; }
#dlg .sb .st:empty { display: none; }
#dlg .sb .st { margin: 8px 0 0; }
#dlg.nosync .ys, #dlg:not(.nosync) .ns { display: none; }
#dlg .link { height: auto; padding: 0; background: none; border: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
#dlg > #st:empty { display: none; }
#calv { display: grid; margin-bottom: 4px; }
.calr { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; column-gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.calr input[type=color] { width: 22px; height: 22px; padding: 0; margin: 0 auto; border: 0; border-radius: 6px; background: none; cursor: pointer; }
.calr input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.calr input[type=color]::-webkit-color-swatch { border: 0; border-radius: 6px; }
.calr input[type=color]::-moz-color-swatch { border: 0; border-radius: 6px; }
.calr input[type=text] { height: 30px; margin: 0; padding: 0 6px; background: none; border: 1px solid transparent; border-radius: 6px; color: var(--text); font: 15px var(--sans); }
.calr input[type=text]:hover { border-color: var(--border); }
.calr input[type=text]:focus { border-color: var(--accent); outline: none; background: var(--panel); }
.calr .calinfo { grid-column: 2 / -1; padding: 0 7px; font-size: 12px; color: var(--faint); }
.calr .calinfo.bad { color: var(--red); }
.calr .calx { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; background: none; border: 0; color: var(--faint); cursor: pointer; }
.calr .calx svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.calnew { margin-top: 10px; flex-wrap: nowrap; }
.calnew #calu { flex: 1; min-width: 0; }
#onv details .row input { flex: 1; min-width: 0; }
li.sec[data-ev] + li { border-top: 1px solid var(--border); padding-top: 12px; }
.area { flex: 0 1 auto; max-width: 34%; margin: 0; padding: 1px 0 0 8px; background: none; border: 0; border-radius: 4px; color: var(--faint); font: 13px/1.4 var(--sans); cursor: pointer; appearance: none; -webkit-appearance: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.area:hover { color: var(--text); }
.x { flex: none; width: 40px; height: 40px; margin: -8px -4px 0 0; opacity: 0; background: none; border: 0; color: var(--faint); font-size: 22px; line-height: 1; cursor: pointer; }
li:hover .x, .x:focus-visible { opacity: 1; }
.x:hover { color: var(--red); }
@media (hover: none) { .x { opacity: 1; } }

li.drag { position: relative; z-index: 2; border-radius: 10px; background: var(--panel); box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
li.over-top { box-shadow: 0 -2px 0 var(--accent); }
li.over-bottom { box-shadow: 0 2px 0 var(--accent); }

.empty { text-align: center; color: var(--faint); padding: 48px 0; }
.foot { margin-top: 18px; font-size: 14px; color: var(--faint); display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.foot .sp { flex: 1; }
.foot button { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 12px 0; }

dialog { width: min(440px, calc(100vw - 32px)); background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
dialog::backdrop { background: rgba(0, 0, 0, .4); }
dialog h2 { font: 700 20px var(--title); margin: 0 0 8px; }
dialog p { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
dialog p.sub { margin-top: 16px; }
dialog .st { color: var(--accent); min-height: 1.4em; margin: 8px 0 0; }
dialog .row { display: flex; flex-wrap: wrap; gap: 8px; }
dialog input { flex: 1; min-width: 0; width: 100%; height: 44px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; font: 16px var(--mono); outline: none; margin-bottom: 8px; }
dialog .row input { width: auto; margin: 0; }
dialog input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
dialog button { height: 44px; background: var(--well); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 0 16px; font: 600 14px var(--sans); cursor: pointer; }
dialog button.primary { background: var(--text); color: var(--bg); border: 0; }
dialog button.danger { margin-top: 12px; background: none; color: var(--red); }
dialog button.close { display: block; margin: 16px 0 0 auto; }
dialog select, dialog input[type=date], dialog input[type=number] { height: 44px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; font: 16px var(--sans); margin-bottom: 8px; }
dialog select { width: 100%; }
dialog .row select { flex: 1; width: auto; margin: 0; }
dialog .row input[type=number] { flex: none; width: 80px; margin: 0; }
dialog input[type=date] { margin-top: 12px; }
#whend .row + select, #whend .row + .st { margin-top: 8px; }
#whend .danger { margin: 8px 0 0; }
#whend .close { margin: 8px 0 0 auto; }
#whend .row:last-child { justify-content: space-between; align-items: center; }
#whend[data-never] #rn, #whend[data-never] #rmode, #whend[data-never] #rhelp { display: none; }
#whend[data-never] #runit { flex: 1; }

@media (min-width: 900px) { h1 { font-size: 32px; } }

/* upcoming: rows are future-dated but grouped by day, so keep them at full strength */
#list.up li.future { opacity: 1; }
/* notes and checklist */
.note { margin: 2px 0 0; color: var(--muted); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.ci { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 14px; color: var(--muted); }
li .ci input[type=checkbox] { margin: 0; width: 16px; height: 16px; }
.ci.done span { text-decoration: line-through; color: var(--faint); }
#whend { max-height: 90dvh; overflow-y: auto; }
#whend textarea, #whend #wcadd, #whend .ci input[type=text] { width: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font: 15px var(--sans); -webkit-user-select: text; user-select: text; }
#whend textarea { resize: vertical; margin-bottom: 8px; }
#whend .ci { margin-top: 6px; }
#whend .ci input[type=text] { flex: 1; min-width: 0; width: auto; }
#whend #wcadd { margin: 6px 0 12px; }
.cx { background: none; border: 0; color: var(--faint); font-size: 18px; cursor: pointer; }
.cx:hover { color: var(--red); }
label.ev { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
dialog input[type=time], #wtime { margin-top: 12px; }
#wtclear { margin-top: 12px; background: none; border: 0; color: var(--faint); font-size: 18px; cursor: pointer; }

/* details sheet */
#whend[open] { display: block; }
#whend h2 { margin-bottom: 12px; }
#whend p.sub { margin: 18px 0 8px; font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
#whend input[type=checkbox] { appearance: none; flex: none; width: 18px; height: 18px; min-width: 18px; margin: 0; padding: 0; border: 1.5px solid var(--border-strong); border-radius: 5px; background: var(--bg); cursor: pointer; display: grid; place-items: center; }
#whend input[type=checkbox]:checked { background: var(--green); border-color: var(--green); }
#whend input[type=checkbox]:checked::after { content: ""; width: 12px; height: 12px; background: var(--bg); -webkit-mask: var(--tick) center / contain no-repeat; mask: var(--tick) center / contain no-repeat; }
#whend input[type=checkbox]:disabled { opacity: .4; cursor: default; }
#whend .ci { gap: 10px; }
#whend .ci input[type=text] { height: 36px; }
#whend #wcadd { height: 36px; margin: 6px 0 0; border-style: dashed; }
#whend .row.quick { flex-wrap: nowrap; }
#whend .row.quick button { flex: 1; padding: 0 4px; height: 38px; font-size: 13px; white-space: nowrap; }
#whend .row.when { margin-top: 8px; flex-wrap: nowrap; align-items: center; }
#whend .row.when input { flex: 1; margin: 0; }
#whend #wtclear { margin: 0; flex: none; width: 36px; padding: 0; }
#whend label.ev { margin-top: 12px; font-size: 14px; color: var(--muted); cursor: pointer; }
#whend .row select, #whend .row input[type=number] { margin: 0; }
#whend .row + select { margin-top: 8px; }
#whend .row.foot2 { margin-top: 20px; justify-content: space-between; align-items: center; flex-wrap: nowrap; }
#whend .foot2 button { margin: 0; }
.note a { color: var(--accent); text-underline-offset: 2px; }
li .area + .area { margin-top: 0; }
/* Today's evening block: its own section, set apart from the day's tasks */
li.sec[data-ev] { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 0 10px; color: var(--text); font: 700 16px var(--title); letter-spacing: 0; text-transform: none; }
li.sec[data-ev] svg, #whend .quick svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#whend .quick button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 52px; font-weight: 500; }
#whend .row.quick button[aria-pressed=true] { background: var(--bg); border-color: var(--border-strong); font-weight: 650; box-shadow: inset 0 0 0 1px var(--border-strong); }
#whend .row.quick button[aria-pressed=true] svg { stroke: var(--text); }
li.sec.head .hc { padding: 6px 1px; color: var(--faint); font-size: 14px; width: 18px; } /* chevron sits in the checkbox column, the name in the title column */
#list li { transition: transform .15s ease; }
#list li.drag { transition: none; }

/* sheet spacing */
#whend #wtitle { height: 48px; margin: 0 0 4px; font: 600 17px var(--sans); }
#whend .row input, #whend .row select, #whend #wtclear { margin: 0; }
#whend { width: min(480px, calc(100vw - 32px)); }
#whend .row.quick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
#whend .row.quick button { height: 62px; padding: 0 2px; gap: 6px; font: 600 12px var(--sans); }
#whend .row.quick svg { width: 20px; height: 20px; }
#whend .row.when { flex-wrap: nowrap; align-items: center; margin-top: 8px; }
#whend .row.when input { flex: 1; min-width: 0; }
#whend #wtclear { flex: none; width: 36px; height: 44px; padding: 0; }
#whend .row + .row { margin-top: 8px; }
#whend .row { padding: 0; }

/* phone: sheet fits the screen, tighter spacing, Cancel/Done stay pinned at the bottom */
@media (max-width: 600px) {
  #whend { max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 14px 16px 0; overscroll-behavior: contain; }
  #whend h2 { margin-bottom: 8px; }
  #whend #wtitle { height: 44px; }
  #whend p.sub { margin: 12px 0 6px; }
  #whend .row.quick button { height: 52px; gap: 4px; }
  #whend .row input, #whend .row select, #whend select, #whend #wlist, #whend #wtclear { height: 40px; }
  #whend textarea { min-height: 0; height: 60px; }
  #whend .row.foot2 { position: sticky; bottom: 0; margin: 8px -16px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--border); }
}

/* ask: our own confirm and prompt */
#ask { width: min(380px, calc(100vw - 32px)); }
#ask p { overflow-wrap: anywhere; }
#ask input { margin: 0 0 4px; font: 16px var(--sans); }
#ask .row { justify-content: flex-end; margin-top: 16px; }
#ask[data-danger] .primary { background: var(--red); color: #fff; }
#askf { display: block; }
#askf button { padding: 0 16px; font: 600 14px var(--sans); }
#ask .primary { background: var(--text); color: var(--bg); }
#tabs .nav.drag { background: var(--panel); box-shadow: 0 4px 14px rgba(0, 0, 0, .18); cursor: grabbing; }
#tabs [data-lid] { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
li .tc { display: block; background: none; border: 0; padding: 4px 0 2px; color: var(--muted); font: 600 12px var(--sans); cursor: pointer; font-variant-numeric: tabular-nums; }
.when svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* completing a task: tick, strike, fade out, close up */
li.completing input[type=checkbox]:checked { animation: pop .3s ease-out; }
li.completing input[type=checkbox]:checked::after { animation: tick .25s ease-out; }
li.completing .t { text-decoration: line-through; color: var(--faint); transition: color .3s; }
li.completing.leaving { max-height: 0 !important; opacity: 0; transform: translateX(12px); padding-top: 0; padding-bottom: 0; overflow: hidden; transition: max-height .32s ease, opacity .25s ease, transform .32s ease, padding .32s ease; }
@keyframes pop { 0% { transform: scale(.8); } 55% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes tick { from { transform: scale(0) rotate(-25deg); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { li.completing * { animation: none !important; } }
li.sec.sub { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
li.sec.sub.drag, li.sec.head.drag { cursor: grabbing; background: var(--panel); box-shadow: 0 4px 14px rgba(0, 0, 0, .18); border-radius: 10px; }

/* sidebar: projects (subareas) under their area */
.nav .car { flex: none; display: grid; place-items: center; width: 28px; height: 28px; margin: 0 -6px 0 0; border-radius: 6px; color: var(--muted); font: 600 22px/1 var(--sans); transition: transform .15s; }
.nav .car.open { transform: rotate(90deg); }
.nav .car:hover { background: var(--border); color: var(--text); }
.nav.subnav { min-height: 34px; padding-left: 38px; font-size: 14px; font-weight: 450; color: var(--muted); }
#tabs .ngrp.drag { background: var(--panel); border-radius: 8px; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); cursor: grabbing; }

/* one icon style: 24px grid, 2px round stroke, the same as the sidebar and the When icons */
:root { --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.500' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.500l4.500 4.500L19 7.500'/%3E%3C/svg%3E"); }
button svg { pointer-events: none; }
.x svg, .cx svg, .hx svg, .hc svg, .tc svg, .upg svg, .car svg, #wtclear svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hc svg, .tc svg, .upg svg, .car svg { transition: transform .15s; }
.hc.open svg, .tc.open svg, .upg.open svg, .car.open svg { transform: rotate(90deg); }
.nav .car.open { transform: none; }
.tc, .upg { display: inline-flex; align-items: center; gap: 2px; }
.tc svg { width: 14px; height: 14px; margin-left: -3px; }
.x svg { width: 18px; height: 18px; }
.hx svg { width: 16px; height: 16px; }
#wtclear { display: grid; place-items: center; }

/* bigger touch targets: the hit area grows, the look stays */
li input[type=checkbox], #whend input[type=checkbox], .hc, .tc, .car, .cal { position: relative; }
li input[type=checkbox]::before, #whend input[type=checkbox]::before { content: ""; position: absolute; inset: -10px; }
li .ci input[type=checkbox]::before { inset: -4px; }
.hc::before, .car::before, .tc::before, .cal::before { content: ""; position: absolute; inset: -8px -6px; }

#toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); padding: 8px 8px 8px 16px; background: var(--text); color: var(--bg); border-radius: 12px; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
#toast[hidden] { display: none; }
#toast button { min-height: 36px; padding: 0 12px; background: none; border: 0; border-radius: 8px; color: var(--accent-on, var(--bg)); font: 700 14px var(--sans); text-decoration: underline; cursor: pointer; }

/* phone width: a long date chip wraps beside the text instead of squeezing it to a sliver; the date and time fields fit */
@media (max-width: 480px) {
  li > .when { flex: 0 1 auto; max-width: 34%; min-height: 0; padding: 3px 6px; white-space: normal; text-align: right; line-height: 1.25; }
  #whend .row.when { gap: 6px; }
  #whend .row.when input { padding: 0 8px; font: 16px var(--sans); }
}

/* a project's or heading's own Upcoming row */
li.sec.ups { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding: 12px 0 6px; border-top: 1px solid var(--border); }
li.sec.ups > svg { flex: none; width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Board: one card per area, side by side; the page scrolls sideways, each card scrolls on its own */
body.board main { max-width: none; }
body.board #f, body.board .hint { display: none; }
#list.board { display: flex; align-items: flex-start; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 2px 16px; margin: 0 -2px; }
#list.board .col { flex: 0 0 300px; max-width: 85vw; scroll-snap-align: start; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 12px 8px; max-height: calc(100dvh - 140px); overflow-y: auto; }
#list.board .colh { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 2px 4px 8px; font: 600 15px var(--title); color: var(--text); cursor: pointer; }
#list.board .cadd { width: 100%; height: 40px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; font: 16px var(--sans); outline: none; margin-bottom: 6px; }
#list.board .cadd::placeholder { color: var(--faint); }
#list.board .cadd:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#list.board .subh { background: none; border: 0; padding: 0; font: 600 12px var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); cursor: pointer; }
#list.board li.sec { padding: 12px 4px 4px; }
#list.board li { flex-wrap: wrap; gap: 8px; }
#list.board li .body { flex: 1 1 130px; }
#list.board li > .when { max-width: none; margin-left: 66px; flex: 0 0 auto; order: 5; }
#list.board li.sec { flex-wrap: nowrap; }

/* Board polish: softer cards, rows on the card colour, thin rounded scrollbars */
#list.board { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; gap: 16px; padding-bottom: 20px; }
#list.board::-webkit-scrollbar, #list.board .col::-webkit-scrollbar { height: 8px; width: 8px; }
#list.board::-webkit-scrollbar-thumb, #list.board .col::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
#list.board::-webkit-scrollbar-track, #list.board .col::-webkit-scrollbar-track { background: transparent; }
#list.board .col { border-radius: 18px; padding: 14px 8px 10px 14px; box-shadow: 0 1px 2px rgba(43,41,37,.06); scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; scrollbar-gutter: stable; }
#list.board .cadd { background: var(--well); border-color: transparent; border-radius: 12px; }
#list.board .cadd:focus { background: var(--bg); border-color: var(--accent); }
#list.board li { background: transparent; border-radius: 10px; border-bottom-color: var(--border); }
#list.board li:first-child { border-top: 0; }
#list.board li.sec { padding: 14px 4px 2px; display: flex; align-items: center; gap: 2px; }
#list.board li.sec .upg { font: 600 12px var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
#list.board li.sec .hc { flex: none; }
#list.board li { border-radius: 0; }
#list.board li.sec { border: 0; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand img { border-radius: 6px; }
#vt { min-width: 0; margin-right: auto; display: flex; align-items: center; gap: 8px; }
#vt svg { width: 26px; height: 26px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn[hidden] { display: none; }

/* Ctrl+K bar */
#kbar { margin: 12vh auto 0; width: min(520px, calc(100vw - 32px)); padding: 8px; box-shadow: 0 12px 40px rgba(0, 0, 0, .3); }
#kbar input { height: 48px; font: 16px var(--sans); }
#kl { list-style: none; margin: 8px 0 0; padding: 0; max-height: min(52vh, 360px); overflow-y: auto; }
#kl li { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border: 0; box-shadow: none; background: none; border-radius: 10px; cursor: pointer; font-size: 15px; }
#kl li.on { background: var(--well); }
#kl li svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#kl li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#kl li em { font-style: normal; font-size: 12px; color: var(--faint); }
#kl li.none { color: var(--muted); cursor: default; }

@media (max-width: 767px) { /* five header buttons: keep the title on one line */
  .head { gap: 6px; }
  .head .iconbtn { width: 36px; height: 36px; }
  #vt { font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* a long title ends in … instead of running under the buttons */
  #vt svg { width: 27px; height: 27px; }
}

/* "#" area picker under the new-task box */
#f { position: relative; }
.hl { position: fixed; z-index: 50; list-style: none; margin: 0; padding: 4px; max-height: 240px; overflow-y: auto; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.hl li { padding: 10px 12px; border: 0; border-radius: 8px; cursor: pointer; font-size: 15px; background: none; }
.hl li.on { background: var(--well); }
#pk, .pkc { margin: 0 0 8px; height: 28px; padding: 0 10px; border: 0; border-radius: 999px; font: 600 13px var(--sans); cursor: pointer; }
.pkc { margin: 0 0 6px; }
/* sheet selects and the Area box: our own chevron, inset from the edge, in place of the cramped native one */
dialog select, #wlist { appearance: none; -webkit-appearance: none; padding-right: 36px; background-repeat: no-repeat; background-position: right 14px center; background-size: 14px; --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2357534b' stroke-width='2.500' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-image: var(--chev); }
:root[data-theme="dark"] dialog select, :root[data-theme="dark"] #wlist { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b7b5a9' stroke-width='2.500' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
#wlist { font: 16px var(--sans); }
#whend .foot2 button:not(.primary) { background: none; }
li.hit { animation: hit 1.6s ease-out; }
@keyframes hit { 0%, 40% { background: var(--accent-soft); } 100% { background: none; } }
@media (prefers-reduced-motion: reduce) { li.hit { animation: none; } }

/* view icons: filled in their own color, in the sidebar and the title; .cut parts are cut out in the surface color */
.nav svg[data-k], #vt svg[data-k] { --cut: var(--panel); }
#vt svg[data-k] { --cut: var(--bg); }
:is(.nav, #vt) svg:is([data-k=inbox], [data-k=today], [data-k=upcoming], [data-k=week], [data-k=all], [data-k=board]) { fill: var(--ic); stroke: var(--ic); }
:is(.nav, #vt) svg[data-k=week] { --ic: var(--c-week); }
:is(.nav, #vt) svg[data-k=done] { stroke: var(--ic); stroke-width: 2.5; }
:is(.nav, #vt) svg[data-k=board] { stroke-width: 1; }
:is(.nav, #vt) svg[data-k=inbox] { --ic: var(--c-inbox); }
:is(.nav, #vt) svg[data-k=today] { --ic: var(--c-today); }
:is(.nav, #vt) svg[data-k=upcoming] { --ic: var(--c-upcoming); }
:is(.nav, #vt) svg[data-k=all] { --ic: var(--c-all); }
:is(.nav, #vt) svg[data-k=board] { --ic: var(--c-board); }
:is(.nav, #vt) svg[data-k=done] { --ic: var(--c-done); }
:is(.nav, #vt) svg .cut { fill: none; stroke: var(--cut); }

#fab { display: none; position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 6; width: 56px; height: 56px; place-items: center; border: 0; border-radius: 50%; background: var(--accent); color: var(--bg); box-shadow: 0 6px 18px rgba(0, 0, 0, .3); cursor: pointer; }
#fab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
@media (max-width: 767px) { #fab { display: grid; } }
body.board #fab, body.menu #fab { display: none; }

/* the area follows the title text, small and muted */
li .body > .area { display: inline; max-width: none; padding: 0; font-size: 13px; line-height: inherit; white-space: normal; overflow: visible; text-align: left; }

.when.dl.over { color: var(--red); }
#wdlclear { display: grid; place-items: center; flex: none; width: 36px; height: 44px; margin: 0; padding: 0; background: none; border: 0; color: var(--faint); font-size: 18px; cursor: pointer; }
#wdlclear svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 600px) { #whend #wdlclear { height: 40px; } }

.when.dl { border: 1px solid var(--border-strong); border-radius: 999px; }

/* Right-click menu on a task: the sheet's quick date buttons and date/time fields, at the pointer. */
#qm { position: fixed; z-index: 40; width: 232px; padding: 8px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, .22); }
#qm[hidden] { display: none; }
#qm .quick { display: grid; gap: 2px; }
#qm button { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; background: none; color: var(--text); border: 0; border-radius: 8px; font: 600 14px var(--sans); text-align: left; cursor: pointer; }
#qm button:hover { background: var(--well); }
#qm button[aria-pressed="true"] { color: var(--accent); }
#qm button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#qm .when { display: flex; gap: 6px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
#qm input { min-width: 0; height: 36px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; font: 14px var(--sans); }
#qm input[type=date] { flex: 1; }
#qm .qarea { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
#qm .qarea[hidden] { display: none; }
#qm #qlist { width: 100%; }
#qm input[type=text] { width: 64px; }
#qm input:focus { border-color: var(--accent); outline: none; }

/* ---- Week: Mon-Fri columns, Sat and Sun stacked; events, a line, then tasks on ruled lines ---- */
body.week main { max-width: none; }
#list.week { --wline: 40px; }
#list.week > li { display: block; min-height: 0; padding: 0; background: none; border: 0; cursor: default; }
#list.week li.future { opacity: 1; }
#list.week > li.wbar { display: flex; align-items: center; gap: 8px; margin: 2px 0 18px; } /* clear of the sticky header above */
.wbar .wkn { margin-right: auto; padding: 4px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--border); color: var(--muted); font: 600 13px var(--sans); }
.wbar .wnav { height: 36px; min-width: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--border); background: none; color: var(--text); font: 600 15px var(--sans); cursor: pointer; }
.wbar .wnav:hover { background: var(--panel); }
.wbar .wtoday:disabled { opacity: .45; cursor: default; background: none; }
#list.week > li.wgrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px; align-items: start; }
.wkend { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.wday { min-width: 0; display: flex; flex-direction: column; }
.wdh { display: flex; align-items: baseline; gap: 8px; padding: 0 4px 10px; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
.wdh .n { font: 700 24px var(--title); letter-spacing: -.02em; color: var(--text); }
.wdh .w { color: var(--faint); font: 600 13px var(--sans); text-transform: uppercase; letter-spacing: .06em; }
.wday.we .wdh .n, .wday.we .wdh .w { color: var(--red); }
.wday.today .wdh { border-bottom: 2px solid var(--accent); }
.wday.today .wdh .n, .wday.today .wdh .w { color: var(--accent); }
.wdh .tag { align-self: center; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: 700 11px var(--sans); text-transform: uppercase; letter-spacing: .06em; }
.wday.past .wdh, .wday.past .wevs { opacity: .6; }
.wevs { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.wad { padding: 5px 8px; margin-bottom: 2px; border-radius: 7px; background: color-mix(in srgb, var(--c) 20%, transparent); color: color-mix(in srgb, var(--c) 65%, var(--text)); font: 600 13px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wev { display: grid; grid-template-columns: 6px 40px minmax(0, 1fr); align-items: center; gap: 8px; padding: 4px 6px; border-radius: 7px; font-size: 14px; }
.wev i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.wev .tm { color: var(--faint); font: 500 12.5px var(--sans); font-variant-numeric: tabular-nums; }
.wev .tt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wev.gone { opacity: .45; }
.wev.now { background: var(--accent-soft); } .wev.now .tm { color: var(--accent); font-weight: 700; }
.wsep { margin: 8px 0 0; border-top: 1px solid var(--border-strong); }
ul.wtasks { list-style: none; margin: 0; padding: 0; }
ul.wtasks > li { position: relative; flex-wrap: wrap; row-gap: 4px; min-height: var(--wline); padding: 9px 22px 8px 2px; border-bottom: 1px solid var(--border); background: none; font-size: 14.5px; gap: 8px; }
ul.wtasks > li[data-id] { cursor: grab; }
ul.wtasks > li .body { flex: 1 1 calc(100% - 26px); min-width: 0; } /* the title gets the row; chips go under it */
ul.wtasks > li .when.chip, ul.wtasks > li .dl { order: 5; flex: none; margin: 0 0 0 26px; padding: 1px 6px; min-height: 0; font-size: 12px; }
ul.wtasks > li .dl + .when.chip, ul.wtasks > li .when.chip + .dl { margin-left: 0; }
ul.wtasks > li .body > .area { display: block; max-width: 100%; padding: 2px 0 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* its own line, one line long */
ul.wtasks > li .t { overflow-wrap: break-word; font-size: 14px; } /* break between words; only a word too long for the column breaks inside */
ul.wtasks > li .note { display: none; } /* notes stay in the task sheet: columns are narrow */
ul.wtasks > li .x { position: absolute; top: 6px; right: -4px; display: grid; visibility: hidden; } /* floats over the row: nothing shifts on hover */
ul.wtasks > li:hover .x, ul.wtasks > li:focus-within .x { visibility: visible; }
ul.wtasks:empty { min-height: 36px; } /* an empty day still takes a drop */
.weve { display: flex; align-items: center; gap: 6px; margin: 16px 0 0; padding: 0 2px 8px; border-bottom: 1px solid var(--border-strong); color: var(--muted); font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .06em; }
.weve svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
ul.wtasks-ev:empty { min-height: 32px; }
ul.wtasks > li.wghost { opacity: .3; }
ul.wtasks > li.wover { box-shadow: inset 0 2px 0 var(--accent); }
ul.wtasks.wover-end { box-shadow: inset 0 -2px 0 var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 6px 6px 0 0; }
li.wlift { position: fixed; z-index: 60; pointer-events: none; display: flex; gap: 8px; padding: 9px 10px; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .4); transform: rotate(-1.5deg); font-size: 14.5px; list-style: none; }
li.wlift .x, li.wlift .when { display: none; }
#list.week > li.wbelow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 34px; }
.wsect h3 { margin: 0; padding: 0 4px 10px; border-bottom: 1px solid var(--border); font: 600 13px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
@media (max-width: 1100px) { #list.week > li.wgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .wkend { flex-direction: row; grid-column: span 2; } .wkend > .wday { flex: 1; } }
@media (max-width: 767px) {
  #list.week > li.wgrid, #list.week > li.wbelow { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .wkend { flex-direction: column; grid-column: auto; gap: 26px; }
  body.week #vt svg { display: none; } /* room for the month on a phone */
  ul.wtasks > li .x { visibility: visible; }
}

/* Recently deleted, in Settings */
#binv { display: grid; }
.binr { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.bint { flex: 1; min-width: 0; } .bint span { display: block; font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bint small { display: block; font-size: 12px; color: var(--faint); margin-top: 1px; }
.binb { flex: none; }
/* three choices (e.g. a repeating task's delete): one per line, the main one first */
#ask:has(#aska:not([hidden])) .row { flex-direction: column; align-items: stretch; gap: 8px; }
#ask:has(#aska:not([hidden])) .row button { width: 100%; margin: 0; }
#ask:has(#aska:not([hidden])) #asko { order: 1; } #ask:has(#aska:not([hidden])) #aska { order: 2; } #ask:has(#aska:not([hidden])) #askx { order: 3; }
