@font-face { font-family: "Nunito Sans"; font-style: normal; font-weight: 200 900; font-display: swap; src: url("/fonts/nunito-sans-latin.woff2") format("woff2"); }
:root {
  --bg: #f7f7f8; --card: #fff; --ink: #111214; --muted: #5a5d63; --line: #dcdde0; --brand: #111214; --brand-ink: #fff;
  --ok: #15803d; --ok-bg: #dcfce7; --no: #b45309; --no-bg: #fef3c7; --bad: #b91c1c; --bad-bg: #fee2e2;
  --blue: #1d4ed8; --blue-bg: #dbeafe; --violet: #4338ca; --violet-bg: #e0e7ff; --grey-bg: #f3f4f6;
  --radius: 10px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f11; --card: #17181b; --ink: #ececee; --muted: #b7bac0; --line: #2c2e33; --brand: #ececee; --brand-ink: #111214;
    --ok: #4ade80; --ok-bg: #12351f; --no: #fbbf24; --no-bg: #3a2a07; --bad: #f87171; --bad-bg: #3b1212;
    --blue: #93c5fd; --blue-bg: #172554; --violet: #a5b4fc; --violet-bg: #1e1b4b; --grey-bg: #22272d; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* a styled button with hidden on it stays hidden (Analysis, Website for admins only) */
html, body { margin: 0; }
body { font: 15px/1.45 "Nunito Sans", "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; }
h2 { font-size: 1.35rem; } h3 { font-size: .95rem; margin-top: 1.2em; }
a { color: var(--brand); }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.error { color: var(--bad); }
.warn { background: var(--no-bg); color: var(--no); padding: .5em .75em; border-radius: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-height: 38px; padding: .4em .9em; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); border-radius: 8px; font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--muted); background: color-mix(in srgb, var(--ink) 3%, var(--card)); }
.btn.primary:hover { background: color-mix(in srgb, var(--brand) 88%, var(--bg)); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
/* A press shows at once, and a button whose save is on its way says so and cannot be pressed twice (2026-10-31). */
button { transition: transform .06s ease; }
button:active:not(:disabled) { transform: translateY(1px) scale(.98); }
[aria-busy="true"] { opacity: .65; pointer-events: none; cursor: progress; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn.wide { width: 100%; }
.btn.call { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; font-size: 1.05rem; min-height: 46px; }
.linkish { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; }
.linkish.danger { color: var(--bad); }
input, select, textarea { font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .5em .65em; min-height: 38px; }
textarea { width: 100%; resize: vertical; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
label { display: block; }

/* login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 28px; width: min(380px, 100%); }
.login-card h1 { font-size: 1.25rem; margin-top: .6em; }
.login-card label { margin: .8em 0; font-weight: 600; font-size: .9rem; }
.login-card input { width: 100%; margin-top: .3em; font-weight: 400; }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.progress { display: flex; align-items: center; gap: 14px; flex: 1; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.progress strong { color: var(--ink); }
.progress progress { width: 140px; height: 8px; accent-color: var(--brand); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.menu { position: relative; }
.menu summary { list-style: none; } .menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px; min-width: 200px; box-shadow: 0 8px 24px rgb(0 0 0 / .12); }
.menu-list button, .menu-list a { display: block; text-decoration: none; box-sizing: border-box; width: 100%; text-align: left; background: none; border: 0; padding: .55em .7em; border-radius: 6px; font: inherit; color: inherit; cursor: pointer; }
.menu-list button:hover, .menu-list a:hover { background: var(--grey-bg); }

/* filters */
.filters { padding: 12px 16px 4px; display: grid; gap: 8px; }
.filters .row { display: flex; gap: 8px; flex-wrap: wrap; }
#search { flex: 1 1 260px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: .3em .8em; font: inherit; font-size: .88rem; cursor: pointer; min-height: 32px; }
.chip b { font-weight: 600; color: var(--muted); margin-left: .2em; }
.chip.on { background: var(--ink); color: var(--card); border-color: var(--ink); }
.chip.on b { color: inherit; opacity: .75; }
.chip.clear { border-style: dashed; color: var(--muted); }
#type-filter { border-radius: 999px; min-height: 32px; padding: .2em .7em; font-size: .88rem; }

/* layout */
.layout { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 16px; padding: 8px 16px 32px; align-items: start; }
.list-count { margin: 0 0 6px; color: var(--muted); font-size: .85rem; }
#people { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: calc(100vh - 230px); overflow: auto; padding-right: 2px; }
#people .none { padding: 24px; text-align: center; color: var(--muted); background: var(--card); border-radius: var(--radius); }
.person { width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; font: inherit; color: inherit; cursor: pointer; display: grid; gap: 3px; }
.person:hover { border-color: var(--muted); }
.person.sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.p-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.p-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-mid { font-size: .85rem; color: var(--muted); }
.p-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: .75rem; padding: .1em .5em; border-radius: 5px; background: var(--grey-bg); color: var(--muted); }
.tag.appt { background: var(--blue-bg); color: var(--blue); }
.tag.repeat { background: var(--violet-bg); color: var(--violet); }
.tag.fam { background: var(--ok-bg); color: var(--ok); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.oncall { background: var(--no-bg); color: var(--no); }
.pill { font-size: .78rem; padding: .15em .6em; border-radius: 999px; white-space: nowrap; background: var(--grey-bg); color: var(--muted); font-weight: 600; }
.pill.s-to_call { background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.pill.s-no_answer { background: var(--no-bg); color: var(--no); }
.pill.s-callback { background: var(--blue-bg); color: var(--blue); }
.pill.s-callback.due { outline: 2px solid var(--blue); }
.pill.s-spoke { background: var(--violet-bg); color: var(--violet); }
.pill.s-booked { background: var(--ok-bg); color: var(--ok); }
.pill.s-wrong_number { background: var(--bad-bg); color: var(--bad); }

/* detail */
.detail { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; }
.detail.empty { display: grid; place-items: center; gap: 10px; min-height: 260px; text-align: center; color: var(--muted); }
.detail.empty[hidden], .detail[hidden] { display: none; }
.back { display: none; margin-bottom: 12px; }
.d-head h2 { margin-bottom: .3em; }
.contact { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 16px; margin: 0; }
.facts dt { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.facts dd { margin: 0; word-break: break-word; }
.family ul { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; }
.msgs blockquote { margin: 0 0 8px; padding: 10px 12px; background: var(--grey-bg); border-radius: 8px; }
.msgs blockquote p { margin: .3em 0 0; white-space: pre-wrap; }
.log { margin-top: 18px; padding-top: 4px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.big-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn.big { min-height: 56px; font-size: 1.05rem; font-weight: 600; }
.btn.big.ok.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.big.no.on { background: var(--no); border-color: var(--no); color: #fff; }
.outs { display: flex; flex-wrap: wrap; gap: 6px; }
.outs .chip { font-size: .95rem; min-height: 38px; }
.cb input { display: block; margin-top: .3em; }
.note { font-weight: 600; font-size: .9rem; } .note textarea { margin-top: .3em; font-weight: 400; }
.also { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.also label { display: inline-flex; gap: .4em; margin-right: 14px; align-items: center; }
.save-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.other { display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; }
.history ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.history li { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; }
.h-top { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.history p { margin: .2em 0 0; white-space: pre-wrap; }

/* dialogs */
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 24px; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgb(0 0 0 / .4); }
.x { position: absolute; right: 12px; top: 8px; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--muted); }
#dlg-body { position: relative; }
.file input { display: block; margin-top: .4em; }
.map { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 14px; }
.map label span { display: block; font-size: .82rem; color: var(--muted); }
.map select { width: 100%; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--grey-bg); }
.sum { font-size: 1rem; }
.radio { border: 0; padding: 0; margin: 0 0 12px; }
.radio legend { font-weight: 600; margin-bottom: 4px; }
.radio label, .inline { display: flex; gap: .5em; align-items: center; margin: 4px 0; }
.stack { display: grid; gap: 10px; }
.stack label input { display: block; width: 100%; margin-top: .3em; }
.stack .inline input { width: auto; display: inline; margin: 0; }
.users { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.users li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 10px; background: var(--grey-bg); border-radius: 8px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--card); padding: 10px 16px; border-radius: 10px; z-index: 20; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgb(0 0 0 / .2); }
.toast.bad { background: var(--bad); color: #fff; }

/* phone: the list, then one person at a time */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .p-top { flex-wrap: wrap; row-gap: 4px; }
  #people { max-height: none; }
  .detail { position: static; max-height: none; }
  .detail.empty { display: none; }
  body.showing .list, body.showing .filters { display: none; }
  .back { display: inline-flex; }
  .progress progress { width: 90px; }
  .top { gap: 8px; }
  .progress { order: 3; flex-basis: 100%; gap: 10px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .chips > * { flex: none; }
  #sort { flex: 1 1 100%; }
}

/* the top bar's page links, as in Mstario */
.top .btn { border-radius: 10px; font-weight: 600; }
.brand strong { font-weight: 800; }
.person { border-radius: 12px; }
.detail { border-radius: 16px; }

/* try again later (lib/retry.mjs), not interested, no more calls */
.pill.timer { background: var(--card); border: 1px dashed var(--line); color: var(--muted); margin-left: 4px; }
.pill.timer.due { border: 1px solid var(--ink); color: var(--ink); }
.pill.rested { background: var(--grey-bg); color: var(--muted); margin-left: 4px; text-decoration: line-through; text-decoration-thickness: 1px; }
.pills { display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.pills .pill { margin-left: 0; }
p.stop { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--bad-bg); color: var(--bad); font-weight: 600; }
p.stop.small { margin: 0; font-weight: 500; }
div.next { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line); display: grid; gap: 4px; }
div.next.due { border: 1px solid var(--ink); }
div.next strong { font-size: 1rem; }
div.next span { font-size: .9rem; }
div.next .last-note { background: var(--grey-bg); padding: 6px 10px; border-radius: 8px; }
div.next .last-note q { font-style: italic; }
div.next .why { font-size: .8rem; color: var(--muted); }
.cb .muted.small { display: block; margin-top: .3em; font-weight: 400; }
.cb-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; }
.cb-row > label { display: block; }
.wait-tick { display: inline-flex !important; gap: 8px; align-items: center; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; cursor: pointer; }
.wait-tick:has(input:checked) { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, var(--card)); }
.wait-tick input { width: 18px; height: 18px; accent-color: var(--ink); margin: 0; }
.since { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 4px; font-weight: 600; font-size: .9rem; }
.since .muted { font-weight: 400; }
.imports { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; }
.imports li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.exp-status { display: flex; flex-wrap: wrap; gap: 2px 16px; padding-left: 1.6em; }
fieldset { border: 0; padding: 0; margin: 0 0 12px; }
fieldset legend { font-weight: 600; margin-bottom: 4px; }
fieldset .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 900px) {
  .top-actions { flex-wrap: wrap; width: 100%; }
  .top-actions .btn { min-height: 34px; padding: .3em .7em; font-size: .9rem; }
  .menu-list { right: auto; left: 0; }
}
/* who made the call: round initials, as in the history (2026-10-28) */
.av { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--card); font: 800 .66rem/1 "Nunito Sans", system-ui, sans-serif; letter-spacing: .02em; flex: none; }
.av.from-note { background: var(--card); color: var(--ink); border: 1.5px dashed var(--ink); }
.av.none { background: transparent; border: 1.5px solid var(--line); }
.history .h-top { align-items: center; }
.who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: .9rem; }
.av-btn { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: 800 .85rem "Nunito Sans", system-ui, sans-serif; cursor: pointer; }
.av-btn:hover { border-color: var(--ink); }
.av-btn.on { background: var(--ink); color: var(--card); border-color: var(--ink); }
.pill.rang { background: var(--ink); color: var(--card); margin-left: 4px; }
.history.logs li { border-left-style: dotted; }
.history.logs li.missed strong { color: var(--bad); }
.history.logs .dir { font-weight: 800; width: 1.1em; display: inline-block; text-align: center; }
.callers { display: grid; gap: 6px; }
.caller-row { display: flex; gap: 8px; align-items: center; }
.caller-row input[name=id] { width: 64px; text-transform: uppercase; font-weight: 700; }
.caller-row input[name=cname] { flex: 1; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.kinds label { font-weight: 600; }
.auto-pick { display: block; margin-top: 6px; font-weight: 500; font-size: .85rem; color: var(--ink); background: var(--grey-bg); padding: 6px 10px; border-radius: 8px; }

/* One scroll per column on a computer (2026-10-28, Ahmed: no double scrolling): the page stays put with the top bar and
   filters in view; the list and the person each scroll on their own. Phones keep one normal page scroll. */
@media (min-width: 901px) {
  html, body { height: 100%; overflow: hidden; }
  body { display: flex; flex-direction: column; }
  .top { position: static; }
  .layout { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; padding-bottom: 16px; }
  .list { display: flex; flex-direction: column; min-height: 0; }
  #people { max-height: none; flex: 1; min-height: 0; }
  .detail { position: static; max-height: none; height: 100%; }
  .detail.empty { height: auto; align-self: start; }
}

/* the person: name and Call on one line, the prompt, then Log this call without scrolling (2026-10-28, Ahmed) */
.d-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.d-head .contact { margin: 0; }
.d-head h2 { margin-bottom: .25em; }
div.next { margin-top: 10px; padding: 9px 12px; gap: 3px; }
div.next span { font-size: .85rem; }
div.next .last-note { padding: 4px 8px; }
.log { margin-top: 12px; gap: 10px; }
.log h3 { margin: 4px 0 0; }
.btn.big { min-height: 48px; }
.facts { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.save-row .who { margin-right: 6px; }
.av-btn { width: 40px; height: 40px; }
.cb-row > label { display: flex; align-items: center; gap: 8px; }
.cb-row > label input { margin-top: 0; }
.cb-row .muted.small { display: inline; margin: 0; }
.why-i { cursor: help; }
.note textarea { margin-top: .2em; }
.log { gap: 8px; }
div.next .last-note { margin-top: 2px; }
.msgs { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.msgs + .facts { margin-top: 12px; padding-top: 0; border-top: 0; }
#people { align-content: start; }   /* a short list sits at the top instead of spreading over the column */

/* callers with no form, how they found us (2026-10-29) */
.tag.phone { background: var(--ink); color: var(--card); }
.tag.newp { background: var(--ok-bg); color: var(--ok); }
.tag.found { background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.marks { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: .88rem; }
.marks .found { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.marks .found > span { color: var(--muted); margin-right: 2px; }
.chip.small { min-height: 28px; padding: .15em .65em; font-size: .8rem; }
.mark-name { display: inline-flex !important; gap: 6px; align-items: center; font-weight: 600; }
.mark-name input { min-height: 32px; padding: .25em .5em; width: 200px; }
.mark-wide input { width: 320px; max-width: 60vw; }
.marks .inline { margin: 0; }
.marks { gap: 6px 14px; padding: 8px 12px; }
.marks .found { flex-basis: 100%; }

/* VoiceStack sync line in the top bar, and VoiceStack's summary of a call under Call logs */
.sync.bad { color: var(--bad); font-weight: 700; }
.said summary { cursor: pointer; color: var(--muted); }
.said p { margin: 4px 0 0; }
/* icon colours for who makes the calls, picked under Settings (also in site.css); white initials read on each */
.c-ink { --c: #111214; } .c-blue { --c: #2b5fb8; } .c-green { --c: #236349; } .c-plum { --c: #6b3fa0; }
.c-amber { --c: #8a5a12; } .c-red { --c: #ae334d; } .c-teal { --c: #1f6f78; }
@media (prefers-color-scheme: dark) { .c-ink { --c: #3a3c42; } }
.av[class*=" c-"]:not(.from-note) { background: var(--c); color: #fff; }
.av.from-note[class*=" c-"] { border-color: var(--c); color: var(--c); }
.av-btn[class*=" c-"] { border-color: var(--c); color: var(--c); }
.av-btn.on[class*=" c-"] { background: var(--c); color: #fff; border-color: var(--c); }
dialog.wide { width: min(1180px, calc(100vw - 32px)); }
.em-wrap { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 20px; margin-top: 12px; align-items: start; }
.em-form { display: grid; gap: 10px; }
.em-form label, .em-call { display: grid; gap: 4px; }
.em-form [hidden] { display: none; }
.em-form textarea { font: inherit; line-height: 1.45; resize: vertical; }
.em-call .btn { justify-self: start; }
.em-preview { display: grid; gap: 8px; min-width: 0; }
.em-subject { margin: 0; }
#em-frame { width: 100%; height: min(62vh, 640px); border: 1px solid var(--line); border-radius: 10px; background: #f5f5f5; }
.em-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 860px) { .em-wrap { grid-template-columns: minmax(0, 1fr); } #em-frame { height: 70vh; } }
#people .loading { list-style: none; padding: 24px 16px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
#people .loading.bad { color: var(--ink); }
/* Filters: one button and a panel instead of two rows of buttons (2026-10-30, Ahmed: "less clunky") */
.filt-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.filt-btn b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: var(--card); font-size: .75rem; display: inline-grid; place-items: center; }
#status-chips { flex-wrap: wrap; gap: 6px; }   /* all the statuses in view, no sideways swiping (Ahmed) */
#status-chips > * { flex: none; }
/* on phones the statuses are tiles, 5 by 2, so they all fit with no swiping: the number on top, the name under it */
@media (max-width: 900px) {
  #status-chips { display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; overflow: visible !important; padding: 0; }
  #status-chips .chip { display: flex; flex-direction: column-reverse; align-items: center; justify-content: center; gap: 1px; min-height: 48px; padding: 4px 2px; border-radius: 10px; font-size: .68rem; line-height: 1.15; text-align: center; white-space: normal; overflow-wrap: anywhere; }
  #status-chips .chip b { margin: 0; font-size: .95rem; color: inherit; }
  #status-chips .chip:not(.on) b { color: var(--ink); }
}
.on-pill { background: var(--ink); color: var(--card); border-color: var(--ink); }
.on-pill span { opacity: .7; margin-left: 2px; }
dialog.filt-dlg { width: min(520px, calc(100vw - 24px)); padding: 20px; display: none; gap: 14px; }
dialog.filt-dlg[open] { display: grid; }
.filt-head { display: flex; align-items: center; justify-content: space-between; }
.filt-head h2 { margin: 0; }
.filt-head .x { position: static; }
.filt-field { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
.filt-field select { font-weight: 400; min-height: 40px; }
#type-filter { border-radius: 8px; min-height: 40px; font-size: 1rem; }
.filt-sub { margin: 4px 0 -6px; font-weight: 600; font-size: .9rem; }
.filt-flags { flex-wrap: wrap; }
.filt-flags .chip { min-height: 38px; }
.filt-foot { display: flex; justify-content: space-between; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.filt-foot .btn { min-height: 42px; }
.filt-foot .primary { flex: 1; }
@media (max-width: 900px) {
  dialog.filt-dlg { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 16px 16px 0 0; max-height: 85vh; overflow: auto; }
  #search { flex: 1 1 0; min-width: 0; }
}
/* One scroll at a time and pop-ups on top (2026-10-30, Ahmed: "I hate double scrolling", "any pop up always on top",
   "fix viewport"). The page under an open pop-up stays still; a pop-up scrolls on its own and never drags the page;
   heights follow the screen you can actually see, address bar and keyboard included. */
.toast[popover] { inset: auto auto 20px 50%; margin: 0; border: 0; }
body:has(dialog[open]) { overflow: hidden; }
dialog { max-height: calc(100dvh - 32px); overscroll-behavior: contain; }
#people, .detail { overscroll-behavior: contain; }
@media (max-width: 900px) {
  #dlg { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0; padding: 18px 16px 24px; }
  dialog.filt-dlg { max-height: 85dvh; }
  #em-frame { height: auto; }
}
#em-frame { height: 400px; overflow: hidden; }
@media (min-width: 861px) { .em-form { position: sticky; top: 0; } }
/* VoiceStack's AI on calls, and the Call review (2026-10-30) */
.tag.hot { background: var(--no-bg); color: var(--no); font-weight: 600; }
.tag.mood.ok { background: var(--ok-bg); color: var(--ok); }
.tag.mood.bad { background: var(--bad-bg); color: var(--bad); }
.ai-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }
.rv-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.rv-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 6px; justify-items: center; text-align: center; }
.rv-card strong { font-size: 1.15rem; }
.rv-ok { color: var(--ok); } .rv-par { color: var(--no); } .rv-bad { color: var(--bad); }
.rv-bar { width: 100px; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.rv-bar span { display: block; height: 100%; width: var(--w); background: currentColor; }
.rv-bar.ok { color: var(--ok); } .rv-bar.par { color: var(--no); } .rv-bar.bad { color: var(--bad); }
.rv-next { background: var(--grey-bg); border-radius: 12px; padding: 10px 14px; margin: 8px 0; }
.rv-next h3 { margin: 0 0 4px; font-size: .95rem; }
.rv-next ul { margin: 0; padding-left: 18px; }
.rv-parts { display: grid; gap: 6px; margin: 6px 0 12px; }
.rv-parts details { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.rv-parts summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 600; }
.rv-parts p { margin: 8px 0 2px; }
.rv-chip { font-size: .75rem; font-weight: 600; padding: .1em .6em; border-radius: 999px; border: 1px solid currentColor; }
.rv-chip.ok { color: var(--ok); } .rv-chip.par { color: var(--no); } .rv-chip.bad { color: var(--bad); }
.rv-script summary { cursor: pointer; font-weight: 600; margin: 6px 0; }
.rv-script ol { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.rv-script li { max-width: 85%; padding: 8px 12px; border-radius: 12px; background: var(--grey-bg); }
.rv-script li.rc { justify-self: end; background: var(--blue-bg); }
.rv-script li p { margin: 2px 0 0; }
.rv-bar span { width: 0; } .rv-bar.ok span { width: 100%; } .rv-bar.par span { width: 60%; } .rv-bar.bad span { width: 25%; }
.rv-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 16px; margin: 4px 0 12px; }
.rv-facts div { display: grid; gap: 2px; }
.rv-facts dt { font-size: .78rem; color: var(--muted); }
.rv-facts dd { margin: 0; font-weight: 600; }
/* Tabs that say what they are, and the order beside the count (2026-10-30, Ahmed: "amazing to work with") */
.view-hint { margin: -2px 0 0; font-size: .82rem; color: var(--muted); }
.more-pick { padding: 0; display: inline-flex; align-items: center; }
.more-face { display: none; }
.more-pick select { border: 0; background: transparent; color: inherit; font: inherit; font-size: .88rem; padding: .3em 1.6em .3em .8em; min-height: 32px; border-radius: 999px; cursor: pointer; }
.more-pick.on select { color: var(--card); }
.more-pick select option { color: var(--ink); background: var(--card); }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; }
.list-head .list-count { margin: 0; }
.sort-pick { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.sort-pick select { font-size: .85rem; min-height: 30px; padding: .15em .5em; border-radius: 8px; max-width: 230px; }
.sort-pick select:disabled { opacity: .6; }
#people { overflow-x: hidden; }
.person { min-width: 0; }
.person .p-tags { min-width: 0; }
@media (max-width: 900px) {
  #status-chips { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  #status-chips .more-pick { display: flex; justify-content: center; }
  #status-chips .more-pick { position: relative; flex-direction: column; }
  #status-chips .more-pick .more-face { display: flex; flex-direction: column; align-items: center; gap: 1px; pointer-events: none; }
  #status-chips .more-pick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; min-height: 0; padding: 0; }
  .sort-pick select { max-width: 170px; }
}
/* the Filters button sits with the count and the order, right above the list (2026-11-01, Ahmed: "move the filter
   down next to the list so it isn't forgotten up there") */
.list-head { flex-wrap: wrap; }
.list-tools { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; min-width: 0; }
.list-tools .filt-btn { min-height: 30px; padding: .15em .7em; font-size: .85rem; }
.list-tools .sort-pick select { max-width: 165px; }
@media (max-width: 420px) { .sort-pick > span { display: none; } .list-tools .sort-pick select { max-width: 150px; } }
/* The top bar (2026-10-30, Ahmed: "make this bar better looking"): name, the day's numbers as quiet stats, the admin
   pages as one segmented group, Sync calls, and one menu with your initials for the rest */
.top { gap: 14px; padding: 10px 16px; }
.brand img { border-radius: 8px; }
.progress { gap: 0; font-size: .85rem; }
.progress > * { padding: 0 12px; border-left: 1px solid var(--line); line-height: 1.3; }
.progress > progress { border: 0; padding: 0; margin-right: 10px; width: 110px; height: 6px; border-radius: 3px; }
.progress > progress + span { border-left: 0; padding-left: 0; }
.progress .sync { font-size: .8rem; }
.top-nav { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--grey-bg); border: 1px solid var(--line); }
.top-nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; }
.top-nav a:hover { color: var(--ink); background: var(--card); }
.top-nav[hidden] { display: none; }
.sync-btn { display: inline-flex; align-items: center; gap: 6px; }
.me-btn { display: inline-flex; align-items: center; gap: 8px; padding-left: 5px !important; }
.me-av { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--card); display: inline-grid; place-items: center; font-size: .72rem; font-weight: 800; }
.menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.menu-list { z-index: 30; }
@media (max-width: 900px) {
  .top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; }
  .top-actions { width: auto; flex-wrap: nowrap; }
  .progress { grid-column: 1 / -1; order: 3; row-gap: 6px; }
  .top-nav { grid-column: 1 / -1; order: 4; justify-self: start; }
  .menu-list { right: 0; left: auto; }
  .sync-btn { padding: .3em .6em; }
}
.delete-row { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }

/* A steady screen on phones (2026-11-02, Ahmed: "lock viewport, it is clunky when you can zoom in and out or move it"):
   no pinch or double-tap zoom, no sideways drift, no rubber-band bounce; scrolling up and down still works, and so do
   the few boxes that scroll sideways on purpose (wide tables). Pull down at the top to refresh (app.js). */
html { touch-action: pan-x pan-y; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; max-width: 100%; }
body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
.ptr { position: fixed; left: 50%; top: 0; z-index: 50; transform: translate(-50%, -48px); padding: 6px 14px; border-radius: 999px; background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0,0,0,.25); font-size: .85rem; font-weight: 600; pointer-events: none; transition: transform .2s ease, opacity .2s ease; opacity: 0; }
.ptr.pulling { transition: none; opacity: 1; }
.ptr.busy { opacity: 1; }
