/* Staff screens, built to the UI/UX specification v1.0 (sections 03-07). Plain CSS that Safari 16 supports. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--canvas); color: var(--ink); font: var(--t-dense); -webkit-text-size-adjust: 100%;
  display: flex; flex-direction: column; overflow: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
/* Installed on a tablet the page runs under the system status bar: that strip is the same solid dark as the header. */
body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); background: var(--ink); z-index: 100; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
.eyebrow { font: var(--t-micro); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--teal); }
.eyebrow.amber { color: var(--amber); }
.sub, .hint { color: var(--muted); }
.hint { font: var(--t-micro); }

/* ---------------------------------------------------------------- top bar: dark chrome */
.top { flex: none; display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s4); min-height: 60px;
  background: var(--ink); color: #fff; }
.brand { font: var(--t-micro); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.date-nav { display: flex; gap: var(--s1); }
.tb-btn { min-height: var(--target); min-width: var(--target); padding: 0 var(--s3); border-radius: var(--r-control);
  border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; font-weight: 700; }
.search { position: relative; flex: 0 1 240px; min-width: 150px; }
.search input { width: 100%; min-height: var(--target); border-radius: var(--r-control); border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.08); color: #fff; padding: 0 var(--s3); }
.search input::placeholder { color: rgba(255,255,255,.7); }
.results { position: absolute; top: 48px; left: 0; width: 340px; max-width: 90vw; background: var(--paper); color: var(--ink);
  border-radius: var(--r-card); box-shadow: var(--shadow-overlay); z-index: 40; overflow: hidden; }
.results button { display: grid; grid-template-columns: 1fr auto; gap: var(--s2); width: 100%; text-align: left; border: 0;
  border-top: 1px solid var(--border); background: var(--paper); padding: var(--s2) var(--s3); min-height: var(--target); }
.results p { padding: var(--s3); }
.seg { display: inline-flex; border-radius: var(--r-control); overflow: hidden; border: 1px solid rgba(255,255,255,.35); }
.seg button { min-height: var(--target); padding: 0 var(--s3); border: 0; background: transparent; color: #fff; font-weight: 700; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.spacer { flex: 1; }
.svc-tag { font: var(--t-micro); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.conn { display: inline-flex; align-items: center; gap: var(--s1); font: var(--t-micro); white-space: nowrap; }
.conn::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #7FC4B8; }
.conn.stale::before { background: #E3B27A; }
.conn.down::before { background: #E58B7F; }

/* ---------------------------------------------------------------- workspace: rail / centre / side */
.main { flex: 1; min-height: 0; display: grid; grid-template-columns: 176px minmax(0, 1fr) 300px; }
.rail { background: var(--paper); border-right: 1px solid var(--border); padding: var(--s4) var(--s3); overflow: auto; }
.rail .eyebrow { margin-bottom: var(--s2); }
.num { display: flex; justify-content: space-between; align-items: baseline; width: 100%; border: 0; border-radius: var(--r-control);
  background: none; padding: var(--s2); min-height: var(--target); text-align: left; }
.num span { color: var(--ink); }
.num b { font: var(--t-section); }
.note.quiet { background: transparent; border: 0; color: var(--muted); padding-left: 0; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); }
.filter-bar label { font-weight: 700; }
.filter-bar select { min-height: 44px; font: inherit; padding: 0 var(--s3); border: 1px solid var(--border); border-radius: var(--r-control); background: var(--paper); }
.need-badge { font-style: normal; font-weight: 700; background: #F4D35E; color: var(--ink); border-radius: 999px; padding: 2px 8px; font-size: 12px; }
.num.attn b { color: var(--amber); }
.rail .btn.block { width: 100%; margin-top: var(--s2); }
.rail #new { margin-top: var(--s4); }
#rail-next { margin-top: var(--s5); }
.nx { display: grid; grid-template-columns: 44px minmax(0, 1fr); width: 100%; text-align: left; border: 0; background: none;
  border-radius: var(--r-control); padding: var(--s1) var(--s2); min-height: var(--target); align-items: center; }
.nx .t { font-weight: 700; color: var(--teal); }
.nx .n { overflow-wrap: anywhere; }   /* wrap rather than cut off the party size */
.main.drawer .key, .main.drawer #banners { margin-right: 300px; }   /* keep the key readable beside the drawer */
.main { position: relative; }
.main.full { grid-template-columns: 176px minmax(0, 1fr); }
.main.full .side { display: none; }
.main.full.drawer .side { display: block; position: absolute; top: 0; right: 0; bottom: 0; width: 300px; z-index: 20;
  box-shadow: var(--shadow-overlay); }
.plan-scroll { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.plan-scroll .plan { flex: none; }
.drawer-space { flex: none; width: 0; }
.main.drawer .drawer-space { width: 300px; }
.centre { overflow: auto; padding: var(--s4); min-width: 0; }
.centre-head { margin-bottom: var(--s3); }
.centre-head h1 { font: var(--t-section); }
.side { background: var(--paper); border-left: 1px solid var(--border); overflow: auto; padding: var(--s4); }

.btn { min-height: var(--target); padding: 0 var(--s4); border-radius: var(--r-control); border: 1px solid var(--border);
  background: var(--paper); color: var(--ink); font-weight: 700; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--teal); padding: 0 var(--s2); }
.btn.danger { color: var(--red); border-color: var(--red); }
.btn[disabled] { opacity: .45; cursor: default; }

/* ---------------------------------------------------------------- side column: next arrivals, action needed */
.side .eyebrow { margin-bottom: var(--s2); }
.card { display: block; width: 100%; text-align: left; background: var(--paper); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: var(--s3); margin-bottom: var(--s2); min-height: var(--target); }
.arrival { display: grid; grid-template-columns: 52px 1fr; gap: var(--s2); }
.arrival .t { font-weight: 700; color: var(--teal); }
.arrival b { display: block; }
.attention { background: var(--amber-tint); border: 1px solid #EBD3B8; border-radius: var(--r-card); padding: var(--s3); margin: var(--s4) 0; }
.attention button { display: block; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid #EBD3B8;
  padding: var(--s2) 0; min-height: var(--target); }
.attention button:first-of-type { border-top: 0; }
.attention .crit { color: var(--red); font-weight: 700; }

/* ---------------------------------------------------------------- status: a sentence, not a colour */
.sentence { font-weight: 700; }
.sentence .sym { display: inline-block; width: 1.2em; }
.secondary { color: var(--muted); }
.tag { display: inline-block; font: var(--t-micro); font-weight: 700; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--paper); white-space: nowrap; }
.tag.live { background: var(--mist); border-color: #BCD6CE; color: var(--teal); }
.tag.due { background: var(--amber-tint); border-color: #EBD3B8; color: var(--amber); }
.tag.risk { background: var(--red-tint); border-color: #E6C4BE; color: var(--red); }
.tag.ended { color: var(--muted); }

/* ---------------------------------------------------------------- list */
.slot { font: var(--t-micro); font-weight: 700; color: var(--muted); margin: var(--s3) 0 var(--s1); }
.row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: var(--s3); align-items: center; width: 100%;
  text-align: left; background: var(--paper); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: var(--s2) var(--s3); margin-bottom: var(--s1); min-height: 56px; }
.row[aria-current="true"] { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.row .t { font-weight: 700; }
.row .who { min-width: 0; display: block; margin: 0; }
.row .who b, .row .who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .who span { color: var(--muted); }
.row.ended { background: transparent; }
.row.ended .who b, .row.ended .t { color: var(--muted); }
.empty { background: var(--paper); border: 1px dashed var(--border); border-radius: var(--r-card); padding: var(--s5); text-align: center; }
.empty p { margin-bottom: var(--s3); }
.skeleton { height: 56px; border-radius: var(--r-card); background: #EEF1EE; margin-bottom: var(--s1); }

/* ---------------------------------------------------------------- floor: rooms / live tables */
.floor-bar { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); flex-wrap: wrap; }
.floor-bar select { min-height: var(--target); border: 1px solid var(--border); border-radius: var(--r-control); background: var(--paper); padding: 0 var(--s2); }
.plan { position: relative; background: var(--paper); border: 1px solid var(--border); border-radius: var(--r-pane); }
.room-label { position: absolute; z-index: 3; font: var(--t-micro); font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap; }
.tbl { position: absolute; }
.tbl.closed { opacity: .4; }
.chair { position: absolute; border-radius: 50%; background: #D3DAD7; }
.tile { position: absolute; inset: 0; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1px; padding: 0; border-radius: 6px; border: 2px solid; text-align: center; overflow: hidden; }
.tile .nm { font: 700 13px/15px var(--font); white-space: nowrap; }
.tile .sym { font: 700 12px/12px var(--font); }
.tbl.small .tile .nm { font-size: 12px; letter-spacing: -.02em; }   /* portrait iPad: keep names inside the table */
/* Table colours, approved 1 Nov 2026 */
.tile.free           { background: #FFFFFF; border-color: #B7C2BD; color: var(--ink); }
.tile.expected       { background: #D8E6F3; border-color: #3E6E9C; color: var(--ink); }
.tile.part_seated    { background: #A8D5CC; border-color: #1D6761; color: var(--ink); }
.tile.seated         { background: #1D6761; border-color: #1D6761; color: #FFFFFF; }
.tile.bill_paid      { background: #6B5B95; border-color: #6B5B95; color: #FFFFFF; }
.tile.needs_clearing { background: #F4D35E; border-color: #B08A12; color: var(--ink); }
/* Choosing tables */
.tile.picked      { background: var(--mist); border-color: var(--teal); color: var(--ink); box-shadow: 0 0 0 2px var(--teal); }
.tile.unavailable { background: #E4E8E6; border-color: #C9D0CD; color: var(--muted); }
.tile[disabled] { cursor: default; }
/* The open booking's tables, joined or not, are outlined together */
.tbl.ring .tile { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink); }
.key { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: var(--s3); padding: var(--s2) var(--s3);
  background: var(--paper); border: 1px solid var(--border); border-radius: var(--r-card); }
.key span { display: inline-flex; align-items: center; gap: var(--s2); white-space: nowrap; }
.key .sw { position: static; flex-direction: row; display: inline-flex; width: 26px; height: 26px; flex: none; border-radius: 5px; font: 700 12px/1 var(--font); }

/* ---------------------------------------------------------------- timeline */
.tl { background: var(--paper); border: 1px solid var(--border); border-radius: var(--r-pane); overflow-x: auto; }
.tl-inner { position: relative; min-width: 640px; }
.tl-axis, .tl-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); }
.tl-axis { height: 32px; position: sticky; top: 0; background: var(--paper); z-index: 3; border-bottom: 1px solid var(--border); }
.tl-axis .ticks, .tl-row .lane { position: relative; }
.tl-axis span { position: absolute; top: 8px; font: var(--t-micro); color: var(--muted); transform: translateX(-50%); }
.tl-room { padding: var(--s2) var(--s3); font: var(--t-micro); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tl-row { min-height: 56px; }
.tl-row:nth-of-type(odd) .lane { background: var(--canvas); }
.tl-row .name { font-weight: 700; padding: var(--s2) var(--s3); position: sticky; left: 0; background: var(--paper); z-index: 2; }
.gl { position: absolute; top: 0; bottom: 0; width: 1px; background: #E8ECE9; }
.gl.hour { background: var(--border); }
.blk { position: absolute; top: 6px; bottom: 6px; border-radius: var(--r-control); border: 1px solid var(--teal); background: var(--paper);
  color: var(--teal); font: 700 12px/16px var(--font); padding: 4px 6px; text-align: left; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; min-height: 32px; }
.blk.live { background: var(--teal); color: #fff; }
.blk.departed { border-color: var(--border); color: var(--muted); background: transparent; }
.blk.unalloc { border-style: dashed; border-color: var(--amber); color: var(--amber); }
.blk .tail { position: absolute; top: 0; bottom: 0; right: 0; background: repeating-linear-gradient(135deg, rgba(24,44,42,.14) 0 3px, transparent 3px 6px); }
.blk .join { font-weight: 400; opacity: .85; }
/* Full names (item 31): first name over surname; each line cuts with an ellipsis only as a last resort, first name first in line. */
.blk .fn, .blk .ln { display: block; overflow: hidden; text-overflow: ellipsis; }
.blk .fn + .ln { margin-top: 0; }
.blk .ln { font-weight: 400; }
.blk[aria-current="true"] { outline: 3px solid var(--ink); outline-offset: 1px; }
.nowline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); z-index: 1; pointer-events: none; }

/* ---------------------------------------------------------------- inspector and allocation */
.insp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s2); }
.insp h2 { font: var(--t-title); font-size: 24px; line-height: 30px; margin-top: var(--s1); }
.insp .full { color: var(--muted); }
.insp .status { margin: var(--s3) 0; }
.insp .status p { margin-bottom: 2px; }
.choose { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s2) 0 var(--s3); }
.choose button { min-height: var(--target); padding: 0 var(--s3); border-radius: var(--r-control); border: 1px solid var(--border); background: var(--paper); }
.choose button[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.stack { display: grid; gap: var(--s2); margin: var(--s3) 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin: var(--s3) 0; }
.insp dl { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: var(--s1) var(--s2); margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--border); }
.insp dt { color: var(--muted); }
.insp dd { margin: 0; overflow-wrap: anywhere; }
.insp dd.phone { font: var(--t-section); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin: var(--s2) 0; }
.chip { display: inline-flex; align-items: center; min-height: var(--target); padding-left: var(--s3); border-radius: var(--r-control);
  background: var(--mist); font-weight: 700; }
.chip button { min-width: var(--target); min-height: var(--target); border: 0; background: none; color: var(--teal); font-size: 18px; }
.note { border-radius: var(--r-card); padding: var(--s3); margin: var(--s3) 0; }
.note.info { background: var(--canvas); }
.decision { background: var(--amber-tint); border-radius: var(--r-card); padding: var(--s3); margin: var(--s3) 0; }
.decision h3 { font: var(--t-section); font-size: 16px; margin: var(--s1) 0 var(--s2); }
.decision p { margin-bottom: 2px; }
.stop { background: var(--red-tint); border: 1px solid #E6C4BE; border-radius: var(--r-card); padding: var(--s3); margin: var(--s3) 0; }
.select-list .trow { display: grid; grid-template-columns: 64px 1fr auto; gap: var(--s2); align-items: center; width: 100%;
  text-align: left; background: var(--paper); border: 1px solid var(--border); border-radius: var(--r-card); padding: var(--s2) var(--s3);
  margin-bottom: var(--s1); min-height: 52px; }
.select-list .trow b { font-weight: 700; }
.select-list .trow.selected { background: var(--mist); border-color: var(--teal); }
.select-list .trow.protected { background: var(--amber-tint); border-color: #EBD3B8; }
.select-list .trow.occupied { color: var(--muted); }
.select-list .trow .why { color: var(--muted); font: var(--t-micro); }
.field { display: grid; gap: var(--s1); margin-bottom: var(--s3); }
.field label { font: var(--t-micro); font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea { min-height: var(--target); border: 1px solid var(--border); border-radius: var(--r-control);
  padding: 0 var(--s3); background: var(--paper); font: var(--t-body); }
.field textarea { padding: var(--s2) var(--s3); min-height: 72px; }
.check { display: flex; gap: var(--s2); align-items: center; min-height: var(--target); }
.check input { width: 22px; height: 22px; }

dialog { border: 0; border-radius: var(--r-pane); box-shadow: var(--shadow-overlay); max-width: 440px; padding: var(--s5); color: var(--ink); }
dialog::backdrop { background: rgba(24, 44, 42, .35); }
dialog h2 { font: var(--t-section); margin-bottom: var(--s2); }
dialog .btns { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s4); flex-wrap: wrap; }
.toast { position: fixed; bottom: var(--s4); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: var(--s2) var(--s2) var(--s2) var(--s4); border-radius: var(--r-card); z-index: 50; max-width: 92vw;
  display: flex; align-items: center; gap: var(--s3); }
.toast[hidden] { display: none; }
.toast button { min-height: var(--target); border: 1px solid rgba(255,255,255,.4); background: transparent; color: #fff;
  border-radius: var(--r-control); padding: 0 var(--s3); font-weight: 700; }

/* ---------------------------------------------------------------- narrower than 1180: tighter chrome */
@media (max-width: 1179px) {
  .svc-tag { display: none; }
  .conn { font-size: 0; gap: 0; }
  .main { grid-template-columns: 156px minmax(0, 1fr) 280px; }
  .main.full { grid-template-columns: 156px minmax(0, 1fr); }
  .main.full.drawer .side { width: 280px; }
  .main.drawer .drawer-space { width: 280px; }
  .main.drawer .key, .main.drawer #banners { margin-right: 280px; }
}
/* ---------------------------------------------------------------- portrait iPad and phones: one column */
@media (max-width: 1023px) {
  .top { flex-wrap: wrap; padding: var(--s2) var(--s3); }
  .brand { display: none; }
  .search { flex: 1 1 130px; min-width: 120px; }
  .spacer { display: none; }
  .top { flex-wrap: nowrap; }   /* the menu stays on the header's one row (25 Nov 2026) */
  .main { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .rail { display: flex; gap: var(--s2); align-items: center; padding: var(--s2) var(--s3); border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
  .rail .eyebrow, #rail-next { display: none; }
  #numbers { display: flex; gap: var(--s1); }
  .num { flex-direction: column; align-items: flex-start; min-width: 92px; padding: var(--s1) var(--s2); }
  .rail .btn.block { width: auto; margin: 0; white-space: nowrap; }
  .rail #new { margin-left: auto; }
  .rail #new, .rail #walk { margin-top: 0; align-self: center; min-height: var(--target); }   /* both buttons level (item 26) */
  .side { position: fixed; left: 0; right: 0; bottom: 0; max-height: 82vh; border-left: 0; border-radius: var(--r-pane) var(--r-pane) 0 0;
    box-shadow: var(--shadow-overlay); z-index: 30; }
  .side.idle { display: none; }
}

/* ---------------------------------------------------------------- status ladder (approved 1 Nov 2026)
   One sequence for guest and table, in the floor plan's colours, used by the status panel, List tags,
   Timeline blocks and the key alike. */
.ladder { list-style: none; margin: var(--s3) 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rung { display: flex; align-items: center; gap: var(--s2); min-height: 36px; padding: 0 var(--s2); border-radius: var(--r-control);
  border: 2px solid transparent; color: var(--muted); }
.rung .sw, .ladder .sw { position: static; display: inline-flex; flex: none; width: 24px; height: 24px; border-radius: 5px; font: 700 12px/1 var(--font); }
.rung.done { color: #7D8985; }
.rung.done .sw { opacity: .55; }
.rung.now { border-color: var(--ink); background: #F3F6F4; color: var(--ink); font-weight: 700; }
.rung .lab, .rung .when { margin-left: auto; font: var(--t-micro); }
.rung .lab { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.btn.step { width: 100%; min-height: 56px; font-size: 18px; font-weight: 700; border-width: 2px; margin-bottom: var(--s2); }
.split { text-align: center; font: var(--t-micro); color: var(--muted); margin: 0 0 var(--s2); }
.link { border: 0; background: none; color: var(--teal); text-decoration: underline; font: inherit; min-height: var(--target); padding: 0 4px; }
.note.warn { background: var(--red-tint); color: var(--red); }

.btn.s-expected, .tag.s-expected, .blk.s-expected             { background: #D8E6F3; border-color: #3E6E9C; color: var(--ink); }
.btn.s-part_seated, .tag.s-part_seated, .blk.s-part_seated    { background: #A8D5CC; border-color: #1D6761; color: var(--ink); }
.btn.s-seated, .tag.s-seated, .blk.s-seated                   { background: #1D6761; border-color: #1D6761; color: #FFFFFF; }
.btn.s-bill_paid, .tag.s-bill_paid, .blk.s-bill_paid          { background: #6B5B95; border-color: #6B5B95; color: #FFFFFF; }
.btn.s-departed                                               { background: #E4E8E6; border-color: #7D8985; color: var(--ink); }
.btn.s-needs_clearing, .tag.s-needs_clearing, .blk.s-needs_clearing { background: #F4D35E; border-color: #B08A12; color: var(--ink); }
.btn.s-free                                                   { background: #FFFFFF; border-color: var(--teal); color: var(--ink); }
.tag.s-due { background: var(--amber-tint); border-color: #EBD3B8; color: var(--amber); }
.tag.s-risk, .blk.s-risk { background: var(--red-tint); border-color: var(--red); color: var(--red); }
.tag.s-ended, .blk.s-ended { background: transparent; border-color: var(--border); color: var(--muted); }
.blk.s-due { border-style: dashed; }

/* ---------------------------------------------------------------- sign-in (W6) */
#who { display: inline-flex; align-items: center; gap: var(--s2); color: #fff; font-weight: 700; }
.who-name, #who .tb-btn { white-space: nowrap; }
#who .lock-btn { display: none; }   /* Lock is in the menu (25 Nov 2026) */
.gate { position: fixed; inset: 0; z-index: 50; background: var(--ink); display: flex; align-items: center; justify-content: center;
  padding: var(--s4); overflow: auto; }
.gate[hidden] { display: none; }
.gate-card { background: var(--paper); border-radius: var(--r-pane); padding: var(--s5); width: 100%; max-width: 420px; }
.gate-card h1 { font: var(--t-section); margin: var(--s1) 0 var(--s3); }
.gate-card fieldset { border: 0; padding: 0; margin: 0 0 var(--s3); }
.gate-card legend { font-weight: 700; margin-bottom: var(--s1); }
.gate-err { color: var(--red); min-height: 1.4em; margin: var(--s2) 0; font-weight: 700; }
.keypad-card { max-width: 340px; text-align: center; }
.dots { display: flex; justify-content: center; gap: var(--s3); margin: var(--s3) 0 0; }
.dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink); }
.dots i.on { background: var(--ink); }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin-top: var(--s2); }
.keys button { min-height: 64px; border-radius: var(--r-control); border: 1px solid var(--border); background: var(--canvas);
  font: 700 24px/1 var(--font); color: var(--ink); }
.keys button.soft { font-size: 15px; background: transparent; }
.keys button:active { background: var(--mist); }
/* Nobody signed in (Kitchen view): look, don't touch. The server refuses changes anyway. */
body.readonly #new, body.readonly #walk, body.readonly .insp .btn:not([data-close]):not(.quiet),
body.readonly .insp .link, body.readonly .split, body.readonly .insp .field { display: none; }
.admin-list { list-style: none; margin: var(--s2) 0; padding: 0; }
.admin-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s2) 0;
  border-bottom: 1px solid var(--border); }
.admin-list li > span:first-child { display: flex; flex-direction: column; }
.pair-s { display: flex; gap: var(--s1); }

/* ---------------------------------------------------------------- pauses and closures (2 Nov 2026) */
#banners { display: flex; flex-direction: column; gap: var(--s1); margin-bottom: var(--s2); }
#banners:empty { display: none; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); width: 100%; min-height: 40px; text-align: left;
  border-radius: var(--r-card); padding: var(--s1) var(--s3); border: 1px solid var(--border); background: var(--paper); color: var(--ink); font: inherit; }
.banner .bt { min-width: 0; }
.banner.pause .bt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* one line however many pauses; the details are a tap away */
.banner.shut { background: var(--red-tint); border-color: var(--red); color: var(--red); }
.banner.shut-soft { background: #F1F3F2; border-style: dashed; }
.banner.pause { background: var(--amber-tint); border-color: #E2C29B; }
.banner .btn { min-height: 36px; }
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); }
.seg-s { display: flex; flex-wrap: wrap; gap: var(--s1); margin: var(--s2) 0 var(--s3); }
.seg-s .btn[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 700; }
.note.warn-soft { background: var(--amber-tint); color: var(--ink); }
.note.warn-soft p { margin: 0; }
.note .plain { margin: var(--s2) 0 0; padding-left: var(--s4); }
.warn-text { color: var(--red); font-weight: 700; }
.att-pause { padding: var(--s2) 0; border-top: 1px solid #E7CDB0; }
.att-pause p { margin: 0 0 var(--s2); color: var(--amber); font-weight: 700; }
.att-pause .btn { min-height: 36px; padding: 0 var(--s2); }
.room-toggle { font: var(--t-micro); font-weight: 700; text-transform: none; letter-spacing: 0; min-height: 0; padding: 0 0 0 6px; }
/* closed to everyone: hatched; held back from online: a small "no web" tag */
.tbl.shut .tile { background: repeating-linear-gradient(135deg, #E4E8E6 0 6px, #F4F6F5 6px 12px); border-color: #9AA6A2; border-style: dashed; color: var(--muted); }
.held-mark { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); z-index: 2; white-space: nowrap;
  font: 700 10px/14px var(--font); padding: 0 5px; border-radius: 7px; background: var(--ink); color: #fff; }
.held-mark.static { position: static; transform: none; display: inline-block; }
.key-extra { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s2); }
.key-extra span { display: inline-flex; align-items: center; gap: var(--s1); }
.sw-shut { display: inline-block; width: 20px; height: 20px; border-radius: 4px; border: 2px dashed #9AA6A2;
  background: repeating-linear-gradient(135deg, #E4E8E6 0 4px, #F4F6F5 4px 8px); }
.tl-shut { position: absolute; top: 4px; bottom: 4px; border-radius: var(--r-control); overflow: hidden; z-index: 0;
  background: repeating-linear-gradient(135deg, rgba(154,166,162,.35) 0 6px, transparent 6px 12px); border: 1px dashed #9AA6A2; }
.tl-shut.online { background: repeating-linear-gradient(135deg, rgba(24,44,42,.10) 0 6px, transparent 6px 12px); }
.tl-shut span { font: var(--t-micro); color: var(--muted); padding: 0 6px; white-space: nowrap; }

.attention .att-pause .btn { display: inline-flex; width: auto; border: 1px solid var(--border); background: var(--paper);
  color: var(--ink); font-weight: 700; padding: 0 var(--s2); min-height: 40px; }
.attention .att-pause .btn.quiet { border-color: transparent; background: transparent; color: var(--teal); }
.attention .att-pause .pair-s { flex-wrap: wrap; }
.num .on-tag { font: 700 12px/1 var(--font); background: var(--amber-tint); color: var(--amber); border-radius: 999px; padding: 4px 8px; }
/* Owner table choice (2 Nov 2026): a numbered order with up/down buttons, touch-sized. */
.pref-list { margin: var(--s2) 0; padding-left: 2em; }
.pref-list li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.pref-list li > span:first-child { display: inline-block; min-width: 5em; line-height: 48px; }
.pref-list li .pair-s { float: right; }
.pref-list li::after { content: ""; display: block; clear: both; }
.pref-list li .pair-s .btn { min-width: 48px; }
textarea { font: inherit; width: 100%; padding: var(--s2); border: 1px solid var(--border); border-radius: 8px; box-sizing: border-box; }

/* ---------------------------------------------------------------- phones (decided 2 Nov 2026): list-first
   The day as a list; a booking opens full screen; New booking and Walk-in sit within thumb reach at the bottom;
   tables are chosen from a list. No floor plan or timeline. Owner screens stack in one column. */
@media (max-width: 599px) {
  .top { gap: var(--s1); padding: var(--s1) var(--s2); flex-wrap: wrap; }
  #views, .svc-tag { display: none; }
  .date-nav { flex: none; }
  .search { order: 5; flex: 1 1 100%; }
  .top .who { margin-left: auto; }
  .main { display: flex; flex-direction: column; }
  .rail { padding: var(--s1) var(--s2); }
  .num { min-width: 84px; }
  .centre { padding: var(--s3) var(--s2) calc(96px + env(safe-area-inset-bottom)); flex: 1; }
  .centre-head h1 { font-size: 20px; }
  .rail #new, .rail #walk { position: fixed; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 20;
    width: calc(50% - 18px); min-height: 52px; margin: 0; box-shadow: var(--shadow-overlay); }
  .rail #new { left: 12px; }
  .rail #walk { right: 12px; left: auto; background: var(--paper); }
  body.sheet .rail #new, body.sheet .rail #walk, body.picking .rail #new, body.picking .rail #walk { display: none; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
  .side:not(.idle) { position: fixed; inset: 0; max-height: none; border-radius: 0; z-index: 40; padding: var(--s3) var(--s3) calc(var(--s5) + env(safe-area-inset-bottom)); }
  body.picking .side:not(.idle) { position: static; box-shadow: none; border-bottom: 1px solid var(--border); order: 2; z-index: auto; }
  body.picking .centre { order: 3; }
  .row { grid-template-columns: 44px minmax(0, 1fr) auto; gap: var(--s2); padding-left: var(--s2); padding-right: var(--s2); }
  .row .tag { white-space: nowrap; }
  .pair { flex-wrap: wrap; }
  dialog { max-width: calc(100vw - 24px); }
}

/* ---------------------------------------------------------------- the Kitchen view (decided 2 Nov 2026)
   View-only, readable from a few feet away. */
body.kitchen .rail, body.kitchen .side, body.kitchen #views, body.kitchen .search, body.kitchen .date-nav,
body.kitchen .svc-tag { display: none; }
body.kitchen .main { grid-template-columns: minmax(0, 1fr); }
body.kitchen .centre { padding: var(--s4) var(--s5); }
body.kitchen .centre-head h1 { font-size: 28px; }
body.kitchen .sub { font-size: 20px; margin-top: var(--s1); }
body.kitchen .centre-head h1 { line-height: 1.2; }
.k-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin: var(--s3) 0 var(--s4); }
.k-num { background: var(--paper); border: 1px solid var(--border); border-radius: var(--r-pane); padding: var(--s3) var(--s4); }
.k-num b { display: block; font-size: 56px; line-height: 1.05; color: var(--ink); }
.k-num span { font-size: 20px; color: var(--muted); }
.k-list { list-style: none; margin: var(--s2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.k-row { display: grid; grid-template-columns: 110px 96px minmax(0, 1fr); gap: var(--s3); align-items: start;
  background: var(--paper); border: 1px solid var(--border); border-left: 8px solid #3E6E9C; border-radius: var(--r-control); padding: var(--s3); }
.k-row.s-part_seated { border-left-color: #A8D5CC; }
.k-row.s-seated { border-left-color: #1D6761; }
.k-time { font-size: 32px; font-weight: 700; }
.k-party { font-size: 32px; font-weight: 700; line-height: 1; }
.k-party small { display: block; font-size: 15px; font-weight: 400; color: var(--muted); margin-top: 4px; }
.k-main { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); align-items: center; font-size: 20px; }
.k-main > b { font-size: 24px; margin-right: var(--s1); }
.k-main .tag { font-size: 15px; }
.k-flag { font-size: 16px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--amber-tint); color: var(--amber); border: 1px solid #EBD3B8; }
.k-note { flex-basis: 100%; font-size: 20px; padding: var(--s1) var(--s2); background: #FFF6D6; border-left: 4px solid #B08A12; border-radius: 4px; }
.k-empty { font-size: 22px; color: var(--muted); margin-top: var(--s3); }
@media (max-width: 1023px) {
  .k-row { grid-template-columns: 80px 70px minmax(0, 1fr); }
  .k-num b { font-size: 40px; }
}

/* ---------------------------------------------------------------- v9.1 (trial feedback, 2 Nov 2026) */
/* Status panel: every status as a large choice; nothing changes until Save. */
.opts { list-style: none; margin: var(--s3) 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.opt { display: flex; align-items: center; gap: var(--s2); width: 100%; min-height: 48px; padding: 0 var(--s3); text-align: left;
  border: 2px solid var(--border); border-radius: var(--r-control); background: var(--paper); color: var(--ink); font: inherit; font-size: 17px; }
.opt .sw { position: static; display: inline-flex; flex: none; width: 26px; height: 26px; border-radius: 6px; font: 700 13px/1 var(--font); }
.opt .lab { margin-left: auto; font: var(--t-micro); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.opt.now { background: #F3F6F4; }
.opt.sel { border-color: var(--teal); box-shadow: inset 0 0 0 2px var(--teal); }
.opt.sel .lab { color: var(--teal); }
.save-status { min-height: 56px; font-size: 18px; font-weight: 700; }
.btn[disabled] { opacity: .45; }
.stepper { display: flex; align-items: center; justify-content: center; gap: var(--s2); margin: 0 0 var(--s1); font-size: 16px; list-style: none; }
.stepper .btn { min-width: 48px; padding: 0; font-size: 22px; font-weight: 700; }
.stepper b { font-size: 20px; min-width: 1.5em; text-align: center; }
.stepper.big input { width: 5em; text-align: center; font-size: 22px; font-weight: 700; min-height: var(--target);
  border: 1px solid var(--border); border-radius: var(--r-control); }
.stepper.inline { justify-content: flex-start; margin: 0; }
.btn.x-close { border: 2px solid var(--ink); color: var(--ink); font-weight: 700; min-width: 104px; }
/* Booking form: date, guests, time by hour then minutes. */
.date-pick { justify-content: flex-start; font-weight: 700; text-align: left; }
.time-big { font-size: 28px; font-weight: 700; margin: 0 0 var(--s2); }
.hours, .mins { display: grid; gap: 6px; margin-bottom: 6px; }
.hours { grid-template-columns: repeat(5, 1fr); }
.mins { grid-template-columns: repeat(4, 1fr); }
.hours .btn, .mins .btn { padding: 0; font-weight: 700; }
.hours .btn.full, .mins .btn.full { background: #F1F3F2; color: #8A9592; border-style: dashed; }
.mins .btn.free { border-color: var(--teal); color: var(--teal); }
.mins .btn.late { font-style: italic; }
.hours .btn.on, .mins .btn.on { background: var(--teal); border-color: var(--teal); color: #fff; }
/* Calendar */
.cal { width: min(92vw, 420px); max-width: 100%; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.cal-head h2 { font-size: 20px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: var(--s3) 0; }
.cal-w { font: var(--t-micro); font-weight: 700; color: var(--muted); text-align: center; }
.cal-d { min-width: 0; padding: 0; min-height: 52px; border: 1px solid var(--border); border-radius: var(--r-control); background: var(--paper); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; font: inherit; }
.cal-d b { font-size: 16px; }
.cal-d small { font-size: 11px; color: var(--teal); font-weight: 700; }
.cal-d.shut { background: #EEF0EF; color: #9AA5A2; }
.cal-d.today { box-shadow: inset 0 0 0 2px var(--ink); }
.cal-d.on { background: var(--teal); color: #fff; }
.cal-d.on small { color: #fff; }
.cal-d[disabled] { opacity: .5; }
.date-pick { min-width: 6.5em; font-weight: 600; white-space: nowrap; }
.tb-btn.icon { display: inline-flex; align-items: center; justify-content: center; }
.cal-btns { display: flex; align-items: center; gap: var(--s2); }
.cal-btns .spacer { flex: 1; }
.linkbtn { background: none; border: 0; color: var(--accent, #1f5a52); font-weight: 600; min-height: var(--target); padding: 0 var(--s2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
/* Item 3 (26 Nov 2026): inputs at 16px or more so iOS never zooms into them, and no double-tap zoom on controls */
input, select, textarea { font-size: 16px; }
button, select, input, textarea, .tbl, .row, .nx, svg { touch-action: manipulation; }
/* Choosing tables: a bar along the bottom, the whole floor in view. */
.pickbar { position: fixed; left: 176px; right: 0; bottom: 0; z-index: 25; background: var(--paper); border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px rgba(24,44,42,.12); padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom)); }
.pickbar[hidden] { display: none; }
.pickbar .bar-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s2); }
.pickbar .chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.pickbar .pair { max-width: 520px; }
.chips .seats { font-weight: 700; color: var(--teal); }
.chips .seats.short { color: var(--red); }
body.barmode .centre { padding-bottom: 210px; }
@media (max-width: 1179px) { .pickbar { left: 156px; } }
@media (max-width: 1023px) { .pickbar { left: 0; } }
.banner .by { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.banner .btn { margin-left: var(--s2); }
/* Phone menu */
.menu { position: relative; }
.menu[hidden] { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 240px; background: var(--paper); border-radius: var(--r-card);
  box-shadow: var(--shadow-overlay); padding: var(--s1); display: flex; flex-direction: column; }
.menu-list[hidden] { display: none; }
.menu-list button { min-height: 52px; border: 0; background: none; text-align: left; padding: 0 var(--s3); font: inherit; font-size: 17px; color: var(--ink); border-radius: var(--r-control); }
.menu-list button:active { background: #F3F6F4; }
.menu-list hr { border: 0; border-top: 1px solid var(--border); margin: var(--s1) 0; }
@media (max-width: 599px) {
  .top .who-name { display: none; }
  #numbers { display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; gap: 2px; }
  .rail { overflow: visible; }
  #numbers .num { min-width: 0; padding: var(--s1); font-size: 12px; }
  #numbers .num b { font-size: 18px; }
  .pickbar { display: none !important; }
}
/* The bar on one or two lines: who, tables and seats, any warning, then Save and Cancel on the right. */
.pickbar { padding-top: var(--s2); padding-bottom: calc(var(--s2) + env(safe-area-inset-bottom)); }
.pickbar .ps-main { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); }
.pickbar .bar-head { margin: 0; }
.pickbar .note { margin: 0; padding: var(--s1) var(--s3); display: flex; align-items: center; gap: var(--s2); }
.pickbar .pair { margin: 0 0 0 auto; width: 320px; flex: none; }
body.barmode .centre { padding-bottom: 140px; }
.cal-d[disabled] { background: #EEF0EF; color: #A3ADAA; opacity: 1; }

/* ---------------------------------------------------------------- v9.2 (25 Nov 2026) */
.rail { min-height: 0; }
/* Short screens (a tablet with the browser bars showing): a tighter header and service column; the column scrolls inside itself. */
@media (min-width: 1024px) and (max-height: 760px) {
  .top { min-height: 52px; }
  .tb-btn, .seg button, .search input { min-height: 40px; }
  .rail { padding: var(--s2) var(--s2); }
  .rail .eyebrow { margin-bottom: 0; }
  .num { min-height: 38px; padding: var(--s1) var(--s2); }
  .rail #new { margin-top: var(--s2); }
  .rail .btn.block { min-height: 40px; margin-top: var(--s1); }
  #rail-next { margin-top: var(--s3); }
  .nx { min-height: 38px; }
  .centre { padding: var(--s3); }
  .centre-head { margin-bottom: var(--s2); display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--s3); }
  .centre-head h1 { font-size: 20px; line-height: 26px; }
  .floor-bar { margin-bottom: var(--s1); }
  .floor-bar .eyebrow { display: none; }
  .floor-bar select { min-height: 36px; }
  .key { margin-top: var(--s2); padding: var(--s1) var(--s3); gap: var(--s1) var(--s3); }
  .key .sw { width: 20px; height: 20px; }
  .banner { min-height: 36px; }
}

/* Nothing in a drawer is ever wider than the drawer (item 27, Closures & coming up on the Samsung). */
.side { overflow-x: hidden; }
.insp, .insp > *, .insp .field, .insp .pair, .insp .stack { min-width: 0; max-width: 100%; }
.insp input, .insp select, .insp textarea, .insp .btn.block { max-width: 100%; }
.insp .row, .insp li, .insp p { overflow-wrap: anywhere; }

.summary { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); align-items: baseline; margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.summary b { color: var(--text, inherit); font-weight: 700; }
.summary i { font-size: 12px; font-style: normal; }

/* v9.2.2 */
.kid { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; font-size: 12px; font-weight: 700; color: var(--muted); vertical-align: middle; }
.kid .ic { flex: none; }
.kidnote { display: flex; align-items: center; gap: var(--s2); }
.mk { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--ink, #182C2A); color: #fff; font-size: 13px; font-weight: 700; flex: none; }
.mk.on-tile { position: absolute; top: -9px; right: -9px; z-index: 3; border: 2px solid #fff; pointer-events: none; }
.nx, .card.arrival { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; text-align: left; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #e6ecea; color: #182C2A; font-size: 12px; font-weight: 600; }
.pill.need { background: #f6d77a; color: #4a3500; }
.again { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 9px); white-space: nowrap; z-index: 2; pointer-events: none; font-size: 11px; line-height: 1.1; font-weight: 600; color: var(--muted); }
.again.tight { color: #8a5a00; background: #fbe8b4; border-radius: 4px; padding: 0 3px; }
.field.two { display: flex; gap: var(--s3); }
.field.two > div { flex: 1; }

.num b { white-space: nowrap; }
.seg { flex: none; }

.newer { display: block; width: 100%; min-height: var(--target); border: 0; background: var(--amber); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }

/* item 2 (v9.4): note and message markers */
.mark { display: inline-flex; align-items: center; margin-left: 6px; color: var(--teal); vertical-align: middle; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.note-line { display: block; font: var(--t-dense); color: var(--muted); font-weight: 400; white-space: normal; }
.note-badge { position: absolute; top: -9px; left: -9px; z-index: 3; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  border: 2px solid var(--teal); color: var(--teal); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.note-badge .ic { width: 11px; height: 11px; }
.filter-bar select#when { margin-left: var(--s2); }

/* ---------------------------------------------------------------- v9.5 markers */
.chip-s { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--mist); color: var(--ink);
  font: var(--t-micro); font-weight: 700; vertical-align: middle; white-space: nowrap; }
.chip-s.late { background: var(--amber-tint); color: var(--amber); }
.mark.new { color: var(--amber); }
.mark.new::after { content: "new"; margin-left: 2px; font: var(--t-micro); font-weight: 700; }
.mark.ok { color: var(--teal); font-weight: 700; }
.late-mark { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); z-index: 3; padding: 0 6px; border-radius: 999px;
  background: var(--amber); color: #fff; font: var(--t-micro); font-weight: 700; white-space: nowrap; }
.kidlines { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s2) 0; font-weight: 700; }
.kidlines span { display: inline-flex; align-items: center; gap: 4px; }
.room-chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--mist); color: var(--teal); font-weight: 700; white-space: nowrap; }
.room-chip.full { background: var(--amber-tint); color: var(--amber); }
.bar-head .room-chip { margin-left: var(--s2); }

/* ---------------------------------------------------------------- v9.5 Flow view */
.fl-cards { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s3); }
.fl-card { background: var(--paper); border: 1px solid var(--border); border-radius: var(--r-card); padding: var(--s1) var(--s3); min-width: 0; }
.fl-card span { display: block; font: var(--t-micro); color: var(--muted); }
.fl-card b { font: 700 24px/30px var(--font); }
.fl-card small { font: var(--t-dense); color: var(--muted); }
.fl-wrap { background: var(--paper); border: 1px solid var(--border); border-radius: var(--r-card); overflow: auto; }
table.fl { width: 100%; border-collapse: collapse; }
.fl th, .fl td { height: 40px; padding: 0 var(--s2); border-bottom: 1px solid var(--border); text-align: right; font: var(--t-body); white-space: nowrap; }
.fl td.fl-flag { white-space: normal; padding: 4px var(--s2); }
.fl thead th { height: 32px; font: var(--t-micro); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.fl th:first-child, .fl td:first-child, .fl .fl-flag { text-align: left; }
.fl tbody th { font-weight: 400; }
.fl tr.past { color: var(--muted); }
.fl tr.now { background: var(--teal-tint); font-weight: 700; }
.fl tr.now th { font-weight: 700; }
.now-chip { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 10px; background: var(--teal); color: #fff; font: var(--t-micro); font-weight: 700; }
.flag { display: inline-block; padding: 2px 8px; border-radius: 12px; background: var(--amber-tint); color: var(--amber);
  font: var(--t-micro); font-weight: 700; }
.flag.very_busy { background: var(--red-tint); color: var(--red); }
#day-note { width: 100%; min-height: 64px; border: 1px solid var(--border); border-radius: var(--r-control); padding: var(--s2); font: var(--t-body); }

/* the Timeline's top row: arriving booked / in */
.tl-row.fr { min-height: 52px; background: var(--mist); border-bottom: 2px solid var(--teal); }
.tl-row.fr .name { background: var(--mist); line-height: 16px; }
.tl-row.fr .name small { display: block; font-weight: 400; color: var(--muted); }
.tl-row.fr .lane { background: transparent !important; }
.fr-cell { position: absolute; top: 0; bottom: 0; padding: 6px 4px; border-left: 1px solid var(--border); overflow: hidden; white-space: nowrap; }
.fr-cell b { font: 700 18px/22px var(--font); }
.fr-cell span { font: var(--t-dense); color: var(--muted); }
.fr-cell.now { background: var(--teal-tint); }
.fr-cell.busy { background: var(--amber-tint); }
.fr-flag { display: block; font: var(--t-micro); font-weight: 700; color: var(--amber) !important; }

/* Turned away */
.ta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); margin-top: var(--s2); }
.btn.ta { min-height: 56px; font: 700 20px/24px var(--font); }
.btn.ta[aria-pressed="true"] { border: 2px solid var(--teal); background: var(--teal-tint); }
#ta-more { width: 120px; min-height: var(--target); border: 1px solid var(--border); border-radius: var(--r-control); padding: 0 var(--s3); }
.rail #turned { display: flex; align-items: center; justify-content: center; gap: var(--s2); }

/* ---------------------------------------------------------------- v9.5 the booking thread */
.thread { margin-top: var(--s4); border-top: 1px solid var(--border); padding-top: var(--s3); }
.th-list { list-style: none; margin: var(--s2) 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.th-list li { display: grid; grid-template-columns: 22px 1fr; gap: var(--s2); padding: var(--s2); border-radius: var(--r-control); background: var(--canvas); }
.th-list li.th-guest, .th-list li.th-to_guest { background: var(--mist); }
.th-list li.th-staff { background: #FBF7E8; }
.th-list li.th-history, .th-list li.th-email { background: transparent; padding-top: 2px; padding-bottom: 2px; color: var(--muted); }
.th-list li.new { box-shadow: inset 3px 0 0 var(--amber); }
.th-ic { display: flex; justify-content: center; padding-top: 2px; color: var(--teal); }
.th-meta { font: var(--t-micro); color: var(--muted); }
.th-meta b { color: var(--ink); }
.th-text { font: var(--t-dense); color: var(--ink); overflow-wrap: anywhere; }
.th-history .th-text, .th-email .th-text { color: var(--muted); }
.th-box { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s3); }
.th-box .seg-s { margin: 0; }
.th-box textarea { width: 100%; min-height: 64px; border: 1px solid var(--border); border-radius: var(--r-control); padding: var(--s2); font: var(--t-body); }

/* ---------------------------------------------------------------- v9.5 owner: hours and texts */
.hours-day { border: 1px solid var(--border); border-radius: var(--r-card); padding: var(--s2) var(--s3); margin: var(--s3) 0 0; }
.hours-day legend { padding: 0 var(--s1); }
.hours-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.hours-grid[hidden] { display: none; }
.hours-grid select, .hours-grid input { width: 100%; min-height: var(--target); border: 1px solid var(--border); border-radius: var(--r-control); background: var(--paper); padding: 0 var(--s2); }
.hours-grid .pair-s input { width: 50%; }
#side textarea[data-tx], #side input[data-tx] { width: 100%; border: 1px solid var(--border); border-radius: var(--r-control); padding: var(--s2); font: var(--t-dense); min-height: var(--target); }
#h-hc { width: 120px; min-height: var(--target); border: 1px solid var(--border); border-radius: var(--r-control); padding: 0 var(--s2); }
.fl thead th { white-space: normal; line-height: 14px; }
.fl td.fl-flag { min-width: 168px; }
.fl th:first-child { min-width: 118px; }
/* v9.5 layout fixes: markers stay on the name line; two-up fields and the hours grid never push the panel wider. */
.row .who b .mark, .row .who b .kid, .row .who b .chip-s, .row .who .chip-s { display: inline-flex; vertical-align: middle; }
.row .who b { white-space: normal; }
.field.two > div { min-width: 0; }
.field.two select, .field.two input { width: 100%; min-width: 0; }
.hours-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.hours-grid > .field { min-width: 0; }
.hours-grid .pair-s { min-width: 0; }
.hours-grid .pair-s input { width: auto; flex: 1 1 0; min-width: 0; }
#side { overflow-x: hidden; }
.hours-day { min-width: 0; max-width: 100%; }
/* v9.5: the fourth view (Flow) must still fit the top bar on an iPad in either direction. */
@media (max-width: 1179px) {
  .seg button { padding: 0 var(--s2); }
  .search { flex: 0 1 200px; min-width: 112px; }
  .top { gap: var(--s2); }
}
@media (max-width: 1023px) { .search { min-width: 88px; } }
