:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --ink: #16202a;
  --muted: #5b6875;
  --line: #d9dfe5;
  --amber: #e5a00d;
  --amber-ink: #1c1606;
  --blue: #1d5fa8;
  --blue-soft: #e4eef9;
  --ok: #1f7a4d;
  --ok-soft: #e1f2e9;
  --warn: #9a5b00;
  --warn-soft: #fbefd9;
  --bad: #b3261e;
  --bad-soft: #fbe4e2;
  --radius: 10px;
  --display: "Secular One", "Assistant", "Arial Hebrew", Arial, sans-serif;
  --body: "Assistant", "Arial Hebrew", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #11171d; --surface: #1a232c; --ink: #e8edf2; --muted: #9aa8b5; --line: #2c3945;
    --amber: #f0b429; --blue: #6aa6ea; --blue-soft: #1c2d41;
    --ok: #5cc28e; --ok-soft: #173326; --warn: #f0b04a; --warn-soft: #3a2c12; --bad: #f08a82; --bad-soft: #3d1b19;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11171d; --surface: #1a232c; --ink: #e8edf2; --muted: #9aa8b5; --line: #2c3945;
  --amber: #f0b429; --blue: #6aa6ea; --blue-soft: #1c2d41;
  --ok: #5cc28e; --ok-soft: #173326; --warn: #f0b04a; --warn-soft: #3a2c12; --bad: #f08a82; --bad-soft: #3d1b19;
}

* { box-sizing: border-box; }
/* Anything hidden stays hidden, whatever display its class gives it (e.g. .btn). */
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.65 var(--body); direction: rtl;
}
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0; max-width: 65ch; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }


