@font-face { font-family: 'Rubik'; font-weight: 500; font-display: swap; src: url(fonts/rubik-hebrew-500-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Rubik'; font-weight: 500; font-display: swap; src: url(fonts/rubik-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Rubik'; font-weight: 800; font-display: swap; src: url(fonts/rubik-hebrew-800-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Rubik'; font-weight: 800; font-display: swap; src: url(fonts/rubik-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  color-scheme: light dark;
  --bg: #f4f3fa;
  --surface: #ffffff;
  --surface-2: #efedf8;
  --line: #e1def0;
  --ink: #15172a;
  --dim: #5d6380;
  --accent: #6c5ce7;
  --accent-ink: #ffffff;
  --accent-soft: #ebe8fd;
  --danger: #c93c55;
  --ok: #2f8a5b;
  --amber: #a86a00;
  --amber-soft: #fbf0d9;
  --shadow: 0 1px 2px rgba(21, 23, 42, .05), 0 6px 20px rgba(21, 23, 42, .06);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0d16;
    --surface: #131829;
    --surface-2: #1a2036;
    --line: #232a42;
    --ink: #e9ecf5;
    --dim: #8a93ab;
    --accent: #8b7cf7;
    --accent-ink: #0a0d16;
    --accent-soft: #221f45;
    --danger: #ef5a6f;
    --ok: #4cc38a;
    --amber: #ffc23d;
    --amber-soft: #2c2412;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 500 16px/1.55 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
svg { width: 20px; height: 20px; flex: 0 0 auto; }

.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: calc(12px + var(--safe-t)) 16px 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.logo { width: 36px; height: 36px; border-radius: 10px; }
.bar h1 { margin: 0; font-size: 19px; font-weight: 800; line-height: 1.2; }
.status { margin: 2px 0 0; display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--dim); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.status.on .dot { background: var(--ok); }
.status.off .dot { background: var(--danger); }

.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(32px + var(--safe-b)); }

/* צימוד */
.pair h2 { margin: 12px 0 6px; font-size: 22px; font-weight: 800; text-wrap: balance; }
.lead { margin: 0 0 20px; color: var(--dim); }
.field-label { display: block; margin: 14px 0 6px; font-size: 14px; color: var(--dim); }
input {
  width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 18px;
}
#code { font-size: 26px; letter-spacing: .18em; text-align: center; direction: ltr; font-variant-numeric: tabular-nums; }
input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* כפתורים */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 18px; border-radius: 14px; border: 1px solid transparent;
  font: inherit; font-size: 17px; font-weight: 800; cursor: pointer; position: relative; overflow: hidden;
  touch-action: manipulation;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-wide { width: 100%; margin-top: 20px; }
.btn-approve { background: var(--accent); color: var(--accent-ink); }
.btn-reject { background: transparent; color: var(--danger); border-color: var(--line); }
.btn-quiet { background: var(--surface); color: var(--ink); border-color: var(--line); font-weight: 500; }
.btn .fill { position: absolute; inset: 0; background: rgba(255, 255, 255, .22); transform-origin: right; transform: scaleX(0); }
.btn-reject .fill { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.btn span, .btn svg { position: relative; }

.msg { min-height: 1.4em; margin: 10px 0 0; font-size: 14px; color: var(--dim); }
.msg.err { color: var(--danger); }

/* תור */
.banner {
  margin-bottom: 14px; padding: 12px 14px; border-radius: 12px;
  background: var(--amber-soft); color: var(--ink); font-size: 14px; line-height: 1.5;
}
.list { display: flex; flex-direction: column; gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px; box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 13px; }
.kind { display: inline-flex; align-items: center; gap: 6px; }
.kind svg { width: 16px; height: 16px; }
.seq { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.age {
  margin-inline-start: auto; display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; background: var(--surface-2); font-variant-numeric: tabular-nums;
}
.age svg { width: 14px; height: 14px; }
.age.old { background: var(--amber-soft); color: var(--amber); }
.card h3 { margin: 10px 0 6px; font-size: 17px; font-weight: 800; line-height: 1.4; text-wrap: pretty; }
.body {
  margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--dim); font-size: 15px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 7; overflow: hidden;
}
.body.open { display: block; }
.expand { margin-top: 4px; padding: 4px 0; background: none; border: 0; color: var(--accent); font: inherit; font-size: 14px; cursor: pointer; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.btn-edit { grid-column: 1 / -1; min-height: 44px; font-size: 15px; }
.edit-box {
  display: block; width: 100%; min-height: 110px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--accent); background: var(--surface-2); color: var(--ink);
  font: inherit; font-size: 16px; line-height: 1.55; resize: vertical; overflow-wrap: anywhere;
}
.edit-box:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.outcome {
  display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 12px 14px;
  border-radius: 12px; background: var(--surface-2); font-size: 15px;
}
.outcome.ok { color: var(--ok); }
.outcome.bad { color: var(--danger); }
.outcome.wait { color: var(--dim); }

.empty { text-align: center; padding: 48px 16px 24px; color: var(--dim); }
.empty-icon { width: 44px; height: 44px; color: var(--accent); }
.empty-title { margin: 12px 0 4px; font-size: 18px; font-weight: 800; color: var(--ink); }
.empty-sub { margin: 0 auto; max-width: 34ch; font-size: 14px; }

.tools { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.hint { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; }
.hint svg { color: var(--accent); margin-top: 2px; }
.hint p { margin: 0; }
.tools .btn-wide { margin-top: 12px; }
.more { margin-top: 18px; color: var(--dim); font-size: 14px; }
.more summary { cursor: pointer; padding: 6px 0; }
.link { display: block; margin-top: 8px; padding: 8px 0; background: none; border: 0; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; text-align: start; }
.link-danger { color: var(--danger); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
