/* SlotBooking - interface styles.
   Layout is a sticky masthead over a centred column, floating on a slow
   gold/copper gradient. Colour is a single dark scheme: gold carries the
   brand, copper carries the one call to action. Everything is driven by
   the tokens below. */

:root {
  --page: #0C0A06;
  --surface: #15120B;
  --surface-sunk: #1C1810;
  --border: #2C2618;
  --border-strong: #423A26;
  --ink: #F1E9D8;
  --ink-soft: #B5A98E;
  --ink-faint: #877C63;

  --brand: #E3BE4E;
  --brand-solid: #E3BE4E;
  --brand-deep: #C9A233;
  --brand-wash: #2A2210;
  --brand-ink: #171717;

  --accent: #E2703C;
  --accent-wash: #33210F;

  --ok: #4ADE80;
  --ok-wash: #142B1D;
  --warn: #F0AE28;
  --warn-wash: #33290F;
  --bad: #F87171;
  --bad-wash: #33181A;
  --idle-wash: #221E14;
  --idle-ink: #A2977E;

  --ring: rgba(227, 190, 78, 0.32);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 8px 26px rgba(0, 0, 0, 0.5);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --gutter: 22px;
  --column: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  /* The page colour lives on the root so it paints onto the canvas and the
     drifting glows below - which sit at a negative z-index - land on top of
     it rather than under it. */
  background: var(--page);
}

body {
  margin: 0;
  background: transparent;
  color: var(--ink);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------- animated backdrop */
/* Three oversized, heavily blurred glows drift behind the whole interface so
   the near-black page never reads as flat. Only transform and opacity are
   animated, so the compositor carries it and nothing repaints per frame. */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  /* Keeps the blurred edges from bleeding past the viewport. */
  contain: paint;
}

.backdrop__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform, opacity;
}

.backdrop__glow--gold {
  width: 70vmax;
  height: 70vmax;
  top: -30vmax;
  left: -20vmax;
  background: radial-gradient(circle at center, rgba(227, 190, 78, 0.20), rgba(227, 190, 78, 0) 70%);
  animation: glow-drift-a 28s ease-in-out infinite alternate;
}

.backdrop__glow--copper {
  width: 62vmax;
  height: 62vmax;
  bottom: -28vmax;
  right: -18vmax;
  background: radial-gradient(circle at center, rgba(226, 112, 60, 0.18), rgba(226, 112, 60, 0) 70%);
  animation: glow-drift-b 36s ease-in-out infinite alternate;
}

.backdrop__glow--ember {
  width: 50vmax;
  height: 50vmax;
  top: 30%;
  left: 45%;
  background: radial-gradient(circle at center, rgba(201, 162, 51, 0.14), rgba(201, 162, 51, 0) 70%);
  animation: glow-drift-c 44s ease-in-out infinite alternate;
}

@keyframes glow-drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.85; }
  to   { transform: translate3d(14vmax, 10vmax, 0) scale(1.18); opacity: 1; }
}

@keyframes glow-drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.1); opacity: 1; }
  to   { transform: translate3d(-16vmax, -9vmax, 0) scale(0.92); opacity: 0.7; }
}

