/* Bayit design system.
   Tokens and component styles carried over from the approved prototype, plus
   the states a real app needs: loading, error, disabled, focus, confirm.
   Every colour is a token so light and dark stay in step. */

@font-face {
  font-family: "NotoHeb";
  src: url("../fonts/noto-heb.woff2") format("woff2-variations");
  font-weight: 300 800;
  font-display: swap;
}

:root {
  direction: rtl;

  --paper: #E9EDEB;
  --surface: #FFFFFF;
  --surface-2: #F4F6F5;
  --ink: #141F1D;
  --ink-soft: #5B6B67;
  --ink-faint: #8C9A96;
  --line: #D5DDDA;
  --line-strong: #BDC8C4;

  --accent: #0E6F72;
  --accent-ink: #0A5457;
  --accent-wash: #DCEBEA;
  --on-accent: #FFFFFF;

  --done: #3B8A5F;
  --alert: #BC4638;
  --alert-wash: #F6E2DF;
  --amber: #B37F12;
  --amber-wash: #F5EAD3;

  --c-house: #2E7FB0;
  --c-maint: #A8730F;
  --c-kids: #7B67BE;
  --c-errand: #C2513C;
  --c-car: #3F7A66;

  --r-s: 8px;
  --r-m: 14px;
  --r-l: 20px;

  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(20, 31, 29, .05), 0 8px 20px -12px rgba(20, 31, 29, .18);

  /* 44px is the smallest comfortable touch target on a phone */
  --tap: 44px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0E1412;
    --surface: #171F1D;
    --surface-2: #1E2825;
    --ink: #E4ECE9;
    --ink-soft: #93A29D;
    --ink-faint: #6C7B77;
    --line: #26322F;
    --line-strong: #35443F;
    --accent: #57BEB6;
    --accent-ink: #8AD6CE;
    --accent-wash: #122E2E;
    --on-accent: #0E1412;
    --done: #5FB284;
    --alert: #E0715F;
    --alert-wash: #331915;
    --amber: #D8A63C;
    --amber-wash: #2D2411;
    --c-house: #63AEDC;
    --c-maint: #D8A63C;
    --c-kids: #A48EE0;
    --c-errand: #E8836C;
    --c-car: #6FBFA0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 20px -12px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "NotoHeb", -apple-system, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ============================================================ login gate */

.gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--paper);
  display: grid;
  place-items: center;
  padding: 24px 20px;
  overflow-y: auto;
}

.gate-card {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gate-brand { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.gate-brand h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.03em; }
.gate-brand p { margin: 0; font-size: 13.5px; color: var(--ink-soft); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }

.field input,
.field select {
  font-family: inherit;
  /* 16px keeps iOS Safari from zooming the viewport on focus */
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 12px 14px;
  width: 100%;
  min-height: var(--tap);
}

.field input::placeholder { color: var(--ink-faint); font-size: 14px; }

.field input:focus-visible,
.field select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.field input[aria-invalid="true"] { border-color: var(--alert); }

.field-error {
  font-size: 12px;
  font-weight: 600;
  color: var(--alert);
  min-height: 1em;
}

.gate-note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-faint);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-m);
  padding: 11px 13px;
}

/* ================================================================= shell */

.shell {
  max-width: 480px;
  margin-inline: auto;
  min-height: 100%;
  padding-bottom: calc(98px + env(safe-area-inset-bottom));
  position: relative;
}

@media (min-width: 900px) {
  .shell { border-inline: 1px solid var(--line); }
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

.top-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.brand h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.brand span { font-size: 11.5px; color: var(--ink-faint); }
.top-right { display: flex; align-items: center; gap: 8px; }

.node {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}

.node.offline { color: var(--alert); border-color: var(--alert); }

.pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--done);
  animation: pulse 2.6s ease-out infinite;
  flex: 0 0 auto;
}

