/* פריסה: עמודה צרה אחת, כמו חריץ של תיבת דואר. מספר הטלפון הוא הכתובת, והוא יושב על "שלט" מעל הלשוניות. */
:root {
  color-scheme: light dark;
  --bg: #EEF2F5;
  --surface: #FFFFFF;
  --ink: #13212B;
  --muted: #586977;
  --line: #D5DDE3;
  --accent: #1B5E8A;
  --accent-ink: #FFFFFF;
  --accent-soft: #E1EEF6;
  --warn: #8A4B00;
  --warn-soft: #FBF0DD;
  --err: #A4262C;
  --font-body: system-ui, 'Segoe UI', Arial, 'Arial Hebrew', sans-serif;
  --font-display: system-ui, 'Segoe UI', Arial, 'Arial Hebrew', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1820; --surface: #16232E; --ink: #E5ECF1; --muted: #94A6B3; --line: #263847;
    --accent: #74B8E6; --accent-ink: #0C1A24; --accent-soft: #1B3447;
    --warn: #E6B15A; --warn-soft: #2E2412; --err: #F08A8F;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  padding-block: 24px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.app { max-width: 680px; margin-inline: auto; display: flex; flex-direction: column; gap: 16px; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: 1.75rem; line-height: 1.2; margin: 0; text-wrap: balance; }
h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; margin: 0 0 4px; }
p { margin: 0; }
.tag { color: var(--muted); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.notice { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); border-radius: 8px; padding: 10px 14px; }
.flash { background: var(--accent-soft); color: var(--ink); border-radius: 8px; padding: 10px 14px; }

label { display: block; font-weight: 500; margin-bottom: 4px; }
input, textarea {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%; min-height: 44px;
}
textarea { resize: vertical; min-height: 140px; }
input.ltr { direction: ltr; text-align: start; }
:where(button, input, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field { display: flex; flex-direction: column; }
.form { display: flex; flex-direction: column; gap: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hint { color: var(--muted); font-size: .9rem; min-height: 1.4em; margin-top: 4px; }
.err { color: var(--err); font-size: .9rem; min-height: 1.4em; }

.btn {
  font: inherit; font-weight: 500; cursor: pointer; min-height: 44px;
  background: var(--accent); color: var(--accent-ink);
  border: 1px solid var(--accent); border-radius: 8px; padding: 10px 18px;
}
.btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { color: var(--err); border-color: var(--err); }
.btn:disabled { opacity: .55; cursor: default; }

.num { direction: ltr; unicode-bidi: isolate; display: inline-block; font-variant-numeric: tabular-nums; }

.plate { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.plate-label { color: var(--muted); font-size: .85rem; letter-spacing: .03em; }
.plate-num { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; letter-spacing: .04em; }
.plate-name { color: var(--muted); overflow-wrap: anywhere; }

.tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.tab {
  font: inherit; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 10px 14px; color: var(--muted); cursor: pointer; min-height: 44px;
}
.tab[aria-current="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }
.tabs .compose-btn { margin-inline-start: auto; margin-block: 6px; min-height: 40px; padding: 6px 16px; }

ul.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.row {
  display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  width: 100%; text-align: start; font: inherit; color: inherit; cursor: pointer;
  background: none; border: 0; border-bottom: 1px solid var(--line); padding: 14px 16px;
}
li:last-child .row { border-bottom: 0; }
.row:hover { background: var(--accent-soft); }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 8px; }
.unread .dot { background: var(--accent); }
.unread .who, .unread .subj { font-weight: 700; }
.who { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.who .nm { overflow-wrap: anywhere; }
.snip { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.when { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 32px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; }

.meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; color: var(--muted); margin-block: 12px 16px; }
.meta dt { font-weight: 500; }
.meta dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; border-top: 1px solid var(--line); padding-top: 16px; margin-bottom: 20px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  font: inherit; cursor: pointer; min-height: 40px; padding: 6px 14px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
}
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.acc { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
li:last-child .acc { border-bottom: 0; }
.acc-main { flex: 1 1 200px; min-width: 0; }
.acc-name { font-weight: 700; overflow-wrap: anywhere; }
.acc-sub { color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.acc .actions .btn { min-height: 40px; padding: 6px 14px; }
.badge { font-size: .8rem; border-radius: 999px; padding: 1px 8px; border: 1px solid currentColor; }
.badge.pending { color: var(--warn); }
.badge.active { color: var(--accent); }
.badge.blocked { color: var(--err); }

.foot { color: var(--muted); font-size: .85rem; }
