/* ==========================================================================
   U-tor — the platform's own look (site, owner area, legal pages, admin console)
   "Your turn": the vernacular of a queue — a ticket with a perforated edge and a big red number.
   Cool paper, deep ink navy, one signal red. Karantina (condensed Hebrew display) for numbers and
   headlines; IBM Plex Sans Hebrew for everything you read.
   ========================================================================== */
:root {
  --u-ink: #14213d;
  --u-ink-2: #36435e;
  --u-muted: #66708a;
  --u-paper: #f2f4f8;
  --u-card: #ffffff;
  --u-line: #dbe1eb;
  --u-line-2: #c7d0de;
  --u-red: #e2384d;
  --u-red-deep: #b72034;
  --u-red-soft: #fde8eb;
  --u-mint: #14946a;
  --u-mint-soft: #def5ec;
  --u-amber: #a86e06;
  --u-amber-soft: #fbf0d9;
  --u-blue-soft: #e4ebf8;
  --u-r: 14px;
  --u-r-lg: 22px;
  --u-shadow: 0 1px 2px rgba(20, 33, 61, 0.06), 0 10px 28px -16px rgba(20, 33, 61, 0.28);
  --u-display: 'Karantina', 'IBM Plex Sans Hebrew', system-ui, sans-serif;
  --u-font: 'IBM Plex Sans Hebrew', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --u-max: 1160px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.u { margin: 0; font-family: var(--u-font); font-size: 16px; line-height: 1.6; color: var(--u-ink); background: var(--u-paper); -webkit-font-smoothing: antialiased; }
.u a { color: inherit; }
.u :focus-visible { outline: 2.5px solid var(--u-red); outline-offset: 2px; border-radius: 6px; }
.u img, .u svg { max-width: 100%; }
.u h1, .u h2, .u h3 { line-height: 1.15; margin: 0; }
.u .num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.u .muted { color: var(--u-muted); }
.u .small { font-size: 0.86rem; }
.u .sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.u-wrap { max-width: var(--u-max); margin: 0 auto; padding: 0 20px; }
.u-skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--u-ink); color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 100; }
.u-skip:focus { top: 12px; }

/* Brand */
.u-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--u-ink); }
.u-logo-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--u-ink); color: #fff; font-family: var(--u-display); font-size: 25px; line-height: 1; padding-top: 2px; }
.u-logo-word { font-family: var(--u-display); font-size: 30px; letter-spacing: 0.02em; line-height: 1; padding-top: 3px; }