.node.offline .pulse { background: var(--alert); animation: none; }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--done) 55%, transparent); }
  70%  { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.av {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  flex: 0 0 auto;
  border: none;
  padding: 0;
  font-family: inherit;
}

.av.sm { width: 21px; height: 21px; font-size: 10px; }
button.av { cursor: pointer; position: relative; }
/* keep the 26px disc but give the thumb a full 44px to land on */
button.av::before { content: ""; position: absolute; inset: -9px; }
button.av:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

main { padding: 16px 16px 0; }

.screen { display: none; }
.screen.on { display: flex; flex-direction: column; gap: 18px; animation: fade .2s ease; }

@keyframes fade {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .07em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.eyebrow .count { font-family: var(--mono); font-size: 11px; letter-spacing: 0; }
.group { display: flex; flex-direction: column; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 9px; }

.datehead h2 {
  margin: 0 0 2px;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.datehead p { margin: 0; color: var(--ink-soft); font-size: 13.5px; }

/* =============================================== loading / empty / error */

.skeleton {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  height: 62px;
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg, transparent, color-mix(in srgb, var(--ink) 6%, transparent), transparent);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

.empty {
  padding: 20px 14px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-faint);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-m);
}

.errorbox {
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: flex-start;
  padding: 14px;
  background: var(--alert-wash);
  border-radius: var(--r-m);
  font-size: 13px;
  color: var(--ink);
}

.errorbox strong { font-size: 14px; color: var(--alert); }

.banner {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border-radius: var(--r-m);
  font-size: 12.5px;
  background: var(--amber-wash);
  color: var(--ink);
}

/* ============================================================ chips/rows */

.cat {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.chip.late   { background: var(--alert-wash);  color: var(--alert);     border-color: transparent; font-weight: 600; }
.chip.bell   { background: var(--accent-wash); color: var(--accent-ink); border-color: transparent; }
.chip.rot    { background: var(--amber-wash);  color: var(--amber);     border-color: transparent; }

.task {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow);
  transition: opacity .2s ease, background .2s ease;
}

.task.done { opacity: .45; background: var(--surface-2); }
.task.done .t-title { text-decoration: line-through; text-decoration-color: var(--ink-faint); }
.task.busy { opacity: .6; pointer-events: none; }

.tick {
  flex: 0 0 auto;
  width: 23px; height: 23px;
  margin-top: 2px;
  border-radius: 7px;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background .15s ease, border-color .15s ease;
  position: relative;
}

/* the visible box stays 23px but the tappable area is a full 44px */
.tick::before {
  content: "";
  position: absolute;
  inset: calc((var(--tap) - 23px) / -2);
}

.tick svg {
  width: 12px; height: 12px;
  stroke: var(--surface);
  stroke-width: 2.8;
  fill: none;
  opacity: 0;
  transition: opacity .15s ease;
}

.task.done .tick, .shop.done .tick { background: var(--done); border-color: var(--done); }
.task.done .tick svg, .shop.done .tick svg { opacity: 1; }
.tick:hover { border-color: var(--accent); }
.tick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tick[disabled] { opacity: .4; cursor: default; }

.t-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.t-title { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.t-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.t-sub { font-size: 12px; color: var(--ink-faint); }

.rowbtn {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.rowbtn:hover { background: var(--surface-2); color: var(--alert); }
.rowbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rowbtn svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.8; fill: none; }

/* =========================================================== filter rail */

.rail {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.rail::-webkit-scrollbar { display: none; }

.fbtn {
  flex: 0 0 auto;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  cursor: pointer;
  white-space: nowrap;
  min-height: 36px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.fbtn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.fbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================== calendar */

.cal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.cal-month { font-size: 15px; font-weight: 700; }
.cal-nav { display: flex; gap: 5px; }

.navb {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.navb svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.navb:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); padding: 8px 8px 10px; gap: 2px; }
.cal-dow { text-align: center; font-size: 10.5px; font-weight: 700; color: var(--ink-faint); padding: 4px 0 6px; }

.cal-day {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 9px;
  border: none;
  background: transparent;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  transition: background .15s ease;
}

.cal-day.blank { visibility: hidden; pointer-events: none; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.today { font-weight: 700; color: var(--accent-ink); background: var(--accent-wash); }
.cal-day.sel { background: var(--ink); color: var(--paper); }
.cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.cal-dots { display: flex; gap: 2px; height: 5px; align-items: center; }
.cal-dots i { width: 4px; height: 4px; border-radius: 50%; display: block; }

.day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 2px; }
.day-head strong { font-size: 16px; font-weight: 700; }
.day-head span { font-size: 12px; color: var(--ink-faint); font-family: var(--mono); }

.evt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow);
  border-inline-start: 3px solid var(--evt, var(--line-strong));
}

.evt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.evt-title { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.evt-when { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); flex: 0 0 auto; }

/* =============================================================== weather */

.wx-band {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow);
  cursor: pointer;
  width: 100%;
  text-align: start;
  font-family: inherit;
  color: inherit;
  min-height: var(--tap);
}

