/*
 * Venue and organiser portal styles (one stylesheet shared by both portals).
 *
 * Brand tokens mirror mobile/lib/theme/otb_tokens.dart exactly. Every colour used below is a
 * var(--token) from :root; no literal colours outside it. Brass is for hairlines only, never small
 * text (4.9:1 on paper but only 2.3:1 on baize); 9-ball yellow is defined for parity but never text.
 */

@font-face {
  font-family: "OtbDisplay";
  src: url("/portal/static/fonts/BricolageGrotesque-Variable.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "OtbText";
  src: url("/portal/static/fonts/InstrumentSans-Variable.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand palette (otb_tokens.dart OtbColors.brand). */
  --baize: #0d4309;
  --cream: #f6f4ee;
  --paper: #fffdf8;
  --ink: #0b1f0d;
  --mute: #5b6458;
  --chalk: #2f5ea8;
  --brass: #8a6a2f;
  --loss: #a62e1e;
  --ball9: #e8b325;
  --ball8: #141210;
  --snooker: #c4241a;
  --heyball: #6b3fa0;

  /* Hairline separator: ink at 14%. */
  --rule: rgba(11, 31, 13, 0.14);

  /* Shapes: card radius is 6px in the app; strip is square. */
  --radius-card: 6px;
  --radius-control: 4px;
  --radius-pill: 999px;

  /* Spacing scale. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;

  /* Type. */
  --font-display: "OtbDisplay", "Helvetica Neue", Arial, sans-serif;
  --font-text: "OtbText", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.4;
  background: var(--cream);
  color: var(--ink);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.2;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

a {
  color: var(--baize);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Keyboard focus is visible on every interactive element. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--baize);
  outline-offset: 2px;
}

/* ---- Header and nav: a baize band with a paper wordmark ---- */

header {
  background: var(--baize);
  color: var(--paper);
  padding: var(--space-4) var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

header strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

header a {
  color: var(--paper);
  margin-left: var(--space-4);
  padding: var(--space-1) 0;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

/* The brass underline is decorative (2.3:1 on baize); the current page is also set heavier. */
header a:hover,
header a[aria-current="page"] {
  text-decoration: none;
  border-bottom-color: var(--brass);
}

header a[aria-current="page"] {
  font-weight: 700;
}

header a:focus-visible,
header button:focus-visible {
  outline-color: var(--paper);
}

header nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

main {
  max-width: 960px;
  margin: var(--space-6) auto;
  padding: 0 var(--space-5);
}

/* ---- Cards (also the centred login/MFA card): paper, hairline, small radius, no shadow ---- */

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  padding: var(--space-5);
  max-width: 400px;
  margin: 3rem auto;
}

/* Full-width page panel (go-live, payouts); .card stays the centred single-form card. */
.panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  padding: var(--space-5);
  margin: 0 0 var(--space-5);
}

details {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  padding: var(--space-4) var(--space-5);
}

details summary {
  cursor: pointer;
  font-weight: 600;
}

/* ---- Forms ---- */

label {
  display: block;
  font-weight: 600;
  margin-top: var(--space-4);
  margin-bottom: var(--space-1);
}

input[type="email"],
input[type="password"],
input[type="tel"],
input[type="text"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="number"],
textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  padding: var(--space-2);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  font-size: 1rem;
}

input[type="number"] {
  width: auto;
  max-width: 12rem;
}

table input[type="text"],
table input[type="number"],
table input[type="time"] {
  width: 100%;
  max-width: none;
  min-width: 6rem;
  font-family: inherit;
  padding: 0.35rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  font-size: 0.9rem;
}

table select {
  font-family: inherit;
  padding: 0.35rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  font-size: 0.9rem;
}

table input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--baize);
}

select,
input[type="datetime-local"] {
  font-family: inherit;
  padding: var(--space-2);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  font-size: 1rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--baize);
  outline-offset: 0;
  border-color: var(--baize);
}