/* Buttons & fields */
.u-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer; text-decoration: none; color: var(--u-ink); background: var(--u-card); border-color: var(--u-line-2); transition: background 0.15s, border-color 0.15s, transform 0.15s; white-space: nowrap; }
.u-btn:hover:not(:disabled) { border-color: var(--u-ink-2); }
.u-btn:active:not(:disabled) { transform: translateY(1px); }
.u-btn:disabled { opacity: 0.55; cursor: default; }
.u-btn.primary { background: var(--u-red); border-color: var(--u-red); color: #fff; }
.u-btn.primary:hover:not(:disabled) { background: var(--u-red-deep); border-color: var(--u-red-deep); }
.u-btn.dark { background: var(--u-ink); border-color: var(--u-ink); color: #fff; }
.u-btn.ghost { background: transparent; border-color: transparent; }
.u-btn.ghost:hover:not(:disabled) { background: rgba(20, 33, 61, 0.06); border-color: transparent; }
.u-btn.danger { background: #fff; color: var(--u-red-deep); border-color: #f2b9c1; }
.u-btn.sm { min-height: 34px; padding: 0 12px; font-size: 0.86rem; border-radius: 10px; }
.u-btn.lg { min-height: 54px; padding: 0 26px; font-size: 1.05rem; border-radius: 14px; }
.u-btn svg { width: 18px; height: 18px; flex: none; }
.u-link { background: none; border: 0; padding: 0; font: inherit; color: var(--u-red-deep); text-decoration: underline; cursor: pointer; }
.u-field { display: grid; gap: 6px; font-size: 0.9rem; }
.u-field > span { font-weight: 600; color: var(--u-ink-2); }
.u-field small { color: var(--u-muted); font-size: 0.8rem; }
.u-input, .u-field input, .u-field select, .u-field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--u-line-2); background: #fff; font: inherit; color: var(--u-ink); }
.u-field textarea { min-height: 88px; resize: vertical; }
.u-field input:focus, .u-field select:focus, .u-field textarea:focus, .u-input:focus { outline: none; border-color: var(--u-ink-2); box-shadow: 0 0 0 3px rgba(20, 33, 61, 0.12); }
.u-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.u-check { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; cursor: pointer; }
.u-check input { width: 20px; height: 20px; accent-color: var(--u-red); }
.u-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: #e8ecf3; }
.u-seg label { position: relative; }
.u-seg input { position: absolute; opacity: 0; inset: 0; }
.u-seg span { display: block; padding: 7px 14px; border-radius: 9px; font-size: 0.9rem; font-weight: 500; cursor: pointer; color: var(--u-ink-2); }
.u-seg input:checked + span { background: #fff; color: var(--u-ink); box-shadow: 0 1px 2px rgba(20, 33, 61, 0.12); }
.u-seg input:focus-visible + span { outline: 2px solid var(--u-red); }
.u-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.u-actions.end { justify-content: flex-end; }

/* Cards, chips, tickets */
.u-card { background: var(--u-card); border: 1px solid var(--u-line); border-radius: var(--u-r-lg); padding: 20px; box-shadow: var(--u-shadow); }
.u-card + .u-card { margin-top: 14px; }
.u-card h2 { font-size: 1.12rem; margin-bottom: 12px; }
.u-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: #eef1f6; color: var(--u-ink-2); white-space: nowrap; }
.u-chip.ok { background: var(--u-mint-soft); color: var(--u-mint); }
.u-chip.warn { background: var(--u-amber-soft); color: var(--u-amber); }
.u-chip.bad { background: var(--u-red-soft); color: var(--u-red-deep); }
.u-chip.info { background: var(--u-blue-soft); color: #2b4a86; }
.u-ticket { position: relative; background: #fff; border-radius: 16px; padding: 16px 18px; box-shadow: var(--u-shadow);
  -webkit-mask: radial-gradient(circle 9px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 9px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat; }
.u-ticket .t-num { font-family: var(--u-display); font-size: 3.1rem; line-height: 0.9; color: var(--u-red); }
.u-ticket .t-label { color: var(--u-ink-2); font-size: 0.9rem; font-weight: 500; }
.u-empty { text-align: center; padding: 28px 12px; color: var(--u-muted); }
.u-empty strong { display: block; color: var(--u-ink); margin-bottom: 4px; }

/* Toasts & modals */
.u-toasts { position: fixed; inset-inline: 0; bottom: 18px; z-index: 300; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.u-toast { pointer-events: auto; max-width: 520px; padding: 11px 18px; border-radius: 12px; background: var(--u-ink); color: #fff; font-size: 0.92rem; box-shadow: 0 12px 30px -12px rgba(20, 33, 61, 0.6); opacity: 0; transform: translateY(8px); transition: 0.25s; }
.u-toast.in { opacity: 1; transform: none; }
.u-toast.success { background: #0f6e4f; }
.u-toast.error { background: var(--u-red-deep); }
.u-toast.warn { background: #7a5005; }
.u-modal-open { overflow: hidden; }
.u-modal-wrap { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(15, 23, 42, 0.42); opacity: 0; transition: opacity 0.2s; overflow-y: auto; }
.u-modal-wrap.in { opacity: 1; }
.u-modal { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: #fff; border-radius: 20px; box-shadow: 0 30px 80px -30px rgba(15, 23, 42, 0.6); }
.u-modal.wide { width: min(860px, 100%); }
.u-modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; background: #fff; border-bottom: 1px solid var(--u-line); }
.u-modal-head h2 { font-size: 1.1rem; }
.u-x { width: 36px; height: 36px; border-radius: 10px; border: 0; background: #eef1f6; font-size: 22px; line-height: 1; cursor: pointer; color: var(--u-ink); }
.u-modal-body { padding: 18px 20px 22px; }
.u-confirm { margin: 0; font-size: 1rem; }
@media (max-width: 560px) {
  .u-modal-wrap { place-items: end center; padding: 0; }
  .u-modal { width: 100%; border-radius: 20px 20px 0 0; max-height: 92dvh; }
}

/* Google button */
.u-google { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--u-line-2); background: #fff; font: inherit; font-weight: 600; cursor: pointer; color: var(--u-ink); }
.u-google:hover { border-color: var(--u-ink-2); }

@media (prefers-reduced-motion: reduce) { .u-toast, .u-modal-wrap, .u-btn { transition: none; } }
.u-logo-mark { position: relative; }
.u-logo-mark::after { content: ''; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--u-red); }
.u [hidden], body.u [hidden] { display: none !important; }

/* iPhone zooms the whole page in when a field smaller than 16px gets focus (and the page jumps
   back and forth while typing). On phones and touch screens every field is 16px. */
@media (max-width: 900px), (pointer: coarse) {
  .u input:not([type=checkbox]):not([type=radio]):not([type=range]), .u select, .u textarea { font-size: 16px !important; }
}