@keyframes glow-drift-c {
  from { transform: translate3d(-8vmax, 6vmax, 0) scale(0.9); opacity: 0.55; }
  to   { transform: translate3d(10vmax, -12vmax, 0) scale(1.25); opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  .backdrop__glow { animation: none; }
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }

svg { flex: none; }

.mono {
  font-family: "Cascadia Mono", ui-monospace, Consolas, "SF Mono", monospace;
  font-size: 0.92em;
  letter-spacing: 0.01em;
}

.muted { color: var(--ink-soft); }
.tiny { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand-solid);
  color: var(--brand-ink);
  padding: 10px 16px;
  z-index: 50;
  border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------- masthead */

.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  /* Solid first, so a browser without color-mix() still gets a masthead. */
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.masthead__inner {
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 62px;
  display: flex;
  align-items: center;
  gap: 18px;
}

/* The wordmark is the whole logo: the stem carries the weight, the tail is
   set light in gold so the two halves read apart without a second colour. */
.brandmark {
  display: inline-flex;
  align-items: baseline;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brandmark:hover { text-decoration: none; }
.brandmark__word { font-weight: 750; }
.brandmark__dot { color: var(--brand); font-weight: 400; }

.navset { display: flex; align-items: center; gap: 4px; margin-left: 8px; }

.navset__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 550;
  font-size: 14.5px;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.navset__link svg { width: 17px; height: 17px; }
.navset__link:hover { background: var(--surface-sunk); color: var(--ink); text-decoration: none; }
.navset__link--on { background: var(--brand-wash); color: var(--brand); }

/* Sign out has to POST, so it is a button wearing the link's clothes. */
button.navset__link {
  border: 0;
  background: none;
  font-family: inherit;
  cursor: pointer;
}
.navset__form { display: flex; margin: 0; }
.navset__form .navset__link { width: 100%; }

/* Splits the two app pages from the account actions. */
.navset__rule {
  flex: none;
  width: 1px;
  height: 20px;
  margin: 0 5px;
  background: var(--border-strong);
}

.masthead__gap { flex: 1; }

.iconbtn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
}
.iconbtn:hover { color: var(--ink); border-color: var(--border-strong); }
.iconbtn svg { width: 17px; height: 17px; }


/* account name plate ---------------------------------------------------- */
/* The account actions live in the navset now, so this only says who you are. */

.whoami {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 4px 13px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-wash);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}

.whoami__id { display: grid; min-width: 0; line-height: 1.25; }
.whoami__name {
  font-weight: 650;
  font-size: 13.5px;
  max-width: 15ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.whoami__tier { font-size: 11.5px; color: var(--ink-soft); }

.nav-toggle { display: none; }

/* ---------------------------------------------------------------- shell */

.shell {
  max-width: var(--column);
  margin: 0 auto;
  padding: 26px var(--gutter) 64px;
}

.pagehead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.pagehead__title { font-size: 25px; }
.pagehead__sub { color: var(--ink-soft); margin: 5px 0 0; font-size: 14.5px; }
.pagehead__tools { display: flex; gap: 9px; flex-wrap: wrap; }
/* A tool that posts (delete) is wrapped in a form; it should still sit
   in the row like a plain button. */
.pagehead__tools form { display: flex; }
.pagehead__tools form .btn { width: 100%; }

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 13.5px;
  margin-bottom: 10px;
}
.backlink svg { width: 15px; height: 15px; }

/* --------------------------------------------------------------- panels */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel + .panel { margin-top: 18px; }

.panel__head {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-sunk);
}
.panel__title { font-size: 15.5px; font-weight: 650; }
.panel__body { padding: 20px; }
.panel__body--flush { padding: 0; }

.stack { display: grid; gap: 18px; }
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* -------------------------------------------------------------- metrics */

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.metric__label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 550;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.metric__label svg { width: 15px; height: 15px; }
.metric__value { font-size: 30px; font-weight: 700; margin-top: 7px; letter-spacing: -0.02em; }
.metric__foot { font-size: 12.5px; color: var(--ink-soft); }
.metric--live { border-color: var(--accent); background: var(--accent-wash); }
.metric--live .metric__label,
.metric--live .metric__foot { color: var(--accent); }

/* --------------------------------------------------------------- tables */

.scroller { overflow-x: auto; }

.dtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.dtable th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
  background: var(--surface-sunk);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.dtable td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.dtable tbody tr:last-child td { border-bottom: 0; }
.dtable tbody tr:hover { background: var(--surface-sunk); }
.dtable .cell-actions { text-align: right; white-space: nowrap; }

.twoline { display: grid; gap: 2px; }
.twoline__lead { font-weight: 600; }
.twoline__sub { font-size: 12.5px; color: var(--ink-soft); }

/* The payment column: the button, and under it the clock running against it.
   `.cell-actions` keeps text on one line, which the countdown must opt out of
   or its label wraps into the bar. */
.paycell { display: grid; gap: 6px; justify-items: end; white-space: normal; }
.paycell .countdown { width: 100%; max-width: 160px; }
/* An expired link is left in place, greyed, so the row still reads as one that
   had a window rather than one that never got there. */
.btn[data-dead="true"] { opacity: 0.4; cursor: not-allowed; }

