:root {
  --ink:        #14231f;
  --ink-soft:   #40534d;
  --stone:      #8a938e;
  --paper:      #edf0ec;
  --surface:    #ffffff;
  --line:       #dbe2dc;

  --eucalyptus: #1d6f58;
  --live:       #2fa37b;
  --amber:      #b06a28;
  --clay:       #9c4a3c;

  --r-sm: 6px;
  --r-md: 14px;
  --r-lg: 22px;

  --step-0: 1rem;
  --step-1: 1.18rem;
  --step-2: 1.45rem;
  --step-3: 1.9rem;
  --step-4: 2.6rem;

  --ease: cubic-bezier(.22, .68, .36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Assistant', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Frank Ruhl Libre', Georgia, serif;
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.01em;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select {
  font-family: inherit;
  font-size: var(--step-0);
  padding: .7rem .9rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}

input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--eucalyptus);
  outline-offset: 2px;
}

.app {
  max-width: 620px;
  margin: 0 auto;
  padding: 0 1.1rem 6rem;
}

/* ---------- header ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -1.1rem 1rem;
  padding: 1.1rem 1.1rem .8rem;
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.masthead .wordmark {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: var(--step-2);
  font-weight: 500;
}

.masthead .who {
  font-size: .82rem;
  color: var(--stone);
}

/* ---------- day rail ---------- */

.days {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: .9rem;
  margin-bottom: .4rem;
}
.days::-webkit-scrollbar { display: none; }

.day {
  flex: 0 0 auto;
  min-width: 3.4rem;
  padding: .5rem .1rem .55rem;
  text-align: center;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: background .25s var(--ease), color .25s var(--ease);
}

.day .dow { font-size: .72rem; color: var(--stone); display: block; }
.day .dom { font-size: var(--step-1); font-weight: 600; display: block; }

.day[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}
.day[aria-pressed="true"] .dow { color: color-mix(in srgb, var(--paper) 70%, transparent); }

.day.has-none { opacity: .38; }

/* ---------- class rows ---------- */

.rows { display: flex; flex-direction: column; gap: .7rem; }

.row {
  position: relative;
  display: grid;
  grid-template-columns: 6px 1fr auto;
  gap: 0 .95rem;
  align-items: center;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 1rem 1rem 1rem .55rem;
  overflow: hidden;
}