.wx-band:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wx-temp { font-size: 27px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.wx-band-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wx-band-t { font-size: 13.5px; font-weight: 600; }
.wx-band-s { font-size: 12px; color: var(--ink-faint); }
.wx-more { font-size: 11.5px; font-weight: 700; color: var(--accent); flex: 0 0 auto; white-space: nowrap; }

.wx-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow);
}

.wx-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.wx-big { display: flex; align-items: baseline; gap: 8px; }
.wx-big .n { font-size: 44px; font-weight: 700; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.wx-big .u { font-size: 16px; color: var(--ink-faint); font-weight: 600; unicode-bidi: plaintext; }
.wx-desc { text-align: end; display: flex; flex-direction: column; gap: 3px; }
.wx-desc .d1 { font-size: 14px; font-weight: 600; }
.wx-desc .d2 { font-size: 12px; color: var(--ink-faint); }

.wx-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border-radius: var(--r-s);
  overflow: hidden;
}

.wx-stat { background: var(--surface); padding: 9px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wx-stat .k { font-size: 10px; color: var(--ink-faint); font-weight: 600; white-space: nowrap; }
.wx-stat .v { font-family: var(--mono); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; unicode-bidi: plaintext; }

.wx-src {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-faint);
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.wxdays { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

.wxday {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 11px 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow);
}

.wxday.on { border-color: var(--accent); background: var(--accent-wash); }
.wxday .dl { font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.wxday .dt { font-family: var(--mono); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wxday .dn { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

.rec {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--rc, var(--line-strong));
  border-radius: var(--r-m);
  box-shadow: var(--shadow);
}

.rec-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.rec-title { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; width: 100%; }
.rec-body { font-size: 13px; line-height: 1.6; color: var(--ink-soft); margin: 0; }
.rec-why { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); padding-top: 7px; border-top: 1px dashed var(--line); }

.rec-act {
  align-self: flex-start;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-wash);
  border: none;
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  margin-top: 2px;
  min-height: 38px;
}

.rec-act:hover { filter: brightness(.97); }
.rec-act:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rec-act[disabled] { opacity: .5; cursor: default; }

/* ============================================================== shopping */

.addbar { display: flex; gap: 7px; }

.addbar input {
  flex: 1;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 11px 13px;
  box-shadow: var(--shadow);
  min-width: 0;
  min-height: var(--tap);
}

.addbar input::placeholder { color: var(--ink-faint); font-size: 14px; }
.addbar input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border: none;
  border-radius: var(--r-m);
  padding: 11px 17px;
  cursor: pointer;
  transition: filter .15s ease;
  flex: 0 0 auto;
  min-height: var(--tap);
}