/* A ticked box, for a flag that is on or absent rather than a state. */
.tickbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.tickbox__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  background: var(--ok);
  color: #06240F;
}
.tickbox__mark svg { width: 10px; height: 10px; }

/* Tracking only helps the reference variant, where the link is a code to
   read character by character. On a plain word -- the account name in the
   bookings table -- the fractional pixel it adds per glyph accumulates and
   snaps into a visible gap mid-word, so the name stays untracked. */
.reflink { font-weight: 650; }
.reflink.mono { letter-spacing: 0.02em; }

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

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
/* State chips are filled with the state's own colour and set in dark ink, so
   a row's status reads at a glance down the column. */
.chip--queued { background: var(--idle-ink); color: #191509; }
.chip--running { background: var(--brand); color: var(--brand-ink); }
.chip--held { background: var(--warn); color: #241A02; }
.chip--settled { background: var(--ok); color: #06240F; }
/* Invoiced sits after success, so it takes the copper accent rather than
   a second green that would read as the same thing. */
.chip--invoiced { background: var(--accent); color: #2A1408; }
.chip--cancelled { background: var(--idle-ink); color: #191509; }
.chip--failed { background: var(--bad); color: #330F0F; }
.chip--plain { background: var(--surface-sunk); color: var(--ink-soft); }
.chip--brand { background: var(--brand-wash); color: var(--brand); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { border-color: var(--border-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
  background: var(--brand-solid);
  border-color: var(--brand-solid);
  color: var(--brand-ink);
}
.btn--primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }

.btn--danger { color: var(--bad); border-color: var(--border); }
.btn--danger:hover { background: var(--bad-wash); border-color: var(--bad); }

.btn--quiet { background: transparent; }
.btn--small { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn--wide { width: 100%; }

/* The checkout button pulls the eye while the window is still open. */
.btn--checkout {
  background: var(--accent);
  border-color: var(--accent);
  color: #2A1A05;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.btn--checkout:hover { filter: brightness(1.06); }
.btn--checkout::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Under the label, over the fill - otherwise the sweep washes the text out. */
  z-index: -1;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.45) 50%, transparent 80%);
  transform: translateX(-120%);
  animation: sweep 2.4s ease-in-out infinite;
}
.btn--checkout[data-spent="true"]::after { animation: none; display: none; }

@keyframes sweep {
  0% { transform: translateX(-120%); }
  60%, 100% { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce) {
  .btn--checkout::after { animation: none; display: none; }
}

.btnrow { display: flex; gap: 9px; flex-wrap: wrap; }

/* ------------------------------------------------------------ countdown */

.countdown { display: grid; gap: 5px; min-width: 104px; }
.countdown__top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--warn);
}
.countdown__top svg { width: 14px; height: 14px; }
.countdown__track {
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.countdown__fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 1s linear;
}
.countdown[data-done="true"] .countdown__top { color: var(--ink-soft); }
.countdown[data-done="true"] .countdown__fill { background: var(--border-strong); }

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

.formgrid { display: grid; gap: 16px; }
.formgrid--pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.formgrid--trio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-all { grid-column: 1 / -1; }

.fieldwrap { display: grid; gap: 6px; min-width: 0; }
.fieldwrap__label {
  font-size: 13px;
  font-weight: 620;
  color: var(--ink);
}
.fieldwrap__label .req { color: var(--bad); margin-left: 2px; }

.field {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
}
.field:focus,
.field-file:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--ring);
}
.field::placeholder { color: var(--ink-soft); opacity: 0.75; }
select.field { appearance: none; background-image: none; padding-right: 34px; }

.selectwrap { position: relative; }
.selectwrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.field-file {
  width: 100%;
  padding: 8px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: var(--surface-sunk);
  color: var(--ink-soft);
  font: inherit;
  font-size: 13.5px;
}

.field-check { width: 17px; height: 17px; accent-color: var(--brand); }

.checkrow {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-sunk);
}
.checkrow__text { display: grid; gap: 2px; }
.checkrow__label { font-weight: 620; font-size: 14px; }

.fieldhelp { font-size: 12.5px; color: var(--ink-soft); }
.fielderr { font-size: 12.5px; color: var(--bad); font-weight: 550; }
.field--bad { border-color: var(--bad); }

.formfoot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 4px;
  flex-wrap: wrap;
}

fieldset { border: 0; margin: 0; padding: 0; }

.formnote {
  display: flex;
  gap: 10px;
  padding: 12px 15px;
  border-radius: var(--r-md);
  background: var(--brand-wash);
  color: var(--brand);
  font-size: 13.5px;
}
.formnote svg { width: 17px; height: 17px; margin-top: 2px; }

/* ----------------------------------------------------- traveller blocks */

.travellers { display: grid; gap: 14px; }

.traveller {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  background: var(--surface-sunk);
}
.traveller[data-dropped="true"] { display: none; }

.traveller__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}
.traveller__tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: 14px;
}
.traveller__index {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--brand-solid);
  color: var(--brand-ink);
  display: grid;
  place-items: center;
  font-size: 12.5px;
}
.traveller__need {
  font-weight: 500;
  font-size: 12px;
  color: var(--bad);
  background: var(--bad-wash);
  padding: 2px 7px;
  border-radius: 999px;
}
.traveller__drop {
  border: 0;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 7px;
}
.traveller__drop:hover { color: var(--bad); background: var(--bad-wash); }
.traveller__drop svg { width: 14px; height: 14px; }