/* the water-level rail */
.rail {
  position: relative;
  align-self: stretch;
  width: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.rail i {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  display: block;
  height: var(--fill, 0%);
  background: var(--live);
  border-radius: 3px;
  transition: height .9s var(--ease);
  transition-delay: var(--delay, 0ms);
}

.row[data-state="tight"] .rail i { background: var(--amber); }
.row[data-state="full"]  .rail i { background: var(--stone); }

.row .meta { min-width: 0; }

.row .title {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: var(--step-1);
  font-weight: 500;
  display: block;
}

.row .sub {
  font-size: .84rem;
  color: var(--stone);
  display: block;
  margin-top: .1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row .when {
  font-variant-numeric: tabular-nums;
  font-size: var(--step-1);
  font-weight: 600;
}

.row .spots {
  grid-column: 2 / -1;
  font-size: .8rem;
  margin-top: .45rem;
  color: var(--ink-soft);
}

.row[data-state="tight"] .spots { color: var(--amber); }
.row[data-state="full"]  .spots { color: var(--stone); }

.row .act { grid-column: 2 / -1; margin-top: .75rem; }

.row.mine { box-shadow: inset 0 0 0 1.5px var(--eucalyptus); }

.row.mine .badge {
  display: inline-block;
  font-size: .74rem;
  background: color-mix(in srgb, var(--eucalyptus) 12%, transparent);
  color: var(--eucalyptus);
  padding: .12rem .5rem;
  border-radius: 100px;
  margin-inline-start: .4rem;
  vertical-align: .1em;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .62rem 1.15rem;
  border-radius: 100px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: .93rem;
  transition: transform .16s var(--ease), background .2s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn.wide { width: 100%; }

.btn.ghost {
  background: transparent;
  color: var(--ink-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn.go { background: var(--eucalyptus); }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------- cards + stats ---------- */

.card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 1.1rem;
  margin-bottom: .8rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
  margin-bottom: 1.2rem;
}

.stat { background: var(--surface); border-radius: var(--r-md); padding: .95rem 1rem; }
.stat .k { font-size: .78rem; color: var(--stone); display: block; }
.stat .v {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: var(--step-3);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  display: block;
  margin-top: .15rem;
}

/* ---------- tab / list lines ---------- */

.line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .8rem;
  padding: .62rem 0;
  border-bottom: 1px solid var(--line);
}
.line:last-child { border-bottom: none; }
.line .n { font-size: .8rem; color: var(--stone); }
.line .amt { font-variant-numeric: tabular-nums; font-weight: 600; }

.total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: .9rem;
  padding-top: .9rem;
  border-top: 2px solid var(--ink);
}
.total .v {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: var(--step-3);
  font-variant-numeric: tabular-nums;
}

/* ---------- roster ---------- */

.person {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .3rem .8rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--line);
}
.person:last-child { border-bottom: none; }
.person .nm { font-weight: 600; }
.person .hist { grid-column: 1; font-size: .78rem; color: var(--stone); }
.person .marks { grid-row: 1 / span 2; display: flex; gap: .35rem; align-items: center; }

.mark {
  width: 2.3rem; height: 2.3rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line);
  display: grid; place-items: center;
  font-size: 1rem;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.mark[aria-pressed="true"].yes { background: var(--live); color: #fff; box-shadow: none; }
.mark[aria-pressed="true"].no  { background: var(--clay); color: #fff; box-shadow: none; }

.person.waiting .nm::after {
  content: 'ממתין';
  font-size: .7rem;
  font-weight: 400;
  color: var(--amber);
  margin-inline-start: .45rem;
}

/* ---------- nav ---------- */

.nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  gap: .25rem;
  padding: .5rem .6rem calc(.5rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}

.nav button {
  flex: 1 1 0;
  max-width: 7rem;
  padding: .5rem .3rem;
  border-radius: var(--r-md);
  font-size: .78rem;
  color: var(--stone);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav button[aria-current="page"] { color: var(--ink); background: var(--surface); font-weight: 600; }

/* ---------- login ---------- */

.gate {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 2rem 1.2rem;
}
.gate .inner { width: 100%; max-width: 25rem; }
.gate h1 { margin-bottom: .3rem; }
.gate p.lede { color: var(--ink-soft); margin: 0 0 2rem; }
.gate label { display: block; font-size: .84rem; color: var(--ink-soft); margin-bottom: .35rem; }
.gate .field { margin-bottom: 1rem; }

.code-input {
  font-size: var(--step-3);
  letter-spacing: .35em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.note { font-size: .82rem; color: var(--stone); margin-top: .9rem; }
.err  { font-size: .86rem; color: var(--clay); margin-top: .7rem; min-height: 1.2em; }

/* ---------- misc ---------- */

.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--stone);
}
.empty strong { display: block; font-family: 'Frank Ruhl Libre', serif; font-size: var(--step-2); color: var(--ink-soft); margin-bottom: .3rem; }

.sect-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 1.6rem 0 .8rem;
}
.sect-head h2 { font-size: var(--step-2); }

.toast {
  position: fixed;
  inset-inline: 1rem;
  bottom: 5.2rem;
  z-index: 40;
  margin: 0 auto;
  max-width: 24rem;
  background: var(--ink);
  color: var(--paper);
  padding: .8rem 1.1rem;
  border-radius: var(--r-md);
  font-size: .9rem;
  text-align: center;
  opacity: 0;
  transform: translateY(.6rem);
  pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.on { opacity: 1; transform: translateY(0); }


/* =============================================================
   ZakSpa additions: entry pass, scanner, counter, forms, sheets
   ============================================================= */

/* nav can hold six roles' worth of tabs */
.nav { overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
.nav::-webkit-scrollbar { display: none; }
.nav button { flex: 0 0 auto; min-width: 5.2rem; }

/* ---------- chips ---------- */

.chips { display: flex; flex-wrap: wrap; gap: .35rem; }

.chip {
  font-size: .74rem;
  padding: .15rem .55rem;
  border-radius: 100px;
  background: color-mix(in srgb, var(--eucalyptus) 11%, transparent);
  color: var(--eucalyptus);
}
.chip.warn { background: color-mix(in srgb, var(--amber) 14%, transparent); color: var(--amber); }
.chip.off  { background: color-mix(in srgb, var(--stone) 16%, transparent); color: var(--ink-soft); }

/* ---------- the entry pass ---------- */

.pass { text-align: center; padding: 1.4rem 1rem 1.8rem; }

.pass .qr {
  width: min(72vw, 17rem);
  aspect-ratio: 1;
  margin: 0 auto 1rem;
  background: #fff;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  padding: .9rem;
}
.pass .qr canvas, .pass .qr svg { width: 100%; height: 100%; image-rendering: pixelated; }

.pass .digits {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 2.9rem;
  letter-spacing: .22em;
  font-variant-numeric: tabular-nums;
  margin: .2rem 0 .1rem;
  direction: ltr;
}

.pass .countdown {
  font-size: .84rem;
  color: var(--stone);
  font-variant-numeric: tabular-nums;
}

.pass .ring {
  --p: 100;
  width: 3rem; height: 3rem;
  margin: .8rem auto 0;
  border-radius: 50%;
  background: conic-gradient(var(--eucalyptus) calc(var(--p) * 1%), var(--line) 0);
  display: grid; place-items: center;
  transition: background .9s linear;
}
.pass .ring span {
  width: 2.35rem; height: 2.35rem;
  border-radius: 50%;
  background: var(--paper);
  display: grid; place-items: center;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- scanner ---------- */

.scanner {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #000;
  aspect-ratio: 3 / 4;
  margin-bottom: .9rem;
}
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner .frame {
  position: absolute;
  inset: 18%;
  border: 2px solid rgba(255,255,255,.8);
  border-radius: var(--r-md);
  box-shadow: 0 0 0 100vmax rgba(0,0,0,.35);
}

.verdict { border-radius: var(--r-md); padding: 1rem 1.1rem; margin-bottom: .8rem; }
.verdict.yes { background: color-mix(in srgb, var(--live) 14%, var(--surface)); }
.verdict.no  { background: color-mix(in srgb, var(--clay) 12%, var(--surface)); }
.verdict .nm { font-family: 'Frank Ruhl Libre', serif; font-size: var(--step-2); }
.verdict .dt { font-size: .84rem; color: var(--ink-soft); margin-top: .25rem; }

/* ---------- counter / menu grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.2rem, 1fr));
  gap: .55rem;
}

.tile {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: .8rem .7rem;
  text-align: start;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .14s var(--ease);
}
.tile:active { transform: scale(.97); }
.tile .nm { display: block; font-weight: 600; font-size: .93rem; }
.tile .pr { display: block; font-size: .8rem; color: var(--stone); font-variant-numeric: tabular-nums; }
.tile[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--eucalyptus); }
.tile .qty {
  display: inline-block;
  margin-top: .3rem;
  font-size: .78rem;
  color: var(--eucalyptus);
  font-weight: 600;
}

/* ---------- forms ---------- */

.form { display: grid; gap: .8rem; }
.form label { display: block; font-size: .84rem; color: var(--ink-soft); margin-bottom: .3rem; }
.form textarea {
  font-family: inherit; font-size: var(--step-0);
  padding: .7rem .9rem; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface);
  color: var(--ink); width: 100%; min-height: 5rem; resize: vertical;
}
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.form .row-actions { display: flex; gap: .5rem; margin-top: .3rem; }

.toggles { display: flex; flex-wrap: wrap; gap: .4rem; }
.toggle {
  padding: .45rem .85rem;
  border-radius: 100px;
  font-size: .86rem;
  box-shadow: inset 0 0 0 1px var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}
.toggle[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }

/* ---------- sheet (confirm / editor) ---------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-items: end;
  background: rgba(20,35,31,.42);
  backdrop-filter: blur(2px);
}
.sheet[hidden] { display: none !important; }

.sheet .panel {
  background: var(--paper);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 1.3rem 1.2rem calc(1.3rem + env(safe-area-inset-bottom));
  max-height: 88svh;
  overflow-y: auto;
  animation: rise .28s var(--ease);
}
@keyframes rise { from { transform: translateY(1.4rem); opacity: .6 } to { transform: none; opacity: 1 } }

.sheet h3 { margin-bottom: .5rem; }
.sheet p { color: var(--ink-soft); margin: 0 0 1.1rem; }
.sheet .actions { display: flex; gap: .6rem; }
.sheet .actions .btn { flex: 1; }

@media (min-width: 640px) {
  .sheet { align-items: center; justify-items: center; }
  .sheet .panel { border-radius: var(--r-lg); max-width: 30rem; width: 100%; }
}

/* ---------- misc ---------- */

.muted { color: var(--stone); font-size: .84rem; }
.mono { font-variant-numeric: tabular-nums; direction: ltr; }

.banner {
  background: color-mix(in srgb, var(--amber) 13%, var(--surface));
  border-radius: var(--r-md);
  padding: .8rem 1rem;
  font-size: .86rem;
  margin-bottom: .8rem;
}

.banner.bad {
  background: color-mix(in srgb, var(--clay) 12%, var(--surface));
  color: var(--ink);
}

.list-head {
  font-size: .78rem;
  color: var(--stone);
  margin: 1.2rem 0 .4rem;
  text-transform: none;
}

.searchbar { display: flex; gap: .5rem; margin-bottom: .8rem; }
.searchbar input { flex: 1; }

.linkish { color: var(--eucalyptus); text-decoration: underline; text-underline-offset: .2em; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; font-size: .88rem; }
.kv dt { color: var(--stone); }
.kv dd { margin: 0; }

.gate .or {
  display: flex; align-items: center; gap: .8rem;
  color: var(--stone); font-size: .8rem; margin: 1.4rem 0;
}
.gate .or::before, .gate .or::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}

.btn.google {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  width: 100%;
  padding: .8rem 1.15rem;
}

/* =============================================================
   Motion. Everything here is switched off wholesale by the
   prefers-reduced-motion block at the end of this file.
   ============================================================= */

/* A view arriving: the whole screen settles into place once. */
@keyframes viewIn {
  from { opacity: 0; transform: translateY(.5rem); }
  to   { opacity: 1; transform: none; }
}

main.view {
  display: block;
  animation: viewIn .3s var(--ease) both;
}

/* Class rows dealt out like cards, one just after another. */
@keyframes rowIn {
  from { opacity: 0; transform: translateY(.7rem) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.rows .row {
  animation: rowIn .42s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

/* Cards and lines on the quieter screens. */
.card, .stat {
  animation: rowIn .38s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 50ms);
}

/* Just booked: a green wash that fades out, so the eye lands on the
   row that changed rather than hunting for it. */
@keyframes flash {
  0%   { box-shadow: inset 0 0 0 2px var(--live),
                     0 0 0 0 color-mix(in srgb, var(--live) 45%, transparent); }
  100% { box-shadow: inset 0 0 0 1.5px var(--eucalyptus),
                     0 0 0 14px transparent; }
}

.row.flash { animation: rowIn .42s var(--ease) both, flash 1.1s var(--ease) .1s; }

/* The entry pass, each time it renews itself. */
@keyframes passPulse {
  0%   { transform: scale(.97); opacity: .55; }
  60%  { transform: scale(1.012); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.pass .qr.renew { animation: passPulse .6s var(--ease); }

@keyframes digitsIn {
  from { opacity: 0; transform: translateY(-.25rem); letter-spacing: .4em; }
  to   { opacity: 1; transform: none; letter-spacing: .22em; }
}

.pass .digits.renew { animation: digitsIn .45s var(--ease); }

/* The 30-second ring: a real second hand, not a stepped bar. */
.pass .ring { transition: background 1s linear; }
.pass .ring.low { background: conic-gradient(var(--clay) calc(var(--p) * 1%), var(--line) 0); }

/* A thin line at the top while a screen fetches, instead of a blank
   page that looks broken. */
.loadbar {
  position: fixed;
  inset-inline: 0;
  top: 0;
  height: 2px;
  z-index: 60;
  background: var(--eucalyptus);
  transform-origin: 100% 50%;
  transform: scaleX(0);
  opacity: 0;
  transition: transform .5s var(--ease), opacity .25s var(--ease);
}
.loadbar.on  { transform: scaleX(.75); opacity: 1; }
.loadbar.done { transform: scaleX(1); opacity: 0; transition: transform .18s ease-out, opacity .3s .1s; }

/* A tile that leads somewhere should say so under the finger. */
a.stat {
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
}

/* .line is already flex — do NOT set display here or the row
   collapses into a block. */
a.line-link {
  text-decoration: none;
  color: inherit;
}
a.line-link:hover { background: color-mix(in srgb, var(--paper) 55%, transparent); }
a.line-link .amt { color: var(--eucalyptus); }

a.toggle { text-decoration: none; }
a.stat::after {
  content: '‹';
  position: absolute;
  inset-inline-start: .8rem;
  top: .8rem;
  color: var(--stone);
  font-size: 1.1rem;
  opacity: .55;
  transition: transform .18s var(--ease), opacity .18s var(--ease);
}
a.stat:hover::after, a.stat:focus-visible::after { opacity: 1; transform: translateX(-.15rem); }
a.stat:active { transform: scale(.985); }
a.stat { transition: transform .14s var(--ease), box-shadow .2s var(--ease); }
a.stat:hover { box-shadow: inset 0 0 0 1px var(--line); }

/* Counting numbers need tabular figures or the tile jitters. */
.stat .v { font-variant-numeric: tabular-nums; }

/* Tapping a tile or a day should feel like pressing something. */
.tile, .day, .toggle, .mark { transition: transform .14s var(--ease), background .2s var(--ease), color .2s var(--ease); }
.day:active, .toggle:active, .mark:active { transform: scale(.94); }

/* The waiting-list badge, when it appears. */
@keyframes badgeIn {
  from { opacity: 0; transform: scale(.8); }
  to   { opacity: 1; transform: none; }
}
.row.mine .badge { animation: badgeIn .35s var(--ease) both .15s; }


/* =============================================================
   Photos
   ============================================================= */

.avatar {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--line);
  display: grid;
  place-items: center;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-soft);
  overflow: hidden;
}
.avatar.lg { width: 4.6rem; height: 4.6rem; font-size: 1.3rem; }
.avatar.sm { width: 2rem; height: 2rem; font-size: .72rem; }
.avatar.ph { background: color-mix(in srgb, var(--eucalyptus) 14%, var(--line)); }

/* A line or row that leads with a face. */
.withface { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.withface > span { min-width: 0; }

/* Class cover on a schedule row. */
.row .cover {
  grid-row: 1 / span 2;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--line);
}

/* Teacher's face inside the row subtitle. */
.row .sub .face {
  width: 1.25rem; height: 1.25rem;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: -.3em;
  margin-inline-end: .3rem;
}

/* Product pictures on the cafe grid. */
.tile .pic {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-sm);
  margin-bottom: .45rem;
  background: var(--line);
}

/* The picture control inside a form. */
.photo-field {
  display: flex;
  align-items: center;
  gap: .9rem;
}
.photo-field .preview {
  width: 4.6rem; height: 4.6rem;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--line);
  display: grid; place-items: center;
  font-size: .72rem;
  color: var(--stone);
  text-align: center;
  overflow: hidden;
}
.photo-field .preview.round { border-radius: 50%; }
.photo-field input[type="file"] { display: none; }
.photo-field .acts { display: flex; flex-direction: column; gap: .4rem; }
.photo-field .acts .btn { padding: .42rem .9rem; font-size: .85rem; }

/* The face on the reception verdict card. */
.verdict .who { display: flex; align-items: center; gap: .9rem; }
.verdict .who .avatar { width: 3.4rem; height: 3.4rem; }


/* =============================================================
   Week and month views of the timetable
   ============================================================= */

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-bottom: .9rem;
  font-size: .95rem;
}
.cal-nav .btn { padding: .35rem .9rem; font-size: 1.1rem; line-height: 1; }
.cal-nav span { font-family: 'Frank Ruhl Libre', serif; font-size: 1.05rem; text-align: center; }

/* ---------- week: one row per day ---------- */

.week { display: flex; flex-direction: column; gap: .45rem; margin-bottom: 1rem; }

.week-day {
  display: grid;
  grid-template-columns: 3.6rem 1fr;
  gap: .7rem;
  align-items: start;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: .7rem .85rem;
}
.week-day.quiet { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.week-day.today { box-shadow: inset 0 0 0 2px var(--eucalyptus); }

.week-name { text-align: center; line-height: 1.25; }
.week-name b { display: block; font-size: .9rem; }
.week-name span { font-size: .75rem; color: var(--stone); font-variant-numeric: tabular-nums; }

.week-items { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }

.chip-session {
  display: inline-flex;
  align-items: baseline;
  gap: .35rem;
  padding: .3rem .6rem;
  border-radius: 100px;
  background: color-mix(in srgb, var(--eucalyptus) 11%, transparent);
  color: var(--ink);
  text-decoration: none;
  font-size: .82rem;
  transition: transform .14s var(--ease), background .2s var(--ease);
}
.chip-session b { font-variant-numeric: tabular-nums; }
.chip-session span { color: var(--stone); font-size: .76rem; }
.chip-session:hover { background: color-mix(in srgb, var(--eucalyptus) 20%, transparent); }
.chip-session:active { transform: scale(.96); }
.chip-session.full { background: color-mix(in srgb, var(--stone) 18%, transparent); }
.chip-session.full span { color: var(--clay); }

/* ---------- month: a grid ---------- */

.month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .3rem;
  margin-bottom: 1rem;
}

.month-dow {
  text-align: center;
  font-size: .72rem;
  color: var(--stone);
  padding-bottom: .2rem;
}

.month-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  background: var(--surface);
  display: grid;
  place-items: center;
  text-decoration: none;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: transform .14s var(--ease), background .2s var(--ease);
}
.month-cell.empty { background: transparent; }
.month-cell b { font-weight: 400; font-size: .95rem; }
.month-cell i {
  position: absolute;
  bottom: .22rem;
  font-style: normal;
  font-size: .62rem;
  background: var(--eucalyptus);
  color: var(--paper);
  min-width: 1.05rem;
  height: 1.05rem;
  border-radius: 100px;
  display: grid;
  place-items: center;
}
.month-cell.has { background: color-mix(in srgb, var(--eucalyptus) 9%, var(--surface)); }
.month-cell.today { box-shadow: inset 0 0 0 2px var(--amber); }
.month-cell.chosen { background: var(--ink); color: var(--paper); }
.month-cell.chosen i { background: var(--paper); color: var(--ink); }
.month-cell:active { transform: scale(.94); }

@media (max-width: 380px) {
  .month { gap: .2rem; }
  .month-cell b { font-size: .82rem; }
}


/* =============================================================
   Class icons
   ============================================================= */

.cicon {
  width: 2.6rem;
  height: 2.6rem;
  flex: 0 0 auto;
  color: var(--eucalyptus);
}
.cicon.inline {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -.2em;
  margin-inline-end: .35rem;
}
.cicon.tiny { width: 1rem; height: 1rem; }

/* the picker */
.iconpick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.4rem, 1fr));
  gap: .4rem;
  max-height: 15rem;
  overflow-y: auto;
  padding: .2rem;
}