.btn:hover:not([disabled]) { filter: brightness(1.08); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn[disabled] { opacity: .55; cursor: progress; }

.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.btn.danger { background: var(--alert); color: #fff; }

.store-head { display: flex; align-items: center; gap: 8px; padding: 0 2px 1px; }
.store-head .nm { font-size: 13.5px; font-weight: 700; }
.store-head .ct { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.store-head .bar { flex: 1; height: 1px; background: var(--line); }

.shop {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow);
  transition: opacity .2s ease;
}

.shop.done { opacity: .42; }
.shop.done .s-name { text-decoration: line-through; }
.shop.busy { opacity: .6; pointer-events: none; }
.s-name { flex: 1; font-size: 14px; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* =============================================================== devices */

.dev {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow);
}

.dev-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dev-name { font-size: 14.5px; font-weight: 600; }
.dev-sub { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); }
.dev.unreachable .dev-name { color: var(--ink-faint); }

.sw {
  flex: 0 0 auto;
  width: 46px; height: 27px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: background .2s ease, border-color .2s ease;
}

.sw::after {
  content: "";
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: var(--ink-faint);
  transition: transform .2s cubic-bezier(.4, 0, .2, 1), background .2s ease;
}

.sw::before { content: ""; position: absolute; inset: -9px -4px; }
.sw[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.sw[aria-checked="true"]::after { transform: translateX(-19px); background: var(--on-accent); }
.sw:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sw[disabled] { opacity: .45; cursor: default; }

.auto {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 15px;
  background: var(--accent-wash);
  border-radius: var(--r-m);
}

.auto-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.auto-title { font-size: 14px; font-weight: 700; color: var(--accent-ink); }
.auto-desc { font-size: 12.5px; color: var(--ink-soft); line-height: 1.55; margin: 0; }
.live { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--done); }

/* =================================================================== tabs */

.tabs {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 30;
  display: flex;
  max-width: 480px;
  margin-inline: auto;
  background: color-mix(in srgb, var(--surface) 93%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 1px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-faint);
  cursor: pointer;
  border-radius: var(--r-s);
  transition: color .15s ease;
  position: relative;
  min-height: var(--tap);
}

.tab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-selected="true"] { color: var(--accent); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.tab .badge {
  position: absolute;
  top: 2px;
  inset-inline-start: calc(50% - 19px);
  min-width: 15px; height: 15px;
  border-radius: 99px;
  background: var(--alert);
  color: #fff;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

/* ================================================================= toast */

.toast {
  position: fixed;
  bottom: calc(84px + env(safe-area-inset-bottom));
  inset-inline: 0;
  margin-inline: auto;
  width: max-content;
  max-width: calc(100% - 36px);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 15px;
  border-radius: 99px;
  box-shadow: 0 10px 28px -10px rgba(0, 0, 0, .5);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

.toast.show { opacity: 1; transform: none; }
.toast .tdot { width: 7px; height: 7px; border-radius: 50%; background: var(--done); flex: 0 0 auto; }
.toast.bad .tdot { background: var(--alert); }

/* =============================================================== dialogs */

dialog.confirm {
  border: none;
  border-radius: var(--r-l);
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  max-width: 320px;
  width: calc(100% - 40px);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .5);
}

dialog.confirm::backdrop { background: rgba(0, 0, 0, .45); }

.confirm-body { padding: 20px 20px 16px; display: flex; flex-direction: column; gap: 8px; }
.confirm-body h3 { margin: 0; font-size: 17px; font-weight: 700; }
.confirm-body p { margin: 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; }
.confirm-actions { display: flex; gap: 8px; padding: 0 20px 20px; }
.confirm-actions .btn { flex: 1; justify-content: center; }

.foot { padding: 24px 16px 6px; font-size: 11.5px; line-height: 1.7; color: var(--ink-faint); text-align: center; }
.foot code { font-family: var(--mono); font-size: 10.5px; }

/* =========================================================== responsive */

/* 320px is the narrowest phone still in use; nothing may overflow there */
@media (max-width: 360px) {
  body { font-size: 14.5px; }
  main { padding: 14px 12px 0; }
  .top { padding: 10px 12px; }
  .node { display: none; }
  .datehead h2 { font-size: 22px; }
  .wx-big .n { font-size: 38px; }
  .tab { font-size: 9.5px; }
  .wx-stat .k { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ==================================================== shopping quantities */

.qtybar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -4px;
}

.qtybar input[type="number"] {
  width: 72px;
  flex: 0 0 auto;
  font-family: inherit;
  font-size: 16px;                 /* stops iOS Safari zooming on focus */
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 9px 10px;
  min-height: 40px;
  text-align: center;
}

.qtybar input[type="number"]::placeholder { color: var(--ink-faint); }
.qtybar input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.qtybar input[aria-invalid="true"] { border-color: var(--alert); }
.qtybar .rail { flex: 1; min-width: 0; }
.qtybar .fbtn { padding: 7px 12px; min-height: 40px; }

/* the quantity on a row, editable in place */
.chip.qty {
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  background: var(--accent-wash);
  color: var(--accent-ink);
  border-color: transparent;
  cursor: pointer;
  min-height: 26px;
}

.chip.qty:hover { filter: brightness(.97); }
.chip.qty:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.qty-edit {
  width: 62px;
  font-family: var(--mono);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 3px 8px;
  text-align: center;
}

.qty-edit:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ================================================ calendar subscription */

.ics-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.ics-url {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  padding: 9px 11px;
  margin: 8px 0;
  /* a long opaque token must wrap, never widen the page */
  overflow-wrap: anywhere;
  word-break: break-all;
  direction: ltr;
  text-align: left;
  user-select: all;
}

@media (max-width: 360px) {
  .qtybar input[type="number"] { width: 62px; }
  .qtybar .fbtn { padding: 7px 9px; font-size: 12px; }
}

/* ========================================================= מזווה שגרה */

.pantry-hint {
  margin: -4px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-faint);
}

.pantry-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pantry-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  min-height: 38px;
  cursor: pointer;
  /* a long-press must not pop the iOS text-selection menu */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: background .15s ease, border-color .15s ease;
}

.pantry-chip:hover:not([disabled]) { border-color: var(--accent); background: var(--accent-wash); }
.pantry-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.pantry-chip.on-list {
  opacity: .45;
  cursor: default;
  background: var(--surface-2);
}

.pantry-chip .pc-qty {
  font-family: var(--mono);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--accent-ink);
  background: var(--accent-wash);
  border-radius: 999px;
  padding: 1px 6px;
}