.traveller__filekept {
  font-size: 12.5px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --------------------------------------------------------------- lists  */

.deflist { display: grid; gap: 0; }
.deflist__row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--border);
}
.deflist__row:last-child { border-bottom: 0; }
.deflist__key { color: var(--ink-soft); font-size: 13.5px; }
.deflist__val { min-width: 0; word-break: break-word; }

.msg {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
}
.msg:last-child { border-bottom: 0; }
.msg__top {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.msg__from { font-weight: 650; font-size: 14px; }
.msg__body {
  color: var(--ink-soft);
  font-size: 13.5px;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg__code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 11px;
  border-radius: 8px;
  background: var(--ok-wash);
  color: var(--ok);
  font-weight: 700;
  letter-spacing: 0.12em;
  font-family: "Cascadia Mono", ui-monospace, Consolas, monospace;
}
/* A value with a copy button beside it -- a reservation id, a one-time code.
   The button only exists where the clipboard does: app.js flags the document
   once it has one, so a page without JavaScript shows the value alone rather
   than a control that would do nothing. */
.copyline { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.copyline__value { overflow-wrap: anywhere; }
.copybtn {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  display: none;
  flex: none;
  opacity: 0.75;
}
:root[data-clipboard="true"] .copybtn { display: inline-flex; }
.copybtn:hover { opacity: 1; }
.copybtn svg { width: 14px; height: 14px; }
.copybtn__done,
.copybtn[data-copied="true"] .copybtn__idle { display: none; }
.copybtn[data-copied="true"] { color: var(--ok); opacity: 1; }
.copybtn[data-copied="true"] .copybtn__done { display: block; }

/* --------------------------------------------------------------- flash  */

.flashes { display: grid; gap: 10px; margin-bottom: 18px; }
.flash {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
}
.flash svg { width: 18px; height: 18px; margin-top: 1px; }
.flash__text { flex: 1; }
.flash__close {
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.flash--success { border-color: var(--ok); background: var(--ok-wash); color: var(--ok); }
.flash--error { border-color: var(--bad); background: var(--bad-wash); color: var(--bad); }
.flash--warning { border-color: var(--warn); background: var(--warn-wash); color: var(--warn); }
.flash--info { border-color: var(--brand); background: var(--brand-wash); color: var(--brand); }

.errorbox {
  border: 1px solid var(--bad);
  background: var(--bad-wash);
  color: var(--bad);
  border-radius: var(--r-md);
  padding: 12px 15px;
  font-size: 13.5px;
  margin-bottom: 16px;
}
.errorbox ul { margin: 6px 0 0; padding-left: 18px; }

/* --------------------------------------------------------------- empty  */

.empty {
  text-align: center;
  padding: 56px 24px;
  display: grid;
  justify-items: center;
  gap: 9px;
}
.empty svg { width: 42px; height: 42px; color: var(--ink-soft); opacity: 0.55; }
.empty h2 { font-size: 17px; }
.empty p { margin: 0; color: var(--ink-soft); max-width: 44ch; }
.empty .btn { margin-top: 8px; }

/* --------------------------------------------------------------- pager  */

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--ink-soft);
  flex-wrap: wrap;
}
.pager__links { display: flex; gap: 8px; }

/* ---------------------------------------------------------- filter bar  */

.filterbar {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

/* --------------------------------------------------------------- entry  */

.entry {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  background:
    radial-gradient(1100px 460px at 12% -8%, var(--brand-wash) 0%, transparent 62%),
    var(--page);
}
.entry__card {
  width: 100%;
  max-width: 408px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: 32px;
}
/* The card is the wordmark, one line of label, and the form - nothing else. */
.entry__brand { display: grid; justify-items: center; gap: 6px; margin-bottom: 26px; }
.entry__title { font-size: 26px; letter-spacing: -0.02em; }
.entry__sub {
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  margin: 0;
}

/* -------------------------------------------------------------- errors  */

.errorpage {
  min-height: 70dvh;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
}
.errorpage__code {
  font-size: 62px;
  font-weight: 750;
  color: var(--brand);
  letter-spacing: -0.04em;
  line-height: 1;
}

/* --------------------------------------------------------------- modal  */

/* A <dialog> carries the confirm step: the browser handles the backdrop,
   Escape and the focus trap, so only the card itself needs dressing. */
.modal {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  width: min(420px, calc(100vw - 32px));
}
.modal::backdrop {
  background: rgba(6, 5, 2, 0.68);
}
.modal__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 22px;
  animation: modal-in 0.14s ease-out;
}
.modal__title { margin: 0; font-size: 17px; font-weight: 650; }
.modal__text {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}
.modal__actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .modal__card { animation: none; }
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 960px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .filterbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .filterbar .span-all { grid-column: 1 / -1; }
}