/* ---- Buttons: primary baize fill; .secondary baize outline; .destructive loss ---- */

button,
input[type="submit"] {
  background: var(--baize);
  color: var(--paper);
  border: 1px solid var(--baize);
  border-radius: var(--radius-control);
  padding: var(--space-2) var(--space-4);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: var(--space-4);
}

button[type="button"] {
  margin-top: 0;
}

button:hover,
input[type="submit"]:hover {
  background: var(--ink);
  border-color: var(--ink);
}

button.outline,
button.secondary {
  background: transparent;
  color: var(--baize);
  border: 1px solid var(--baize);
  padding: var(--space-1) var(--space-2);
  margin: 0;
}

button.outline:hover,
button.secondary:hover {
  background: var(--baize);
  color: var(--paper);
}

button.destructive {
  background: transparent;
  color: var(--loss);
  border: 1px solid var(--loss);
  padding: var(--space-1) var(--space-2);
  margin: 0;
}

button.destructive:hover {
  background: var(--loss);
  border-color: var(--loss);
  color: var(--paper);
}

/* ---- Flash and error messages: loss for errors, brass for notices ---- */

.error,
.notice {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-left-width: 4px;
  border-radius: var(--radius-control);
  padding: var(--space-3);
  margin-top: var(--space-4);
}

.error {
  color: var(--loss);
  border-left-color: var(--loss);
}

.notice {
  border-left-color: var(--brass);
}

.mfa-qr svg {
  width: 12rem;
  height: 12rem;
  display: block;
  margin: var(--space-2) 0;
}

.mfa-secret {
  font-family: monospace;
  font-size: 1.1rem;
  background: var(--cream);
  border: 1px solid var(--rule);
  padding: var(--space-3);
  border-radius: var(--radius-control);
  word-break: break-all;
  margin: var(--space-2) 0;
}

/* ---- Tables: brass hairlines, small-caps mute headers, tabular figures, no zebra ---- */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--brass);
}

tbody tr:last-child td {
  border-bottom: none;
}

th {
  background: var(--paper);
  color: var(--mute);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.actions form {
  display: inline;
  margin-right: 0.4rem;
}

.actions button {
  margin-top: 0;
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
}

.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.month-nav h2 {
  margin: 0;
}

.explainer {
  color: var(--mute);
  font-size: 0.9rem;
  margin-bottom: var(--space-5);
}

/* ---- Stats ---- */

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.stat {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  padding: var(--space-4) 1.25rem;
  min-width: 8rem;
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  color: var(--mute);
  font-size: 0.85rem;
}

/* ---- Floor plan ---- */

.floor-plan {
  margin-top: 2.5rem;
}

.floor-plan-layout {
  display: flex;
  gap: var(--space-5);
  align-items: flex-start;
}

.floor-plan-canvas {
  position: relative;
  flex: 1;
  height: 480px;
  background: var(--paper);
  border: 1px dashed var(--brass);
  border-radius: var(--radius-card);
}

.floor-plan-canvas.drag-over {
  border-color: var(--baize);
  background: var(--cream);
}

.table-marker {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--baize);
  color: var(--paper);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: grab;
  user-select: none;
}

.table-marker--rect {
  border-radius: var(--radius-card);
}

.table-marker--oval {
  border-radius: 50%;
}

.table-marker.dragging {
  opacity: 0.4;
}

.rotate-btn {
  position: absolute;
  top: -0.6rem;
  right: -0.6rem;
  width: 1.4rem;
  height: 1.4rem;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  font-size: 0.85rem;
  line-height: 1;
}

.rotate-btn:hover {
  background: var(--cream);
  border-color: var(--rule);
}

.floor-plan-unplaced {
  width: 12rem;
  flex-shrink: 0;
}

.floor-plan-unplaced h3 {
  margin: 0 0 var(--space-2);
  font-size: 1rem;
}