.iconopt {
  display: grid;
  justify-items: center;
  gap: .15rem;
  padding: .5rem .25rem .4rem;
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-soft);
  transition: transform .14s var(--ease), background .2s var(--ease);
}
.iconopt span { font-size: .66rem; color: var(--stone); }
.iconopt .cicon { width: 1.7rem; height: 1.7rem; color: currentColor; }
.iconopt:active { transform: scale(.94); }
.iconopt[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  box-shadow: none;
}
.iconopt[aria-pressed="true"] span { color: color-mix(in srgb, var(--paper) 75%, transparent); }


.qrsvg { width: 100%; height: 100%; display: block; }


/* =============================================================
   Class page, links, alerts
   ============================================================= */

.titlelink { color: inherit; text-decoration: none; }
.titlelink:hover { text-decoration: underline; text-underline-offset: .2em; }

.classhero {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--r-md);
  background: var(--line);
  margin-bottom: .8rem;
}
.classhero.blank {
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--eucalyptus) 9%, var(--surface));
}
.cicon.big { width: 4.5rem; height: 4.5rem; }

.verdict.warn { background: color-mix(in srgb, var(--amber) 16%, var(--surface)); }

.alertline {
  margin-top: .7rem;
  padding-top: .7rem;
  border-top: 1px solid color-mix(in srgb, var(--clay) 35%, transparent);
  font-size: .88rem;
  color: var(--clay);
}


