/* Parlor Manager — admin styles */

:root {
  --ink: #1d1a17;
  --ink-soft: #5f5850;
  --paper: #f6f3ee;
  --card: #ffffff;
  --line: #e2dcd2;
  --side: #1f1915;
  --side-text: #d8cfc2;
  --accent: #a8742f;
  --accent-dark: #865a20;
  --ok-bg: #e7f3ea;
  --ok-ink: #1f5c33;
  --err-bg: #fbe9e6;
  --err-ink: #8f2a1c;
  --radius: 8px;

  /* 4px spacing scale: every margin, padding and gap uses these */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  /* three text sizes, so no screen shows more than three */
  --fs-sm: 13px;
  --fs-md: 16px;
  --fs-lg: 24px;

  accent-color: var(--accent);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: var(--fs-md)/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif;
}

a { color: var(--accent-dark); }

h1 { font-size: var(--fs-lg); margin: 0 0 var(--s-1); line-height: 1.2; }
h2 { font-size: var(--fs-md); margin: 0 0 var(--s-4); }
.lead { color: var(--ink-soft); margin: 0 0 var(--s-6); max-width: 62ch; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }

.side {
  background: var(--side);
  color: var(--side-text);
  padding: var(--s-5) var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  /* Pinned to the screen with its own scroll: the owner's full menu and Sign out stay in reach on long pages. */
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.side__shop { padding: 0 var(--s-2); display: grid; gap: var(--s-1); }
.side__shop strong { color: #fff; font-size: var(--fs-md); }
.side__shop span { font-size: var(--fs-sm); opacity: .75; }
.side__nav { display: grid; gap: var(--s-3); }
.side__group { display: grid; gap: 0; }
.side__heading { margin: 0 0 2px; padding: 0 var(--s-3); font-size: var(--fs-sm); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; opacity: .55; }
.side__nav a, .side__account {
  color: inherit;
  text-decoration: none;
  padding: 6px var(--s-3);
  border-radius: 6px;
}
.side__nav a:hover, .side__account:hover { background: rgba(255, 255, 255, .07); }
.side__nav a.is-current, .side__account.is-current { background: var(--accent); color: #fff; }
/* Account links sit under the signed-in name, so the menu below has the full height. */
.side__out { display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-1) var(--s-3); border-bottom: 1px solid rgba(255, 255, 255, .1); }
.side__account { font-size: var(--fs-sm); padding: var(--s-1) var(--s-2); }
.side__out .btn { width: auto; padding: var(--s-1) var(--s-2); font-size: var(--fs-sm); }

.main { padding: var(--s-8) clamp(var(--s-4), 4vw, var(--s-12)) var(--s-16); min-width: 0; }

/* ---------- Bare pages (sign-in, setup) ---------- */
.bare .main { max-width: 460px; margin: 0 auto; padding-top: 9vh; }
.bare .card { padding: var(--s-8); }

/* ---------- Cards and layout ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s-5);
  margin-bottom: var(--s-5);
}
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: var(--s-5); align-items: start; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-4); margin-bottom: var(--s-5); }
.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s-4);
  text-decoration: none;
  color: inherit;
  display: grid;
  gap: var(--s-1);
}
.tile:hover { border-color: var(--accent); }
.tile b { font-size: var(--fs-lg); line-height: 1.1; }
.tile span { color: var(--ink-soft); font-size: var(--fs-sm); }

.steps { margin: 0; padding-left: var(--s-5); display: grid; gap: var(--s-2); }
.steps .done { color: var(--ink-soft); text-decoration: line-through; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
th, td { text-align: left; padding: var(--s-3) var(--s-3); border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.actions { text-align: right; white-space: nowrap; }
td.actions form { display: inline; }
tr.is-off td { color: #9b938a; }
.sub { display: block; font-size: var(--fs-sm); color: var(--ink-soft); }
.empty { color: var(--ink-soft); margin: 0; }

.tag { display: inline-block; font-size: var(--fs-sm); padding: var(--s-1) var(--s-2); border-radius: 99px; background: #efe9df; color: var(--ink-soft); white-space: nowrap; }
.tag--off { background: #eee; }

/* ---------- Forms ---------- */
.field { display: grid; gap: var(--s-1); margin-bottom: var(--s-4); }
.field label, .field .label { font-size: var(--fs-sm); font-weight: 600; }
.field small { color: var(--ink-soft); font-size: var(--fs-sm); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }

input[type=text], input[type=tel], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  padding: var(--s-2) var(--s-3);
  border: 1px solid #cfc7ba;
  border-radius: 6px;
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
td input[type=number] { width: 96px; text-align: right; }

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: var(--s-2) var(--s-4);
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn--plain { background: #fff; color: var(--ink); border-color: #cfc7ba; }
.btn--plain:hover { background: #f3efe8; border-color: #b9b0a2; }
.btn--small { padding: var(--s-1) var(--s-3); font-size: var(--fs-sm); font-weight: 500; }
.btn--quiet { background: transparent; border-color: rgba(255, 255, 255, .25); color: inherit; width: 100%; font-weight: 500; }
.btn--quiet:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .4); }
.form-actions { display: flex; gap: var(--s-3); align-items: center; margin-top: var(--s-1); }

/* ---------- Messages ---------- */
.flash, .errors { border-radius: 6px; padding: var(--s-3) var(--s-4); margin: 0 0 var(--s-5); }
.flash--ok { background: var(--ok-bg); color: var(--ok-ink); }
.flash--error, .errors { background: var(--err-bg); color: var(--err-ink); }
.errors ul { margin: 0; padding-left: var(--s-5); }
.note { background: #f3ede2; border-radius: 6px; padding: var(--s-3) var(--s-4); color: var(--ink-soft); font-size: var(--fs-sm); margin: 0 0 var(--s-4); }

/* ---------- Small screens ---------- */
@media (max-width: 1320px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split > .card:last-child, .split > div:last-child { max-width: 560px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .side { min-width: 0; }
  .side__nav { min-width: 0; }
  .split > .card:last-child, .split > div:last-child { max-width: none; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; padding: var(--s-3) var(--s-4); gap: var(--s-3); position: static; height: auto; overflow: visible; }
  .side__shop { flex: 1 1 0; min-width: 0; padding: 0; }
  .side__out { margin: 0; padding: 0; border: 0; display: flex; align-items: center; gap: var(--s-2); }
  .side__out .btn { width: auto; }
  .side__account { white-space: nowrap; }
  .side__nav { order: 3; flex: 1 1 100%; display: flex; gap: var(--s-1); overflow-x: auto; padding-bottom: var(--s-1); }
  /* On a phone the groups sit in one scrolling row, split by a thin line instead of headings. */
  .side__group { display: flex; gap: var(--s-1); }
  .side__group + .side__group { border-left: 1px solid rgba(255, 255, 255, .15); padding-left: var(--s-2); margin-left: var(--s-1); }
  .side__heading { display: none; }
  .side__nav a { white-space: nowrap; padding: var(--s-2) var(--s-3); }
  .main { padding-top: var(--s-6); }
}
@media (max-width: 480px) {
  .row { grid-template-columns: 1fr; }
}

/* ---------- Page head ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-1); }
.page-head .lead { margin-bottom: var(--s-5); }
.page-head h1 .tag { vertical-align: middle; margin-left: var(--s-2); }
.card--narrow { max-width: 620px; }
.tag--good { background: var(--ok-bg); color: var(--ok-ink); }
.tag--bad { background: var(--err-bg); color: var(--err-ink); }
.btn--danger { background: #a3361f; border-color: #a3361f; }
.btn--danger:hover { background: #862a17; border-color: #862a17; }
.btn--wide { width: 100%; padding: var(--s-3) var(--s-4); font-size: var(--fs-md); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Floor ---------- */
.floor__today { margin: 0 0 var(--s-4); color: var(--ink-soft); }
.floor__today b { color: var(--ink); }
.floor { display: grid; grid-template-columns: minmax(0, 1fr) 240px; grid-template-areas: "chairs wait" "chairs pay"; gap: var(--s-5); align-items: start; }
.floor__chairs { grid-area: chairs; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s-3); }
.floor__col:nth-of-type(2) { grid-area: wait; }
.floor__col:nth-of-type(3) { grid-area: pay; }
.floor__col { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s-4); }
.floor__col h2 { font-size: var(--fs-md); margin-bottom: var(--s-3); display: flex; justify-content: space-between; align-items: center; }

.chair {
  display: grid;
  gap: var(--s-1);
  align-content: start;
  min-height: 118px;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  color: inherit;
  text-decoration: none;
  font-size: var(--fs-sm);
}
.chair b { font-size: var(--fs-md); line-height: 1.25; overflow-wrap: anywhere; }
.chair__label { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.chair__foot { margin-top: var(--s-2); font-variant-numeric: tabular-nums; }
.chair--free { border-style: dashed; color: var(--ink-soft); }
.chair--free b { color: var(--ok-ink); }
.chair--free:hover { border-color: var(--ok-ink); background: #fbfdfb; }
.chair--busy { border-color: var(--accent); border-left-width: 5px; background: #fffaf2; }
.chair--busy:hover { background: #fff4e3; }
/* Blocked by out-of-order equipment: not seatable. The tile opens the property list to see why. */
.chair--off { background: repeating-linear-gradient(135deg, var(--card), var(--card) 8px, var(--err-bg) 8px, var(--err-bg) 10px); color: var(--ink-soft); }
.chair--off b { color: var(--err-ink); }
.chair:focus-visible, .queue:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.queue { display: grid; gap: var(--s-1); padding: var(--s-2) var(--s-3); border-radius: 6px; text-decoration: none; color: inherit; border: 1px solid var(--line); margin-top: var(--s-2); font-size: var(--fs-sm); }
.queue:hover { border-color: var(--accent); }
.queue span { color: var(--ink-soft); }
.queue--pay { border-left: 4px solid var(--ok-ink); }

/* ---------- Bill ---------- */
.split--bill { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); }
.inline-form { display: flex; gap: var(--s-2); align-items: center; }
.inline-form select { min-width: 130px; }
select.needs { border-color: #c9772a; background: #fff6ea; }
.add-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: var(--s-3); align-items: end; }
.add-row--two { grid-template-columns: minmax(0, 1fr) auto; margin-top: var(--s-1); }
.add-row .btn { margin-bottom: var(--s-4); }
.add-row + .add-row, .add-row + .note { border-top: 1px solid var(--line); padding-top: var(--s-4); }
.form-actions--spread { justify-content: space-between; border-top: 1px solid var(--line); padding-top: var(--s-4); }
.below { margin-top: var(--s-3); }

.totals { margin: 0; display: grid; gap: var(--s-2); }
.totals div { display: flex; justify-content: space-between; gap: var(--s-3); align-items: baseline; }
.totals dt { color: var(--ink-soft); }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.totals__due { border-top: 1px solid var(--line); padding-top: var(--s-3); }
.totals__due dt { color: var(--ink); font-weight: 600; }
.totals__due dd { font-size: var(--fs-lg); font-weight: 700; }

.pay-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-2); align-items: center; margin-bottom: var(--s-2); }
.pay-row label { font-weight: 600; font-size: var(--fs-sm); }
.pay-row input[data-pay] { text-align: right; font-variant-numeric: tabular-nums; }
.pay-left { min-height: 22px; margin: var(--s-1) 0 var(--s-3); font-size: var(--fs-sm); }
.pay-left--off { color: var(--err-ink); font-weight: 600; }

/* ---------- Receipt ---------- */
.receipt { width: 302px; max-width: 100%; background: #fff; border: 1px solid var(--line); padding: var(--s-5) var(--s-4); font-size: var(--fs-sm); line-height: 1.4; color: #000; position: relative; }
.receipt p { margin: 0; }
.receipt__shop { text-align: center; font-size: var(--fs-md); font-weight: 700; }
.receipt__meta, .receipt__foot { text-align: center; }
.receipt__rule { border-top: 1px dashed #000; margin: var(--s-2) 0; }
.receipt__row { display: flex; justify-content: space-between; gap: var(--s-3); }
.receipt__row span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.receipt__part { padding-left: var(--s-3); font-size: var(--fs-sm); color: #333; }
.receipt__total { font-size: var(--fs-md); font-weight: 700; margin: var(--s-1) 0; }
/* A titled group of fields inside a form, such as the daily bonus in Shop settings. */
.fieldset { border: 1px solid var(--line); border-radius: 8px; padding: var(--s-4); margin: 0 0 var(--s-4); }
.fieldset legend { font-size: var(--fs-sm); font-weight: 600; padding: 0 var(--s-2); }
.fieldset .note { margin-top: 0; }

/* Stock: the add-usage row has a service, an amount and its button on one line. */
.row--add { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; margin-top: var(--s-4); }
.field--end { align-self: end; }
@media (max-width: 480px) {
  .row--add { grid-template-columns: 1fr; }
}
.form-gap { margin-top: var(--s-6); }
.floor__low { margin: 0 0 var(--s-3); }
.floor__low a { font-weight: 600; }

/* Walk-in slip: the token is the one thing the customer must read across the room, so it is the only text above --fs-lg. */
.slip__label { text-align: center; margin-top: var(--s-3) !important; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .2em; }
.slip__token { text-align: center; font-size: calc(var(--fs-lg) * 2.5); font-weight: 700; line-height: 1; margin-bottom: var(--s-2) !important; font-variant-numeric: tabular-nums; }
.token { display: inline-block; min-width: 2em; padding: 0 var(--s-1); border-radius: 4px; background: var(--ink); color: #fff; font-size: var(--fs-sm); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.page-head h1 .token { vertical-align: middle; font-size: var(--fs-md); padding: var(--s-1) var(--s-2); }
.receipt__void { text-align: center; font-size: var(--fs-lg); font-weight: 700; letter-spacing: .2em; border: 2px solid #000; margin-bottom: var(--s-2) !important; }

@media (max-width: 1320px) {
  .split--bill { grid-template-columns: minmax(0, 1fr); }
  .split--bill > div:last-child { max-width: 560px; }
}
@media (max-width: 1000px) {
  .floor { grid-template-columns: minmax(0, 1fr); grid-template-areas: "chairs" "wait" "pay"; }
}
@media (max-width: 860px) {
  .split--bill > div:last-child { max-width: none; }
}
@media (max-width: 560px) {
  .floor__chairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .add-row, .add-row--two { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .add-row .btn { justify-self: start; }
  .inline-form select { min-width: 0; width: 100%; }
  .inline-form { width: 100%; }
  /* Bill lines stack: service and price on top, barber and remove below. */
  .lines thead { display: none; }
  .lines, .lines tbody { display: block; }
  .lines tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-2) var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
  .lines tr:last-child { border-bottom: 0; }
  .lines td { border: 0; padding: 0; }
  .lines td:nth-child(1) { grid-area: 1 / 1; }
  .lines td:nth-child(3) { grid-area: 1 / 2; }
  .lines td:nth-child(2) { grid-area: 2 / 1; }
  .lines td:nth-child(4) { grid-area: 2 / 2; align-self: center; }
}

@media print {
  .side, .no-print, .flash { display: none !important; }
  body, .shell { display: block; background: #fff; }
  .main { padding: 0; }
  .receipt { border: 0; width: 72mm; padding: 0; font-size: var(--fs-sm); }
  @page { margin: 4mm; }
}

/* ---------- Search, customers, closing ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.search { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; margin-bottom: var(--s-5); }
.search input[type=text] { width: min(320px, 100%); }
.search input[type=date] { width: auto; }
textarea { resize: vertical; min-height: 90px; }
div.tile b { font-size: var(--fs-lg); overflow-wrap: anywhere; }
.pay-left--ok { color: var(--ok-ink); font-weight: 600; }
.note.below { margin: var(--s-4) 0 0; }
form.below .note { margin-bottom: var(--s-3); }

/* ---------- Reports, payroll ---------- */
.quick { display: flex; gap: var(--s-2); flex-wrap: wrap; margin: 0 0 var(--s-5); }
.quick .tag { text-decoration: none; padding: var(--s-1) var(--s-3); font-size: var(--fs-sm); }
.quick .tag:hover { background: #e6dccb; }
.tag--on { background: var(--accent); color: #fff; }
.split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
tfoot th { border-top: 2px solid var(--line); border-bottom: 0; font-size: var(--fs-md); text-transform: none; letter-spacing: 0; color: var(--ink); padding-top: var(--s-3); }
.check { display: flex; gap: var(--s-2); align-items: center; font-weight: 600; font-size: var(--fs-sm); }
.check input { width: 18px; height: 18px; }
.search input[type=month] { width: auto; font: inherit; padding: var(--s-2) var(--s-3); border: 1px solid #cfc7ba; border-radius: 6px; background: #fff; }
.main > .form-actions { flex-wrap: wrap; }
@media (max-width: 1320px) {
  .split--even { grid-template-columns: minmax(0, 1fr); }
  .split--even > .card:last-child { max-width: none; }
}
@media print {
  .card { border: 0; padding: 0; }
  .tag { background: none; padding: 0; }
}
@media (max-width: 1320px) {
  .split--summary-first > div:last-child { order: -1; }
}
@media (max-width: 560px) {
  .hide-sm { display: none; }
  th, td { padding-left: var(--s-2); padding-right: var(--s-2); }
}

/* ---------- Lounges ---------- */
.floor__lounge { grid-column: 1 / -1; margin: var(--s-2) 0 0; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.floor__lounge:first-child { margin-top: 0; }
.tag--lounge { background: #e9dcc6; color: #6b4a1c; }
tr.group-row th { background: #f6f1e8; color: var(--ink); font-size: var(--fs-sm); padding-top: var(--s-2); padding-bottom: var(--s-2); }
input[type=file] { font: inherit; width: 100%; }
table.compact th, table.compact td { padding-left: var(--s-2); padding-right: var(--s-2); }
table.compact td.actions .btn { padding-left: var(--s-2); padding-right: var(--s-2); }
.row { align-items: start; }


/* ---------- Brand colour in place of browser defaults ---------- */
::selection { background: var(--accent); color: #fff; }
html { -webkit-tap-highlight-color: rgba(168, 116, 47, 0.25); }
input, select, textarea, button { accent-color: var(--accent); }

/* ---------- Hover and focus on every link and button ---------- */
a { transition: color .15s; }
a:where(:not(.btn, .tile, .chair, .queue, .tag)):hover { color: var(--accent); text-decoration-thickness: 2px; }
.side__nav a:hover { color: #fff; }
a:focus-visible, button:focus-visible, .btn:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}
.side a:focus-visible, .side button:focus-visible { outline-color: #fff; }
.btn:active { transform: translateY(1px); }
a.tile:focus-visible, .chair:focus-visible, .queue:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
input:hover, select:hover, textarea:hover { border-color: #b9b0a2; }

/* ---------- Inline field errors ---------- */
.field-error { display: block; color: var(--err-ink); font-size: var(--fs-sm); font-weight: 600; }
.field .field-error { margin-top: 0; }
.field:has(.field-error) input, .field:has(.field-error) select, .field:has(.field-error) textarea { border-color: var(--err-ink); background: #fffafa; }

/* ---------- Empty lists ---------- */
.empty-state { display: grid; gap: var(--s-3); justify-items: start; padding: var(--s-2) 0; color: var(--ink-soft); }
.empty-state p { margin: 0; }
.floor__col .empty-state { padding: 0; }
.floor__col .empty-state .btn { padding: var(--s-1) var(--s-3); font-size: var(--fs-sm); }

/* ---------- Loading and busy states ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: var(--s-4);
  height: var(--s-4);
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -3px;
  animation: spin .7s linear infinite;
}
.btn.is-busy { pointer-events: none; opacity: .75; }
.btn.is-busy .spinner { margin-right: var(--s-2); }
.live { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--fs-sm); color: var(--ink-soft); }
.live::before { content: ""; width: var(--s-2); height: var(--s-2); border-radius: 50%; background: var(--ok-ink); }
.live.is-loading::before { background: none; border: 2px solid var(--accent); border-right-color: transparent; animation: spin .7s linear infinite; }
.live.is-offline { color: var(--err-ink); font-weight: 600; }
.live.is-offline::before { background: var(--err-ink); }
#floor.is-first-load { min-height: 240px; background: linear-gradient(100deg, #efe9df 30%, #f8f4ec 50%, #efe9df 70%) 0 0 / 200% 100%; border-radius: var(--radius); animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; } }

/* Form controls take the page's font and size instead of the browser's own */
input, button, select, textarea, optgroup { font: inherit; }

/* Lines an import could not take, listed under its result. */
.problems { margin: 0; padding-left: var(--s-5); font-size: var(--fs-sm); color: var(--err-ink); }

/* Messages: the preview under the message form, a message as the customer sees it, and a copyable command. */
.preview { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.preview h3 { margin: 0 0 var(--s-2); font-size: var(--fs-md); }
.preview__msg { margin: var(--s-3) 0; padding: var(--s-3) var(--s-4); background: var(--ok-bg); border-radius: var(--radius); white-space: normal; }
.code { padding: var(--s-3); background: #f6f1e8; border-radius: 6px; font-size: var(--fs-sm); white-space: pre-wrap; word-break: break-all; }

/* Bookings: a request still to confirm, and the public booking page (no menu, phone first). */
.tag--warn { background: #fdf0d8; color: #7a4b0c; }
.book { max-width: 640px; margin: 0 auto; padding: var(--s-6) var(--s-4); }
.book h1 { margin-bottom: var(--s-1); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--s-2); }
.slot { position: relative; }
.slot input { position: absolute; opacity: 0; inset: 0; }
.slot span { display: block; text-align: center; padding: var(--s-2); border: 1px solid var(--line); border-radius: 6px; background: var(--card); cursor: pointer; font-variant-numeric: tabular-nums; }
.slot input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.slot input:focus-visible + span { outline: 2px solid var(--accent-dark); outline-offset: 2px; }
.slot--full span { color: var(--ink-soft); text-decoration: line-through; background: transparent; cursor: not-allowed; opacity: .55; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.checks { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); }
/* A group of choices laid out like any other field (booking times, closed days): no browser border. */
fieldset.field { border: 0; padding: 0; margin: 0 0 var(--s-4); min-width: 0; }
fieldset.field > legend.label { padding: 0; margin-bottom: var(--s-2); font-size: var(--fs-sm); font-weight: 600; }

/* ---------- Waiting-area TV screen ----------
   Read from across the room, so sizes follow the screen (vw) instead of the app's three text sizes. */
.tv { position: fixed; inset: 0; display: flex; flex-direction: column; background: #15100c; color: #f4ede2; padding: 2.5vw 3vw; overflow: hidden; }
.tv__head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid rgba(255, 255, 255, .12); padding-bottom: 1.2vw; margin-bottom: 2vw; }
.tv__shop { font-size: 2.6vw; font-weight: 700; letter-spacing: .02em; }
.tv__clock { font-size: 2.2vw; color: #c9a46a; font-variant-numeric: tabular-nums; }
.tv__body { flex: 1; display: grid; grid-template-columns: 2.2fr 1fr; gap: 3vw; min-height: 0; }
.tv h2 { margin: 0 0 1.4vw; font-size: 1.6vw; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: #c9a46a; }
.tv__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4vw; }
.tv__card { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.6vw 1vw; border-radius: 1vw; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.tv__token { font-size: 6vw; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.tv__chair { margin-top: .6vw; font-size: 1.8vw; color: #d9cfc0; }
.tv__card.is-new { background: #a8742f; border-color: #e0b878; animation: tv-call 1.2s ease-in-out 6; }
.tv__card.is-new .tv__chair { color: #fff; }
@keyframes tv-call { 50% { transform: scale(1.06); box-shadow: 0 0 0 .6vw rgba(224, 184, 120, .35); } }
.tv__queue { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1vw; }
.tv__queue li { font-size: 3.4vw; font-weight: 700; text-align: center; padding: .8vw 0; border-radius: .8vw; background: rgba(255, 255, 255, .05); font-variant-numeric: tabular-nums; }
.tv__queue li.is-next { grid-column: 1 / -1; font-size: 4.6vw; background: rgba(201, 164, 106, .22); color: #fff; }
.tv__empty, .tv__more { font-size: 1.8vw; color: #b9ab98; margin: 0; }
.tv__more { margin-top: 1vw; }
@media (prefers-reduced-motion: reduce) { .tv__card.is-new { animation: none; } }
@media (max-aspect-ratio: 1/1) {
  .tv__body { grid-template-columns: 1fr; }
  .tv__shop { font-size: 5vw; } .tv__clock { font-size: 4.4vw; } .tv h2 { font-size: 3.4vw; }
  .tv__token { font-size: 12vw; } .tv__chair, .tv__empty, .tv__more { font-size: 3.6vw; } .tv__queue li { font-size: 7vw; }
}