.floor-plan-unplaced ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.table-chip {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  padding: var(--space-2) var(--space-3);
  cursor: grab;
}

/* ---- Analytics ---- */

.heatmap {
  display: grid;
  grid-template-columns: 3rem repeat(24, 1fr);
  gap: 2px;
  font-size: 0.7rem;
  margin-bottom: var(--space-5);
}

.heatmap-label {
  color: var(--mute);
  display: flex;
  align-items: center;
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  /* --heat is 0..1 from the template: cream at 0 up to full baize at 1. */
  background: var(--cream);
  background: color-mix(in srgb, var(--baize) calc(var(--heat, 0) * 100%), var(--cream));
  border: 1px solid var(--rule);
}

.trend-bars {
  display: flex;
  align-items: flex-end;
  height: 10rem;
  margin-bottom: var(--space-5);
}

.hourly-bars {
  --bar-gap: 0.15rem;
}

.hourly-bars .trend-bar-col > span {
  font-size: 0.7rem;
}

/* Vertical so the tag fits a narrow hour column without overlapping its neighbours. */
.busiest-tag {
  writing-mode: vertical-rl;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.hourly-caption {
  font-weight: 700;
}

.trend-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  padding-inline: var(--bar-gap, var(--space-2));
  flex: 1;
  /* A definite height so the bar's inline height: N% resolves against it. */
  height: 100%;
}

.trend-bar {
  width: 100%;
  background: var(--baize);
  border-radius: 3px 3px 0 0;
}

/* The newest bar is the selected month. */
.trend-bar-col.is-current .trend-bar {
  background: var(--brass);
}

.trend-bar-col > span {
  flex-shrink: 0;
}

/* The label's top border is the shared baseline axis, so a 0% bar reads as zero rather than a
   rendering glitch (#2101). */
.trend-bar-label {
  /* Stretch over the column padding so the axis is unbroken between bars. */
  width: calc(100% + 2 * var(--bar-gap, var(--space-2)));
  text-align: center;
  border-top: 1px solid var(--mute);
  font-size: 0.75rem;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
}

.table-chip.dragging {
  opacity: 0.4;
}

.photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.photo-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: flex-start;
}

/* ---- Live floor view: states read by fill and by the word inside, not by colour alone ---- */

.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.stats-strip .stat {
  align-items: center;
  text-align: center;
}

.floor-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
}

.floor-legend li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.legend-swatch {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-control);
  border: 2px solid var(--baize);
}

.legend-swatch--free {
  background: var(--paper);
}

.legend-swatch--occupied {
  background: var(--baize);
}

.floor-canvas {
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  padding: var(--space-6);
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floor-grid {
  position: relative;
  width: 100%;
  height: 600px;
  background-color: var(--paper);
  background-image: linear-gradient(90deg, var(--rule) 1px, transparent 1px),
    linear-gradient(var(--rule) 1px, transparent 1px);
  background-size: 40px 40px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
}

.table-item {
  position: absolute;
  transform: translate(-50%, -50%);
}

.floor-grid .table-marker {
  position: relative;
  flex-direction: column;
  width: 64px;
  height: 64px;
  line-height: 1.1;
  text-align: center;
  cursor: default;
}

.floor-grid .table-marker--rect {
  width: 76px;
  height: 52px;
}

.floor-grid .table-marker--available {
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--baize);
}

.floor-grid .table-marker--occupied {
  background: var(--baize);
  color: var(--paper);
  border: 2px solid var(--baize);
}

.table-state {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table-occupant {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  max-width: 120px;
  padding: 1px 6px;
  border-radius: var(--radius-control);
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.table-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-0.5rem);
  background: var(--ink);
  color: var(--paper);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-control);
  font-size: 0.85rem;
  font-weight: 400;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.table-item:hover .table-tooltip {
  opacity: 1;
}

.unplaced-tables {
  margin-top: var(--space-6);
  padding: var(--space-4);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
}