.photo-field .preview.over {
  outline: 2px dashed var(--eucalyptus);
  outline-offset: 2px;
}


/* Standing in somebody else's shoes — impossible to miss. */
.actingbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--amber);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  padding: .5rem 1rem;
  font-size: .88rem;
}
.actingbar button {
  background: rgba(255,255,255,.22);
  color: #fff;
  border-radius: 100px;
  padding: .2rem .7rem;
  font-size: .82rem;
}
.actingbar + .app .masthead { top: 2.2rem; }


/* =============================================================
   Money chart
   ============================================================= */

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: .4rem;
}

.legend { display: flex; gap: .9rem; font-size: .82rem; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend i { width: .7rem; height: .7rem; border-radius: 3px; display: inline-block; }

.mchart { width: 100%; height: auto; display: block; touch-action: manipulation; }
.mchart .maxis { stroke: var(--line); stroke-width: 1; }
.mchart .mtot {
  font-size: 9px;
  fill: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.mchart .mmon { font-size: 9px; fill: var(--stone); }
.mchart .mbar { cursor: pointer; }
.mchart .mbar rect:not(.mhit) { transition: opacity .15s var(--ease); }
.mchart .mbar.on rect:not(.mhit) { opacity: 1; }
.mchart:has(.mbar.on) .mbar:not(.on) rect:not(.mhit) { opacity: .45; }
.mchart .mbar:focus { outline: none; }
.mchart .mbar:focus-visible rect.mhit {
  fill: color-mix(in srgb, var(--eucalyptus) 10%, transparent);
}

.mtip {
  margin-top: .5rem;
  font-size: .84rem;
  color: var(--ink-soft);
  background: var(--paper);
  border-radius: var(--r-sm);
  padding: .5rem .7rem;
}
.mtip[hidden] { display: none; }

/* =============================================================
   Change notices — the red lights
   ============================================================= */

.notices {
  background: color-mix(in srgb, var(--amber) 12%, var(--surface));
  border-radius: var(--r-md);
  padding: .8rem .9rem;
  margin-bottom: .9rem;
}
.notices.loud { background: color-mix(in srgb, var(--clay) 13%, var(--surface)); }

.notices-head {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: .5rem;
}

.notices .dot {
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  background: var(--clay);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--clay) 60%, transparent);
  animation: pulse 1.8s var(--ease) infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--clay) 55%, transparent); }
  70%  { box-shadow: 0 0 0 .55rem transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.notice {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem 0;
  color: inherit;
  text-decoration: none;
  font-size: .88rem;
  border-bottom: 1px solid color-mix(in srgb, var(--clay) 18%, transparent);
}
.notice:last-of-type { border-bottom: none; }
.notice .n { display: block; color: var(--stone); font-size: .78rem; }

.row.changed { box-shadow: inset 0 0 0 1.5px var(--clay); }
.badge.red {
  background: color-mix(in srgb, var(--clay) 15%, transparent) !important;
  color: var(--clay) !important;
}

/* =============================================================
   Counter: who is here, guests, arriving orders
   ============================================================= */

.chips-people { display: flex; flex-wrap: wrap; gap: .4rem; }

.personchip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .7rem .3rem .35rem;
  border-radius: 100px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: .85rem;
  transition: transform .14s var(--ease), background .2s var(--ease);
}
.personchip span { text-align: start; line-height: 1.15; }
.personchip .n { display: block; font-size: .7rem; color: var(--stone); }
.personchip:active { transform: scale(.96); }
.personchip.on { background: var(--ink); color: var(--paper); box-shadow: none; }
.personchip.on .n { color: color-mix(in srgb, var(--paper) 70%, transparent); }

