/* מצרכים — quiet, list-first. One blue accent, plain rows, floating entry, bottom tabs. */
:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --accent: #1a73e8;
  --accent-soft: #e3edfc;
  --accent-ink: #ffffff;
  --ink: #17211b;
  --muted: #6c7a70;
  --faint: #8a948d;
  --ring: #c3c9c4;
  --hairline: #e7eae4;
  --field: #eff2ec;
  --danger: #c62828;
  --danger-soft: #fbeceb;
  --danger-button: #e0564f;
  --shadow: 0 1px 2px rgba(23, 33, 27, .06), 0 4px 12px rgba(23, 33, 27, .04);
  --float: 0 6px 22px rgba(23, 33, 27, .09);
  --tabbar: calc(3.5rem + env(safe-area-inset-bottom));
  --keyboard: 0px;
  --sidebar: #eef0eb;
  --hover: #eceee9;
}

* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { font-size: 17px; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Noto Sans Hebrew", Arial, sans-serif;
  background: var(--bg); color: var(--ink); min-height: 100dvh;
}
button { font: inherit; color: inherit; cursor: pointer; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

main {
  padding: calc(1.1rem + env(safe-area-inset-top)) 1.25rem calc(var(--tabbar) + 6rem);
  max-width: 680px; margin: 0 auto;
}
.empty { color: var(--muted); text-align: center; padding: 3rem 1rem; line-height: 1.6; }
.page-head { margin: .3rem 0 .4rem; }
.page-title { font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.page-sub { font-size: .85rem; color: var(--faint); margin-top: .1rem; }
.page-sub:empty { display: none; }
.page-head + .category h2, .page-head + div > .category:first-child h2 { margin-top: .9rem; }
.mini-head {
  position: fixed; z-index: 5; inset: 0 0 auto; text-align: center; font-size: .95rem; font-weight: 600;
  padding: calc(env(safe-area-inset-top) + .6rem) 1rem .6rem;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--hairline); opacity: 0; pointer-events: none; transition: opacity .15s;
}
.mini-head.show { opacity: 1; }

/* section labels */
.category h2, .completed summary {
  display: flex; align-items: center; justify-content: space-between; gap: .4rem;
  font-size: .78rem; font-weight: 600; color: var(--faint);
  margin: 1.4rem 0 .25rem;
}
.category:first-child h2 { margin-top: .2rem; }

/* rows */
.row {
  display: flex; align-items: center; gap: .8rem;
  min-height: 2.75rem; padding: .35rem 0;
  background: var(--bg);
  touch-action: pan-y;
}
.row input[type=checkbox] {
  appearance: none; -webkit-appearance: none;
  width: 1.2rem; height: 1.2rem; flex: none;
  border: 1.5px solid var(--ring); border-radius: 50%;
  background: transparent; display: grid; place-content: center;
}
.row input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
.row input[type=checkbox]:checked::before {
  content: ""; width: .32rem; height: .6rem;
  border: solid var(--accent-ink); border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-10%);
}
.row .name {
  flex: 1; min-width: 0; border: 0; background: transparent; padding: .3rem 0;
  text-align: start; font-size: 1rem; overflow-wrap: anywhere;
}
.row.done .name { color: var(--faint); text-decoration: line-through; }
.row .meta {
  flex: none; display: inline-flex; align-items: center; gap: .2rem;
  font-size: .72rem; color: var(--faint); font-variant-numeric: tabular-nums;
}
.row .meta svg { width: .75rem; height: .75rem; }
.row .qty-label { flex: none; font-size: .85rem; color: var(--faint); font-variant-numeric: tabular-nums; min-width: 1.2rem; text-align: end; }

/* swipe to delete: the row becomes a rounded card over a soft red strip */
.swipe { position: relative; border-radius: 14px; }
.swipe .under {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: flex-end;
  padding-inline: .45rem; background: var(--danger-soft); border-radius: 14px;
}
.swipe .delete-button {
  display: inline-flex; align-items: center; gap: .3rem; border: 0;
  background: var(--danger-button); color: #fff; border-radius: 10px;
  padding: .45rem .75rem; font-size: .78rem; font-weight: 600;
}
.swipe .delete-button svg { width: .8rem; height: .8rem; }
.swipe.moving .under, .swipe.open .under { display: flex; }
.swipe.moving > .row, .swipe.open > .row {
  position: relative; border-radius: 14px; background: var(--surface);
  padding-inline: .75rem; margin-inline: -.75rem; box-shadow: 0 2px 10px rgba(23, 33, 27, .07);
}
.swipe.open > .row { margin-left: 5.3rem; }
.swipe.settling > .row { transition: transform .18s ease-out, margin .18s ease-out; }
@media (prefers-reduced-motion: reduce) { .swipe.settling > .row { transition: none; } }