.unplaced-tables h3 {
  margin-top: 0;
  color: var(--mute);
}

.unplaced-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.unplaced-chip {
  background: var(--cream);
  border: 1px solid var(--rule);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  color: var(--mute);
}

/* Filter links (statement All / Refunds); the active one is filled. */
.pill {
  display: inline-block;
  padding: var(--space-1) var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  text-decoration: none;
}

.pill[aria-current="page"] {
  background: var(--cream);
  font-weight: 700;
}

/* ---- Small helpers that replace inline style= attributes ---- */

.mt-4 {
  margin-top: var(--space-4);
}

.mt-5 {
  margin-top: var(--space-5);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.explainer--small {
  font-size: 0.85rem;
  margin-top: var(--space-5);
  margin-bottom: 0;
}

.inline-form {
  display: inline;
}

.block-form {
  display: block;
}

.field-error {
  color: var(--loss);
  font-size: 0.85em;
}

.field-hint {
  color: var(--mute);
  font-size: 0.85em;
}

.check-row {
  display: block;
  white-space: nowrap;
}

tr.cancelled {
  text-decoration: line-through;
  opacity: 0.6;
}

/* Bot trap: off-screen rather than display:none so naive bots still fill it. */
.honeypot {
  position: absolute;
  left: -10000px;
}

/* ---- Tournaments ---- */

.tournament-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.tournament-card h3 {
  margin-top: 0;
}

.tournament-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-4);
  margin: var(--space-4) 0;
  font-size: 0.9rem;
}

.info-item {
  background: var(--cream);
  padding: var(--space-3);
  border-radius: var(--radius-control);
  border-left: 3px solid var(--brass);
}

.info-label {
  font-size: 0.85rem;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-value {
  font-size: 1rem;
  font-weight: 700;
  margin-top: var(--space-1);
}

/* Status reads by fill and outline as well as by the word inside, never by colour alone. */
.status-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--rule);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-draft {
  background: var(--cream);
  color: var(--mute);
}

.status-open {
  background: var(--baize);
  border-color: var(--baize);
  color: var(--paper);
}

/* Text on a brass tint is ink; brass itself is only ever text on paper or cream. */
.status-in_progress {
  background: color-mix(in srgb, var(--brass) 25%, var(--paper));
  border-color: var(--brass);
  color: var(--ink);
}

.status-completed {
  background: var(--paper);
  border-color: var(--baize);
  color: var(--baize);
}

.status-cancelled {
  background: var(--paper);
  border-color: var(--loss);
  color: var(--loss);
}

.tournament-actions {
  margin-top: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.tournament-actions form {
  display: inline;
}

/* A link styled as a button; .outline makes it the neutral secondary. */
a.button,
a.outline {
  display: inline-block;
  background: var(--baize);
  color: var(--paper);
  border: 1px solid var(--baize);
  border-radius: var(--radius-control);
  padding: var(--space-2) var(--space-4);
  font-weight: 600;
  text-decoration: none;
}

a.button:hover {
  background: var(--ink);
  border-color: var(--ink);
  text-decoration: none;
}

a.outline {
  background: transparent;
  color: var(--baize);
  padding: var(--space-1) var(--space-2);
}

a.outline:hover {
  background: var(--baize);
  color: var(--paper);
  text-decoration: none;
}

.tournament-create-link {
  margin-top: var(--space-5);
}

/* The base .card is the narrow centred login card; tournament sections span the page. */
.tournament-section {
  max-width: none;
  margin: 0 0 var(--space-5);
}

.walk-in-form {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
  margin-top: var(--space-4);
}

.walk-in-form button {
  margin-top: 0;
}

.entries-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.entries-list li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
}

.entries-list li:last-child {
  border-bottom: none;
}

.round-block {
  margin-bottom: var(--space-5);
}

.round-block h3 {
  margin-bottom: var(--space-2);
}

.match-card {
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
}