/* an order that just arrived from somebody's phone */
.line.fresh {
  background: color-mix(in srgb, var(--live) 12%, transparent);
  border-radius: var(--r-sm);
  animation: rowIn .4s var(--ease) both;
}


/* =============================================================
   Ambient background
   -------------------------------------------------------------
   Three large, very soft colour fields that drift over tens of
   seconds. Deliberately cheap: translate on a GPU layer, no blur
   filter and no background-position animation, both of which cost
   real frames on a phone. Each field is tinted with the spa's own
   accent, so this belongs to the spa rather than to the app.
   ============================================================= */

.ambient {
  position: fixed;
  inset: 0;
  /* Zero, not -1: a fixed layer behind the root background is a known
     source of paint glitches. The app sits above it on z-index 1. */
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 85% at 50% -10%,
      color-mix(in srgb, var(--eucalyptus) 7%, transparent), transparent 60%),
    var(--paper);
}

.ambient i {
  position: absolute;
  display: block;
  border-radius: 50%;
  opacity: .5;
  will-change: transform;
  /* its own layer, so drifting never repaints the page above it */
  transform: translateZ(0);
  contain: strict;
}

/* the big one, low and slow */
.ambient i:nth-child(1) {
  width: 78vmax; height: 78vmax;
  inset-block-start: -26vmax;
  inset-inline-end: -22vmax;
  background: radial-gradient(circle at 50% 50%,
    color-mix(in srgb, var(--eucalyptus) 16%, transparent) 0%,
    transparent 68%);
  animation: drift-a 46s var(--ease) infinite alternate;
}