.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
.top-inner { max-width: 1040px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.brand { font-family: var(--display); font-size: 1.35rem; color: var(--ink); text-decoration: none; }
.brand span { color: var(--amber); }
.nav { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.97rem; }
.nav a { color: var(--muted); text-decoration: none; padding: 2px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a:focus-visible { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--amber); }
.nav .sep { color: var(--line); }
.top-phone { margin-inline-start: auto; font-weight: 700; color: var(--ink); text-decoration: none; }

main { max-width: 1040px; margin: 0 auto; padding: 28px 16px 56px; display: grid; gap: 32px; }
.narrow { max-width: 640px; }

/* The hotline "plate": the one bold element, styled like a road sign. */
.plate {
  background: var(--amber); color: var(--amber-ink); border-radius: 14px;
  padding: 22px 24px; display: grid; gap: 6px; border: 3px solid var(--amber-ink);
  box-shadow: inset 0 0 0 3px var(--amber);
}
.plate .label { font-weight: 700; letter-spacing: 0.02em; }
.plate .phone { font-family: var(--display); font-size: clamp(2.4rem, 9vw, 3.8rem); line-height: 1; }
.plate small { font-size: 0.95rem; }

.hero { display: grid; gap: 20px; grid-template-columns: 1.2fr 1fr; align-items: center; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } }
.hero p { color: var(--muted); font-size: 1.1rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 14px; align-content: start; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.steps li { display: grid; gap: 6px; }
.steps b { font-family: var(--display); font-weight: 400; font-size: 1.1rem; }
.steps .key { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: var(--ink); color: var(--bg); font-weight: 700; }

.cities { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 0.92rem; }
.chip.soon { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.pill { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 0.85rem; font-weight: 700; }
.pill.open { background: var(--warn-soft); color: var(--warn); }
.pill.taken { background: var(--blue-soft); color: var(--blue); }
.pill.done { background: var(--ok-soft); color: var(--ok); }
.pill.pending { background: var(--warn-soft); color: var(--warn); }
.pill.approved { background: var(--ok-soft); color: var(--ok); }
.pill.blocked { background: var(--bad-soft); color: var(--bad); }

.notice { border-inline-start: 4px solid var(--bad); background: var(--bad-soft); padding: 10px 14px; border-radius: 6px; }
.notice.ready { border-color: var(--ok); background: var(--ok-soft); font-weight: 700; }

form { display: grid; gap: 16px; }
label { display: grid; gap: 4px; font-weight: 700; }
label .hint { font-weight: 400; color: var(--muted); font-size: 0.9rem; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 12px; width: 100%;
}
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; }
legend { font-weight: 700; padding: 0 6px; }
fieldset label { display: flex; align-items: center; gap: 6px; font-weight: 400; }
fieldset input { width: auto; }

.btn {
  font: inherit; font-weight: 700; border: 0; border-radius: 8px; padding: 10px 18px; cursor: pointer;
  background: var(--ink); color: var(--bg); justify-self: start; text-decoration: none; display: inline-block;
}
.btn.amber { background: var(--amber); color: var(--amber-ink); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.small { padding: 5px 12px; font-size: 0.9rem; }
.btn:disabled { opacity: 0.5; cursor: default; }
.result { padding: 12px 14px; border-radius: 8px; background: var(--ok-soft); color: var(--ok); }
.result.error { background: var(--bad-soft); color: var(--bad); }
audio { width: 100%; max-width: 420px; }
.bignum a { color: inherit; text-decoration: none; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.calls { display: grid; gap: 12px; }
.call { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 8px; }
.call.mine { border-color: var(--amber); border-width: 2px; }
.call-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.call-head h3 { margin-inline-end: auto; }
.meta { color: var(--muted); font-size: 0.92rem; }
.audio { display: flex; align-items: center; gap: 10px; }
.audio .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--line); position: relative; overflow: hidden; }
.audio .bar i { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; background: var(--blue); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bignum { font-family: var(--display); font-size: 1.8rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 0.9rem; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: start; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 700; font-size: 0.85rem; }
tr:last-child td { border-bottom: 0; }

.prose { display: grid; gap: 12px; }
.prose h2 { margin-top: 10px; }
.prose ul { margin: 0; padding-inline-start: 22px; display: grid; gap: 4px; }

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
footer .inner { max-width: 1040px; margin: 0 auto; padding: 16px; display: flex; flex-wrap: wrap; gap: 8px 20px; }

@media (prefers-reduced-motion: no-preference) { .audio .bar i { transition: width 0.2s linear; } }

.sub { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.82rem; white-space: nowrap; }
.sub.ok { background: var(--ok-soft); color: var(--ok); }
.sub.warn { background: var(--warn-soft); color: var(--warn); }
.sub.bad { background: var(--bad-soft); color: var(--bad); font-weight: 700; }
.line-status { display: grid; gap: 10px; }
button.link { background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; cursor: pointer; font: inherit; }

/* ---- App pages (admin panel, volunteer board) ---- */
main.app { gap: 18px; }
.page-head { display: grid; gap: 4px; }
[role="tabpanel"] { display: grid; gap: 18px; align-content: start; }
[role="tabpanel"][hidden] { display: none; }

/* Tabs: a sticky bar under the header; scrolls sideways on a phone. */
.tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--line); margin-inline: -16px; padding: 0 16px;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  font: inherit; font-weight: 700; color: var(--muted); background: none; border: 0;
  padding: 10px 14px 9px; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--amber); }
.tabs button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: 6px; }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 0.78rem; line-height: 20px;
  background: var(--bad); color: #fff; text-align: center; font-variant-numeric: tabular-nums;
}
.badge.ok { background: var(--ok); }

.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }

