/* The signed-in screens. One look, the day colours of the guest page: sand
   background, white cards, the same teal button. System fonts only (the CSP
   has no font-src) and no inline styles anywhere (style-src 'self'). Phone
   first: one column, 480px at most. */

/* tokens:begin - the ONE place a colour, a radius or a type size is written.
   Every rule below reads them by name; a test refuses a literal outside
   this block (tests/test_app_tokens.py). */
:root {
  --c-ink: #1d2a33;
  --c-ink-soft: #55636b;
  --c-brand: #0e7c86;
  --c-brand-deep: #0a4d5c;
  --c-on-brand: #ffffff;
  --c-page: #fcf5e3;
  --c-surface: #ffffff;
  --c-surface-dim: #f6fbfa;
  --c-track: #f1e7cd;
  --c-line: #d6e9e7;
  --c-focus: #1a4d8f;
  --c-ok: #2e7d5b;
  --c-wa: #1f7a4d;
  --c-danger: #a8362a;
  --c-danger-line: #f0d3c8;
  --c-danger-bg: #fbeee8;
  --c-danger-ink: #5a1f2e;
  --c-error-ink: #7a1f1f;
  --c-warn-ink: #7a4a00;
  --c-notice-bg: #fff4d6;
  --c-notice-ink: #5c4400;
  --c-neutral-bg: #eef1f0;
  --c-neutral-ink: #4a5c64;
  --c-active-bg: #dcf3f2;
  --c-spinner-track: rgba(255, 255, 255, .35);
  --shadow-tab: 0 2px 8px rgba(10, 77, 92, .12);
  --shadow-card: 0 6px 18px rgba(10, 77, 92, .08);
  --shadow-btn: 0 10px 24px -10px rgba(14, 124, 134, .6);
  --shadow-wa: 0 10px 24px -10px rgba(31, 122, 77, .6);
  --r-1: 11px;
  --r-2: 12px;
  --r-3: 14px;
  --r-4: 16px;
  --r-5: 22px;
  --r-pill: 999px;
  --r-round: 50%;
  --fs-1: 13px;
  --fs-2: 14px;
  --fs-3: 15px;
  --fs-4: 16px;
  --fs-5: 17px;
  --fs-6: 18px;
  --fs-7: 19px;
  --fs-8: 20px;
  --fs-9: 21px;
  --fs-10: 24px;
}
/* tokens:end */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; color-scheme: light; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--c-page);
  color: var(--c-ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Hebrew", Arial, sans-serif;
  font-size: var(--fs-5);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
.page, .shell { max-width: 480px; margin: 0 auto; }
.page { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
.shell { padding: 48px 18px; }

/* the tenant at the top, and who is signed in */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 54px; height: 40px; object-fit: contain; flex: none; }
.tname { font-size: var(--fs-8); font-weight: 800; line-height: 1.2; color: var(--c-brand-deep); overflow-wrap: anywhere; }
.me { display: flex; flex-direction: column; align-items: flex-end; flex: none; max-width: 45%; }
.uname { font-size: var(--fs-2); color: var(--c-ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.link {
  padding: 4px 0; border: 0; background: none; color: var(--c-brand);
  font-family: inherit; font-size: var(--fs-3); font-weight: 700; text-decoration: underline; cursor: pointer;
}

/* the few screens */
.tabs { display: flex; gap: 6px; margin: 0 18px; padding: 4px; border-radius: var(--r-3); background: var(--c-track); }
.tab {
  flex: 1; min-height: 44px; display: flex; align-items: center; justify-content: center;
  padding: 6px 4px; border-radius: var(--r-1); color: var(--c-brand-deep);
  font-size: var(--fs-3); font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none;
}
.tab.is-on { background: var(--c-surface); box-shadow: var(--shadow-tab); }
.tab:focus-visible, .link:focus-visible, .btn:focus-visible, .input:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }

.ribbon {
  margin: 10px 18px 0; padding: 8px 12px; border-radius: var(--r-2);
  background: var(--c-notice-bg); color: var(--c-notice-ink); font-size: var(--fs-3); text-align: center;
}
.heading { margin: 18px 18px 0; font-size: var(--fs-10); line-height: 1.25; font-weight: 800; color: var(--c-brand-deep); }
.heading.in-card { margin: 0 0 4px; font-size: var(--fs-9); }
.card {
  margin: 14px 18px 0; padding: 16px; border-radius: var(--r-5);
  background: var(--c-surface); border: 1px solid var(--c-line); box-shadow: var(--shadow-card);
}
.card.center { margin: 0; text-align: center; }
.title { margin: 0; font-size: var(--fs-10); line-height: 1.25; color: var(--c-brand-deep); }
.lead { margin: 10px 0 0; font-size: var(--fs-5); }
.mark { width: 44px; height: 44px; color: var(--c-brand); }

/* a gate card: the guest page's press */
.gname { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; font-size: var(--fs-6); color: var(--c-brand-deep); }
.gicon { width: 22px; height: 22px; flex: none; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 56px; margin-top: 12px; padding: 14px 12px;
  border: 0; border-radius: var(--r-4); background: var(--c-brand); color: var(--c-on-brand);
  font-family: inherit; font-size: var(--fs-7); font-weight: 700; line-height: 1.2; text-decoration: none;
  cursor: pointer; touch-action: manipulation;
  box-shadow: var(--shadow-btn);
  transition: transform .08s ease, filter .15s ease;
}
.btn:active:not(:disabled) { transform: scale(.985); filter: brightness(.94); }
.btn:disabled { cursor: default; opacity: .6; }
.btn.is-busy { opacity: .88; font-size: var(--fs-5); }
.btn.small { min-height: 44px; padding: 8px 12px; font-size: var(--fs-4); border-radius: var(--r-2); box-shadow: none; }
.btn.ghost { background: var(--c-surface); color: var(--c-brand-deep); border: 2px solid var(--c-line); box-shadow: none; }
.btn.danger { background: var(--c-surface); color: var(--c-danger); border: 2px solid var(--c-danger-line); box-shadow: none; }
.btn.wa { background: var(--c-wa); box-shadow: var(--shadow-wa); }
.spinner {
  width: 20px; height: 20px; flex: none; border-radius: var(--r-round);
  border: 3px solid var(--c-spinner-track); border-top-color: var(--c-on-brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
  .btn { transition: none; }
}
.sent { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; color: var(--c-ok); font-weight: 700; font-size: var(--fs-7); }
.sent svg { width: 30px; height: 30px; flex: none; }
.status { margin-top: 8px; }
.status-title { margin: 0; font-weight: 700; }
.status-title:empty { display: none; }
.status-hint { margin: 6px 0 0; font-size: var(--fs-3); color: var(--c-ink-soft); }
.status.is-error .status-title { color: var(--c-error-ink); }
.status.is-warn .status-title { color: var(--c-warn-ink); }
.off { margin: 10px 0 0; font-size: var(--fs-4); color: var(--c-ink-soft); }

/* forms: everything inline, where the data is */
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.field, legend { display: block; margin: 14px 0 6px; padding: 0; font-size: var(--fs-3); font-weight: 700; color: var(--c-brand-deep); }
.input {
  display: block; width: 100%; min-height: 48px; padding: 10px 12px;
  border: 2px solid var(--c-line); border-radius: var(--r-2); background: var(--c-surface); color: var(--c-ink);
  font-family: inherit; font-size: var(--fs-5);
}
.input[readonly] { background: var(--c-surface-dim); }
.linkbox { font-size: var(--fs-2); }
.pair { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 420px) { .pair { grid-template-columns: 1fr 1fr; gap: 10px; } }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: var(--fs-5); cursor: pointer; }
.check input { width: 24px; height: 24px; flex: none; margin: 0; accent-color: var(--c-brand); }
.hint { margin: 8px 0 0; font-size: var(--fs-2); color: var(--c-ink-soft); }
.said { margin: 8px 0 0; font-size: var(--fs-3); font-weight: 700; color: var(--c-brand-deep); }
.said:empty { display: none; }
.said.is-error { color: var(--c-error-ink); }
#top-said { margin: 8px 18px 0; }
.done { margin: 6px 0 10px; font-size: var(--fs-7); font-weight: 800; color: var(--c-ok); }

/* the lists */
.row { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--c-line); }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row-name { font-size: var(--fs-6); font-weight: 700; color: var(--c-brand-deep); overflow-wrap: anywhere; }
.row-line { margin: 4px 0 0; font-size: var(--fs-3); color: var(--c-ink-soft); overflow-wrap: anywhere; }
.row-line strong { color: var(--c-ink); }
.mail { text-align: right; }
.badge { flex: none; padding: 3px 10px; border-radius: var(--r-pill); font-size: var(--fs-1); font-weight: 700; background: var(--c-neutral-bg); color: var(--c-neutral-ink); }
.badge.s-active { background: var(--c-active-bg); color: var(--c-brand-deep); }
.badge.s-before { background: var(--c-notice-bg); color: var(--c-notice-ink); }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ask { margin-top: 10px; padding: 12px; border-radius: var(--r-3); background: var(--c-danger-bg); color: var(--c-danger-ink); font-size: var(--fs-3); }
.ask p { margin: 0; font-weight: 700; }

/* the admin's screens: the same cards and rows; a number with its button beside it, the way back, three more states */
.back { display: inline-block; margin: 14px 18px 0; min-height: 24px; color: var(--c-brand); font-size: var(--fs-3); font-weight: 700; }
.back:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.inline .btn { width: auto; min-width: 88px; min-height: 48px; margin-top: 0; }
h2.row-name, h3.row-name { margin: 0; }
.row-head .heading { min-width: 0; overflow-wrap: anywhere; }
select.input { appearance: auto; }
.badge.s-suspended, .badge.s-disabled { background: var(--c-notice-bg); color: var(--c-notice-ink); }
.badge.s-revoked { background: var(--c-danger-bg); color: var(--c-danger-ink); }