/* a warmer field, opposite corner */
.ambient i:nth-child(2) {
  width: 62vmax; height: 62vmax;
  inset-block-end: -24vmax;
  inset-inline-start: -18vmax;
  background: radial-gradient(circle at 50% 50%,
    color-mix(in srgb, var(--amber) 13%, transparent) 0%,
    transparent 66%);
  animation: drift-b 58s var(--ease) infinite alternate;
}

/* a pale centre that breathes, to keep the middle from going flat */
.ambient i:nth-child(3) {
  width: 54vmax; height: 54vmax;
  inset-block-start: 28%;
  inset-inline-start: 22%;
  background: radial-gradient(circle at 50% 50%,
    color-mix(in srgb, var(--live) 10%, transparent) 0%,
    transparent 70%);
  animation: drift-c 72s linear infinite;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-6vmax, 4vmax, 0) scale(1.08); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.04); }
  to   { transform: translate3d(5vmax, -5vmax, 0) scale(1); }
}
@keyframes drift-c {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(3vmax, -3vmax, 0) scale(1.12); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

/* The paper itself must stay opaque where content sits, or text
   starts fighting the background. */
body { background: transparent; }

#root, .app { position: relative; z-index: 1; }

/* =============================================================
   A little more depth, now that there is something behind
   ============================================================= */

.card, .stat, .row, .week-day, .month-cell:not(.empty), .tile, .personchip {
  box-shadow:
    0 1px 2px color-mix(in srgb, var(--ink) 4%, transparent),
    0 6px 18px -12px color-mix(in srgb, var(--ink) 16%, transparent);
}

/* Translucent, but NOT blurred. A backdrop-filter on every card —
   dozens of them, over a fixed background layer — made the compositor
   drop the sticky header while scrolling: the masthead detached and
   left a grey band behind it. The blur stays on the two bars only,
   where there is one of each. */
.card, .stat, .row {
  background: color-mix(in srgb, var(--surface) 96%, transparent);
}

.tile[aria-pressed="true"], .personchip.on, .month-cell.chosen {
  box-shadow:
    inset 0 0 0 2px var(--eucalyptus),
    0 2px 10px -4px color-mix(in srgb, var(--eucalyptus) 40%, transparent);
}

.masthead {
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  backdrop-filter: blur(18px) saturate(1.35);
}

.masthead .wordmark { letter-spacing: -.015em; }

.nav {
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: blur(18px) saturate(1.25);
}

.btn.go {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--eucalyptus) 92%, #fff),
    var(--eucalyptus));
  box-shadow: 0 2px 10px -4px color-mix(in srgb, var(--eucalyptus) 55%, transparent);
}