.match-players {
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.match-players .winner {
  color: var(--baize);
  text-decoration: underline;
}

.match-result-form {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}

.match-result-form button {
  margin-top: 0;
}

.match-result-form input[type="number"] {
  width: 9.5rem;
  font-family: inherit;
  padding: var(--space-2);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  font-size: 1rem;
}

.walk-in-form input[type="text"] {
  width: auto;
  flex: 1 1 12rem;
}

.tournament-section .actions button {
  padding: var(--space-2) var(--space-4);
  font-size: 1rem;
}

/* Go-live review: one block per step with its status word, entered values and Edit/Fix link (#2081). */
.review-step {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  padding: var(--space-4) var(--space-5);
  margin: 0 0 var(--space-4);
}

.review-step .status-done {
  color: var(--baize);
}

.review-step .status-todo {
  color: var(--loss);
}

.review-step .review-line {
  color: var(--mute);
  margin: 0;
}

.review-step ~ form button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---- Walk-in duration chips: visually hidden radios, label chips ---- */

.chip-group {
  border: 0;
  padding: 0;
  margin: var(--space-4) 0 0;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip-group legend {
  font-weight: 600;
  padding: 0;
  margin-bottom: var(--space-1);
}

.chip-group input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.chip-group label {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  font-weight: 400;
  cursor: pointer;
}

.chip-group input:checked + label {
  background: var(--baize);
  color: var(--paper);
  border-color: var(--baize);
}

.chip-group input:focus-visible + label {
  outline: 2px solid var(--baize);
  outline-offset: 2px;
}

/* Timeline: the day's tables x hours grid above the bookings list (#2096). */
.timeline-section {
  margin: 0 0 var(--space-5);
}

.timeline-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
}

.timeline-swatch {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 2px;
  border: 1px solid var(--rule);
  vertical-align: middle;
}

.timeline-scroll {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  background: var(--paper);
}

.timeline-grid {
  min-width: calc(9rem + var(--hours) * 3.5rem);
}

.timeline-row {
  display: flex;
  border-top: 1px solid var(--rule);
}

.timeline-row:first-child {
  border-top: 0;
}

.timeline-label {
  position: sticky;
  left: 0;
  z-index: 2;
  flex: 0 0 9rem;
  box-sizing: border-box;
  padding: var(--space-2);
  background: var(--paper);
  border-right: 1px solid var(--rule);
  font-size: 0.9rem;
}

.timeline-track {
  position: relative;
  flex: 1 1 auto;
  min-height: 2.5rem;
  display: flex;
}

.timeline-head .timeline-track {
  min-height: 2rem;
}

.timeline-hour {
  flex: 1 1 0;
  padding: var(--space-2) 0 0 var(--space-1);
  font-size: 0.75rem;
  color: var(--mute);
  border-left: 1px solid var(--rule);
  box-sizing: border-box;
}

.timeline-bar {
  position: absolute;
  top: 0.3rem;
  bottom: 0.3rem;
  box-sizing: border-box;
  padding: 0 var(--space-1);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.8rem;
  line-height: 1.8rem;
  border-radius: var(--radius-control);
  text-decoration: none;
}

.timeline-booked {
  background: var(--baize);
  color: var(--paper);
}

.timeline-walk_in {
  background: #c2cebc;
  color: var(--ink);
}

.timeline-blocked {
  background: var(--mute);
  color: var(--paper);
}

.timeline-awaiting_payment {
  background: var(--ball9);
  color: var(--ink);
}

.timeline-now {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--loss);
  pointer-events: none;
  z-index: 1;
}

.timeline-now-label {
  position: absolute;
  top: 0.1rem;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--loss);
  background: var(--paper);
  white-space: nowrap;
}

/* Suspension notice (#2295): spans the full width of the wrapping header, under the wordmark and nav. */
header .suspension-banner {
  flex: 1 1 100%;
  margin: 0;
}
