/* VOICE   work tool for people on the road: calm, quiet, dense where it counts
   IDEA    the supervisor's weekly route card: a line per stop, a mark per visit
   PICTURE the visit dots themselves: red until done, green check when done
   COLOUR  white ground, near-black ink, one sober blue; red and green only for visits
   TYPE    Inter for everything
   LAYOUT  phone: one column with bottom tabs; tablet: list on the left, stop on the right */

:root {
  color-scheme: light dark;
  --bg: light-dark(#ffffff, #0f1216);
  --surface: light-dark(#f4f5f7, #171b21);
  --raise: light-dark(#ffffff, #1c2129);
  --line: light-dark(#e3e6eb, #2a3039);
  --ink: light-dark(#121a24, #e9edf2);
  --muted: light-dark(#5d6875, #9aa4b0);
  --brand: light-dark(#2251a3, #7ea6f2);
  --brand-ink: light-dark(#ffffff, #0f1216);
  --brand-soft: light-dark(#e9effa, #1b2638);
  --ok: light-dark(#18864b, #43c07f);
  --ok-soft: light-dark(#e5f4eb, #15291f);
  --due: light-dark(#d33a35, #f2726c);
  --warn: light-dark(#b4620a, #eaa24a);
  --warn-soft: light-dark(#fbf0e2, #2d2315);
  --a-monsey: light-dark(#0f7a6e, #4cc7b6);
  --a-williamsburg: light-dark(#6a45c2, #a993ef);
  --a-boropark: light-dark(#a8590c, #e9a65a);
  --a-nj: light-dark(#2251a3, #7ea6f2);
  --r: 12px;
  --tabs-h: 64px;
}
:root[data-theme=light] { color-scheme: light; }
:root[data-theme=dark] { color-scheme: dark; }
* { box-sizing: border-box; min-width: 0; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: clamp(22px, 3.2vw, 28px); line-height: 1.1; letter-spacing: -0.02em; margin: 0; font-weight: 700; }
h2 { font-size: 16px; margin: 0; font-weight: 650; }
small, .sm { font-size: 13px; }
.muted { color: var(--muted); }
.okc { color: var(--ok); }
.warnc { color: var(--warn); }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[dir=rtl] .flip { transform: scaleX(-1); }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------- shell ---------- */
#app { height: 100%; display: flex; flex-direction: column; }
.boot { flex: 1; display: grid; place-items: center; }
.boot .logo { width: 56px; height: 56px; opacity: .85; }
.demobar { background: var(--warn-soft); color: var(--ink); font-size: 13px; padding: 6px max(16px, env(safe-area-inset-left)); text-align: center; }
.demobar .link { font-size: 13px; }
.top { display: flex; align-items: center; gap: 10px; padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); background: var(--bg); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; flex: 1; }
.brand.lg { font-size: 20px; margin-bottom: 20px; }
.logo { width: 30px; height: 30px; flex: none; }
.brand.lg .logo { width: 40px; height: 40px; }
.top .wk { color: var(--muted); font-size: 13px; white-space: nowrap; }
.top .wk b { color: var(--ink); font-weight: 600; }
.main { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); background: var(--bg); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--tabs-h); font-size: 12px; font-weight: 550; color: var(--muted); }
.tabs a.on { color: var(--brand); }
.tabs a.on .ic { stroke-width: 2.3; }
@media (min-width: 700px) { .tabs a { flex-direction: row; gap: 8px; font-size: 14px; } }

.pad { padding: 18px max(16px, env(safe-area-inset-left)) 28px; max-width: 1240px; margin: 0 auto; }
.pad-s { padding: 12px 14px; margin: 0; }
.sec { display: flex; gap: 8px; align-items: baseline; margin: 22px 0 10px; }
.cols { display: grid; gap: 0 24px; }
@media (min-width: 900px) { .cols { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.card { background: var(--raise); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.card + .card { margin-top: 12px; }
.ch { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 10px; flex-wrap: wrap; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 8px; }
.empty .ic { width: 34px; height: 34px; }
.empty.big { padding: 70px 20px; }
.empty.big h1 { color: var(--ink); }
.empty p { max-width: 46ch; margin: 0; }
.soonline { display: flex; gap: 10px; align-items: center; color: var(--ink); background: var(--surface); border-style: dashed; }
.soonline .ic { color: var(--muted); }
.backlink { display: inline-flex; align-items: center; gap: 4px; color: var(--brand); font-weight: 600; min-height: 40px; margin-bottom: 6px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--raise); font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.big { min-height: 54px; font-size: 17px; border-radius: 12px; }
.btn.wide { width: 100%; margin-top: 14px; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .6; cursor: default; }
.dangerbtn { color: var(--due); }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink); font-weight: 600; font-size: 14px; }
.iconbtn:hover, .iconbtn.on { background: var(--surface); border-color: var(--line); }
.iconbtn.sm { min-width: 40px; height: 40px; font-size: 18px; }
.iconbtn.danger { color: var(--due); }
.link { background: none; border: 0; color: var(--brand); font-weight: 600; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; min-height: 40px; padding: 0 4px; }
.link .ic { width: 18px; height: 18px; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.btnrow.end { justify-content: flex-end; }
.grow { flex: 1; }
.av { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13px; flex: none; position: relative; }
.av.on::after { content: ""; position: absolute; inset-inline-end: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); border: 2px solid var(--raise); }
.me { border: 0; background: none; padding: 0; cursor: pointer; min-width: 44px; height: 44px; display: grid; place-items: center; }
.tag { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.bar { display: block; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--due) 18%, var(--surface)); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.bar.lg { height: 10px; }

/* ---------- forms ---------- */
.form { display: grid; gap: 6px; }
.form label:not(.radio):not(.check) { font-weight: 600; font-size: 14px; margin-top: 8px; }
input:not([type=radio]):not([type=checkbox]), select, textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 16px; }
textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
input.num { width: 110px; }
.codein { letter-spacing: .4em; font-weight: 700; font-size: 20px !important; width: 140px !important; text-align: center; }
.inrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inrow input { flex: 1; }
.radios { display: flex; flex-wrap: wrap; gap: 8px; }
.radio, .check { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.radio:has(input:checked), .check:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.radio input, .check input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }
.checks { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.err { color: var(--due); min-height: 20px; margin: 4px 0 0; font-size: 14px; }

/* ---------- sign in ---------- */
.login { flex: 1; overflow-y: auto; display: flex; flex-wrap: wrap; gap: 20px; align-content: center; justify-content: center; padding: 28px 16px; background: var(--surface); }
.lcard { background: var(--raise); border: 1px solid var(--line); border-radius: 18px; padding: 28px; width: min(400px, 100%); }
.lcard .btn.big { margin-top: 10px; }
.lcard > .link { margin-top: 14px; }
.demo-people h2 { margin-bottom: 4px; }
.plist { display: grid; gap: 6px; margin-top: 12px; max-height: 420px; overflow-y: auto; }
.pick { display: flex; gap: 12px; align-items: center; text-align: start; min-height: 52px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; }
.pick:hover { border-color: var(--brand); }
.pick b, .pick small { display: block; }
.pick small { color: var(--muted); }

/* ---------- dashboard ---------- */
.hero { display: grid; gap: 18px; padding: 20px; border-radius: 16px; background: var(--brand-soft); }
@media (min-width: 760px) { .hero { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: center; } }
.bigfig { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 10px; }
.bigfig b { font-size: clamp(44px, 7vw, 64px); line-height: 1; letter-spacing: -0.03em; font-weight: 750; font-variant-numeric: tabular-nums; }
.bigfig span { color: var(--muted); font-size: 16px; }
.hero-r { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--raise); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; border: 1px solid transparent; }
.stat b { font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat b small { font-size: 14px; color: var(--muted); font-weight: 600; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.warn b { color: var(--warn); }
a.stat:hover { border-color: var(--line); }
.areas { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .areas { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.area { display: grid; gap: 8px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--raise); border-inline-start: 5px solid var(--ac); min-height: 92px; }
.area:hover { background: var(--surface); }
.an { font-weight: 700; font-size: 16px; }
.am { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.a-monsey { --ac: var(--a-monsey); }
.a-williamsburg { --ac: var(--a-williamsburg); }
.a-boropark { --ac: var(--a-boropark); }
.a-nj { --ac: var(--a-nj); }
.people { display: grid; gap: 10px; }
@media (min-width: 900px) { .people { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.pcard { background: var(--raise); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.phead { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px 6px; background: none; border: 0; cursor: pointer; text-align: start; }
.pn { flex: 1; display: grid; }
.pn b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp { display: grid; gap: 4px; width: 92px; text-align: end; font-variant-numeric: tabular-nums; }
.chev { color: var(--muted); width: 18px; height: 18px; }
.pmeta { display: flex; gap: 6px 14px; flex-wrap: wrap; padding: 0 14px 12px 60px; font-size: 13px; }
[dir=rtl] .pmeta { padding: 0 60px 12px 14px; }
.pmeta .ic { width: 15px; height: 15px; vertical-align: -3px; }
.rows.inset { border-top: 1px solid var(--line); }
.ahead { padding: 16px; border-radius: 14px; background: var(--surface); border-inline-start: 6px solid var(--ac); display: grid; gap: 8px; }
.ahead p { margin: 0; color: var(--muted); }

/* ---------- stop rows: one slim line each ---------- */
.rows { display: block; }
.rows.card { padding: 0; overflow: hidden; }
.row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface); }
.row.sel { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
[dir=rtl] .row.sel { box-shadow: inset -3px 0 0 var(--brand); }
.row .st { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.st.ok { background: var(--ok); }
.st.due { background: var(--due); }
.row .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }
.ar { font-size: 11px; font-weight: 700; color: var(--ac); background: color-mix(in srgb, var(--ac) 12%, transparent); padding: 2px 6px; border-radius: 5px; white-space: nowrap; flex: none; }
.dots { display: inline-flex; gap: 4px; align-items: center; flex: none; }
.dsep { width: 6px; flex: none; }
.dots.sm .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.due { background: var(--due); }
.dot.ok { background: var(--ok); }
.dots.sm .dot.ok.off { background: var(--ok); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--warn); }
.dots.lg { gap: 8px; flex-wrap: wrap; }
.dots.lg .dot { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; border: 0; padding: 0; position: relative; color: #fff; }
.dots.lg button.dot { cursor: pointer; }
.dots.lg button.dot:hover { transform: scale(1.08); }
.dots.lg .dot .ic { width: 20px; height: 20px; stroke-width: 2.8; }
.dot .flag { position: absolute; top: -3px; inset-inline-end: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--warn); border: 2px solid var(--raise); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 0; }
.legend .dot { width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; position: relative; color: #fff; margin-inline-start: 8px; }
.legend .dot .ic { width: 11px; height: 11px; stroke-width: 3; }
.legend .dot .flag { width: 8px; height: 8px; border-width: 1.5px; top: -2px; inset-inline-end: -2px; }

/* ---------- Stops tab ---------- */
.split { min-height: 100%; }
.pane.list .lhead { padding: 14px max(16px, env(safe-area-inset-left)) 6px; position: sticky; top: 0; background: var(--bg); z-index: 2; border-bottom: 1px solid var(--line); }
.seg { display: flex; background: var(--surface); border-radius: 11px; padding: 3px; gap: 3px; margin-bottom: 10px; }
.seg a, .seg button { flex: 1; text-align: center; min-height: 38px; display: grid; place-items: center; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--muted); border: 0; background: none; cursor: pointer; }
.seg .on { background: var(--raise); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.seg.sm button { min-height: 34px; font-size: 13px; }
.toolbar { display: flex; gap: 6px; align-items: center; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.search .ic { color: var(--muted); width: 18px; height: 18px; }
.search input { border: 0 !important; background: transparent !important; padding: 0 !important; min-height: 44px; outline: none !important; }
.toolbar .btn span { display: none; }
@media (min-width: 520px) { .toolbar .btn span { display: inline; } }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; align-items: center; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--raise); font-weight: 550; font-size: 14px; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.sel { min-height: 36px !important; padding: 4px 10px !important; border-radius: 99px !important; font-size: 14px !important; width: auto !important; flex: none; }
.count { margin: 0; padding: 8px max(16px, env(safe-area-inset-left)); font-size: 13px; color: var(--muted); }
.grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); padding: 0 max(16px, env(safe-area-inset-left)) 20px; }
.tile { display: grid; gap: 6px; align-content: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--raise); border-top: 3px solid var(--due); min-height: 96px; }
.tile.isdone { border-top-color: var(--ok); }
.tile.sel { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.tn { font-weight: 650; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tm { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.ta { display: flex; gap: 3px; flex-wrap: wrap; }
.mini { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 5px; background: var(--surface); color: var(--muted); }
.pane.detail .empty { padding-top: 120px; }

@media (max-width: 899px) {
  .split.has-detail .pane.list, .split:not(.has-detail) .pane.detail { display: none; }
}
@media (min-width: 900px) {
  [data-tab=stops] .main { overflow: hidden; }
  .split { display: grid; grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); height: 100%; }
  .pane { overflow-y: auto; height: 100%; }
  .pane.list { border-inline-end: 1px solid var(--line); }
  .only-narrow { display: none !important; }
  .pane.detail { background: var(--surface); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- stop page ---------- */
.dwrap { padding: 14px max(16px, env(safe-area-inset-left)) 30px; max-width: 880px; margin: 0 auto; display: grid; gap: 12px; }
.dwrap .card + .card { margin-top: 0; }
.dtitle { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.dact { display: flex; gap: 2px; }
.meta { margin: 6px 0 0; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wkcard { border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.who { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.who:first-of-type { border-top: 0; }
.wn { flex: 1; font-weight: 600; }
.wc { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 34px; text-align: end; }
@media (max-width: 520px) { .who { flex-wrap: wrap; } .who .dots { order: 3; width: 100%; padding-inline-start: 46px; } }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--surface); border-radius: 10px; padding: 2px; }
.stepper span { padding: 0 6px; font-size: 14px; white-space: nowrap; }
.demoloc { margin-top: 10px; display: grid; gap: 6px; }
.demoloc .seg { margin: 0; background: var(--warn-soft); }
.addr { margin: 0 0 6px; font-size: 16px; }
.geo { display: flex; gap: 6px; align-items: center; margin: 0; font-size: 14px; }
.geo .ic { width: 18px; height: 18px; }
.contact { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.contact:first-of-type { border-top: 0; }
.cn { flex: 1; display: grid; }
.cphone { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-weight: 600; min-height: 40px; white-space: nowrap; }
.cphone .ic { width: 18px; height: 18px; }
@media (max-width: 420px) { .cphone span { display: none; } }
.vlog { display: grid; }
.vrow { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: start; cursor: pointer; width: 100%; }
.card.vlog { padding: 0 14px; }
.vrow:first-child { border-top: 0; }
.vt { width: 92px; flex: none; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; white-space: nowrap; }
.vn { flex: 1; display: grid; }
.vn small { color: var(--muted); }
.loc { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.loc .ic { width: 20px; height: 20px; }
.loc.ok { color: var(--ok); }
.loc.warn { color: var(--warn); }
.loc.muted { color: var(--muted); }
.soonpair { display: grid; gap: 12px; }
@media (min-width: 600px) { .soonpair { grid-template-columns: 1fr 1fr; } }

/* ---------- team ---------- */
.ttl { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.urow { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); min-height: 56px; }
.urow:last-child { border-bottom: 0; }
.un { flex: 1; display: grid; }
.un b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team .form.card { margin-bottom: 12px; }

/* ---------- sheets, popover, toast ---------- */
.scrim { position: fixed; inset: 0; background: rgb(10 14 20 / .42); z-index: 40; animation: fade .15s ease; }
.sheet { position: fixed; z-index: 41; inset-inline: 0; bottom: 0; max-height: 92%; overflow-y: auto; background: var(--raise); border-radius: 18px 18px 0 0; padding: 6px 18px calc(18px + env(safe-area-inset-bottom)); animation: up .2s ease; }
@media (min-width: 700px) { .sheet { inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: min(560px, 92vw); max-height: 86vh; border-radius: 18px; animation: fade .15s ease; } }
.shead { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--raise); padding: 8px 0; z-index: 1; }
.sbody p { margin-top: 0; }
.menu { display: grid; gap: 4px; }
.mi { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 12px; border-radius: 10px; border: 0; background: none; cursor: pointer; font-weight: 550; text-align: start; }
.mi:hover { background: var(--surface); }
#pop { position: fixed; z-index: 30; background: var(--raise); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgb(0 0 0 / .16); padding: 12px 14px; }
.popin { display: grid; gap: 6px; justify-items: start; }
.toast { position: fixed; z-index: 50; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 550; width: max-content; max-width: min(520px, calc(100vw - 32px)); box-shadow: 0 8px 24px rgb(0 0 0 / .2); }
.toast.bad { background: var(--due); color: #fff; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 560px) { .top .wk { display: none; } .iconbtn span { display: none; } }

/* user-written text keeps its own direction inside a Yiddish (right-to-left) screen */
.addr, .nm, .tn, .wn, .vn b, .pn b, .un b, .cn b, .dtitle h1, textarea, input { unicode-bidi: plaintext; }
.pane.list { container-type: inline-size; }
@media (min-width: 900px) { .toolbar .btn span { display: none; } }
@container (min-width: 520px) { .toolbar .btn span { display: inline; } }
@media (max-width: 560px) { .demobar .long { display: none; } }

/* ---------- stage 2: Pop-ins, Temidi, Tasks ---------- */
:root { --st-todo: light-dark(#5d6875, #9aa4b0); --st-doing: light-dark(#b4620a, #eaa24a); --st-done: var(--ok); }
.narrowish { max-width: 980px; }
.lead { flex: 1; margin: 0; color: var(--muted); font-size: 14px; }
.push { margin-inline-start: auto; font-size: 14px; }
.sec .push { min-height: 0; }
.sep { color: var(--line); padding: 0 2px; }
.btnline { display: flex; gap: 6px; flex-wrap: wrap; }
.jobs.card, .tasks.card { padding: 0; overflow: hidden; }
.job { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.jobs.card .job:first-child, .jobs.flat > .job:first-of-type { border-top: 0; }
.jobs.flat .job { padding-inline: 0; }
.jkind { font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 8px; }
.jobs.flat .jkind + .job { border-top: 0; padding-top: 2px; }
.jobs.flat .jkind:not(:first-child) { border-top: 1px solid var(--line); margin-top: 2px; }
.jstate { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--due); flex: none; display: grid; place-items: center; }
.job.isdone .jstate { background: var(--ok); border-color: var(--ok); color: #fff; }
.jstate .ic { width: 14px; height: 14px; stroke-width: 3; }
.jm { flex: 1; display: grid; gap: 2px; }
.jt { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.jn b { font-weight: 650; }
a.jn:hover b, a.jn:hover { text-decoration: underline; }
.jmeta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 4px; align-items: center; }
.jmeta b { color: var(--ink); }
.jnote { margin: 2px 0 0; font-size: 14px; unicode-bidi: plaintext; }
.ja { display: flex; gap: 6px; align-items: center; flex: none; }
@media (max-width: 520px) { .job { flex-wrap: wrap; } .ja { width: 100%; padding-inline-start: 34px; } .ja .btn.primary { flex: 1; } }
.tag { background: var(--surface); color: var(--muted); }
.hm { display: flex; gap: 10px; }
.hmf { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.hmf input { width: 96px !important; text-align: center; }

.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid transparent; font-size: 13px; font-weight: 650; cursor: pointer; white-space: nowrap; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 13%, var(--raise)); }
.pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.pill .ic { width: 15px; height: 15px; stroke-width: 2.8; }
.pill.s-todo { --c: var(--st-todo); }
.pill.s-doing { --c: var(--st-doing); }
.pill.s-done { --c: var(--st-done); }
.pill.static { cursor: default; min-height: 26px; padding: 0 9px; }
.pill.big { min-height: 48px; padding: 0 16px; font-size: 15px; justify-content: center; }
.pill.cur { border-color: var(--c); box-shadow: 0 0 0 1px var(--c); }
.stpills { display: inline-flex; gap: 6px; }
.stbtns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stbtns.col { grid-template-columns: 1fr; min-width: 200px; }
.trow { display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-top: 1px solid var(--line); min-height: 56px; }
.tasks.card .trow:first-child, .tasks.flat .trow:first-child { border-top: 0; }
.tasks.flat .trow { padding-inline: 0; }
.trow .pill { width: 132px; justify-content: flex-start; }
@media (max-width: 520px) { .trow .pill span { display: none; } .trow .pill { width: auto; padding: 0 10px; } }
.tbody { flex: 1; display: grid; gap: 2px; background: none; border: 0; padding: 4px 0; text-align: start; cursor: pointer; }
.tt { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.trow.s-done .tt { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.tbody small { display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; }
.cnt { color: var(--muted); font-weight: 600; margin-inline-start: 2px; }
.chip.on .cnt { color: inherit; opacity: .75; }
.tdet { white-space: pre-wrap; unicode-bidi: plaintext; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 16px 0 0; }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; }
.kv a { color: var(--brand); font-weight: 600; }
#pop .stbtns { margin: 0; }

/* ---------- areas: eight colors, given by each area's place in the list ---------- */
:root {
  --a0: light-dark(#0f7a6e, #4cc7b6); --a1: light-dark(#2f6b1f, #8bc96f); --a2: light-dark(#2251a3, #7ea6f2); --a3: light-dark(#a8590c, #e9a65a);
  --a4: light-dark(#6a45c2, #a993ef); --a5: light-dark(#a3306a, #ec8bb8); --a6: light-dark(#5b5f14, #c7cc6a); --a7: light-dark(#8a3b1d, #e9937a);
}
.ar, .area, .ahead { --ac: var(--a2); }
.tw { color: var(--muted); font-weight: 400; font-size: 13px; }
.toolbar .lead { display: none; }
.lead-line { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
@media (min-width: 900px) { .toolbar .btn span { display: inline; } .pane.list .toolbar .btn span { display: none; } }
@container (min-width: 520px) { .pane.list .toolbar .btn span { display: inline; } }

/* ---------- stage 3: chat ---------- */
.tabs a { position: relative; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--due); color: #fff; font-size: 12px; font-weight: 700; font-style: normal; }
.tabs .badge { position: absolute; top: 8px; inset-inline-start: calc(50% + 4px); }
@media (min-width: 700px) { .tabs .badge { position: static; } }
.badge[hidden] { display: none; }
[data-tab=chat] .main { overflow: hidden; }
.split.chat { height: 100%; }
.split.chat .pane.list .lhead { padding-bottom: 8px; }
.split.chat .ttl h1 { font-size: 24px; }
.split.chat .ttl { margin-bottom: 10px; }
.crow { display: flex; align-items: center; gap: 12px; padding: 10px max(16px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); min-height: 64px; }
.crow:hover { background: var(--surface); }
.crow.sel { background: var(--brand-soft); }
.crow.hasnew .cmid b { font-weight: 750; }
.crow.hasnew .cmid small { color: var(--ink); }
.cmid { flex: 1; display: grid; gap: 2px; }
.cmid b, .cmid small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.cmid small { color: var(--muted); }
.cend { display: grid; justify-items: end; gap: 4px; flex: none; }
.cend small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.cav { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; }
.cav .ic { width: 18px; height: 18px; }
.stopav { background: color-mix(in srgb, var(--ac) 14%, var(--raise)); color: var(--ac); }
.grpav { background: var(--surface); color: var(--muted); }
.conv { display: flex; flex-direction: column; height: 100%; background: var(--surface); }
@media (max-width: 899px) { .split.chat.has-detail { height: 100%; } .split.chat.has-detail .pane.detail { height: 100%; } }
.chead { display: flex; align-items: center; gap: 10px; padding: 8px max(12px, env(safe-area-inset-left)); background: var(--bg); border-bottom: 1px solid var(--line); min-height: 60px; }
.ctitle { flex: 1; display: grid; }
.ctitle b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.msgs { flex: 1; overflow-y: auto; padding: 12px max(12px, env(safe-area-inset-left)) 16px; display: flex; flex-direction: column; gap: 4px; }
.msgs .empty { margin: auto; }
.dayline { text-align: center; margin: 12px 0 6px; }
.dayline span { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg); padding: 3px 10px; border-radius: 99px; }
.msg { display: grid; justify-items: start; max-width: min(78%, 560px); }
.msg.mine { align-self: flex-end; justify-items: end; }
.who { font-size: 12px; color: var(--muted); margin: 6px 10px 2px; }
.bub { background: var(--raise); border: 1px solid var(--line); border-radius: 16px 16px 16px 6px; padding: 8px 12px 6px; display: grid; gap: 4px; cursor: default; max-width: 100%; }
.msg.mine .bub { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); border-radius: 16px 16px 6px 16px; }
[dir=rtl] .bub { border-radius: 16px 16px 6px 16px; }
[dir=rtl] .msg.mine .bub { border-radius: 16px 16px 16px 6px; }
.bub p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.bub .mt { font-size: 11px; opacity: .7; justify-self: end; }
.bub .muted { color: inherit; opacity: .75; }
.mimg { display: block; width: min(280px, 60vw); max-height: 340px; object-fit: cover; border-radius: 10px; background: var(--surface); cursor: zoom-in; min-height: 120px; }
.mvoice { display: flex; align-items: center; gap: 8px; }
.mvoice audio { height: 40px; max-width: min(260px, 56vw); }
.mvoice small { opacity: .75; }
.composer { display: flex; align-items: flex-end; gap: 4px; padding: 8px max(10px, env(safe-area-inset-left)) calc(8px + 0px); background: var(--bg); border-top: 1px solid var(--line); }
.composer textarea { min-height: 44px; max-height: 140px; resize: none; border-radius: 22px; padding: 11px 16px; flex: 1; }
.composer .iconbtn { height: 44px; color: var(--muted); }
.composer .sendbtn { background: var(--brand); color: var(--brand-ink); border-radius: 50%; width: 44px; }
.rec.on { background: var(--due); color: #fff; border-radius: 22px; }
.rec span:empty { display: none; }
.rec span { font-size: 13px; font-variant-numeric: tabular-nums; }
.subh { font-size: 15px; margin: 14px 0 8px; }
.fullimg { width: 100%; height: auto; border-radius: 12px; display: block; }
.mlist { margin: 0; padding-inline-start: 20px; }

/* ---------- stage 4: reports ---------- */
.btnrow.tight { margin: 0; gap: 8px; }
.rbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 16px; }
.rbar .seg { margin: 0; min-width: 200px; }
.rnav { display: flex; align-items: center; gap: 4px; background: var(--surface); border-radius: 10px; padding: 2px; }
.rnav b { min-width: 170px; text-align: center; font-variant-numeric: tabular-nums; }
.rnav .iconbtn:disabled { opacity: .35; cursor: default; }
.rtiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.rtiles .stat { background: var(--raise); border: 1px solid var(--line); }
.rtiles .stat.big { grid-column: span 2; }
@media (max-width: 520px) { .rtiles .stat.big { grid-column: 1 / -1; } }
.rtiles .stat .bar { margin-top: 6px; }
.card.scroll { padding: 0; overflow-x: auto; }
.rt { width: 100%; border-collapse: collapse; font-size: 14px; }
.rt th, .rt td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.rt th { font-size: 13px; color: var(--muted); font-weight: 600; background: var(--surface); white-space: nowrap; }
.rt td.num, .rt th.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rt .nw { white-space: nowrap; }
.rt tbody tr:last-child td { border-bottom: 0; }
.rt tfoot td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
.rt tr.short td.num b { color: var(--due); }
.rt tr.okrow td.num b { color: var(--ok); }
.rt .loc .ic { width: 18px; height: 18px; }
@media (max-width: 600px) { .rt { font-size: 13px; } .rt th, .rt td { padding: 7px 8px; } .report .ttl { flex-wrap: wrap; } }

/* ---------- design pass: calmer, denser dashboard ---------- */
.pad { padding-top: 14px; }
.hero { padding: 14px 16px; gap: 12px; border-radius: 14px; }
.hero h1 { font-size: 20px; }
.hero-l p { margin: 2px 0 0; font-size: 13px; }
.bigfig { margin: 6px 0 8px; }
.bigfig b { font-size: clamp(32px, 5vw, 40px); }
.bigfig span { font-size: 14px; }
.hero-r { gap: 8px; }
.stat { padding: 8px 12px; border-radius: 10px; }
.stat b { font-size: 19px; }
.stat span { font-size: 12px; line-height: 1.3; }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
  .hero-r { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.sec { margin: 18px 0 8px; font-size: 15px; }
.areas { display: none; }
.arealist { padding: 0; display: grid; overflow: hidden; }
@media (min-width: 760px) { .arealist { grid-template-columns: 1fr 1fr; } .arealist .arow:nth-child(odd) { border-inline-end: 1px solid var(--line); } }
.arow { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.arow:hover { background: var(--surface); }
.adot { width: 10px; height: 10px; border-radius: 3px; background: var(--ac); flex: none; }
.arow .an { font-weight: 600; flex: 1; font-size: 14px; }
.arow .am { color: var(--muted); font-size: 13px; white-space: nowrap; }
.arow .av2 { font-variant-numeric: tabular-nums; font-size: 13px; min-width: 44px; text-align: end; }
.arow .bar { width: 64px; flex: none; height: 5px; }
.bar.ghost { background: transparent; }
.arow .chev { width: 16px; height: 16px; color: var(--muted); }
.pcard .phead { padding: 10px 12px 4px; }
.pmeta { padding: 0 12px 10px 58px; }
.av { width: 32px; height: 32px; font-size: 12px; }

/* ---------- daily hours ---------- */
.hourscard { margin-top: 12px; }
.hstrip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.hday { display: grid; gap: 2px; justify-items: center; padding: 6px 2px; min-height: 52px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.hday small { color: var(--muted); font-size: 12px; }
.hday b { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hday.has b { color: var(--ok); }
.hday.today { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.hday.sel { background: var(--brand-soft); border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.hday:disabled { opacity: .45; cursor: default; }
.hform { margin-top: 10px; }
.hrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hrow .hm { flex: 1; }
.hmf select { width: 84px !important; }
.ht td:first-child { min-width: 130px; }
.hnotes { display: block; color: var(--muted); font-size: 12px; max-width: 320px; white-space: normal; }

/* ---------- sign-in codes ---------- */
.codebox { text-align: center; padding: 18px; margin: 4px 0 14px; border-radius: 14px; background: var(--brand-soft); }
.codebox b { font-size: 40px; letter-spacing: .25em; font-variant-numeric: tabular-nums; color: var(--brand); padding-inline-start: .25em; }
.urow .btn.sm { flex: none; }
.urow .un small + small { margin-top: 1px; }
@media (max-width: 520px) { .urow .btn.sm span { display: none; } }

/* ---------- logo ---------- */
.logoplate { display: inline-grid; place-items: center; background: #fff; border-radius: 8px; padding: 2px 5px; flex: none; box-shadow: 0 0 0 1px var(--line); }
.logoimg { display: block; height: 30px; width: auto; }
.brand.lg { flex-direction: column; align-items: flex-start; gap: 12px; }
.brand.lg .logoplate { padding: 6px 10px; border-radius: 12px; box-shadow: none; }
.brand.lg .logoimg { height: 74px; }
.boot .logoimg { height: 90px; }
.boot .logoplate { padding: 10px 14px; border-radius: 14px; }
@media (max-width: 420px) { .top .brand span:not(.logoplate) { font-size: 15px; } .logoimg { height: 26px; } }

/* ---------- quick "log visit" on stop rows ---------- */
.rowx { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.rowx:last-child { border-bottom: 0; }
.rowx .row { flex: 1; border-bottom: 0; }
.rowx.sel { background: var(--brand-soft); }
.qlog { flex: none; width: 52px; border: 0; border-inline-start: 1px solid var(--line); background: transparent; color: var(--brand); cursor: pointer; display: grid; place-items: center; }
.qlog .ic { width: 22px; height: 22px; stroke-width: 2.6; }
.qlog:hover { background: var(--brand-soft); }
.qlog:active { background: var(--brand); color: var(--brand-ink); }
.qlog.busy { opacity: .45; }
.toast { display: flex; align-items: center; gap: 14px; }
.toast.warn { background: var(--warn); color: #fff; }
.tact { background: transparent; border: 1.5px solid currentColor; color: inherit; border-radius: 8px; min-height: 34px; padding: 0 12px; font-weight: 700; cursor: pointer; flex: none; }

/* ---------- Admin dashboard: the Mashgichim first ---------- */
.mhead { display: grid; gap: 12px; align-items: end; }
@media (min-width: 900px) { .mhead { grid-template-columns: auto minmax(0, 1fr); gap: 24px; } }
.mhead h1 { font-size: 24px; }
.mhead p { margin: 2px 0 0; font-size: 13px; }
.sumstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 600px) { .sumstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sstat { background: var(--surface); border-radius: 10px; padding: 8px 12px; display: grid; gap: 2px; border: 1px solid transparent; }
.sstat b { font-size: 18px; font-variant-numeric: tabular-nums; }
.sstat b small { font-size: 13px; color: var(--muted); }
.sstat span { font-size: 12px; color: var(--muted); }
.sstat.warn b { color: var(--warn); }
a.sstat:hover { border-color: var(--line); }
.sstat .bar { margin-top: 4px; height: 4px; }
.msortbar { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin: 14px 0 8px; }
.msortbar .seg { margin: 0; width: auto; }
.msortbar .seg button { padding: 0 12px; flex: none; }
.mgrid { display: grid; gap: 12px; }
@media (min-width: 760px) { .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.mcard { background: var(--raise); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.mcard.complete { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.mtop { display: flex; align-items: center; gap: 12px; }
.av.lg { width: 44px; height: 44px; font-size: 15px; }
.mname { flex: 1; display: grid; }
.mname b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mfig { text-align: end; font-variant-numeric: tabular-nums; display: grid; line-height: 1.05; }
.mfig b { font-size: 28px; letter-spacing: -0.02em; }
.mfig span { font-size: 15px; color: var(--muted); font-weight: 600; }
.mfig small { font-size: 12px; color: var(--muted); }
.mfig b + span { display: inline; }
.mstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; }
.ms { background: var(--surface); border-radius: 8px; padding: 6px 8px; display: grid; font-size: 12px; color: var(--muted); line-height: 1.25; }
.ms b { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ms.warn b { color: var(--warn); }
.ms.okk b { color: var(--ok); }
.mline { margin: 0; }
.mact { display: flex; gap: 6px; flex-wrap: wrap; }
.mact .btn .ic { width: 18px; height: 18px; }
.mcard .rows.inset { margin: 0 -14px -14px; }

/* ---------- task notes ---------- */
.tnote { display: flex; gap: 5px; align-items: center; color: var(--ink); font-size: 13px; overflow: hidden; }
.tnote .ic { width: 14px; height: 14px; color: var(--st-doing); flex: none; }
.tnote span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.thist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.thist li { display: flex; gap: 10px; align-items: flex-start; }
.thist .pill { min-width: 118px; justify-content: flex-start; }
.thist p { margin: 2px 0 0; white-space: pre-wrap; unicode-bidi: plaintext; }
@media (max-width: 520px) { .mstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- tappable small dots and the visit popover ---------- */
.dots.sm.tap { cursor: pointer; padding: 10px 6px; margin: -10px -6px; border-radius: 8px; }
.dots.sm.tap:hover { background: var(--surface); }
.pvis { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-top: 1px solid var(--line); width: 100%; }
.pvis:first-of-type { border-top: 0; }
.pvis > div { display: grid; gap: 2px; }
.pdot { width: 22px; height: 22px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; flex: none; margin-top: 1px; }
.pdot .ic { width: 14px; height: 14px; stroke-width: 3; }
.popin .btn.sm { margin-top: 4px; }

/* ---------- voice note player ---------- */
.vplayer { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.vplay { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; flex: none; background: var(--brand); color: var(--brand-ink); }
.msg.mine .vplay { background: var(--brand-ink); color: var(--brand); }
.vplay .ic { width: 20px; height: 20px; fill: currentColor; }
.vbar { flex: 1; height: 5px; border-radius: 99px; background: color-mix(in srgb, currentColor 22%, transparent); overflow: hidden; min-width: 90px; }
.vbar i { display: block; height: 100%; width: 0; background: currentColor; border-radius: 99px; transition: width .25s linear; }
.vtime { font-variant-numeric: tabular-nums; min-width: 34px; text-align: end; opacity: .85; }

/* ---------- logo from the vector files: no plate needed ---------- */
.logoplate, .brand.lg .logoplate, .boot .logoplate { background: none; box-shadow: none; padding: 0; border-radius: 0; }
.logoimg { height: 38px; }
.brand.lg .logoimg { height: 96px; }
.boot .logoimg { height: 110px; }
@media (max-width: 420px) { .logoimg { height: 32px; } }

/* ---------- recording bar: record, stop, listen, send ---------- */
.recbar { display: flex; align-items: center; gap: 10px; padding: 8px max(12px, env(safe-area-inset-left)); background: var(--bg); border-top: 1px solid var(--line); min-height: 64px; }
.recbar[hidden] { display: none; }
.conv.recording .composer { display: none; }
.recdot { width: 14px; height: 14px; border-radius: 50%; background: var(--due); flex: none; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.rectime { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 42px; }
.recbar .vbar { color: var(--brand); }
.recbar .btn .ic { width: 18px; height: 18px; }
.recbar .iconbtn { color: var(--due); }

/* ---------- Admin dashboard: Mashgichim collapsed to name + progress line ---------- */
.mgrid { align-items: start; }
.mrow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0 14px; background: var(--raise); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; text-align: start; }
.mrow:hover { background: var(--surface); }
.mrname { font-weight: 650; font-size: 16px; width: 38%; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow .bar { flex: 1; height: 10px; }
.mrow .chev { width: 18px; height: 18px; color: var(--muted); flex: none; }
.mcard.open { grid-column: 1 / -1; }
.mrow.inside { border: 0; padding: 0; min-height: 36px; background: none; }
.mrow.inside:hover { background: none; }
.mtasks .subh { margin: 4px 0 6px; }
.mtasks .tasks.flat .trow { padding-inline: 0; }

/* =====================================================================
   NAVY AND GOLD — the app's look (chosen Dec 2026)
   VOICE   formal and calm, like a kashrus certificate
   COLOUR  ivory page, white cards with fine warm lines, navy ink and
           header, gold for details and progress; red/green only for visits
   TYPE    Cormorant Garamond for titles and figures, Inter for everything else
   ===================================================================== */
:root {
  --navy: #14213d; --navy-2: #1d2d52; --gold: #b8955a; --gold-soft: light-dark(#f5eedf, #2a2a26);
  --bg: light-dark(#fbfaf7, #0c1322);
  --surface: light-dark(#f3f0e9, #121b2e);
  --raise: light-dark(#ffffff, #16213a);
  --line: light-dark(#e6e1d6, #26324d);
  --ink: light-dark(#14213d, #eceef4);
  --muted: light-dark(#6b7180, #9aa3b5);
  --brand: light-dark(#14213d, #d4b277);
  --brand-ink: light-dark(#ffffff, #0c1322);
  --brand-soft: light-dark(#eef0f5, #1b2640);
  --ok: light-dark(#2e7d4f, #5cbf85);
  --due: light-dark(#b8433a, #e5766c);
  --warn: light-dark(#a8661b, #e0a95a);
  --warn-soft: light-dark(#f7ecda, #2c2416);
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
}
body { background: var(--bg); }
h1, .sec, .hero h1, .mhead h1, .ttl h1, .dtitle h1, .shead h2, .lcard h2, .empty.big h1, .ahead h1 { font-family: var(--serif); font-weight: 600; letter-spacing: 0; }
h1 { font-size: clamp(26px, 3.4vw, 32px); }
.sec { font-size: 21px; margin: 22px 0 10px; color: var(--ink); }
.sec .muted { font-family: Inter, system-ui, sans-serif; font-size: 13px; font-weight: 500; }
.shead h2 { font-size: 22px; }

/* header: a navy band with the white logo and a gold rule */
.top { background: var(--navy); color: #fff; border-bottom: 2px solid var(--gold); padding-block: 10px; }
.top .brand span:not(.logoplate) { font-family: var(--serif); font-size: 20px; font-weight: 600; color: #fff; }
.top .logoimg { height: 40px; }
.top .wk { color: #c9cfdc; }
.top .wk b { color: #fff; }
.top .av { background: var(--gold); color: var(--navy); }
.demobar { background: var(--gold-soft); color: var(--ink); border-bottom: 1px solid var(--line); }

/* bottom tabs: quiet, with a gold mark over the open tab */
.tabs { background: var(--raise); border-top: 1px solid var(--line); }
.tabs a { position: relative; color: var(--muted); }
.tabs a.on { color: var(--ink); }
.tabs a.on::before { content: ""; position: absolute; top: -1px; left: 28%; right: 28%; height: 3px; background: var(--gold); border-radius: 0 0 3px 3px; }

/* cards: white, fine warm line, no shadow */
.card, .pcard, .mcard, .mrow, .lcard, .area, .tile, .stat, .sstat, .ms, .hday, .rtiles .stat { border-color: var(--line); }
.card, .mcard, .mrow, .lcard { background: var(--raise); border-radius: 10px; }
.hero { background: var(--raise); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: 0 0 10px 10px; }
.stat, .sstat, .ms { background: var(--bg); border: 1px solid var(--line); }
.bigfig b, .mfig b, .stat b, .sstat b, .ms b, .codebox b, .rtiles .stat b { font-family: var(--serif); font-weight: 600; }
.bigfig b { font-size: clamp(44px, 6vw, 56px); }
.mfig b { font-size: 34px; }
.stat b, .sstat b { font-size: 24px; }
.ms b { font-size: 20px; }
.stat b small, .sstat b small { font-family: Inter, system-ui, sans-serif; }

/* progress: soft red track, green done */
.bar { background: color-mix(in srgb, var(--due) 22%, var(--raise)); }
.bar i { background: var(--ok); }
.mrow .bar { height: 8px; }
.mrname { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.mcard.complete { border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); }

/* buttons and controls */
.btn { border-radius: 8px; border-color: var(--line); background: var(--raise); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: none; background: light-dark(var(--navy-2), #e0c18a); }
.chip { border-color: var(--line); background: var(--raise); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme=dark] .chip.on { background: var(--gold); border-color: var(--gold); color: var(--navy); }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .chip.on { background: var(--gold); border-color: var(--gold); color: var(--navy); } }
.seg { background: var(--surface); }
.seg .on { box-shadow: 0 0 0 1px var(--line); }
.link, .backlink, .kv a, .cphone { color: var(--brand); }
.av { background: var(--gold-soft); color: light-dark(#7a5c26, #e3c690); }
.row.sel, .crow.sel, .rowx.sel { background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold); }
.tile.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.pane.detail { background: var(--bg); }
.pane.list .lhead { background: var(--raise); }
.toast { background: var(--navy); color: #fff; border: 1px solid var(--gold); }
.qlog { color: var(--brand); }
.qlog:active { background: var(--navy); color: #fff; }
.hday.sel { background: var(--gold-soft); border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.hday.today { border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); }
.rt th { background: var(--surface); color: var(--muted); }
.ar { font-weight: 600; }

/* sign-in and setup: navy page, white card */
.login { background: var(--navy); }
.login .lcard { border: 0; border-top: 3px solid var(--gold); border-radius: 4px 4px 12px 12px; }
.login .lcard .brand.lg span:not(.logoplate) { font-family: var(--serif); font-size: 26px; font-weight: 600; }
.boot { background: var(--navy); }

/* chat */
.msg.mine .bub { background: var(--navy); border-color: var(--navy); color: #fff; }
.msg.mine .vplay { background: #fff; color: var(--navy); }
:root[data-theme=dark] .msg.mine .bub { background: #24345c; border-color: #24345c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .msg.mine .bub { background: #24345c; border-color: #24345c; } }
.composer .sendbtn, .vplay { background: var(--brand); color: var(--brand-ink); }
.conv { background: var(--bg); }

/* Mashgiach dashboard: tasks and jobs side by side under the hours */
.myside { display: block; }
.sec .link, .sec a { font-family: Inter, system-ui, sans-serif; font-size: 13px; font-weight: 600; }
.hday { border-radius: 8px !important; }
.golink { margin-top: 18px; }

/* replies: the quoted message inside a bubble, and the bar above the typing box */
.quote { display: block; border-left: 3px solid var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); border-radius: 6px; padding: 5px 9px; margin-bottom: 6px; font-size: 13px; line-height: 1.35; cursor: pointer; max-width: 100%; }
.quote b { display: block; font-size: 12px; color: light-dark(#7a5c26, #e3c690); }
.quote span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.msg.mine .quote { background: rgba(255,255,255,.12); border-left-color: var(--gold); }
.msg.mine .quote b { color: #e3c690; }
.msg.mine .quote span { color: #e6e9f0; }
.replybar { display: flex; align-items: center; gap: 8px; padding: 8px 10px 0; background: var(--raise); border-top: 1px solid var(--line); }
.replybar .quote { flex: 1; margin: 0; cursor: default; }
.msg.flash .bub { animation: qflash 1.4s ease; }
@keyframes qflash { 0%, 40% { box-shadow: 0 0 0 3px var(--gold); } 100% { box-shadow: 0 0 0 0 transparent; } }
.popin .btn svg { width: 16px; height: 16px; }

.vplayer small { line-height: 1.35; }
.vcode { opacity: .7; font-size: 11px; }
.msg.mine .vplayer .link, .msg.mine .bub .link { color: #e3c690; text-decoration: underline; }

/* read receipts */
.bub .mt { display: inline-flex; align-items: center; gap: 2px; }
.tick { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.tick.all { color: var(--gold); opacity: 1; }
.msg.mine .tick.all { color: #e3c690; }
.readinfo { display: grid; gap: 3px; margin: 6px 0 2px; font-size: 13px; min-width: 180px; }
.readinfo b { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 4px; }

/* no signal bar, notification card, waiting visits */
.offbar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--warn-soft); color: var(--ink); border-bottom: 1px solid var(--line); font-size: 13px; }
.offbar svg { width: 18px; height: 18px; flex: none; color: var(--warn); }
.offbar span { flex: 1; }
.notifcard { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--raise); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.notifcard > svg { width: 24px; height: 24px; color: var(--gold); flex: none; }
.notifcard > div:first-of-type { flex: 1; min-width: 200px; }
.notifcard p { margin: 2px 0 0; }
.dot.pend { background: transparent !important; box-shadow: inset 0 0 0 2px var(--ok); }
.bklist { margin: 8px 0 10px; border: 1px solid var(--line); border-radius: 8px; }
.bklist .row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: var(--ink); text-decoration: none; }
.bklist .row + .row { border-top: 1px solid var(--line); }
.bklist svg { width: 18px; height: 18px; color: var(--brand); }

/* voice note speed: 1× / 1.5× / 2× */
.vspeed { flex: none; min-width: 40px; height: 28px; padding: 0 8px; border-radius: 99px; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); background: transparent; color: inherit; font: 600 12px/1 Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; cursor: pointer; }
.vspeed.fast { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.vplayer { min-width: 250px; }

/* ---------- the Admin's Stops list: grouped by area ---------- */
.fbtn { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.fbtn.on { border-color: var(--gold); }
.fcount { font-style: normal; background: var(--gold); color: var(--navy); border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.seg.modes { margin-top: 10px; }
.seg.modes button { flex: 1; border: 0; background: transparent; font: inherit; color: var(--muted); padding: 7px 4px; border-radius: 6px; cursor: pointer; }
.seg.modes button.on { background: var(--raise); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.fchip { display: inline-flex; align-items: center; gap: 4px; }
.fchip svg { width: 14px; height: 14px; }
.fsheet h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 6px 0 8px; font-weight: 600; }
.wrapchips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.agroup { margin: 0 10px 6px; }
.ahead { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; color: var(--ink); font: inherit; text-align: start; padding: 12px 4px 8px; cursor: pointer; }
.ahead .aname { flex: 1; min-width: 0; }
.ahead .aname b { display: block; font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.1; }
.ahead .aname small { color: var(--muted); font-size: 12px; }
.ahead .chev { width: 18px; height: 18px; color: var(--muted); transition: transform .15s; transform: rotate(-90deg); }
.ahead.open .chev { transform: none; }
.apc, .pc { display: grid; justify-items: end; gap: 3px; font-variant-numeric: tabular-nums; }
.apc b { font-size: 13px; }
.apc i, .pc i { display: block; width: 64px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--due) 22%, var(--raise)); overflow: hidden; }
.pc i { width: 46px; }
.apc u, .pc u { display: block; height: 100%; background: var(--ok); text-decoration: none; }
.apc.ok b, .pc.ok b { color: var(--ok); }
.pc.due b { color: var(--due); }
.pc b { font-size: 12.5px; }
.acard { padding: 0; overflow: hidden; }
.arow { display: flex; align-items: center; gap: 10px; padding: 9px 14px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.arow:last-child { border-bottom: 0; }
.arow:hover { background: var(--surface); }
.arow.sel { background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold); }
.arow .nm { flex: 1; min-width: 0; }
.arow .nm b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arow .nm small { display: flex; align-items: center; gap: 3px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.arow.other .nm b { font-weight: 500; }
.ini { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--gold-soft); color: light-dark(#7a5c26, #e3c690); font-size: 9.5px; font-weight: 700; flex: none; }
.ini:last-of-type { margin-right: 4px; }
.fold { display: flex; justify-content: space-between; width: 100%; border: 0; border-top: 1px solid var(--line); background: var(--bg); color: var(--muted); font: inherit; font-size: 13px; padding: 11px 14px; cursor: pointer; }
.arow + .fold:first-child, .acard > .fold:first-child { border-top: 0; }
.fold:hover { color: var(--ink); }

/* assign stops to a Mashgiach (dashboard) */
@media (min-width: 700px) { .sheet.wide { width: min(720px, 94vw); } }
.ashead { position: sticky; top: -6px; z-index: 2; background: var(--raise); padding: 4px 0 8px; }
.ashead .search { width: 100%; }
.ckline { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 6px; }
.asarea { font-family: var(--serif); font-size: 19px; font-weight: 600; margin: 14px 2px 6px; }
.asarea small { font-family: Inter, system-ui, sans-serif; font-size: 12px; font-weight: 500; }
.aslist { padding: 0; overflow: hidden; }
.asrow { display: flex; align-items: center; gap: 10px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.asrow:last-child { border-bottom: 0; }
.asrow.on { background: var(--gold-soft); }
.asrow > label:first-child { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 0; cursor: pointer; }
.asrow input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--navy); flex: none; }
.asrow .nm { min-width: 0; }
.asrow .nm b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asrow .nm small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asw { display: flex; align-items: center; gap: 5px; flex: none; }
.asw select { padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--raise); color: var(--ink); font: inherit; }
.asw small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.asfoot { position: sticky; bottom: -18px; display: flex; align-items: center; gap: 8px; background: var(--raise); border-top: 1px solid var(--line); padding: 12px 0 16px; margin-top: 12px; z-index: 2; }
.asfoot span { flex: 1; font-weight: 600; font-size: 14px; }

/* stop notes save by themselves; each Mashgiach's visits a week on a stop */
.nsave { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.who .stepper.sm { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; }
.who .stepper.sm b { min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.who .stepper.sm small { font-size: 11px; }

/* a Mashgiach's Stops list: same rows as the Admin's, with the one-tap log button */
.mlist { margin: 0 10px 10px; }
.mrowx { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.mrowx:last-child { border-bottom: 0; }
.mrowx .arow { flex: 1; min-width: 0; border-bottom: 0; }
.mrowx .qlog { flex: none; width: 52px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--brand); display: grid; place-items: center; cursor: pointer; }
.mrowx .qlog svg { width: 20px; height: 20px; }
.mrowx.sel { background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold); }

/* backups with restore */
.bklist .row { gap: 8px; }
.bklist .row .grow { display: grid; }
.bklist .row .grow b { font-weight: 600; font-size: 14px; }
.bklist .row .btn.sm { padding: 6px 10px; }

/* notes on a stop: each note its own box */
.notes { display: grid; gap: 8px; margin-bottom: 12px; }
.note { border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 8px; padding: 9px 12px; background: var(--bg); }
.note p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.nmeta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.nmeta .iconbtn svg { width: 16px; height: 16px; }
.noteform { display: grid; gap: 8px; }
.noteform .btn { justify-self: start; }

.movedbar { background: var(--gold-soft); }
.movedbar svg { color: var(--gold); }
.movedbar .btn { flex: none; }