.pantry-chip .pc-n {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.pantry-chip.on-list .pc-qty { background: transparent; color: var(--ink-faint); }

/* ============================================ subscribed (external) calendars */

.evt.external .evt-title { font-weight: 500; }

.ext-add {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 0;
  overflow: hidden;
}

.ext-add > summary {
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  min-height: var(--tap);
  display: flex;
  align-items: center;
}

.ext-add > summary::-webkit-details-marker { display: none; }
.ext-add > summary::before { content: "+ "; margin-inline-end: 4px; }
.ext-add[open] > summary::before { content: "− "; }
.ext-add > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.ext-howto {
  padding: 0 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.ext-howto p { margin: 0 0 6px; }
.ext-howto ol { margin: 0 0 10px; padding-inline-start: 20px; line-height: 1.7; }
.ext-howto .warn {
  color: var(--amber);
  background: var(--amber-wash);
  border-radius: var(--r-s);
  padding: 8px 10px;
  margin-top: 8px;
}

.ext-add form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px 16px;
}

.ext-shared {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
  min-height: 36px;
}

.ext-shared input { width: 20px; height: 20px; accent-color: var(--accent); }

/* ============================================================= notifications */

.notif-prefs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 6px 4px;
}

.notif-pref {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
  border-radius: var(--r-s);
  min-height: var(--tap);
}

.notif-pref:hover { background: var(--surface-2); }
.notif-pref input { width: 20px; height: 20px; accent-color: var(--accent); flex: 0 0 auto; }
.notif-pref input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ========================================================= adding a chore */

.newchore {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  overflow: hidden;
}

.newchore > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  min-height: var(--tap);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.newchore > summary::-webkit-details-marker { display: none; }

.newchore > summary::before {
  content: "+";
  font-size: 17px;
  line-height: 1;
  font-weight: 400;
}

.newchore[open] > summary {
  border-bottom: 1px solid var(--line);
}

.newchore[open] > summary::before { content: "−"; }

.newchore form {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 14px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rail.wrap { flex-wrap: wrap; }

/* the seven weekday buttons are a single unit — keep them on one line even
   on a narrow phone, where five words of a category rail would wrap */
#chore-days { display: flex; gap: 5px; }
#chore-days .fbtn { flex: 1; min-width: 0; padding-inline: 0; text-align: center; }

.recur-hint {
  margin: -4px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
}

.recur-hint.empty { color: var(--ink-faint); font-weight: 400; }

.rot > summary {
  cursor: pointer;
  list-style: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 8px 2px;
  min-height: 34px;
  display: flex;
  align-items: center;
}

.rot > summary::-webkit-details-marker { display: none; }
.rot > summary::after { content: " ▾"; color: var(--ink-faint); }
.rot[open] > summary::after { content: " ▴"; }
.rot > .field { margin-bottom: 8px; }

.rotpeople {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface-2);
  border-radius: var(--r-s);
  padding: 4px;
}

/* ============================================================== בני הבית */

.dev.off { opacity: .55; }

.hh-hint {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-faint);
}

.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  position: relative;
}

/* keep the 30px disc but give the thumb the full target */
.swatch::before { content: ""; position: absolute; inset: -7px; }
.swatch.on { border-color: var(--ink); }
.swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.build {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-faint);
  opacity: .7;
  margin-inline-start: 4px;
}