/* floating entry above the tab bar */
.pill {
  position: fixed; z-index: 5;
  inset-inline: max(.75rem, env(safe-area-inset-left));
  bottom: calc(var(--tabbar) + .6rem + var(--keyboard));
  max-width: 640px; margin: 0 auto;
  display: flex; align-items: center; gap: .55rem;
  border: 0; border-radius: 18px; background: var(--surface); box-shadow: var(--float);
  padding: .85rem 1.1rem; color: var(--faint); font-size: 1rem; text-align: start;
}
.pill svg { width: 1rem; height: 1rem; }
.pill-form input {
  flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--ink); padding: 0;
}
.pill-form input::placeholder { color: var(--faint); }
.pill-form input:focus { outline: none; }
body.keyboard .tabbar { visibility: hidden; }

/* task composer: rises above the keyboard */
.composer-layer { position: fixed; inset: 0; z-index: 15; }
.composer-dim { position: absolute; inset: 0; background: rgba(23, 33, 27, .28); }
.composer {
  position: absolute; inset-inline: max(.6rem, env(safe-area-inset-left));
  bottom: calc(.6rem + max(var(--keyboard), env(safe-area-inset-bottom)));
  max-width: 640px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; background: var(--surface); border-radius: 18px;
  padding: 1rem 1rem .8rem; box-shadow: 0 8px 28px rgba(23, 33, 27, .14);
}
#todo-title { border: 0; background: transparent; font: inherit; font-size: 1.05rem; color: var(--ink); padding: 0; }
#todo-title:focus { outline: none; }
#todo-title::placeholder { color: var(--faint); }
.parsed-chip {
  justify-self: start; display: inline-flex; align-items: center; gap: .35rem; margin-top: -.4rem;
  background: var(--accent-soft); color: var(--accent); font-size: .8rem; font-weight: 600;
  border-radius: 999px; padding: .2rem .25rem .2rem .65rem;
}
.parsed-chip[hidden] { display: none; }
.parsed-chip svg { width: .8rem; height: .8rem; }
.parsed-chip button {
  border: 0; background: transparent; color: inherit; font: inherit; line-height: 1;
  width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center;
}
.composer .chips { gap: .35rem; flex-wrap: nowrap; }
.composer .chip { padding: .36rem .55rem; font-size: .8rem; white-space: nowrap; flex: none; gap: .25rem; }
.composer #composer-extra { flex: 1 1 auto; min-width: 0; gap: .3rem; overflow-x: auto; scrollbar-width: none; }
.composer #composer-extra::-webkit-scrollbar { display: none; }
/* A filled date or time reads on its own; dropping the icon keeps all four chips in view. */
#composer-date.soft-on svg, #composer-time.soft-on svg { display: none; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 2.2rem; }
.addbtn {
  flex: none; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center;
}
.addbtn svg { width: 1.05rem; height: 1.05rem; }
.date-chip { position: relative; overflow: hidden; }
.date-chip input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; border: 0; padding: 0; }

/* tasks: meta and collapsible sections */
.row .meta.late { color: var(--muted); }
details.category > summary { list-style: none; cursor: pointer; }
details.category > summary::-webkit-details-marker { display: none; }
details.category > summary h2 { margin: 1.4rem 0 .25rem; }