/* Five nav items plus the name plate stop fitting well before the old
   780px drawer breakpoint, so the hamburger takes over earlier. */
@media (max-width: 1040px) {
  .nav-toggle { display: grid; }

  .navset {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px var(--gutter) 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    margin: 0;
    display: none;
  }
  .navset[data-open="true"] { display: flex; }
  .navset__link { border-radius: 10px; padding: 11px 13px; }
  .navset__rule { width: auto; height: 1px; margin: 7px 2px; }
}

@media (max-width: 780px) {
  :root { --gutter: 15px; }

  .masthead__inner { height: 56px; gap: 10px; }

  .formgrid--pair,
  .formgrid--trio { grid-template-columns: minmax(0, 1fr); }

  .deflist__row { grid-template-columns: minmax(0, 1fr); gap: 2px; }

  .pagehead { align-items: flex-start; }
  .pagehead__tools { width: 100%; }
  .pagehead__tools .btn,
  .pagehead__tools form { flex: 1; }

  /* Tables become stacked cards: each cell carries its own label. */
  .dtable--stacks thead { display: none; }
  .dtable--stacks tbody tr {
    display: block;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
  }
  .dtable--stacks tbody tr:hover { background: transparent; }
  .dtable--stacks td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 5px 0;
    border: 0;
    text-align: left;
  }
  .dtable--stacks td::before {
    content: attr(data-label);
    font-size: 11.5px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-soft);
    flex: none;
  }
  .dtable--stacks td:empty { display: none; }
  .dtable--stacks .cell-actions { justify-content: flex-end; padding-top: 10px; }
  .twoline { text-align: right; justify-items: end; }
  .paycell { justify-items: end; }
  .paycell .countdown { max-width: 190px; }
}

@media (max-width: 420px) {
  .metrics { grid-template-columns: minmax(0, 1fr); }
  .brandmark { font-size: 18px; }
  /* Keep the name; the tier is one line too many at this width. */
  .whoami { padding-right: 10px; }
  .whoami__name { max-width: 9ch; }
  .whoami__tier { display: none; }
}

@media print {
  .masthead, .pagehead__tools, .btnrow, .pager { display: none; }
  body { background: #FFFFFF; }
  .panel { box-shadow: none; border-color: #CCCCCC; }
}