/* On/off switch: a checkbox that slides. */
input.switch {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0; cursor: pointer;
  width: 50px; height: 28px; border-radius: 999px; background: var(--line);
  position: relative; transition: background 0.18s; border: 0; padding: 0;
}
input.switch::after {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.3); transition: inset-inline-start 0.18s;
}
input.switch:checked { background: var(--ok); }
input.switch:checked::after { inset-inline-start: 25px; }
input.switch:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
input.switch:disabled { opacity: 0.5; cursor: default; }
@media (prefers-reduced-motion: reduce) { input.switch, input.switch::after { transition: none; } }
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; font-weight: 400; cursor: pointer;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.switch-row:first-of-type { border-top: 0; }
.switch-row span { display: grid; gap: 2px; }
.switch-row small { color: var(--muted); font-size: 0.9rem; }
input.short { max-width: 110px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar input[type="search"] { max-width: 280px; }
.toolbar select { width: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn {
  font: inherit; font-size: 0.92rem; cursor: pointer; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.chip-btn[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.progress { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--ok); width: 0; transition: width 0.3s; }

/* Volunteer cards (pending approvals) */
.cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.vcard { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 6px; background: var(--bg); }
.vcard .row { gap: 6px; }
.who { display: grid; gap: 0; }
.who small { color: var(--muted); }

/* Dialogs ("sheets"): centered on a wide screen, full width on a phone. */
dialog.sheet {
  border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(760px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgb(0 0 0 / 0.25);
}
dialog.sheet::backdrop { background: rgb(10 15 20 / 0.45); }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.sheet-body { padding: 16px 18px 22px; display: grid; gap: 16px; }
.icon-btn { font: inherit; font-size: 1.1rem; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
fieldset.cities-pick { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 4px; margin: 0; }
fieldset.cities-pick legend { font-weight: 700; padding: 0 6px; }
/* Picking cities: tiles grouped by region (volunteer board, admin's volunteer card). */
.city-picker { display: grid; gap: 18px; padding: 4px 0 14px; }
.cp-group { display: grid; gap: 10px; }
.cp-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.cp-group-head b { font-family: var(--display); font-weight: 400; font-size: 1.08rem; }
.cp-group-count { color: var(--blue); font-size: 0.85rem; font-weight: 700; }
.cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.city-picker .cp-tile {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; font-weight: 700;
  transition: border-color 0.12s, background 0.12s;
}
.cp-tile:hover { border-color: var(--muted); }
.cp-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.cp-box {
  flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line);
  display: grid; place-items: center; font-size: 13px; line-height: 1; color: transparent; background: var(--surface);
}
.cp-label { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.cp-name { overflow-wrap: anywhere; }
.cp-label small { color: var(--warn); font-size: 0.78rem; font-weight: 400; }
.cp-tile:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.cp-tile:has(input:checked) .cp-box { background: var(--blue); border-color: var(--blue); color: #fff; }
.cp-tile:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 2px; }
.cp-total { color: var(--blue); font-weight: 700; font-size: 0.95rem; }
dialog .cp-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (prefers-reduced-motion: reduce) { .cp-tile { transition: none; } }

/* The save button stays in sight while scrolling a long list. */
.save-bar {
  position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin-inline: -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius);
}
.save-bar + .result { margin-top: 10px; }

/* Volunteer board */
.board-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 20px; }
.hello { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--muted); }
.hello b { color: var(--ink); }
.hello-cities { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hello-cities .chip { padding: 1px 10px; font-size: 0.85rem; }
.hello-cities a { text-decoration: none; font-size: 0.9rem; }
.board-narrow { max-width: 760px; width: 100%; }
.settings { display: grid; gap: 16px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.empty {
  display: grid; gap: 6px; justify-items: center; text-align: center; padding: 34px 20px;
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted);
}
.empty b { color: var(--ink); font-family: var(--display); font-weight: 400; font-size: 1.15rem; }
.empty span { max-width: 46ch; }

.chip-check { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 400; }
.chip-check:has(input:checked) { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.chip-check input { margin: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--bg); }
textarea { width: 100%; font: inherit; }

/* A sent form becomes a confirmation with the next steps. */
.done-panel { border-color: var(--ok); text-align: start; }
.done-panel h2 { margin: 0; color: var(--ok); }
.done-mark { width: 48px; height: 48px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; font-size: 26px; font-weight: 700; }
.done-steps { margin: 0; padding-inline-start: 22px; display: grid; gap: 10px; line-height: 1.7; }

/* The Options menu next to a row's button. */
.menu {
  position: fixed; z-index: 50; min-width: 200px; display: grid; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
}
.menu button {
  all: unset; box-sizing: border-box; cursor: pointer; padding: 9px 12px; border-radius: 6px;
  font: inherit; color: var(--ink); text-align: start;
}
.menu button:hover, .menu button:focus-visible { background: var(--bg); }
.menu button.danger, .btn.danger { color: var(--bad); }
.btn.options { white-space: nowrap; }

/* Quiet-hours ranges: one row each, removable. */
.ranges { display: grid; gap: 8px; margin-bottom: 8px; }
.ranges:empty::before { content: "אין שעות שקטות: צינתוק בכל שעה."; color: var(--muted); }
.range-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.range-row input[type="time"] { max-width: 140px; }

/* A call written on the website, in the history: one line, the rest on hover. */
.call-text { display: inline-block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* A recording played from a table: its own row, the player as wide as it needs. */
.player-row td { background: var(--bg); padding: 10px 14px; }
.player-row audio { width: 100%; max-width: 520px; }