.sect-head h2 { letter-spacing: -.01em; }


/* =============================================================
   Background styles, chosen per person (body[data-bg])
   -------------------------------------------------------------
   Every one of them is CSS: nothing to download, nothing to decode,
   and each picks up the accent colour, so a person's choice of
   colour changes the whole mood rather than one button.
   ============================================================= */

/* aurora — the default: three fields drifting */
body[data-bg="mist"] .ambient i:nth-child(1),
body[data-bg="mist"] .ambient i:nth-child(2) { animation-duration: 90s; opacity: .38; }
body[data-bg="mist"] .ambient i:nth-child(3) { display: none; }
body[data-bg="mist"] .ambient {
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--eucalyptus) 9%, transparent),
      transparent 45%),
    var(--paper);
}

body[data-bg="sand"] .ambient {
  background:
    radial-gradient(120% 80% at 70% 0%,
      color-mix(in srgb, var(--amber) 12%, transparent), transparent 62%),
    var(--paper);
}
body[data-bg="sand"] .ambient i:nth-child(1) {
  background: radial-gradient(circle at 50% 50%,
    color-mix(in srgb, var(--amber) 18%, transparent) 0%, transparent 68%);
}
body[data-bg="sand"] .ambient i:nth-child(3) {
  background: radial-gradient(circle at 50% 50%,
    color-mix(in srgb, var(--clay) 12%, transparent) 0%, transparent 70%);
}