/* projects */
.row .proj { flex: none; max-width: 40%; font-size: .72rem; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pie {
  flex: none; width: 1.15rem; height: 1.15rem; border-radius: 50%; padding: 2px;
  border: 1.5px solid var(--accent); background: conic-gradient(var(--accent) calc(var(--p) * 1%), transparent 0) content-box;
}
.project-row .count { flex: none; font-size: .8rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.back-button { border: 0; background: transparent; color: var(--accent); font-size: .95rem; padding: .2rem 0; }
.project-title { display: block; border: 0; background: transparent; text-align: start; padding: 0; margin-top: .6rem; font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.project-sub { font-size: .8rem; color: var(--faint); margin: .15rem 0 .6rem; }

/* reminders */
.time-input { border: 0; background: transparent; font: inherit; color: var(--faint); text-align: end; padding: 0; }
.setting .value.on { color: #2e7d32; }
.presets { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.preset {
  display: grid; gap: .1rem; justify-items: start; border: 0; text-align: start;
  background: var(--field); border-radius: 14px; padding: .7rem .8rem;
}
.preset svg { width: 1.1rem; height: 1.1rem; color: var(--accent); margin-bottom: .2rem; }
.preset b { font-size: .9rem; font-weight: 600; }
.preset span { font-size: .75rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.preset.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.wheel { position: relative; display: flex; justify-content: center; gap: 1.6rem; direction: ltr; height: 9rem; }
.wheel::before {
  content: ""; position: absolute; inset-inline: 0; top: 3.4rem; height: 2.2rem;
  background: var(--field); border-radius: 10px; pointer-events: none;
}
.wheel-col {
  position: relative; width: 3.2rem; overflow-y: auto; scroll-snap-type: y mandatory;
  padding-block: 3.4rem; scroll-padding-block: 3.4rem; scrollbar-width: none; text-align: center;
}
.wheel-col::-webkit-scrollbar { display: none; }
.wheel-col div { height: 2.2rem; line-height: 2.2rem; scroll-snap-align: start; font-size: 1.15rem; color: var(--ring); font-variant-numeric: tabular-nums; }
.wheel-col div.c { color: var(--ink); font-weight: 600; }
.wheel-colon { position: relative; align-self: center; font-weight: 600; font-size: 1.15rem; margin-inline: -1rem; }
.perm { display: grid; justify-items: center; text-align: center; gap: .8rem; }
.perm .bigbell { width: 3.4rem; height: 3.4rem; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.perm .bigbell svg { width: 1.8rem; height: 1.8rem; }
.perm h3 { font-size: 1.1rem; }
.perm p { font-size: .9rem; color: var(--muted); line-height: 1.55; }
.perm .btn-primary { width: 100%; }

/* settings-style rows inside sheets */
.rows { background: var(--field); border-radius: 12px; overflow: hidden; }
.rows .setting { font-size: .92rem; padding: .75rem .85rem; }
.rows .setting .value.accent { color: var(--accent); font-weight: 600; }
.when-chips { display: flex; flex-wrap: wrap; gap: .4rem; }

/* bottom tabs */
.tabbar {
  position: fixed; z-index: 4; inset-inline: 0; bottom: 0;
  display: flex; justify-content: space-around;
  padding: .4rem max(.5rem, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(.5rem, env(safe-area-inset-left));
  background: var(--bg); border-top: 1px solid var(--hairline);
}
.tab {
  flex: 1; max-width: 7rem; display: grid; justify-items: center; gap: .1rem;
  border: 0; background: transparent; color: var(--faint);
  font-size: .62rem; font-weight: 500; padding: .2rem 0 .35rem;
}
.tab svg { width: 1.45rem; height: 1.45rem; }
.tab.active { color: var(--accent); }

/* catalog: the add/search screen of the shopping list */
.overlay {
  position: fixed; inset: 0; z-index: 10; overflow-y: auto; background: var(--bg);
  padding: calc(.75rem + env(safe-area-inset-top)) 1rem calc(2rem + env(safe-area-inset-bottom));
}
.catalog-bar {
  position: sticky; top: calc(-.75rem - env(safe-area-inset-top)); z-index: 1;
  display: flex; align-items: center; gap: .75rem;
  margin: calc(-.75rem - env(safe-area-inset-top)) -1rem .5rem;
  padding: calc(.75rem + env(safe-area-inset-top)) 1rem .5rem; background: var(--bg);
}
.search-field {
  flex: 1; display: flex; align-items: center; gap: .45rem;
  background: var(--field); border-radius: 12px; padding: .55rem .75rem;
}
.search-field svg { width: 1rem; height: 1rem; color: var(--faint); }
#search { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--ink); }
#search:focus { outline: none; }
#search::placeholder { color: var(--faint); }
.link-button { border: 0; background: transparent; color: var(--accent); font-weight: 600; padding: .4rem 0; }
.catalog-title { font-size: 1.2rem; font-weight: 700; margin: .4rem 0 .2rem; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  border: 0; background: var(--field); color: var(--ink);
  border-radius: 999px; padding: .42rem .85rem; font-size: .92rem;
  display: inline-flex; align-items: center; gap: .3rem;
}
.chip svg { width: .85rem; height: .85rem; }
.chip.on-list, .chip.on { background: var(--accent); color: var(--accent-ink); }
.chip.soft-on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.add-new { background: transparent; border: 1.5px dashed var(--ring); color: var(--muted); }

.results { display: grid; }
.result {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  border: 0; border-bottom: 1px solid var(--hairline); background: transparent;
  padding: .7rem 0; text-align: start; font-size: 1rem;
}
.result .tag { font-size: .75rem; color: var(--faint); }
.result .act {
  margin-inline-start: auto; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--field); color: var(--accent);
}
.result .act svg { width: .9rem; height: .9rem; }
.result.in .act { background: var(--accent); color: #fff; }
.result.create { color: var(--accent); border-bottom: 0; gap: .4rem; }
.result.create svg { width: .95rem; height: .95rem; }

.cat-ctl {
  border: 1px solid var(--hairline); background: var(--surface);
  border-radius: 8px; font-size: .75rem; padding: .15rem .45rem; color: var(--muted);
}

/* settings */
.group-label { font-size: .75rem; font-weight: 600; color: var(--faint); margin: 1.3rem .25rem .45rem; }
.group { background: var(--surface); border-radius: 14px; overflow: hidden; }
.setting {
  width: 100%; display: flex; align-items: center; gap: .7rem;
  border: 0; background: transparent; text-align: start; padding: .8rem .9rem; font-size: .95rem;
}
.setting + .setting { border-top: 1px solid var(--hairline); }
.setting > svg { width: 1.1rem; height: 1.1rem; color: var(--faint); }
.setting > span:not(.chev):not(.avatar):not(.value) { flex: 1; }
.setting .value { margin-inline-start: auto; color: var(--faint); font-size: .9rem; }
.chev { color: var(--ring); }
.avatar {
  flex: none; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700;
}
.account-text { display: grid; gap: .1rem; min-width: 0; }
.account-text b { font-weight: 600; overflow-wrap: anywhere; }
#sync-status { font-size: .75rem; color: var(--faint); overflow-wrap: anywhere; }

/* undo toast */
.toast {
  position: fixed; z-index: 30; inset-inline: .75rem;
  bottom: calc(var(--tabbar) + 4.6rem + var(--keyboard));
  max-width: 640px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--ink); color: #f3f5f3; border-radius: 14px; padding: .75rem 1rem; font-size: .9rem;
}
.toast button { border: 0; background: transparent; color: #8ab4f8; font-weight: 600; padding: 0; }
.toast-texts { display: grid; gap: .1rem; min-width: 0; }
#toast-sub { font-size: .78rem; opacity: .75; }

/* bottom sheet */
#sheet {
  border: 0; padding: 0; margin: 0 auto auto;
  position: fixed; inset-inline: 0; bottom: 0; top: auto;
  width: 100%; max-width: 640px; max-height: 92dvh;
  background: var(--surface); color: var(--ink);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 30px rgba(23, 33, 27, .18);
}
#sheet::backdrop { background: rgba(23, 33, 27, .3); }
.grab { width: 2.3rem; height: .28rem; border-radius: 3px; background: var(--hairline); margin: .55rem auto 0; }
#sheet-body {
  display: grid; gap: .85rem;
  padding: .8rem 1.1rem calc(1.2rem + env(safe-area-inset-bottom));
}
.sheet-title { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 1.05rem; }
.sheet-label { font-size: .78rem; font-weight: 600; color: var(--faint); margin-bottom: -.45rem; }
.sheet-field {
  font: inherit; width: 100%; padding: .65rem .85rem;
  border: 0; border-radius: 12px; background: var(--field); color: var(--ink);
}
.sheet-cats { display: flex; flex-wrap: wrap; gap: .35rem; }
.cat-pick {
  border: 0; background: var(--field);
  border-radius: 999px; padding: .4rem .85rem; font-size: .9rem;
}
.cat-pick.selected { background: var(--accent); color: var(--accent-ink); }
.sheet-actions { display: flex; gap: .5rem; align-items: center; }
.sheet-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .2rem; }
.btn-primary {
  flex: 1; border: 0; background: var(--accent); color: var(--accent-ink);
  border-radius: 12px; padding: .7rem; font-weight: 600;
}
.btn-primary:disabled { opacity: .45; }
.btn-pill { flex: none; border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: .5rem 1.3rem; font-weight: 600; }
.btn-quiet {
  border: 0; background: var(--field);
  border-radius: 12px; padding: .7rem .9rem; color: var(--muted);
}
.btn-text { border: 0; background: transparent; color: var(--muted); padding: .4rem 0; }
.btn-danger-text { border: 0; background: transparent; color: var(--danger); padding: .4rem 0; font-size: .92rem; }
.btn-danger {
  border: 0; background: var(--danger-soft); color: var(--danger);
  border-radius: 12px; padding: .65rem .9rem; font-weight: 600;
}
.btn-danger.arm { background: var(--danger); color: #fff; }

/* quantity stepper (quantity sheet) */
.stepper {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--field); border-radius: 999px; padding: .25rem; align-self: center; justify-self: center;
}
.stepper button {
  width: 2.6rem; height: 2.6rem; border: 0; border-radius: 50%;
  background: var(--surface); color: var(--ink); font-size: 1.3rem; line-height: 1;
}
.stepper .qty { min-width: 2.5rem; text-align: center; font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* account dialog */
#account-panel { margin: auto; width: min(94vw, 440px); max-height: 90dvh; border: 0; border-radius: 20px; color: var(--ink); background: var(--surface); }
#account-panel::backdrop { background: rgba(23, 33, 27, .35); }
.account-content { display: grid; gap: 1rem; padding: 1.25rem; line-height: 1.6; }
.account-content h2 { font-size: 1.15rem; }
.account-content p { font-size: .9rem; overflow-wrap: anywhere; }
.account-form { display: grid; gap: .6rem; margin-top: 1rem; }
.account-form label { font-size: .85rem; }
#account-message:empty { display: none; }

/* date sheet: shortcuts, then a month calendar */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.quick button { border: 0; background: var(--field); border-radius: 12px; padding: .6rem .2rem; display: grid; justify-items: center; gap: .25rem; font: inherit; font-size: .8rem; color: var(--ink); }
.quick svg { width: 1.05rem; height: 1.05rem; color: var(--accent); }
.quick button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal { display: grid; gap: .35rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: .92rem; }
.cal-head button { border: 0; background: transparent; color: var(--accent); font-size: 1.2rem; width: 2rem; height: 2rem; border-radius: 50%; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: .2rem; text-align: center; font-variant-numeric: tabular-nums; }
.cal-grid .dow { font-size: .7rem; color: var(--faint); font-weight: 600; padding-bottom: .15rem; }
.cal-grid button { border: 0; background: transparent; font: inherit; font-size: .88rem; color: var(--ink); width: 2.1rem; height: 2.1rem; border-radius: 50%; justify-self: center; }
.cal-grid button.past { color: var(--ring); }
.cal-grid button.today { color: var(--accent); font-weight: 700; }
.cal-grid button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* repeat sheets */
.opts { background: var(--field); border-radius: 12px; overflow: hidden; }
.opt { display: flex; align-items: center; gap: .5rem; width: 100%; border: 0; background: transparent; font: inherit; font-size: .92rem; color: var(--ink); padding: .7rem .85rem; text-align: start; }
.opt + .opt { border-top: 1px solid var(--hairline); }
.opt .detail { margin-inline-start: auto; color: var(--faint); font-size: .8rem; }
.opt svg { width: .95rem; height: .95rem; color: var(--accent); flex: none; }
.opt.on { color: var(--accent); font-weight: 600; }
.opt .chev { margin-inline-start: auto; color: var(--ring); }
.seg { display: flex; background: var(--field); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; font: inherit; font-size: .82rem; padding: .45rem 0; border-radius: 8px; color: var(--faint); }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(23, 33, 27, .1); }
.repeat-step { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: .92rem; }
.repeat-step .b { width: 2rem; height: 2rem; border: 0; border-radius: 9px; background: var(--field); color: var(--accent); font-size: 1.1rem; font-weight: 700; }
.repeat-step .n { min-width: 1.4rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.wd { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; }
.wd button { aspect-ratio: 1; border: 0; border-radius: 50%; background: var(--field); font: inherit; font-size: .85rem; color: var(--ink); }
.wd button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.repeat-summary { background: var(--accent-soft); color: var(--accent); border-radius: 10px; padding: .55rem .7rem; font-size: .85rem; font-weight: 600; text-align: center; }
.repeat-hint { font-size: .78rem; color: var(--faint); text-align: center; }
.meta .rep { width: .75rem; height: .75rem; }

/* task notes, in the edit sheet and the details pane */
.notes-field {
  font: inherit; font-size: .95rem; line-height: 1.5; width: 100%; min-height: 4.6rem; resize: none; overflow: hidden;
  border: 0; border-radius: 12px; background: var(--field); color: var(--ink); padding: .65rem .85rem;
}
.notes-field::placeholder { color: var(--faint); }
.notes-field:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--accent-soft); }

/* ---------- desktop: sidebar, a reading column, details pane, popovers ---------- */
.sidebar, .pane, .ctx-menu { display: none; }
@media (min-width: 760px) {
  :root { --side: 236px; --pane: 0px; --tabbar: 0px; }
  .tabbar, .mini-head, .back-button { display: none !important; }
  main {
    max-width: none; margin: 0; margin-inline-start: var(--side); margin-inline-end: var(--pane);
    padding: 2.2rem max(2.5rem, calc((100vw - var(--side) - var(--pane) - 640px) / 2)) 7rem;
  }
  .pill, .composer, .toast {
    inset-inline-start: calc(var(--side) + 2.5rem); inset-inline-end: calc(var(--pane) + 2.5rem);
  }
  .pill { bottom: 1.4rem; }
  .pill::after { content: "N"; margin-inline-start: auto; font-size: .72rem; color: var(--faint); border: 1px solid var(--hairline); border-bottom-width: 2px; border-radius: 6px; padding: 0 .4rem; background: var(--bg); }
  .composer { bottom: 1.4rem; }
  .composer-dim { background: transparent; }
  .toast { bottom: 6rem; }

  .sidebar {
    display: flex; flex-direction: column; gap: 2px; position: fixed; z-index: 6; inset-block: 0; inset-inline-start: 0;
    width: var(--side); padding: 1.1rem .7rem; background: var(--sidebar); border-inline-end: 1px solid var(--hairline); overflow-y: auto;
  }
  .side-item {
    display: flex; align-items: center; gap: .6rem; width: 100%; border: 0; background: transparent; text-align: start;
    padding: .42rem .6rem; border-radius: 9px; font-size: .88rem; color: var(--ink);
  }
  .side-item svg { width: 1.1rem; height: 1.1rem; color: var(--muted); }
  .side-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-item .n { color: var(--faint); font-size: .78rem; font-variant-numeric: tabular-nums; }
  .side-item:hover { background: rgba(23, 33, 27, .05); }
  .side-item.on { background: #dfe9f9; color: var(--accent); font-weight: 600; }
  .side-item.on svg, .side-item.on .n { color: var(--accent); }
  .side-item.drop { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
  .side-sep { height: 1px; background: var(--hairline); margin: .5rem .6rem; }
  .side-label { display: flex; justify-content: space-between; align-items: center; padding: 1rem .6rem .25rem; }
  .side-label button { border: 0; background: transparent; padding: 0; font-size: .72rem; font-weight: 600; color: var(--faint); }
  .side-label .side-add { color: var(--accent); font-weight: 500; }
  .side-grow { flex: 1; }

  /* Rows highlight under the pointer and when selected. */
  .todo-row, #screen-list .row { border-radius: 10px; padding-inline: .6rem; margin-inline: -.6rem; }
  .todo-row.sel { background: var(--accent-soft); }
  .todo-row[draggable=true] { cursor: default; }

  .pane {
    display: flex; flex-direction: column; gap: .9rem; position: fixed; z-index: 7; inset-block: 0; inset-inline-end: 0;
    width: 372px; max-width: 100vw; padding: 1.2rem 1.3rem 1.4rem; background: var(--surface);
    border-inline-start: 1px solid var(--hairline); overflow-y: auto; box-shadow: 0 0 40px rgba(23, 33, 27, .12);
  }
  .pane-top { display: flex; align-items: center; justify-content: space-between; font-size: .75rem; color: var(--faint); }
  .pane-close { width: 1.7rem; height: 1.7rem; border: 0; border-radius: 50%; background: var(--field); color: var(--muted); font-size: .8rem; }
  .pane-title {
    font: inherit; font-size: 1.25rem; font-weight: 700; line-height: 1.3; width: 100%; resize: none; overflow: hidden;
    border: 0; background: transparent; color: var(--ink); padding: .2rem 0;
  }
  .pane-title:focus { outline: none; }
  .pane .sheet-footer { margin-top: auto; }

  /* The shopping catalog opens beside the list instead of over it. */
  #catalog.overlay {
    inset-block: 0; inset-inline-start: auto; inset-inline-end: 0; width: 372px; z-index: 7;
    background: var(--surface); border-inline-start: 1px solid var(--hairline); box-shadow: 0 0 40px rgba(23, 33, 27, .12);
    padding: 1rem 1.2rem 2rem;
  }
  #catalog .catalog-bar { background: var(--surface); top: -1rem; margin: -1rem -1.2rem .5rem; padding: 1rem 1.2rem .5rem; }

  #sheet {
    inset: auto; margin: 0; width: 340px; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow-y: auto;
    border-radius: 14px; border: 1px solid var(--hairline);
    box-shadow: 0 2px 6px rgba(23, 33, 27, .08), 0 18px 44px rgba(23, 33, 27, .18);
  }
  #sheet::backdrop { background: transparent; }
  #sheet .grab { display: none; }
  #sheet-body { padding: 1rem; }

  .ctx-menu {
    display: grid; position: fixed; z-index: 40; width: 230px; padding: 6px; background: var(--surface);
    border: 1px solid var(--hairline); border-radius: 12px; box-shadow: 0 2px 6px rgba(23, 33, 27, .08), 0 18px 44px rgba(23, 33, 27, .18);
  }
  .ctx-item {
    display: flex; align-items: center; gap: .6rem; width: 100%; border: 0; background: transparent; text-align: start;
    padding: .42rem .6rem; border-radius: 7px; font-size: .85rem; color: var(--ink);
  }
  .ctx-item svg { width: 1rem; height: 1rem; color: var(--muted); }
  .ctx-item .label { flex: 1; }
  .ctx-item kbd, .keys kbd {
    font: inherit; font-size: .7rem; color: var(--faint); background: var(--bg); border: 1px solid var(--hairline);
    border-bottom-width: 2px; border-radius: 6px; padding: 0 .4rem; direction: ltr;
  }
  .ctx-item .ck { color: var(--accent); }
  .ctx-item .ar { color: var(--ring); }
  .ctx-item:hover, .ctx-item:focus-visible { background: var(--accent); color: var(--accent-ink); outline: none; }
  .ctx-item:hover svg, .ctx-item:focus-visible svg, .ctx-item:hover .ck, .ctx-item:hover .ar { color: var(--accent-ink); }
  .ctx-item.danger, .ctx-item.danger svg { color: var(--danger); }
  .ctx-item.danger:hover, .ctx-item.danger:hover svg { background: var(--danger); color: #fff; }
  .ctx-menu hr { border: 0; border-top: 1px solid var(--hairline); margin: 5px 4px; }
  .keys { display: grid; grid-template-columns: auto 1fr; gap: .55rem .9rem; align-items: center; font-size: .9rem; }
  .keys kbd { justify-self: start; font-size: .78rem; color: var(--muted); }
}
@media (min-width: 760px) and (hover: hover) {
  .todo-row:not(.sel):hover, #screen-list .row:hover { background: var(--hover); }
}
@media (min-width: 1100px) {
  body.pane-open, body.catalog-open { --pane: 372px; }
  .pane, #catalog.overlay { box-shadow: none; }
}
.search-field { min-width: 0; }
@media (min-width: 760px) {
  #todos-container > .category:first-child:not(:has(h2)) { margin-top: .9rem; }
}
#sheet:focus-visible { outline: none; }