/* ==================================================================== ג׳יני */

.t-open {
  /* it is a button now, but it must still look like the row it replaced */
  appearance: none;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  text-align: start;
  padding: 0;
  cursor: pointer;
  min-width: 0;
}

.t-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.jn-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: color-mix(in srgb, #000 45%, transparent);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.jn-panel {
  width: 100%;
  max-width: 480px;
  height: min(88vh, 780px);
  background: var(--paper);
  border-radius: var(--r-l) var(--r-l) 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: jn-rise .22s ease;
  padding-bottom: env(safe-area-inset-bottom);
}

@keyframes jn-rise { from { transform: translateY(24px); opacity: .6; } }

.jn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.jn-brand { font-size: 17px; font-weight: 700; color: var(--accent); letter-spacing: -.02em; }
.jn-sub { font-size: 12.5px; color: var(--ink-soft); }
.jn-head-text { min-width: 0; }
.jn-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.jn-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.jn-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: var(--r-m);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.jn-user { align-self: flex-start; background: var(--accent); color: var(--on-accent); }
.jn-jinni { align-self: flex-end; background: var(--surface); border: 1px solid var(--line); }
.jn-waiting { color: var(--ink-soft); font-style: italic; }

.jn-notice {
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-m);
  padding: 12px 14px;
}

.jn-notice.bad { color: var(--alert); border-color: var(--alert); background: var(--alert-wash); }

.jn-photos { display: flex; flex-wrap: wrap; gap: 6px; }

.jn-photo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-soft);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
}

.jn-photo.shared { border-color: var(--done); color: var(--done); }

/* ---- the plan */

.jn-plan {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.jn-plan-sum { font-size: 15px; font-weight: 600; line-height: 1.5; }

.jn-plan-h {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.jn-ask {
  font-size: 13.5px;
  line-height: 1.6;
  background: var(--accent-wash);
  border-radius: var(--r-s);
  padding: 10px 12px;
}

.jn-list, .jn-safety, .jn-disagree {
  margin: 0;
  padding-inline-start: 20px;
  font-size: 13.5px;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.jn-safety { color: var(--alert); font-weight: 600; }
.jn-disagree { color: var(--amber); }

.jn-steps {
  margin: 0;
  padding-inline-start: 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 14px;
  line-height: 1.6;
}

.jn-steps li::marker { font-weight: 700; color: var(--accent); }
.jn-step-do { display: block; }
.jn-step-why { display: block; font-size: 12px; color: var(--ink-faint); }

.jn-buy { display: flex; flex-direction: column; gap: 7px; }

.jn-buy-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--surface-2);
  border-radius: var(--r-s);
  padding: 9px 11px;
}

.jn-buy-what { font-size: 13.5px; font-weight: 600; }
.jn-buy-where { font-size: 12px; color: var(--ink-soft); }

.jn-plan-foot {
  font-size: 11px;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.jn-warn { color: var(--amber); font-weight: 600; }

.jn-form {
  display: flex;
  gap: 7px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  align-items: center;
}

.jn-form input[type="text"] {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 16px;          /* stops iOS zooming the sheet on focus */
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 11px 13px;
  min-height: var(--tap);
}

.jn-form input:disabled { opacity: .5; }
#jinni-photo-btn { font-size: 17px; line-height: 1; min-width: var(--tap); }
.jn-engine .dev-sub { word-break: break-word; }

.jn-budget {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  text-align: center;
  padding: 5px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.jn-budget.tight { color: var(--amber); font-weight: 700; }

.jn-questions { display: flex; flex-direction: column; gap: 6px; }

.jn-q {
  appearance: none;
  text-align: start;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: var(--accent-ink);
  background: var(--accent-wash);
  border: 1px solid transparent;
  border-radius: var(--r-s);
  padding: 9px 11px;
  cursor: pointer;
  min-height: 38px;
}

.jn-q:hover { border-color: var(--accent); }
.jn-q:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.jn-pending { color: var(--accent); font-weight: 600; }

.jn-pending::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-inline-end: 5px;
  animation: pulse 1.8s ease-out infinite;
}

/* ================================================== the card that opens */

.card { display: flex; flex-direction: column; }
.card.open .task { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

.t-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--r-m) var(--r-m);
  padding: 12px 14px 13px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  animation: fade .16s ease;
}

.t-notes {
  font-size: 13.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  color: var(--ink);
  background: var(--surface-2);
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--r-s);
  padding: 10px 12px;
}