body[data-bg="stone"] .ambient {
  background:
    radial-gradient(110% 70% at 30% 0%,
      color-mix(in srgb, var(--ink) 7%, transparent), transparent 60%),
    var(--paper);
}
body[data-bg="stone"] .ambient i {
  background: radial-gradient(circle at 50% 50%,
    color-mix(in srgb, var(--ink) 9%, transparent) 0%, transparent 70%) !important;
  opacity: .42;
}

/* plain — no movement at all, for anyone who wants the app to sit still */
body[data-bg="plain"] .ambient i { display: none; }
body[data-bg="plain"] .ambient { background: var(--paper); }

/* the picker itself */
.bgpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr)); gap: .5rem; }

.bgopt {
  border-radius: var(--r-md);
  padding: 0;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: center;
  background: var(--surface);
}
.bgopt .swatch { display: block; height: 3.2rem; }
.bgopt span { display: block; font-size: .72rem; padding: .3rem 0; color: var(--ink-soft); }
.bgopt[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--eucalyptus); }
.bgopt[aria-pressed="true"] span { color: var(--ink); font-weight: 600; }

.accents { display: flex; flex-wrap: wrap; gap: .5rem; }
.accent-dot {
  width: 2.2rem; height: 2.2rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent);
  position: relative;
}
.accent-dot[aria-pressed="true"]::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: .9rem;
}

/* the install hint on the sign-in page */
.install {
  margin-top: 1.2rem;
  background: color-mix(in srgb, var(--eucalyptus) 8%, var(--surface));
  border-radius: var(--r-md);
  padding: .8rem .9rem;
  font-size: .85rem;
}
.install b { display: block; margin-bottom: .2rem; }
.install .btn { margin-top: .6rem; }

/* Must stay LAST, and must also kill the delays: a staggered
   animation with fill-mode both would otherwise hold an element at
   opacity 0 for its delay even with the duration zeroed. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    /* the ambient fields are infinite: park them where they start */
    animation-play-state: paused !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
}