.t-notes.empty {
  color: var(--ink-faint);
  border-inline-start-color: var(--line-strong);
  font-style: italic;
}

.t-facts { display: flex; flex-direction: column; gap: 3px; }

.t-fact { display: flex; gap: 8px; font-size: 12.5px; line-height: 1.6; }
.t-fact-k { color: var(--ink-faint); min-width: 84px; flex: 0 0 auto; }
.t-fact-v { color: var(--ink); }

.t-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.t-actions .fbtn, .t-actions .btn { flex: 1 1 auto; min-height: 40px; }
.fbtn.danger { color: var(--alert); border-color: color-mix(in srgb, var(--alert) 35%, transparent); }
.fbtn.danger:hover { background: var(--alert-wash); }
.fbtn.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.fbtn.accent:hover { background: var(--accent-wash); }

.t-edit { display: flex; flex-direction: column; gap: 10px; }
.t-edit .field label { font-size: 11.5px; }
.t-edit .field input, .t-edit .field select { padding: 9px 11px; min-height: 40px; }
.t-edit .field { gap: 4px; }

.t-days { display: flex; gap: 4px; margin-top: 6px; }
.t-days .fbtn { flex: 1; min-width: 0; padding-inline: 0; text-align: center; }

#jinni-photo-btn { min-width: var(--tap); padding-inline: 0; display: grid; place-items: center; }
#jinni-photo-btn .ic { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ============================================== pantry: is this one product? */

.dupe {
  background: var(--amber-wash);
  border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
  border-radius: var(--r-m);
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dupe-q { font-size: 11.5px; font-weight: 700; color: var(--amber); }
.dupe-names { display: flex; flex-wrap: wrap; gap: 6px; }

.dupe-name {
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
}

.dupe-actions { display: flex; gap: 7px; }
.dupe-actions .fbtn { flex: 1; min-height: 36px; }

/* The house, on the way in. Same drawing as the home-screen icon, in the app's
   own tokens so it follows light and dark rather than carrying its own teal. */
.mark {
  width: 54px;
  height: 54px;
  display: block;
  margin-bottom: 10px;
}

/* ============================================================== חיפוש */

.iconbtn {
  width: var(--tap);
  height: 30px;
  display: grid;
  place-items: center;
  background: none;
  border: none;
  padding: 0;
  color: var(--ink-soft);
  cursor: pointer;
}

.iconbtn svg {
  width: 19px; height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.iconbtn:hover { color: var(--accent); }
.iconbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.search-form { flex: 1; min-width: 0; }

.search-form input {
  width: 100%;
  font-family: inherit;
  font-size: 16px;          /* stops iOS zooming the sheet on focus */
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 10px 13px;
  min-height: var(--tap);
}

.search-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.sr {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* finished work is the point of this screen, so it is not greyed out of the
   way — just marked, so a still-open row stands out from it */
.sr.done { border-inline-start: 3px solid var(--done); }

.sr-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.sr-kind {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.sr-when { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.sr-title { font-size: 14.5px; line-height: 1.5; }
.sr-sub { font-size: 12px; color: var(--ink-soft); line-height: 1.5; }

/* ========================================================== מה חדש */

.news-card {
  width: 100%;
  max-width: 380px;
  margin: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  animation: fade .2s ease;
  box-shadow: var(--shadow);
}

.news-top { display: flex; align-items: center; gap: 12px; }
.news-mark { width: 42px; height: 42px; flex: 0 0 auto; }

.news-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.news-version {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.news-body { display: flex; flex-direction: column; gap: 14px; }
.news-note { display: flex; flex-direction: column; gap: 4px; }

/* anything but the newest is something they missed while away, so it is
   present but quieter */
.news-note.older { padding-top: 12px; border-top: 1px solid var(--line); opacity: .78; }

.news-older-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-faint);
}

.news-headline { font-size: 15px; font-weight: 700; line-height: 1.45; }
.news-line { font-size: 13.5px; line-height: 1.65; color: var(--ink-soft); }

/* the sheet centres this one instead of docking it to the bottom */
#news-sheet { align-items: center; padding: 20px; }
