/* FIXR Watcher
   One stylesheet for the whole console. Quiet surfaces; ink for primary
   actions; pine green only where something is live, armed or positive. The dark
   panels are reserved for computed summaries (worker status, previews, headline
   profit) so they read as the system talking back, in either theme.

   Theme: follows the system unless the viewer picks one, which sets
   data-theme on <html>. The dark values live in one block, applied both by the
   media query (no explicit choice) and by [data-theme="dark"]. */

:root {
  color-scheme: light;

  --canvas: #f3f4f2;
  --surface: #fff;
  --surface-2: #f7f8f6;
  --ink: #14171a;
  --ink-2: #2b3035;
  --on-ink: #fff;
  --muted: #62696f;
  --faint: #8d949a;
  --line: #e3e5e1;
  --line-strong: #cfd3ce;
  --border-hover: #b7bcb6;
  --hover: rgba(20, 23, 26, 0.045);
  --row-hover: #fbfbfa;
  --chip: #eef0ed;
  --track: #f0f1ef;
  --glass: rgba(243, 244, 242, 0.86);
  --backdrop: rgba(20, 23, 26, 0.4);

  --accent: #0b6e4f;
  --accent-hover: #095b41;
  --accent-soft: #e3f1ea;
  --accent-border: rgba(11, 110, 79, 0.45);
  --focus-ring: rgba(11, 110, 79, 0.14);
  --signal: #2bc486;

  --amber: #9f5705;
  --amber-soft: #fcf0dc;
  --amber-ink: #6f3e04;
  --amber-border: #f1dcb8;
  --red: #bb3a30;
  --red-soft: #fbeae7;
  --red-ink: #8e2a22;
  --red-hover: #a3322a;
  --blue: #1f5c9e;
  --blue-soft: #e7eef7;
  --count: #f0a53a;
  --on-count: #1c1407;

  --dark: #16191c;
  --dark-2: #1f2327;
  --dark-line: #2f353a;
  --dark-muted: #9aa2a8;
  --dark-text: #e3e8eb;
  --dark-positive: #62dca6;
  --dark-negative: #ff9d93;

  --chart-gain: #138a60;
  --chart-loss: #bb3a30;
  --chart-cost: #c98a1b;
  --chart-grid: #eceeeb;
  --chart-axis: #b5bab4;
  /* Waterfall bars, one hue per service; validated as a set against --surface. */
  --trace-fixr: #2a78d6;
  --trace-mail: #8056c7;
  --trace-discord: #eb6834;
  --trace-push: #1baf7a;
  --trace-stripe: #d6457d;
  --trace-bin: #8a8f2a;

  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(20, 23, 26, 0.04);
  --shadow-pop: 0 12px 32px -8px rgba(20, 23, 26, 0.18), 0 2px 6px rgba(20, 23, 26, 0.06);
  --rail: 248px;
  --strip: 52px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #121517;
    --surface: #191d20;
    --surface-2: #1f2427;
    --ink: #e9ecea;
    --ink-2: #c8cdca;
    --on-ink: #121517;
    --muted: #979ea3;
    --faint: #6d747a;
    --line: #2a3034;
    --line-strong: #3a4146;
    --border-hover: #4d555b;
    --hover: rgba(233, 236, 234, 0.06);
    --row-hover: #1c2124;
    --chip: #262c30;
    --track: #262c30;
    --glass: rgba(18, 21, 23, 0.82);
    --backdrop: rgba(0, 0, 0, 0.55);
    --accent: #45c290;
    --accent-hover: #6bd3a8;
    --accent-soft: #16302a;
    --accent-border: rgba(69, 194, 144, 0.45);
    --focus-ring: rgba(69, 194, 144, 0.22);
    --amber: #e3a44e;
    --amber-soft: #33270f;
    --amber-ink: #f1c989;
    --amber-border: #4d3a15;
    --red: #f08276;
    --red-soft: #3a1d1a;
    --red-ink: #f6b2aa;
    --red-hover: #d9665a;
    --blue: #86b5ea;
    --blue-soft: #182a3f;
    --count: #e9a84c;
    --on-count: #1c1407;
    --dark: #13211b;
    --dark-2: #1b2c24;
    --dark-line: #29392f;
    --dark-muted: #93a69b;
    --chart-gain: #3fb985;
    --chart-loss: #e8766a;
    --chart-cost: #d9a03a;
    --chart-grid: #262c30;
    --chart-axis: #454c52;
    /* Waterfall bars, stepped for the dark surface. */
    --trace-fixr: #3987e5;
    --trace-mail: #a47de0;
    --trace-discord: #d95926;
    --trace-push: #199e70;
    --trace-stripe: #e0628f;
    --trace-bin: #a9ae45;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-pop: 0 16px 40px -10px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.35);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #121517;
  --surface: #191d20;
  --surface-2: #1f2427;
  --ink: #e9ecea;
  --ink-2: #c8cdca;
  --on-ink: #121517;
  --muted: #979ea3;
  --faint: #6d747a;
  --line: #2a3034;
  --line-strong: #3a4146;
  --border-hover: #4d555b;
  --hover: rgba(233, 236, 234, 0.06);
  --row-hover: #1c2124;
  --chip: #262c30;
  --track: #262c30;
  --glass: rgba(18, 21, 23, 0.82);
  --backdrop: rgba(0, 0, 0, 0.55);
  --accent: #45c290;
  --accent-hover: #6bd3a8;
  --accent-soft: #16302a;
  --accent-border: rgba(69, 194, 144, 0.45);
  --focus-ring: rgba(69, 194, 144, 0.22);
  --amber: #e3a44e;
  --amber-soft: #33270f;
  --amber-ink: #f1c989;
  --amber-border: #4d3a15;
  --red: #f08276;
  --red-soft: #3a1d1a;
  --red-ink: #f6b2aa;
  --red-hover: #d9665a;
  --blue: #86b5ea;
  --blue-soft: #182a3f;
  --count: #e9a84c;
  --on-count: #1c1407;
  --dark: #13211b;
  --dark-2: #1b2c24;
  --dark-line: #29392f;
  --dark-muted: #93a69b;
  --chart-gain: #3fb985;
  --chart-loss: #e8766a;
  --chart-cost: #d9a03a;
  --chart-grid: #262c30;
  --chart-axis: #454c52;
  /* Waterfall bars, stepped for the dark surface. */
  --trace-fixr: #3987e5;
  --trace-mail: #a47de0;
  --trace-discord: #d95926;
  --trace-push: #199e70;
  --trace-stripe: #e0628f;
  --trace-bin: #a9ae45;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-pop: 0 16px 40px -10px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* --- Base ------------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--canvas);
  color: var(--ink);
  font-family: "Geist", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}
body {
  background: var(--canvas);
  margin: 0;
  min-height: 100vh;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
/* No double-tap zoom, so taps land at once. */
a,
button,
label,
summary,
input,
select,
textarea {
  touch-action: manipulation;
}
h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: -0.015em;
}
strong {
  font-weight: 600;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
::selection {
  background: var(--accent-soft);
}

.data,
.countdown,
.strip-clock,
.count-badge,
time {
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
}

.skip-link {
  background: var(--ink);
  border-radius: 0 0 var(--radius-sm) 0;
  color: var(--on-ink);
  font-size: 14px;
  font-weight: 500;
  left: 0;
  padding: 10px 18px;
  position: fixed;
  top: 0;
  transform: translateY(-130%);
  transition: transform 0.15s ease;
  z-index: 60;
}
.skip-link:focus-visible {
  transform: none;
}
main#main-content:focus {
  outline: none;
}

/* --- Sidebar --------------------------------------------------------------- */

.rail {
  background: var(--canvas);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100vh;
  left: 0;
  padding: 18px 14px 16px;
  position: fixed;
  top: 0;
  width: var(--rail);
  z-index: 5;
}
.brand {
  align-items: center;
  display: flex;
  gap: 11px;
  padding: 2px 6px;
}
.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 9px;
  color: var(--on-ink);
  display: inline-flex;
  flex: none;
  font-size: 17px;
  font-weight: 700;
  height: 34px;
  justify-content: center;
  letter-spacing: -0.02em;
  position: relative;
  width: 34px;
}
.brand-mark::after {
  background: var(--signal);
  border: 2px solid var(--canvas);
  border-radius: 50%;
  content: "";
  height: 10px;
  position: absolute;
  right: -3px;
  top: -3px;
  width: 10px;
}
.brand strong,
.brand small {
  display: block;
}
.brand strong {
  font-size: 15px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.brand small {
  color: var(--muted);
  font-size: 12.5px;
}

.rail nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 30px;
}
.rail nav a {
  align-items: center;
  border-radius: 8px;
  color: var(--ink-2);
  display: flex;
  font-size: 14px;
  font-weight: 500;
  gap: 11px;
  padding: 8px 10px;
}
.rail nav svg {
  fill: none;
  flex: none;
  height: 18px;
  stroke: var(--faint);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
  width: 18px;
}
.rail nav a:hover {
  background: var(--hover);
  color: var(--ink);
}
.rail nav a:hover svg {
  stroke: var(--ink-2);
}
.rail nav a[aria-current="page"] {
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--line),
    var(--shadow);
  color: var(--ink);
  font-weight: 600;
}
.rail nav a[aria-current="page"] svg {
  stroke: var(--accent);
}
/* The counts beside Control room and Reservations: amber like the countdowns and the
   alert favicon, because it is the same "act on this now" signal. */
.nav-count {
  align-items: center;
  background: var(--count);
  border-radius: 999px;
  color: var(--on-count);
  display: inline-flex;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  height: 20px;
  justify-content: center;
  line-height: 1;
  margin-left: auto;
  min-width: 20px;
  padding: 0 6px;
}
.nav-count[hidden] {
  display: none;
}
.nav-count.bump {
  animation: nav-count-bump 0.45s cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes nav-count-bump {
  40% {
    transform: scale(1.25);
  }
}
.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}
.nav-section {
  color: var(--faint);
  font-size: 12px;
  font-weight: 500;
  margin: 22px 10px 6px;
}

/* --- Collapsed rail (desktop) ---------------------------------------------- */

.rail-head {
  align-items: center;
  display: flex;
  gap: 8px;
}
.rail-head .brand {
  flex: 1;
  min-width: 0;
}
.rail-collapse {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--faint);
  display: inline-flex;
  flex: none;
  height: 30px;
  justify-content: center;
  padding: 0;
  width: 30px;
}
.rail-collapse:hover {
  background: var(--hover);
  color: var(--ink);
}
.rail-collapse svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
  width: 18px;
}
.rail-collapse-arrow {
  transform-origin: 15px 12px;
}
/* Names stay on one line while the rail widens, so they are revealed rather than
   reflowing from two lines to one; the rail's edge trims them until they fit. Only
   while it moves: at rest the account menu has to reach out over the page. */
.rail nav a,
.nav-section,
.brand-name {
  white-space: nowrap;
}
.rail.rail-moving {
  overflow-x: clip;
}
/* Phones open the rail as a drawer, never folded. */
@media (max-width: 760px) {
  .rail-collapse {
    display: none;
  }
}
@media (min-width: 761px) and (prefers-reduced-motion: no-preference) {
  .rail-animate .rail,
  .rail-animate .app-shell {
    transition:
      width 0.18s ease,
      margin-left 0.18s ease,
      padding 0.18s ease;
  }
}
@media (min-width: 761px) {
  :root[data-rail="collapsed"] {
    --rail: 68px;
  }
  [data-rail="collapsed"] .rail {
    padding-left: 10px;
    padding-right: 10px;
  }
  [data-rail="collapsed"] .rail-head {
    flex-direction: column;
    gap: 14px;
  }
  [data-rail="collapsed"] .rail-head .brand {
    flex: none;
    padding: 2px 0;
  }
  [data-rail="collapsed"] .brand-name {
    display: none;
  }
  [data-rail="collapsed"] .rail-collapse-arrow {
    transform: scaleX(-1);
  }
  [data-rail="collapsed"] .rail nav {
    margin-top: 18px;
  }
  [data-rail="collapsed"] .rail nav a {
    justify-content: center;
    padding: 9px 0;
    position: relative;
  }
  /* The name stays for screen readers; sighted people get it as a tooltip. */
  [data-rail="collapsed"] .nav-label {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }
  /* Counts ride on the icon's corner. */
  [data-rail="collapsed"] .rail nav .nav-count {
    font-size: 10px;
    height: 16px;
    min-width: 16px;
    padding: 0 4px;
    position: absolute;
    right: 2px;
    top: 1px;
  }
  /* Section names become a rule between groups. */
  [data-rail="collapsed"] .nav-section {
    background: var(--line);
    font-size: 0;
    height: 1px;
    margin: 14px 8px;
  }
  [data-rail="collapsed"] .row-menu.account-menu > summary {
    grid-template-columns: auto;
    justify-content: center;
  }
  [data-rail="collapsed"] .rail-user-name,
  [data-rail="collapsed"] .account-menu-chevron {
    display: none;
  }
  /* The menu keeps its full width, reaching out over the page. */
  [data-rail="collapsed"] .account-menu .row-menu-list {
    width: 240px;
  }
}

.avatar {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 50%;
  color: var(--accent);
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  height: 32px;
  justify-content: center;
  width: 32px;
}
.text-button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 7px;
}
.text-button:hover {
  background: var(--hover);
  color: var(--ink);
}

/* --- Top strip ------------------------------------------------------------- */

.app-shell {
  margin-left: var(--rail);
  min-height: 100vh;
}
.mobile-bar {
  display: none;
}
.system-strip {
  align-items: center;
  backdrop-filter: saturate(1.4) blur(10px);
  background: var(--glass);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 13px;
  gap: 22px;
  height: var(--strip);
  padding: 0 40px;
  position: sticky;
  top: 0;
  z-index: 4;
}
.system-strip strong {
  color: var(--ink);
  font-weight: 500;
}
.strip-lead,
.strip-tools {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  gap: inherit;
}
/* Narrower, the status takes the spare room and search joins the tools on the right. */
.strip-tools {
  flex-grow: 0;
  justify-content: flex-end;
}
/* Wide enough for search to sit in the middle of the bar: the two sides grow alike,
   so whatever sits between them is centred. */
@media (min-width: 1280px) {
  .strip-lead,
  .strip-tools {
    flex: 1 1 0;
    white-space: nowrap;
  }
}
.strip-status {
  align-items: center;
  color: var(--ink-2);
  display: inline-flex;
  font-weight: 500;
}
.status-dot,
.presence {
  background: var(--signal);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(43, 196, 134, 0.18);
  display: inline-block;
  height: 7px;
  margin-right: 9px;
  width: 7px;
}
.strip-status.paused {
  color: var(--red-ink);
}
.strip-status.paused .status-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(187, 58, 48, 0.18);
}
.strip-clock {
  color: var(--ink-2);
  min-width: 86px;
}

.live-toggle {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  color: var(--ink-2);
  display: inline-flex;
  font-size: 12.5px;
  font-weight: 500;
  gap: 7px;
  padding: 4px 11px 4px 9px;
  white-space: nowrap;
}
.live-toggle:hover {
  border-color: var(--line-strong);
}
.live-toggle[hidden] {
  display: none;
}
.live-dot {
  background: var(--signal);
  border-radius: 50%;
  flex: none;
  height: 7px;
  width: 7px;
}
.live-toggle[data-live-state="live"] .live-dot {
  animation: live-breathe 2.4s ease-in-out infinite;
}
.live-toggle[data-live-state="paused"] {
  color: var(--muted);
}
.live-toggle[data-live-state="paused"] .live-dot {
  background: var(--line-strong);
}
.live-toggle[data-live-state="stale"] {
  color: var(--amber);
}
.live-toggle[data-live-state="stale"] .live-dot {
  background: var(--amber);
}
@keyframes live-breathe {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(43, 196, 134, 0.45);
  }
  60% {
    box-shadow: 0 0 0 5px rgba(43, 196, 134, 0);
  }
}

.theme-toggle {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  display: inline-flex;
  height: 30px;
  justify-content: center;
  padding: 0;
  width: 30px;
}
.theme-toggle:hover {
  background: var(--hover);
  color: var(--ink);
}
.theme-toggle svg {
  fill: none;
  height: 17px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
  width: 17px;
}
/* Bell: struck through while alerts are off, accent-coloured while on. */
.alerts-toggle[aria-pressed="true"] {
  color: var(--accent);
}
.alerts-toggle[aria-pressed="true"] .alerts-off-slash {
  display: none;
}
/* The icon shows the theme a click switches to. */
.theme-toggle .theme-icon-light {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .theme-icon-light {
  display: block;
}
:root[data-theme="dark"] .theme-toggle .theme-icon-dark {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .theme-icon-light {
    display: block;
  }
  :root:not([data-theme]) .theme-toggle .theme-icon-dark {
    display: none;
  }
}
.theme-toggle.floating {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow);
  height: 36px;
  position: fixed;
  right: 20px;
  top: 20px;
  width: 36px;
  z-index: 10;
}

/* Dense tables are a large-screen choice: the switch hides, and the setting rests, below 1280px. */
@media (min-width: 1280px) {
  :root[data-density="dense"] .table-head,
  :root[data-density="dense"] .table-row {
    gap: 14px;
    padding-bottom: 6px;
    padding-top: 6px;
  }
  :root[data-density="dense"] .table-row {
    font-size: 13.5px;
    min-height: 40px;
  }
  :root[data-density="dense"] .table-row small {
    font-size: 12px;
    margin-top: 0;
  }
  :root[data-density="dense"] .table-row .status {
    padding-bottom: 1px;
    padding-top: 1px;
  }
  :root[data-density="dense"] .table-row .button.compact {
    min-height: 26px;
    padding-bottom: 2px;
    padding-top: 2px;
  }
  :root[data-density="dense"] .step-columns {
    min-height: 0;
  }
  :root[data-density="dense"] .compact-row {
    padding-bottom: 6px;
    padding-top: 6px;
  }
  :root[data-density="dense"] .chart-table th,
  :root[data-density="dense"] .chart-table td {
    padding: 5px 16px;
  }
}

/* --- Toast messages -------------------------------------------------------- */

.messages {
  position: fixed;
  right: 24px;
  top: calc(var(--strip) + 14px);
  z-index: 10;
}
.message {
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  display: flex;
  font-size: 14px;
  gap: 12px;
  margin-bottom: 8px;
  max-width: 400px;
  padding: 12px 12px 12px 14px;
}
.message::before {
  background: var(--accent);
  border-radius: 50%;
  content: "";
  flex: none;
  height: 8px;
  margin-top: 7px;
  width: 8px;
}
.message.error::before {
  background: var(--red);
}
.message.warning::before {
  background: var(--amber);
}
.message.info::before {
  background: var(--blue);
}
.message p {
  flex: 1;
  margin: 0;
}
.message-undo {
  flex: none;
  margin: -3px 0;
}
.message-action {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding: 5px 8px;
}
.message-action:hover {
  background: var(--surface-2);
}
.message.leaving {
  animation: message-out 0.28s ease-in forwards;
}
@keyframes message-out {
  to {
    opacity: 0;
    transform: translateX(12px);
  }
}
.message-dismiss {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--faint);
  flex: none;
  font-size: 18px;
  height: 24px;
  line-height: 1;
  padding: 0;
  width: 24px;
}
.message-dismiss:hover {
  background: var(--surface-2);
  color: var(--ink);
}

/* --- Maintenance banner --------------------------------------------------- */

.maintenance-banner {
  align-items: flex-start;
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius);
  color: var(--amber-ink);
  display: flex;
  font-size: 14px;
  gap: 12px;
  margin: 16px auto 0;
  max-width: calc(1440px - 80px);
  padding: 12px 16px;
  width: calc(100% - 80px);
}
.maintenance-banner.is-active {
  background: var(--red-soft);
  border-color: var(--red);
  color: var(--red-ink);
}
.maintenance-banner svg {
  fill: none;
  flex: none;
  height: 18px;
  margin-top: 1px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 18px;
}
.maintenance-banner p {
  flex: 1;
  margin: 0;
}
.maintenance-note {
  display: block;
  margin-top: 2px;
  opacity: 0.85;
}
.maintenance-manage {
  color: inherit;
  flex: none;
  font-weight: 600;
}
.maintenance-when {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}
.settings-actions .maintenance-open {
  margin-top: 14px;
}
.settings-actions .maintenance-cancel + .maintenance-open {
  margin-top: 8px;
}
.maintenance-dialog {
  width: 560px;
}
.maintenance-form .field small {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 4px;
}

/* --- Page structure -------------------------------------------------------- */

main#main-content {
  margin: 0 auto;
  max-width: 1440px;
  padding: 36px 40px 80px;
}
main#main-content.auth-shell {
  max-width: none;
  padding: 0;
}
.page-head {
  align-items: flex-end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 28px;
}
.page-head.narrow {
  max-width: 860px;
}
.page-head h1 {
  font-size: 30px;
  letter-spacing: -0.028em;
  line-height: 1.15;
  margin: 0;
}
.page-head p {
  color: var(--muted);
  margin: 6px 0 0;
  max-width: 64ch;
}
.kicker {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 4px;
}

.head-metrics {
  display: flex;
  gap: 8px;
}
.head-metrics div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 128px;
  padding: 10px 14px;
}
.head-metrics strong,
.head-metrics span {
  display: block;
}
.head-metrics strong {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.head-metrics span {
  color: var(--muted);
  font-size: 12.5px;
}
.head-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}
.head-actions form {
  margin: 0;
}

.queue-panel,
.action-panel,
.recent-strip,
.extra-panel,
.data-panel,
.form-panel,
.rule-ledger,
.history-timeline,
.log-filters,
.collection-filters,
.checkout-summary,
.checkout-panel,
.chart-card,
.not-found-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.queue-panel,
.action-panel,
.recent-strip,
.extra-panel {
  padding: 22px 24px;
}

.section-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}
.section-head h2 {
  font-size: 16px;
  margin: 0;
}
.section-head p {
  color: var(--muted);
  font-size: 13.5px;
  margin: 2px 0 0;
}
.section-head > a {
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.section-head > a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.panel-heading {
  font-size: 18px;
  margin: 0 0 4px;
}
.panel-heading + p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 20px;
}

.count-badge {
  background: var(--ink);
  border-radius: 999px;
  color: var(--on-ink);
  font-size: 13px;
  font-weight: 600;
  min-width: 28px;
  padding: 3px 10px;
  text-align: center;
}

/* --- Buttons & links ------------------------------------------------------- */

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-flex;
  font-size: 14px;
  font-weight: 500;
  gap: 8px;
  justify-content: center;
  line-height: 1.2;
  min-height: 38px;
  padding: 8px 15px;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease;
  white-space: nowrap;
}
.button.primary {
  background: var(--ink);
  color: var(--on-ink);
}
.button.primary:hover {
  background: var(--ink-2);
}
.button.secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}
.button.secondary:hover {
  background: var(--surface-2);
  border-color: var(--border-hover);
}
.button.danger {
  background: var(--red);
  color: #fff;
}
.button.danger:hover {
  background: var(--red-hover);
}
.button.compact {
  font-size: 13px;
  min-height: 32px;
  padding: 5px 11px;
}
.button.full {
  width: 100%;
}
.button[disabled],
.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.danger-button {
  color: var(--red) !important;
  margin-right: auto;
}

.table-action,
.form-link {
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}
.table-action:hover,
.form-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.form-link {
  display: inline-block;
  text-align: center;
}

.row-actions {
  align-items: center;
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
.row-actions form {
  margin: 0;
}
.row-actions > a:not(.button),
.row-actions button:not(.button):not(.picker *) {
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  padding: 5px 8px;
}
.row-actions > a:not(.button):hover,
.row-actions button:not(.button):not(.picker *):hover {
  background: var(--surface-2);
  color: var(--ink);
}
.row-actions .danger-link {
  color: var(--red) !important;
}
.row-actions .danger-link:hover {
  background: var(--red-soft) !important;
}
.row-actions button:disabled:not(.picker *) {
  cursor: not-allowed;
  opacity: 0.45;
}

/* A submitted form's button: a small spinner, and no second click. */
.is-busy {
  cursor: progress;
  pointer-events: none;
}
.button.is-busy {
  opacity: 0.75;
}
.is-busy::after {
  animation: busy-spin 0.7s linear infinite;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-right-color: transparent;
  content: "";
  display: inline-block;
  flex: none;
  height: 12px;
  margin-left: 8px;
  vertical-align: -2px;
  width: 12px;
}
@keyframes busy-spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Confirmation dialog --------------------------------------------------- */

.confirm-dialog {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  color: var(--ink);
  max-width: calc(100vw - 32px);
  padding: 24px;
  width: 420px;
}
.confirm-dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(2px);
}
.confirm-dialog[open] {
  animation: dialog-in 0.16s ease-out;
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}
.confirm-dialog h2 {
  font-size: 17px;
  line-height: 1.3;
  margin: 0;
  overflow-wrap: anywhere;
}
.confirm-dialog p {
  color: var(--muted);
  font-size: 14px;
  margin: 8px 0 0;
}
.confirm-dialog p:empty {
  display: none;
}
.profile-password-dialog .field {
  margin: 18px 0 0;
}

/* The profile's time choice: two cards, each showing how a time would read. */
.profile-times {
  border-top: 1px solid var(--line);
}
.profile-times-head h2 {
  font-size: 17px;
  margin: 0;
}
.profile-times-head p {
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0 0;
}
.time-choices {
  border: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0;
}
.time-choice {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  display: grid;
  gap: 6px;
  padding: 14px 16px 14px 44px;
  position: relative;
  transition:
    border-color 0.12s ease,
    background-color 0.12s ease;
}
.time-choice:hover {
  border-color: var(--border-hover);
}
.time-choice:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}
.time-choice:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.time-choice input {
  accent-color: var(--accent);
  left: 16px;
  margin: 0;
  position: absolute;
  top: 16px;
}
.time-choice input:focus-visible {
  outline: none;
}
.time-choice-name {
  font-size: 14px;
  font-weight: 600;
}
.time-choice-sample {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 13px;
  padding: 7px 10px;
}
.time-choice-sample time {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  text-decoration: underline dotted var(--line-strong);
  text-underline-offset: 3px;
}
.time-choice small {
  color: var(--muted);
  font-size: 12.5px;
}
.time-choices-save {
  align-items: center;
}
.time-choices-status {
  color: var(--muted);
  font-size: 13px;
  margin-right: auto;
}
@media (max-width: 760px) {
  .time-choices {
    grid-template-columns: minmax(0, 1fr);
  }
}
.confirm-dialog-lines {
  border-top: 1px solid var(--line);
  font-size: 14px;
  margin: 12px 0 0;
}
.confirm-dialog-lines div {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 6px 0;
}
.confirm-dialog-lines dd {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  margin: 0;
}
.confirm-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 22px;
}

/* Transfer links to send the buyer, each with Copy (and Share where the device has it). */
.transfer-dialog {
  width: 520px;
}
.transfer-links {
  display: grid;
  gap: 14px;
  list-style: none;
  margin: 18px 0 0;
  max-height: min(60vh, 480px);
  overflow-y: auto;
  padding: 0;
}
.transfer-link-head {
  display: grid;
  gap: 2px;
  margin-bottom: 6px;
}
.transfer-link-head strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.transfer-link-head small {
  color: var(--muted);
  font-size: 12px;
}
/* A link to hand someone, as text with Copy beside it (transfer links, invitations). */
.link-box {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  gap: 10px;
  padding: 8px 8px 8px 12px;
}
.link-box-url {
  color: var(--ink);
  flex: 1;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  min-width: 0;
  word-break: break-all;
  user-select: all;
}
.link-box-actions {
  display: flex;
  flex: none;
  gap: 6px;
}

/* --- Status pills ---------------------------------------------------------- */

.status {
  align-items: center;
  background: var(--chip);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 500;
  gap: 6px;
  justify-self: start;
  line-height: 1.4;
  padding: 3px 10px 3px 8px;
  white-space: nowrap;
}
.status::before {
  background: currentColor;
  border-radius: 50%;
  content: "";
  flex: none;
  height: 6px;
  width: 6px;
}
.status.active,
.status.connected,
.status.ok {
  background: var(--accent-soft);
  color: var(--accent);
}
.status.pending,
.status.reconciling,
.status.deferred {
  background: var(--amber-soft);
  color: var(--amber);
}
.status.failed,
.status.invalid,
.status.rejected,
.status.network_error,
.status.timeout {
  background: var(--red-soft);
  color: var(--red);
}
.status.purchased {
  background: var(--blue-soft);
  color: var(--blue);
}
.status.inactive,
.status.cancelled,
.status.written_off,
.status.won {
  background: var(--surface-2);
  color: var(--ink-2);
}
.status.part_refunded,
.status.refunded,
.status.refund,
.status.cancellation,
.status.disputed {
  background: var(--amber-soft);
  color: var(--amber);
}
.status.charged_back,
.status.lost {
  background: var(--red-soft);
  color: var(--red);
}

/* --- Dashboard ------------------------------------------------------------- */

.work-status {
  background: var(--dark);
  border-radius: var(--radius-lg);
  color: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px 240px;
  margin-bottom: 20px;
  overflow: hidden;
}
.work-status > div {
  align-content: center;
  border-left: 1px solid var(--dark-line);
  display: grid;
  gap: 2px;
  padding: 16px 22px;
}
.work-status > div:first-child {
  align-items: center;
  border-left: 0;
  column-gap: 14px;
  grid-template-columns: auto 1fr;
}
.work-status small {
  color: var(--dark-muted);
  font-size: 13px;
  grid-column: 2;
}
.work-status span {
  color: var(--dark-muted);
  font-size: 12.5px;
}
.work-status strong {
  font-weight: 500;
}
.work-status strong.data {
  font-size: 18px;
  letter-spacing: -0.01em;
}
.pulse {
  animation: live-breathe 2.4s ease-in-out infinite;
  background: var(--signal) !important;
  border-radius: 50%;
  grid-row: 1 / 3;
  height: 10px;
  width: 10px;
}
.pulse.off-duty {
  animation: none;
  background: var(--dark-muted) !important;
  opacity: 0.6;
}
.pulse.paused {
  animation: none;
  background: var(--dark-negative) !important;
}
.command-head .automation-switch {
  align-self: center;
  margin-left: auto;
}

/* Each member's own arrangement: rows three columns wide, a panel spanning one, two or all three. */
.control-grid {
  --control-gap: 20px;
  display: grid;
  gap: var(--control-gap);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
/* Wide enough for panels side by side, each sits where it was placed (Dashboard's
   placePanels): --x the column it starts in, --w how many it spans, top from above. */
.control-grid.is-placed {
  display: block;
  position: relative;
}
.control-grid.is-placed > .control-panel {
  --third: calc((100% - 2 * var(--control-gap)) / 3);
  left: calc(var(--third) * var(--x) + var(--control-gap) * var(--x));
  position: absolute;
  width: calc(var(--third) * var(--w) + var(--control-gap) * (var(--w) - 1));
}
@media (prefers-reduced-motion: no-preference) {
  .control-grid.is-placed > .control-panel {
    transition:
      top 0.18s ease,
      left 0.18s ease,
      width 0.18s ease;
  }
}
/* Following the pointer, not catching up with it. */
.control-grid.is-placed > .control-panel.is-resizing {
  transition: none;
}
.control-panel {
  container: control-panel / inline-size;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.control-grid > .control-panel > * {
  flex: 1;
  margin: 0;
}
.control-panel > .work-status {
  flex: none;
}
.control-panel.span-1 {
  grid-column: span 1;
}
.control-panel.span-2 {
  grid-column: span 2;
}
.control-panel.span-3 {
  grid-column: 1 / -1;
}
/* A panel given a height keeps it, scrolling inside itself, where panels sit side by side. */
@media (min-width: 1051px) {
  .control-panel.has-height {
    align-self: start;
    height: var(--panel-height);
  }
  .control-grid > .control-panel.has-height > :not(.arrange-chrome) {
    min-height: 0;
    overflow-y: auto;
  }
  /* The worker status bar keeps its own height until it is given one. */
  .control-grid > .control-panel.has-height > .work-status {
    flex: 1;
  }
}
.control-empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}

/* Customising: each panel is outlined with a grip to drag it by and a handle on its right
   edge to resize it. Its own buttons and links rest until customising ends. */
.control-grid.is-arranging {
  margin-top: 8px;
}
/* Something for the handles to sit on; placed panels already are. */
.control-grid.is-arranging:not(.is-placed) .control-panel {
  position: relative;
}
.control-grid.is-arranging .control-panel > :not(.arrange-chrome) {
  pointer-events: none;
  user-select: none;
}
.arrange-chrome {
  border: 2px dashed var(--accent-border);
  border-radius: var(--radius-lg);
  cursor: grab;
  inset: 0;
  position: absolute;
  transition: border-color 0.12s ease;
  z-index: 2;
}
.arrange-chrome:hover,
.is-dragging > .arrange-chrome,
.is-resizing > .arrange-chrome {
  border-color: var(--accent);
}
.is-dragging > .arrange-chrome,
.is-resizing > .arrange-chrome {
  border-style: solid;
}
.is-dragging > .arrange-chrome {
  cursor: grabbing;
}
/* Its bottom edge lined up with another panel's: a firm line says so. */
.is-aligned > .arrange-chrome {
  border-bottom: 3px solid var(--accent);
}
/* A panel being dragged sits where it would land, drawn as the slot it will drop into: a
   firm ringed outline over a tint, its content faded behind, and a label saying so. Its name
   follows the pointer (.drag-ghost). */
.control-panel.is-dragging {
  z-index: 3;
}
.control-panel.is-dragging > .arrange-chrome {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-width: 3px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}
.control-panel.is-dragging > .arrange-chrome::after {
  background: var(--accent);
  border-radius: 999px;
  color: var(--surface);
  content: "Drops here";
  font-size: 13px;
  font-weight: 500;
  left: 50%;
  padding: 5px 12px;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}
.control-panel.is-dragging > :not(.arrange-chrome) {
  opacity: 0.25;
}
.arrange-grip {
  align-items: center;
  background: var(--dark);
  border: 0;
  border-radius: 999px;
  box-shadow: var(--shadow);
  color: #fff;
  cursor: grab;
  display: inline-flex;
  font-size: 13px;
  font-weight: 500;
  gap: 8px;
  left: 50%;
  max-width: calc(100% - 24px);
  padding: 6px 14px;
  position: absolute;
  /* Astride the top edge, in the gap above the panel, so it covers none of its heading. */
  top: -15px;
  touch-action: none;
  transform: translateX(-50%);
  white-space: nowrap;
}
.arrange-grip > span {
  font-size: 15px;
  line-height: 1;
}
.arrange-grip small {
  color: var(--dark-muted);
  font-size: 12px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
}
.arrange-grip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.arrange-resize {
  background: var(--surface);
  border: 2px solid var(--accent);
  padding: 0;
  border-radius: 999px;
  cursor: ew-resize;
  height: 56px;
  position: absolute;
  right: -8px;
  top: 50%;
  touch-action: none;
  transform: translateY(-50%);
  width: 14px;
}
.arrange-resize:hover,
.is-resizing .arrange-resize {
  background: var(--accent);
}
.arrange-resize-y {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 999px;
  bottom: -8px;
  cursor: ns-resize;
  height: 14px;
  left: 50%;
  padding: 0;
  position: absolute;
  touch-action: none;
  transform: translateX(-50%);
  width: 56px;
}
.arrange-resize-xy {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 4px;
  bottom: -8px;
  cursor: nwse-resize;
  height: 16px;
  position: absolute;
  right: -8px;
  touch-action: none;
  width: 16px;
}
.arrange-resize-y:hover,
.arrange-resize-xy:hover,
.is-resizing .arrange-resize-y,
.is-resizing .arrange-resize-xy {
  background: var(--accent);
}
.arrange-resize-y:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Below this every panel is full width at its natural height, so there is nothing to resize or say about size. */
@media (max-width: 1050px) {
  .arrange-resize,
  .arrange-resize-y,
  .arrange-resize-xy,
  .arrange-grip small {
    display: none;
  }
}

/* Customise, beside the page's title. */
.title-line {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.title-line .customise-button {
  gap: 6px;
}
/* While customising, the header says so; the controls float in a dock at the bottom. */
.customise-head p {
  margin-top: 4px;
}
.customise-dock {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  bottom: calc(var(--tab-bar-space, 0px) + 20px);
  box-shadow: var(--shadow);
  display: flex;
  left: 50%;
  max-width: calc(100% - 32px);
  padding: 8px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 40;
}
/* Room under the last panel, so the dock never covers it. */
#live-region:has(> .customise-dock) {
  padding-bottom: 96px;
}
.customise-dock-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.palette-anchor {
  position: relative;
}
.add-panel-button {
  gap: 8px;
}
.add-panel-button > span:first-child {
  font-size: 17px;
  line-height: 1;
}
.add-panel-button .count-badge {
  font-size: 11.5px;
  height: 20px;
  min-width: 20px;
}
.panel-palette {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: 14px;
  bottom: calc(100% + 12px);
  left: 0;
  position: absolute;
  width: 340px;
  z-index: 30;
}
.panel-palette.is-dragging-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.panel-palette-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}
.panel-palette-head strong {
  font-size: 15px;
  font-weight: 500;
}
.panel-palette > p {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 10px;
}
.panel-palette ul {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.palette-card {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  cursor: grab;
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
  /* A finger scrolls the menu; only the grip picks a card up. */
  touch-action: pan-y;
  transition:
    border-color 0.12s ease,
    background 0.12s ease;
  width: 100%;
}
.palette-card:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}
.palette-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.palette-card > span:nth-child(2) {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}
.palette-card strong {
  font-size: 14px;
  font-weight: 500;
}
.palette-card small {
  color: var(--muted);
  font-size: 12.5px;
}
.palette-grip {
  color: var(--muted);
  font-size: 16px;
  touch-action: none;
}
/* On a touch screen the grip is what drags, so it gets a fingertip's worth of room. */
@media (pointer: coarse) {
  .palette-grip {
    align-self: stretch;
    cursor: grab;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: -10px 0 -10px -12px;
    min-width: 40px;
    font-size: 20px;
  }
}
.palette-plus {
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent);
  display: inline-flex;
  flex: none;
  font-size: 16px;
  height: 26px;
  justify-content: center;
  width: 26px;
}
.drag-ghost {
  align-items: center;
  background: var(--dark);
  border-radius: 999px;
  box-shadow: var(--shadow);
  color: #fff;
  display: inline-flex;
  font-size: 13px;
  font-weight: 500;
  gap: 8px;
  padding: 8px 14px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, -50%) rotate(-2deg);
  white-space: nowrap;
  z-index: 50;
}
.add-panel-tile {
  margin-top: 20px;
  width: 100%;
  align-items: center;
  background: transparent;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font-size: 14px;
  gap: 10px;
  grid-column: 1 / -1;
  justify-content: center;
  min-height: 72px;
  transition:
    border-color 0.12s ease,
    color 0.12s ease;
}
.add-panel-tile > span {
  font-size: 22px;
  line-height: 1;
}
.add-panel-tile:hover,
.add-panel-tile:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}
.arrange-remove {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  box-shadow: var(--shadow);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font-size: 16px;
  height: 28px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: -10px;
  top: -12px;
  width: 28px;
}
.arrange-remove:hover {
  background: var(--red);
  border-color: transparent;
  color: #fff;
}
.arrange-remove:focus-visible,
.arrange-resize:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (max-width: 760px) {
  .page-head.customise-head h1 {
    font-size: 19px;
  }
  /* Across the screen, just above the tab bar; the add menu opens over it at full width. */
  .customise-dock {
    border-radius: var(--radius-lg);
    bottom: calc(var(--tab-bar-space, 0px) + 10px);
    width: calc(100% - 20px);
  }
  .customise-dock-actions {
    flex-wrap: nowrap;
    gap: 6px;
    width: 100%;
  }
  .customise-dock-actions > .button.primary {
    margin-left: auto;
  }
  /* "+ Add" and "Reset" are enough here, so every control fits on one line. */
  .customise-dock .wide-only {
    display: none;
  }
  .palette-anchor {
    position: static;
  }
  .panel-palette {
    left: 0;
    right: 0;
    width: auto;
  }
}
/* A phone is narrower than the six controls, so they take two lines: arranging above, and
   cancel and save below, half the dock each. */
@media (max-width: 520px) {
  .customise-dock-actions {
    flex-wrap: wrap;
    gap: 3px 6px;
    justify-content: flex-start;
  }
  /* An empty line of no height between the two, which is what breaks them apart. */
  .customise-dock-actions::after {
    content: "";
    flex-basis: 100%;
    order: 1;
  }
  .customise-dock-actions > .button.primary,
  .customise-dock-actions > .button:has(+ .button.primary) {
    flex: 1 1 0;
    margin-left: 0;
    order: 2;
  }
  #live-region:has(> .customise-dock) {
    padding-bottom: 130px;
  }
}

/* The optional panels: short linked lists, and the stock figures. */
.panel-list {
  margin-top: 10px;
}
.panel-list > a {
  align-items: center;
  border-top: 1px solid var(--line);
  color: inherit;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 0;
  text-decoration: none;
}
.panel-list > a:hover strong {
  color: var(--accent);
}
.panel-list > a > div {
  min-width: 0;
}
.panel-list strong,
.panel-list > a > div > small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.panel-list strong {
  font-size: 14px;
  font-weight: 500;
}
.panel-list small {
  color: var(--muted);
  font-size: 12.5px;
}
.panel-list > a > small,
.panel-list > a > .status {
  flex: none;
}
.panel-list > a.is-unread strong::before {
  background: var(--accent);
  border-radius: 50%;
  content: "";
  display: inline-block;
  height: 7px;
  margin-right: 7px;
  vertical-align: middle;
  width: 7px;
}
.panel-empty {
  color: var(--muted);
  font-size: 13.5px;
  margin: 12px 0 0;
}
/* "+3 more" under a list showing fewer than there are. */
.more-rows {
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0 0;
}
.more-rows a,
.more-rows strong {
  font-weight: 500;
}
.action-panel .more-rows {
  margin-bottom: 12px;
}
.undo-buttons {
  display: flex;
  gap: 4px;
}
.undo-buttons .button {
  font-size: 16px;
  min-width: 36px;
  padding-left: 0;
  padding-right: 0;
}
.stock-figures {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  margin: 12px 0 0;
}
.stock-figures > div {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.stock-figures dt {
  color: var(--muted);
  font-size: 12.5px;
}
.stock-figures dd {
  font-size: 18px;
  margin: 2px 0 0;
}
.revenue-figures small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}
.revenue-figures small.up {
  color: var(--accent);
}
.revenue-figures small.down,
.revenue-figures .loss dd {
  color: var(--red);
}
/* The revenue panel's choice of period, smaller than a page's segmented control. */
.panel-period {
  margin-top: 12px;
}
.segmented.panel-period span {
  font-size: 13px;
  padding: 4px 10px;
}
/* Spend by bank: a row per bank, its name and total over one bar for each day. */
/* The administrators' panels (AdminPanels.tsx): a heading over a second list, and the
   Server page's advice without its page padding. */
.admin-panel-subhead {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  margin: 16px 0 0;
}
.concurrency-advice.admin-panel-advice {
  padding: 12px 0 0;
}
.bank-spend {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 12px;
}
.bank-spend h3 {
  display: flex;
  font-size: 13.5px;
  justify-content: space-between;
  margin: 0;
}
.bank-spend > small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 10px;
}
.bank-spend-row {
  column-gap: 12px;
  display: grid;
  font-size: 13.5px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 10px;
}
.bank-spend-row strong {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.spend-days {
  border-bottom: 1px solid var(--chart-axis);
  display: flex;
  gap: 1px;
  grid-column: 1 / -1;
  height: 36px;
  margin-top: 4px;
}
/* Each day is hovered over its whole column, so a day with nothing spent still answers. */
.spend-days span {
  align-items: flex-end;
  display: flex;
  flex: 1;
  min-width: 0;
}
.spend-days span:hover {
  background: var(--hover);
}
.spend-days i {
  background: var(--chart-cost);
  border-radius: 2px 2px 0 0;
  width: 100%;
}
.timeline {
  margin-top: 12px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 46px 18px 1fr;
  position: relative;
}
.timeline-item time {
  color: var(--muted);
  font-size: 13px;
  padding-top: 18px;
}
.timeline-pin {
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--accent-soft);
  height: 10px;
  margin: 22px 0 0 2px;
  position: relative;
  width: 10px;
  z-index: 2;
}
.timeline-item::before {
  background: var(--line);
  bottom: 0;
  content: "";
  left: 52px;
  position: absolute;
  top: 0;
  width: 2px;
}
.timeline-item:first-child::before {
  top: 22px;
}
.timeline-item:last-child::before {
  bottom: auto;
  height: 22px;
}
.timeline-item:only-child::before {
  display: none;
}
.timeline-body {
  border-bottom: 1px solid var(--line);
  padding: 14px 0 18px 10px;
}
.timeline-item:last-child .timeline-body {
  border-bottom: 0;
}
.item-line {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}
.item-line h2,
.item-line h3 {
  font-size: 15.5px;
  margin: 0;
}
.item-line p,
.timeline-body > p {
  color: var(--muted);
  font-size: 14px;
  margin: 3px 0;
}
.item-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-top: 12px;
}
.countdown {
  color: var(--amber);
  font-size: 14px;
  font-weight: 600;
}
.countdown.elapsed {
  color: var(--red);
}
.countdown.urgent {
  align-items: center;
  color: var(--red);
  display: inline-flex;
  gap: 8px;
}
.countdown.urgent::before {
  animation: urgent-pulse 1.2s ease-in-out infinite;
  background: var(--red);
  border-radius: 50%;
  content: "";
  flex: none;
  height: 7px;
  width: 7px;
}
@keyframes urgent-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 55%, transparent);
  }
  70% {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--red) 0%, transparent);
  }
}
.checkout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* --- Hold cards -------------------------------------------------------------
   A held reservation is a decision with a deadline, so it gets a card rather
   than a history row: the ring drains to the expiry, the money and the pay
   button sit together, and the card itself turns red for the last two minutes. */

/* How much each bank is charged when the holds are paid by saved card. */
.bank-funds {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 6px 8px;
  margin-top: 12px;
}
.bank-funds-title {
  color: var(--muted);
}
.bank-funds-item {
  background: var(--chip);
  border-radius: 999px;
  display: inline-flex;
  gap: 6px;
  padding: 3px 10px;
}
.bank-funds-item strong {
  font-variant-numeric: tabular-nums;
}
.bank-funds-item.unnamed {
  color: var(--muted);
}
.bank-funds-count {
  color: var(--muted);
}
/* Whether the bank's recorded balance covers it (Bank balances page). */
.bank-funds-balance {
  color: var(--muted);
}
.bank-funds-item.short {
  background: var(--red-soft);
}
.bank-funds-item.short .bank-funds-balance {
  color: var(--red);
  font-weight: 600;
}
.bank-funds-link {
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 500;
}

/* --- Bank balances ----------------------------------------------------------
   One card per bank behind the person's saved cards: what it holds, what the
   waiting holds take out of it, where the figure comes from (the bank itself by
   open banking, or typed in), and the form to type a new one. */
.bank-balances {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
}
.bank-balance {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}
.bank-balance.low,
.bank-balance.short {
  border-color: var(--amber-border);
}
.bank-balance header {
  align-items: flex-start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
.bank-balance h2 {
  font-size: 17px;
  margin: 0;
}
.bank-balance header small {
  display: block;
  margin-top: 2px;
}
.bank-balance header small,
.bank-balance-note {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}
/* How the open banking link stands, in a word. */
.bank-link-pill {
  align-items: center;
  background: var(--chip);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  flex: none;
  font-size: 12.5px;
  font-weight: 550;
  gap: 6px;
  padding: 3px 10px;
}
.bank-link-pill::before {
  background: currentColor;
  border-radius: 50%;
  content: "";
  height: 6px;
  width: 6px;
}
.bank-link-pill.ok {
  background: var(--accent-soft);
  color: var(--accent);
}
.bank-link-pill.warn {
  background: var(--amber-soft);
  color: var(--amber-ink);
}
.bank-link-pill.bad {
  background: var(--red-soft);
  color: var(--red-ink);
}
.bank-balance-figure {
  font-size: 34px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0 0 4px;
}
.bank-balance.low .bank-balance-figure,
.bank-balance-alert {
  color: var(--amber);
}
.bank-balance-alert {
  font-size: 13px;
  font-weight: 550;
  margin: 2px 0 0;
}
.bank-balance-needed {
  font-size: 13.5px;
  margin: 0;
}
/* What the waiting holds take, to scale. Covered: the bar is the balance, its filled
   part the holds. Short: the bar is the holds, its filled part what the balance covers,
   and the hatched rest is what is missing. */
.bank-cover {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.bank-cover-bar {
  background: var(--accent-soft);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.bank-cover-bar span {
  background: var(--accent);
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 6px;
}
.bank-cover.short .bank-cover-bar {
  background: repeating-linear-gradient(135deg, var(--red) 0 2px, var(--red-soft) 2px 7px);
}
.bank-cover.short .bank-cover-bar span {
  background: var(--ink-2);
  border-radius: 999px 0 0 999px;
  min-width: 0;
}
.bank-cover-legend {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  font-size: 13.5px;
  gap: 2px 12px;
  justify-content: space-between;
  margin: 0;
}
.bank-cover-legend span {
  color: var(--ink-2);
}
.bank-cover-legend strong {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.bank-cover.short .bank-cover-legend strong {
  color: var(--red);
}
.bank-balance-form {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}
.bank-balance-form .field {
  margin: 0;
}
.bank-balance-form input {
  min-width: 0;
  width: 100%;
}
/* On a linked bank the figure is the bank's, so typing one in is folded away. */
.bank-balance-edit summary {
  color: var(--muted);
  font-size: 13px;
  width: fit-content;
}
.bank-balance-edit summary:hover,
.bank-balance-edit[open] summary {
  color: var(--ink);
}
.bank-balance-edit[open] summary {
  margin-bottom: 10px;
}
/* Open banking: how the bank's link stands, and choosing or renewing it. */
.bank-link-state,
.bank-link-form {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
}
.bank-link-form small {
  color: var(--muted);
  font-size: 12.5px;
}
.bank-link-form .field {
  margin: 0;
}
/* Choosing the bank: a search box that opens the list of banks, each with its logo
   (pages/accounts/BankPicker.tsx). It borrows the combobox's frame and menu. */
.bank-logo {
  align-items: center;
  /* Logos are drawn for a white page, so the tile stays white in the dark theme too. */
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: inline-flex;
  flex: none;
  height: 32px;
  justify-content: center;
  overflow: hidden;
  padding: 3px;
  width: 54px;
}
.bank-logo img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}
.bank-logo.initial {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.bank-picker > .bank-logo {
  height: 28px;
  left: 6px;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}
.field .bank-picker.chosen input:not([type="checkbox"]):not([type="radio"]) {
  padding-left: 70px;
}
.field .bank-picker input:not([type="checkbox"]):not([type="radio"]) {
  font-weight: 500;
  text-overflow: ellipsis;
}
.combobox-menu.bank-picker-menu {
  max-height: 296px;
  scroll-padding: 5px;
}
.bank-option {
  align-items: center;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  font-size: 14px;
  gap: 12px;
  line-height: 1.3;
  padding: 6px 34px 6px 6px;
  position: relative;
}
.bank-option:hover,
.bank-option.active {
  background: var(--surface-2);
}
.bank-option.active {
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.bank-option strong {
  color: var(--ink);
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bank-option small {
  color: var(--muted);
  font-size: 12.5px;
  margin-left: auto;
  white-space: nowrap;
}
/* A tick at the end of the bank that is chosen. */
.bank-option.current::after {
  background: var(--accent);
  content: "";
  height: 14px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 7.2 2.8 2.8 5.2-5.8'/%3E%3C/svg%3E")
    center / 14px no-repeat;
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
}
.bank-link-source {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  gap: 2px 10px;
  justify-content: space-between;
  margin: 0;
}
.bank-link-source strong {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.bank-link-source span {
  color: var(--muted);
  font-size: 13px;
}
/* Shown in the browser when the bank sent someone back there from a link started in the app. */
.bank-return-notice {
  background: var(--accent-soft);
  border-radius: var(--radius);
  font-size: 14px;
  margin: 0 0 16px;
  padding: 12px 16px;
}
.bank-return-notice p {
  margin: 0;
}
.bank-link-note {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}
.bank-link-note strong {
  color: var(--ink);
}
.bank-link-note.warn {
  color: var(--amber);
}
.bank-link-note.error {
  color: var(--red);
}
.bank-link-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}
.bank-link-actions .row-actions {
  margin-left: auto;
}
.bank-link-open {
  align-self: flex-start;
}
.bank-link-accounts {
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
}
.bank-link-accounts legend {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 4px;
}
.bank-link-accounts label {
  align-items: center;
  display: flex;
  font-size: 14px;
  gap: 8px;
}
.bank-balance-forget {
  align-self: flex-start;
  margin: -6px 0 -6px -8px;
}
/* Every kept balance added up, above the banks, with Refresh all at its end. On a phone
   the figures sit side by side and the button takes the full width under them. */
.bank-summary {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  gap: 16px 40px;
  margin-bottom: 16px;
  padding: 18px 20px;
}
.bank-summary-figure {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.bank-summary-figure + .bank-summary-figure {
  border-left: 1px solid var(--line);
  padding-left: 40px;
}
.bank-summary-figure span,
.bank-summary-figure small {
  color: var(--muted);
  font-size: 13px;
}
.bank-summary-figure strong {
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.bank-summary-figure.short strong {
  color: var(--red);
}
.bank-summary-refresh {
  margin: 0 0 0 auto;
}
@media (max-width: 760px) {
  .bank-summary {
    display: grid;
    gap: 14px 16px;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    padding: 16px;
  }
  .bank-summary-figure + .bank-summary-figure {
    border-left: 0;
    padding-left: 0;
  }
  .bank-summary-figure strong {
    font-size: 24px;
  }
  .bank-summary-refresh {
    grid-column: 1 / -1;
    margin: 0;
  }
  .bank-summary-refresh .button {
    width: 100%;
  }
}
.bank-balances-unnamed {
  font-size: 13px;
  margin-top: 16px;
}
.hold-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  padding: 22px 24px;
}
.hold-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.hold-card {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  column-gap: 16px;
  display: grid;
  grid-template-areas: "clock art main pay" "warn warn warn warn" "more more more more";
  grid-template-columns: 76px 64px minmax(0, 1fr) auto;
  padding: 14px 16px 0;
  transition: border-color 0.2s ease;
}
.hold-card.urgent {
  animation: hold-alarm 1.6s ease-in-out infinite;
  border-color: var(--red);
}
.hold-card.elapsed {
  opacity: 0.6;
}
.hold-card.contested {
  border-color: var(--amber-border);
}
@keyframes hold-alarm {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 0%, transparent);
  }
  50% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 16%, transparent);
  }
}

.hold-clock {
  grid-area: clock;
  height: 76px;
  position: relative;
  width: 76px;
}
.hold-ring {
  height: 100%;
  transform: rotate(-90deg);
  width: 100%;
}
.hold-ring circle {
  fill: none;
  stroke-width: 5;
}
.hold-ring-track {
  stroke: var(--track);
}
.hold-ring-fill {
  stroke: var(--accent);
  stroke-dasharray: 100;
  stroke-linecap: round;
  transition:
    stroke-dashoffset 1s linear,
    stroke 0.3s ease;
}
.hold-card.urgent .hold-ring-fill {
  stroke: var(--red);
}
.hold-clock-face {
  align-content: center;
  display: grid;
  inset: 0;
  position: absolute;
  text-align: center;
}
.hold-seconds {
  font-family: var(--mono);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.hold-card.urgent .hold-seconds {
  color: var(--red);
}
.hold-clock-face small {
  color: var(--muted);
  font-size: 11px;
}

.hold-art {
  align-items: center;
  background: var(--chip);
  border-radius: var(--radius-sm);
  color: var(--muted);
  display: flex;
  font-size: 22px;
  font-weight: 600;
  grid-area: art;
  height: 64px;
  justify-content: center;
  overflow: hidden;
  width: 64px;
}
.hold-art img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.hold-main {
  grid-area: main;
  min-width: 0;
}
.hold-main h3 {
  font-size: 16px;
  margin: 0;
  overflow-wrap: anywhere;
}
.hold-ticket {
  color: var(--ink-2);
  font-size: 14px;
  margin: 2px 0 8px;
}
.hold-ticket time {
  color: var(--muted);
}
.hold-facts {
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 4px 18px;
  margin: 0;
}
.hold-facts div {
  display: flex;
  gap: 6px;
  min-width: 0;
}
.hold-facts dt {
  color: var(--muted);
}
.hold-facts dd {
  font-weight: 500;
  margin: 0;
  overflow-wrap: anywhere;
}
.hold-facts dd span {
  color: var(--muted);
  font-weight: 400;
}

.hold-pay {
  display: grid;
  gap: 2px;
  grid-area: pay;
  justify-items: end;
  text-align: right;
}
.hold-pay small {
  color: var(--muted);
  font-size: 12px;
}
.hold-pay strong {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.hold-pay form {
  margin: 0;
}
.hold-pay-button {
  font-size: 15px;
  font-weight: 600;
  min-height: 44px;
  min-width: 132px;
}
.hold-pay-button:has(.hold-pay-card) {
  flex-direction: column;
  gap: 0;
  line-height: 1.2;
}
.hold-pay-card {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  opacity: 0.85;
}

.hold-warning {
  background: var(--amber-soft);
  border-radius: var(--radius-sm);
  color: var(--amber-ink);
  font-size: 13.5px;
  grid-area: warn;
  margin: 12px 0 0;
  padding: 9px 12px;
}

/* A saved-card payment running in the background, or one that didn't go through. */
.hold-warning[data-tone="info"] {
  background: var(--accent-soft);
  color: var(--ink);
}

.hold-warning[data-tone="error"] {
  background: var(--red-soft);
  color: var(--red-ink);
}

.hold-more {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  font-size: 13.5px;
  gap: 8px 18px;
  grid-area: more;
  margin-top: 14px;
  min-height: 42px;
  padding: 6px 0;
}
.hold-more form {
  margin: 0;
}
.hold-more .table-action {
  font-size: 13.5px;
}
.hold-star {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 4px 0;
}
.hold-star:hover,
.hold-star.starred {
  color: var(--accent);
}
.hold-ignore {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  margin-left: auto;
  padding: 4px 0;
}
.hold-ignore:hover:not(:disabled) {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hold-ignore:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.hold-released {
  color: var(--muted);
  font-size: 13.5px;
  margin: 10px 0;
}
/* The tabs and, on the history, its sort share one row; the sort drops below when it runs out of room. */
.reservation-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  margin-bottom: 16px;
}
.reservation-tabs a {
  white-space: nowrap;
}

/* Column headers that re-sort their list, and the same choice as a bar where there are no headers. */
.sort-link {
  align-items: center;
  color: inherit;
  display: inline-flex;
  gap: 4px;
  text-decoration: none;
}
.sort-link:hover,
.sort-link.active {
  color: var(--ink);
}
.sort-link:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sort-arrow {
  margin-left: 4px;
}
.sort-link .sort-arrow {
  margin-left: 0;
}
/* A quiet line of choices, so it never reads as a second set of tabs. */
.sort-bar {
  align-items: baseline;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  gap: 12px;
  min-width: 0;
}
.sort-bar-label {
  color: var(--faint);
  flex: none;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sort-options {
  display: flex;
  gap: 16px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.sort-options .sort-link {
  font-weight: 500;
  padding: 4px 0;
  white-space: nowrap;
}
.sort-options .sort-link.active {
  box-shadow: inset 0 -2px 0 var(--ink);
}
/* Inventory sorts from its column headers until they are hidden on narrow screens. */
.sort-bar.inventory-sort {
  display: none;
  margin: 0;
  padding: 12px 16px;
}

.empty-state {
  padding: 52px 20px;
  text-align: center;
}
.empty-state.roomy {
  padding: 76px 24px;
}
.empty-state h3 {
  font-size: 16px;
  margin: 16px 0 4px;
}
.empty-state h3:first-child {
  margin-top: 0;
}
.empty-state p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 auto 18px;
  max-width: 46ch;
}
.radar {
  background: radial-gradient(circle, var(--accent) 0 3px, transparent 4px);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 11px var(--surface),
    inset 0 0 0 12px var(--line);
  display: inline-block;
  height: 52px;
  width: 52px;
}

.action-list {
  margin: 14px 0 18px;
}
.action-list > a {
  align-items: flex-start;
  border-radius: var(--radius-sm);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  padding: 13px 4px;
}
.action-list > a:first-child {
  border-top: 0;
}
.action-list > a:hover strong {
  color: var(--accent);
}
.action-list strong {
  font-size: 14px;
}
.action-list p {
  color: var(--muted);
  font-size: 13px;
  margin: 2px 0 0;
}
.action-list time {
  color: var(--faint);
  font-size: 12px;
  padding-top: 2px;
}
.fault-mark {
  align-items: center;
  background: var(--red-soft);
  border-radius: 50%;
  color: var(--red);
  display: flex;
  font-size: 12px;
  font-weight: 700;
  height: 22px;
  justify-content: center;
  width: 22px;
}
.clear-state {
  color: var(--muted);
  font-size: 14px;
  padding: 30px 0 18px;
  text-align: center;
}
.clear-state span {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 50%;
  color: var(--accent);
  display: inline-flex;
  font-size: 15px;
  font-weight: 600;
  height: 34px;
  justify-content: center;
  width: 34px;
}
.clear-state p {
  margin: 10px 0 0;
}

.recent-strip {
  margin-top: 20px;
}
.compact-table {
  margin-top: 12px;
}
.compact-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-template-columns: 104px minmax(0, 1.5fr) minmax(0, 1fr) 150px 88px;
  margin: 0 -10px;
  padding: 11px 10px;
}
.compact-row:first-child {
  border-top: 0;
}
.compact-row:hover {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.compact-row strong {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compact-row time,
.compact-row > span {
  color: var(--muted);
  font-size: 13.5px;
}
.compact-row .data {
  color: var(--ink);
  font-weight: 500;
  text-align: right;
}
.table-empty {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
  padding: 48px 24px;
  text-align: center;
}

/* --- Tables ---------------------------------------------------------------- */

.data-panel {
  overflow: hidden;
}
.table-head,
.table-row {
  align-items: center;
  display: grid;
  gap: 18px;
  padding: 12px 20px;
}
.table-head {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}
.table-row {
  border-top: 1px solid var(--line);
  font-size: 14px;
  min-height: 64px;
}
.table-head + .table-row,
.table-row:first-of-type {
  border-top: 0;
}
.table-row:hover {
  background: var(--row-hover);
}
.table-row strong,
.table-row small {
  display: block;
}
.table-row strong {
  font-weight: 500;
}
.table-row small {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}
.table-row > span {
  color: var(--ink-2);
}

.account-columns {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 150px 132px 92px 44px;
}
/* A long disposable address wraps rather than running into the next column. */
.account-columns .bulk-cell small {
  overflow-wrap: break-word;
}
.account-meta {
  display: none !important;
}
.group-columns {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1.2fr) 124px;
}
/* A pool's row has one more action (Test) than a group's, and its first column lists proxies, so it gets the most room. */
.pool-columns {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) 176px;
}
/* A service pool has no accounts to list. */
.service-pool-columns {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 2fr) 176px;
}
/* A proxy's host is one long word; break it rather than run into the next column. */
.pool-columns small {
  overflow-wrap: anywhere;
}
/* Beside the sidebar, below this the three text columns are squeezed to a word or two each,
   so each pool stacks as on a phone: labelled lines, then its actions. */
@media (max-width: 1050px) {
  .table-head.pool-columns {
    display: none;
  }
  .table-row.pool-columns {
    align-items: start;
    gap: 8px 14px;
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }
  .pool-columns > [data-label]::before {
    color: var(--muted);
    content: attr(data-label);
    display: block;
    font-size: 11.5px;
    font-weight: 500;
    margin-bottom: 2px;
  }
  .pool-columns > .row-actions {
    justify-content: flex-start;
    margin-left: -8px;
  }
}
/* A pool's test, under its row: a moving bar while it runs, then every proxy and how it did. */
.proxy-test {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  grid-column: 1 / -1;
  min-width: 0;
  padding: 12px 14px;
}
.proxy-test.passed {
  border-left: 3px solid var(--accent);
}
.proxy-test.mixed {
  border-left: 3px solid var(--amber);
}
.proxy-test.failed {
  border-left: 3px solid var(--red);
}
.proxy-test-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}
.proxy-test-head strong {
  font-weight: 600;
}
.proxy-test-head .proxy-test-note {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}
.proxy-test-head button {
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  margin-left: auto;
  padding: 4px 8px;
}
.proxy-test-head button:hover {
  background: var(--chip);
  color: var(--ink);
}
.proxy-test-bar {
  background: var(--track);
  border-radius: 999px;
  height: 6px;
  margin-top: 10px;
  overflow: hidden;
}
.proxy-test-bar span {
  animation: proxy-test-slide 1.1s ease-in-out infinite;
  background: var(--accent);
  border-radius: inherit;
  display: block;
  height: 100%;
  width: 35%;
}
@keyframes proxy-test-slide {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(290%);
  }
}
.proxy-test-list {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 10px 0 0;
  max-height: 260px;
  overflow-y: auto;
  padding: 0;
}
.proxy-test-list li {
  align-items: center;
  display: grid;
  gap: 4px 12px;
  grid-template-columns: 84px minmax(0, 220px) minmax(0, 1fr);
}
.proxy-test-list code {
  font-family: var(--mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.proxy-test-list li > span:last-child {
  color: var(--muted);
  font-size: 13px;
}
.proxy-test-list li.failed > span:last-child {
  color: var(--red);
}
@media (max-width: 560px) {
  .proxy-test-list li {
    grid-template-columns: 84px minmax(0, 1fr);
  }
  .proxy-test-list li > span:last-child {
    grid-column: 1 / -1;
  }
}
/* Proxies are pasted one per line, so they read best lined up. */
.field-proxies textarea {
  font-family: var(--mono);
  font-size: 13px;
  white-space: pre;
}
.account-health {
  display: grid;
  gap: 3px;
  justify-items: start;
}
.account-health small {
  color: var(--muted);
  font-size: 12px;
}
.status.health-green {
  background: var(--accent-soft);
  color: var(--accent);
}
.status.health-amber {
  background: var(--amber-soft);
  color: var(--amber);
}
.status.health-red {
  background: var(--red-soft);
  color: var(--red);
}
.account-menu-actions {
  justify-content: flex-end;
}
.mailbox-columns {
  grid-template-columns: minmax(0, 1.7fr) minmax(180px, 0.8fr) 150px auto;
}
.mailbox-subject {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 8px minmax(0, 1fr);
  min-width: 0;
}
.mailbox-subject strong,
.mailbox-subject small,
.mailbox-sender {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mailbox-dot {
  background: transparent;
  border-radius: 50%;
  height: 7px;
  width: 7px;
}
.mailbox-unread .mailbox-dot {
  background: var(--signal);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.mailbox-unread strong {
  font-weight: 650;
}
.mailbox-row {
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}
.mailbox-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.mailbox-arrow {
  color: var(--faint) !important;
  font-size: 22px;
  justify-self: end;
  transition:
    color 120ms ease,
    transform 120ms ease;
}
.mailbox-row:hover .mailbox-arrow,
.mailbox-row:focus-visible .mailbox-arrow {
  color: var(--accent) !important;
  transform: translateX(2px);
}
.mailbox-message-body {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
  max-width: 78ch;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.mailbox-message-frame {
  /* Email HTML assumes a white page; the page script darkens it for the dark
     theme. A light scheme keeps emails from applying their own dark styles,
     which the inversion would turn back to light. */
  background: #fff;
  color-scheme: light;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: block;
  height: 75vh;
  min-height: 320px;
  resize: vertical;
  width: 100%;
}
:root[data-theme="dark"] .mailbox-message-frame {
  background: #121517;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mailbox-message-frame {
    background: #121517;
  }
}
.mailbox-otp {
  align-items: baseline;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  display: grid;
  gap: 4px 18px;
  grid-template-columns: auto 1fr;
  padding: 16px 18px;
}
.mailbox-otp > span,
.mailbox-otp > small {
  color: var(--muted);
  font-size: 13px;
}
.mailbox-otp > strong {
  color: var(--accent);
  font-family: var(--mono);
  font-size: clamp(26px, 5vw, 40px);
  font-variant-numeric: tabular-nums;
  grid-row: 1 / 3;
  letter-spacing: 0.12em;
}
.mailbox-otp > small {
  grid-column: 1;
}
.log-columns {
  grid-template-columns: 118px minmax(0, 1.5fr) 118px 110px 80px 92px;
}
.log-columns > *:nth-child(5) {
  text-align: right;
}
/* Arrows in one column and sizes right-aligned in the next, so both lines line up. */
.call-sizes {
  color: var(--muted);
  column-gap: 4px;
  display: grid;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  /* Wide enough for "1023 B", so the arrows also line up from row to row. */
  grid-template-columns: auto minmax(6.5ch, auto);
  justify-content: end;
  margin-top: 2px;
  white-space: nowrap;
}
.call-sizes > :nth-child(even) {
  text-align: right;
}
.log-table code,
.log-columns code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  justify-self: start;
  padding: 2px 6px;
}
.correlation-link {
  justify-self: start;
}
.correlation-link {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  text-decoration: none;
}
.correlation-link small {
  color: var(--accent) !important;
  font-size: 12px !important;
  margin: 0 !important;
  white-space: nowrap;
}
.table-row.linked:hover code,
.correlation-link:focus-visible code {
  border-color: var(--accent);
  color: var(--accent);
}
/* The whole row opens its operation; the saved response stays its own control above the link. */
.table-row.linked {
  cursor: pointer;
  position: relative;
}
.row-link::after {
  content: "";
  inset: 0;
  position: absolute;
}
.row-link:focus-visible {
  outline: none;
}
.table-row.linked:has(.row-link:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.table-row.linked details {
  position: relative;
  z-index: 1;
}
.operation-columns {
  color: inherit;
  grid-template-columns: 118px minmax(0, 1.4fr) 110px minmax(0, 1fr) 90px 92px;
  text-decoration: none;
}
.operation-columns > *:nth-child(5) {
  text-align: right;
}
.operation-failures {
  color: var(--red) !important;
  display: inline !important;
}
.operation-reached {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.step-columns {
  grid-template-columns: 96px 124px minmax(0, 1fr) 110px 80px;
  min-height: 52px;
}
.step-columns > *:nth-child(5) {
  text-align: right;
}
.step-call {
  min-width: 0;
  overflow-wrap: anywhere;
}
.step-method {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  margin-right: 4px;
}
.stage-tag {
  color: var(--muted) !important;
  font-size: 12.5px;
  font-weight: 500;
}
.operation-lane {
  margin-bottom: 16px;
}
.lane-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 20px;
}
.lane-head h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
.lane-head small {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 2px;
}
.lane-reservation {
  align-items: center;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 20px;
}
.lane-reservation strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
}
.lane-reservation small {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 2px;
}
.operation-lane > .table-head {
  border-top: 1px solid var(--line);
}
.trace.operation-id {
  margin: 0 0 16px;
}
.stage-filter-note {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 12px;
}
.operation-pipeline {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 16px;
}
.pipeline-stage {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  border-top: 3px solid var(--accent);
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 10px 14px;
  text-decoration: none;
}
a.pipeline-stage:hover {
  background: var(--row-hover);
}
.pipeline-stage > span {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}
.pipeline-stage > strong {
  font-size: 15px;
  font-weight: 600;
}
.pipeline-stage > small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}
.pipeline-stage.partial {
  border-top-color: var(--amber);
}
.pipeline-stage.failed {
  border-top-color: var(--red);
}
.pipeline-stage.skipped {
  border-style: dashed;
  border-top: 3px dashed var(--line);
}
.pipeline-stage.skipped > strong {
  color: var(--muted);
  font-weight: 500;
}
.pipeline-stage.selected {
  box-shadow: 0 0 0 2px var(--accent);
}
.trace-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 12px;
}
.trace-toolbar .stage-filter-note {
  margin: 0;
}
.segmented a {
  border-radius: 7px;
  color: var(--muted);
  display: block;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  text-decoration: none;
}
.segmented a:hover {
  color: var(--ink);
}
.segmented a[aria-current="true"] {
  background: var(--surface);
  box-shadow:
    0 1px 2px rgba(20, 23, 26, 0.1),
    0 0 0 1px var(--hover);
  color: var(--ink);
}
.segmented a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Waterfall: one row per call, bars placed on the window's time axis. */
.waterfall {
  --wf-label: 340px;
  --wf-gutter: 64px;
  margin-bottom: 16px;
}
/* The operation fills one visible width; --wf-ratio widths hold the whole trace. */
.wf-scroll {
  container-type: inline-size;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.wf-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.wf-canvas {
  /* Never narrower than 420px a screen, so tick labels keep their room on phones. */
  --wf-track: calc(max(100cqw - var(--wf-label) - var(--wf-gutter), 420px) * var(--wf-ratio));
  width: calc(var(--wf-label) + var(--wf-track) + var(--wf-gutter));
}
.wf-canvas {
  position: relative;
}
/* The time under the pointer: a line down the whole chart, labelled in the axis row. */
.wf-cursor {
  border-left: 1px dashed var(--ink-2);
  bottom: 0;
  left: var(--x);
  pointer-events: none;
  position: absolute;
  top: 0;
  z-index: 1;
}
.wf-cursor > span {
  background: var(--ink);
  border-radius: 4px;
  color: var(--surface);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  left: 0;
  padding: 2px 6px;
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  white-space: nowrap;
}
.wf-cursor.end > span {
  transform: translateX(-100%);
}
.wf-cursor.start > span {
  transform: none;
}
.wf-fixr {
  --c: var(--trace-fixr);
}
.wf-mail_tm {
  --c: var(--trace-mail);
}
.wf-discord {
  --c: var(--trace-discord);
}
.wf-push {
  --c: var(--trace-push);
}
.wf-stripe {
  --c: var(--trace-stripe);
}
.wf-card_bin {
  --c: var(--trace-bin);
}
.wf-legend {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 6px 18px;
  padding: 12px 20px;
}
.wf-legend > span {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}
.wf-legend small {
  color: var(--muted);
  flex-basis: 100%;
  font-size: 12.5px;
}
.wf-swatch {
  background: var(--c);
  border-radius: 3px;
  display: inline-block;
  height: 10px;
  width: 14px;
}
.wf-swatch.failed,
.wf-bar.failed {
  background: repeating-linear-gradient(
    135deg,
    var(--c) 0 3px,
    color-mix(in srgb, var(--c) 35%, var(--surface)) 3px 6px
  );
}
.wf-axis,
.wf-group,
.wf-row {
  display: grid;
  grid-template-columns: var(--wf-label) var(--wf-track);
}
.wf-axis {
  align-items: center;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  height: 34px;
}
.wf-axis strong {
  color: var(--ink);
  font-weight: 600;
}
.wf-label-col {
  align-items: center;
  align-self: stretch;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--line);
  display: flex;
  gap: 8px;
  left: 0;
  min-width: 0;
  padding: 0 12px 0 20px;
  position: sticky;
  z-index: 2;
}
.wf-axis .wf-label-col {
  background: var(--surface-2);
}
.wf-row:hover .wf-label-col,
.wf-row:focus-visible .wf-label-col {
  background: var(--row-hover);
}
.wf-row[aria-expanded="true"] .wf-label-col {
  background: var(--surface-2);
}
.wf-track {
  height: 100%;
  margin-right: var(--wf-gutter);
  position: relative;
}
.wf-tick {
  font-variant-numeric: tabular-nums;
  left: var(--x);
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}
.wf-tick:first-child {
  transform: translate(0, -50%);
}
.wf-tick.last {
  transform: translate(-100%, -50%);
}
.wf-body {
  position: relative;
}
.wf-gridlines {
  bottom: 0;
  left: var(--wf-label);
  pointer-events: none;
  position: absolute;
  top: 0;
  width: var(--wf-track);
}
.wf-gap {
  background: repeating-linear-gradient(
    135deg,
    transparent 0 7px,
    color-mix(in srgb, var(--chart-grid) 80%, transparent) 7px 8px
  );
  bottom: 0;
  left: var(--x);
  position: absolute;
  top: 0;
  width: var(--w);
}
.wf-gap > span {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-block;
  font-size: 12px;
  left: calc(var(--wf-label) + 24px);
  margin: 10px 0 0 24px;
  padding: 2px 10px;
  position: sticky;
  white-space: nowrap;
}
.wf-jumps {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}
.wf-gridlines i {
  border-left: 1px solid var(--chart-grid);
  bottom: 0;
  left: var(--x);
  position: absolute;
  top: 0;
}
.wf-group {
  font-size: 13px;
  position: relative;
}
.wf-group .wf-label-col {
  padding-bottom: 4px;
  padding-top: 12px;
}
.wf-body > .wf-group:not(:first-of-type) {
  border-top: 1px solid var(--line);
}
.wf-body > .wf-row:last-of-type,
.wf-body > .wf-detail:last-child {
  margin-bottom: 0;
}
.wf-group strong {
  font-weight: 600;
  white-space: nowrap;
}
.wf-group .status {
  font-size: 11.5px;
  padding: 1px 7px;
}
.wf-row {
  align-items: center;
  cursor: pointer;
  height: 30px;
  position: relative;
}
.wf-row:hover {
  background: var(--row-hover);
}
.wf-row:focus-visible {
  background: var(--row-hover);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.wf-row[aria-expanded="true"] {
  background: var(--surface-2);
}
.wf-row .step-method {
  flex: 0 0 40px;
}
.wf-name {
  color: var(--ink-2);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wf-bar {
  background: var(--c);
  border-radius: 4px;
  height: 12px;
  left: var(--x);
  min-width: 3px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: var(--w);
}
.wf-value {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  left: var(--x);
  margin-left: 8px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
}
.wf-value.before {
  margin-left: -8px;
  transform: translate(-100%, -50%);
}
.wf-failed {
  color: var(--red);
  font-weight: 600;
}
.wf-size {
  margin-left: 6px;
}
.wf-detail {
  background: var(--surface-2);
  box-sizing: border-box;
  left: 0;
  position: sticky;
  width: 100cqw;
  z-index: 3;
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  padding: 4px 20px 12px;
}
.wf-detail .trace {
  background: var(--surface);
}
.wf-tooltip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-pop);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.5;
  max-width: 340px;
  padding: 8px 12px;
  pointer-events: none;
  position: fixed;
  z-index: 60;
}
.wf-tooltip strong {
  color: var(--ink);
  display: block;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.wf-tooltip span {
  display: block;
}
.invite-columns {
  grid-template-columns: minmax(0, 1.3fr) 96px 96px 92px 132px;
}
.usage-columns {
  grid-template-columns: minmax(0, 1.2fr) 112px 88px minmax(0, 1fr);
}
.usage-columns > span:nth-child(2),
.usage-columns > span:nth-child(3) {
  text-align: right;
}
.failed-alert-columns {
  grid-template-columns: 128px minmax(0, 1.2fr) 88px minmax(0, 1fr) 96px;
}
.audit-columns {
  grid-template-columns: 150px minmax(0, 1fr) 150px minmax(0, 1fr) minmax(0, 1.4fr) 64px;
}
.audit-columns > * {
  min-width: 0;
  overflow-wrap: anywhere;
}
.audit-columns > code:last-child {
  justify-self: end;
}
.audit-detail small {
  margin: 0;
}
.audit-detail small + small {
  margin-top: 2px;
}
.audit-detail span {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
}
.access-columns {
  grid-template-columns: minmax(0, 1.4fr) 130px 120px 260px;
}
.user-account-columns {
  grid-template-columns: minmax(0, 1.4fr) 140px 190px 152px;
}
.user-rule-columns {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.7fr) 90px 104px 92px;
}
.user-reservation-columns {
  grid-template-columns: 148px minmax(0, 1.7fr) minmax(0, 1fr) 80px 130px 92px;
}
.ledger-columns {
  grid-template-columns: 96px minmax(0, 1.8fr) minmax(0, 0.8fr) 52px 92px 92px 100px 116px;
}
.inventory-columns {
  grid-template-columns: minmax(0, 1.8fr) 84px 110px 92px 128px 92px 116px 164px;
}

.pagination {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 12px;
  padding: 10px 14px;
}
.data-panel > .pagination,
.queue-panel > .pagination {
  border-radius: 0;
  border-width: 1px 0 0;
  margin-top: 0;
}
.queue-panel > .pagination {
  margin: 12px -24px -22px;
  padding: 10px 24px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.pagination-range {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}
.pagination-range strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.pagination-controls {
  align-items: center;
  display: flex;
  gap: 10px;
}
.pagination-controls > strong {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.pagination-controls a,
.pagination-controls span {
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  min-width: 76px;
  padding: 5px 10px;
  text-align: center;
}
.pagination-controls a:hover {
  background: var(--surface-2);
}
.pagination-controls span[aria-disabled="true"] {
  border-color: var(--line);
  color: var(--faint);
}

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

.form-panel {
  display: grid;
  gap: 48px;
  grid-template-columns: minmax(0, 640px) minmax(250px, 1fr);
  max-width: 1080px;
  padding: 32px;
}
.form-panel.single {
  grid-template-columns: minmax(0, 640px) minmax(260px, 1fr);
  max-width: none;
}
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
/* The payment card form, with a preview of the card beside it. */
.card-field-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.card-field-row .field {
  min-width: 0;
}
/* A member's caps: on the invitation, and on their page afterwards. */
.limit-fields {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.limit-fields .field {
  min-width: 0;
}
.limits-form {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 18px 20px;
}
.limits-form .field {
  flex: 1 1 130px;
  max-width: 200px;
}
[data-card-number],
[data-card-expiry],
[data-card-cvc] {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.card-postcode input {
  max-width: 180px;
  text-transform: uppercase;
}
.card-aside {
  align-content: start;
  display: grid;
  gap: 16px;
}
.card-preview {
  aspect-ratio: 1.586;
  background: linear-gradient(135deg, var(--dark) 0%, #253038 60%, #0b3d2e 100%);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(20, 23, 26, 0.18);
  color: var(--dark-text);
  display: grid;
  /* The issuing bank top left, as cards print it, with the chip below. */
  grid-template-areas:
    "bank brand"
    "chip ."
    "number number"
    "foot foot";
  grid-template-rows: auto auto 1fr auto;
  max-width: 340px;
  row-gap: 8px;
  padding: 20px 22px;
}
.card-preview-brand {
  font-size: 15px;
  font-weight: 600;
  grid-area: brand;
  justify-self: end;
  letter-spacing: 0.02em;
}
.card-preview-bank {
  font-size: 15px;
  font-weight: 700;
  grid-area: bank;
  letter-spacing: 0.01em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-preview-chip {
  background: linear-gradient(135deg, #d9c27a, #a88b3d);
  border-radius: 5px;
  grid-area: chip;
  height: 26px;
  width: 36px;
}
.card-preview-number {
  align-self: center;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  grid-area: number;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.card-preview-foot {
  color: var(--dark-muted);
  display: flex;
  font-size: 13px;
  gap: 12px;
  grid-area: foot;
  justify-content: space-between;
  text-transform: uppercase;
}
.card-preview-foot span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-aside-note {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0;
  max-width: 340px;
}
.card-bank-form {
  display: grid;
  gap: 6px;
  max-width: 340px;
}
.card-bank-form label {
  font-size: 13.5px;
  font-weight: 600;
}
.card-bank-form.unnamed {
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.card-bank-form.unnamed label {
  color: var(--amber-ink);
}
.card-bank-row {
  display: flex;
  gap: 8px;
}
.card-bank-row input {
  flex: 1;
  min-width: 0;
}
.card-bank-form small {
  color: var(--muted);
  font-size: 12.5px;
}
@media (max-width: 760px) {
  .card-preview {
    max-width: none;
  }
  .card-preview-number {
    font-size: 17px;
  }
}

.disposable-count input {
  max-width: 140px;
}

/* Bulk disposable registration progress */
.batch-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.batch-progress-head {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  justify-content: space-between;
}
.batch-progress-head strong {
  font-size: 20px;
}
.batch-note,
.batch-progress-head span,
.batch-progress-tally {
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  margin: 0;
}
.batch-progress-tally .batch-failed {
  color: var(--red);
}
.batch-progress-bar {
  background: var(--track);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}
.batch-progress-bar span {
  background: var(--accent);
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 10px;
  transition: width 0.4s ease;
}
.batch-accounts {
  border: 1px solid var(--line);
  border-radius: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.batch-account {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  justify-content: space-between;
  padding: 12px 16px;
}
.batch-account + .batch-account {
  border-top: 1px solid var(--line);
}
.batch-account.working {
  background: var(--amber-soft);
}
.batch-account.queued .batch-account-name {
  color: var(--muted);
}
.batch-account-name {
  font-weight: 500;
}
.batch-steps {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}
.batch-steps li {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 14px;
  gap: 10px;
}
.batch-steps li::before {
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  box-sizing: border-box;
  content: "";
  flex: none;
  height: 14px;
  width: 14px;
}
.batch-steps li.done::before {
  background: var(--accent);
  border-color: var(--accent);
}
.batch-steps li.current {
  color: var(--ink);
  font-weight: 500;
}
.batch-steps li.current::before {
  animation: spin 0.9s linear infinite;
  border-color: var(--amber);
  border-top-color: transparent;
}
@media (prefers-reduced-motion: reduce) {
  .batch-progress-bar span,
  .batch-steps li.current::before {
    animation: none;
    transition: none;
  }
}

.field label,
.sale-form .field-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}
.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea,
.log-filters input,
.log-filters select,
.filter-inline select,
.generated-link input,
.filter-field select,
.filter-field input[type="date"],
.filter-field input[type="search"],
.filter-field input[type="text"] {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 1px 1px rgba(20, 23, 26, 0.03);
  color: var(--ink);
  min-height: 40px;
  padding: 8px 12px;
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
  width: 100%;
}
.field input:not([type="checkbox"]):not([type="radio"]):hover,
.field select:hover,
.field textarea:hover,
.log-filters input:hover,
.log-filters select:hover,
.filter-field select:hover,
.filter-field input[type="date"]:hover,
.filter-field input[type="search"]:hover,
.filter-field input[type="text"]:hover {
  border-color: var(--border-hover);
}
.filter-field input[type="search"] {
  background: var(--surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238d949a' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='6.2' cy='6.2' r='4.2'/%3E%3Cpath d='m9.5 9.5 3 3'/%3E%3C/svg%3E")
    12px center / 14px no-repeat;
  padding-left: 34px;
}
.field input:not([type="checkbox"]):not([type="radio"]):focus,
.field select:focus,
.field textarea:focus,
.log-filters input:focus,
.log-filters select:focus,
.filter-inline select:focus,
.generated-link input:focus,
.filter-field select:focus,
.filter-field input[type="date"]:focus,
.filter-field input[type="search"]:focus,
.filter-field input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}
.field textarea {
  min-height: 88px;
  resize: vertical;
}
.field select:not([multiple]),
.log-filters select,
.filter-inline select,
.filter-field select:not([multiple]) {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2362696f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.field input[type="checkbox"],
.field input[type="radio"] {
  accent-color: var(--accent);
  height: 17px;
  margin: 0;
  width: 17px;
}
.field input[data-secret-stored="true"]::placeholder {
  color: var(--ink-2);
  opacity: 1;
}
.field small {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 6px;
}
.field .errorlist,
.form-error .errorlist,
.filter-field .errorlist {
  color: var(--red);
  font-size: 13px;
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}
.errorlist.nonfield,
.form-error .errorlist {
  background: var(--red-soft);
  border-radius: 8px;
  color: var(--red-ink);
  font-size: 14px;
  list-style: none;
  margin: 0 0 18px;
  padding: 10px 14px;
}

.field-accounts ul,
.field-weekdays > div {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.field-weekdays > div {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.field-accounts li,
.field-weekdays > div > div {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  transition:
    border-color 0.12s ease,
    background-color 0.12s ease;
}
.field-accounts li:hover,
.field-weekdays > div > div:hover {
  border-color: var(--border-hover);
}
.field-accounts li:has(input:checked),
.field-weekdays > div > div:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}
.field-weekdays > div > div label,
.field-accounts li label {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-weight: 500;
  gap: 9px;
  margin: 0;
  padding: 9px 11px;
}
.field-accounts select[multiple] {
  background: var(--surface-2);
  min-height: 176px;
  padding: 4px;
}
.field-accounts select[multiple] option {
  border-radius: 6px;
  color: var(--ink);
  margin: 1px 0;
  padding: 9px 11px;
}
.field-accounts select[multiple] option:checked {
  background: linear-gradient(var(--ink), var(--ink));
  color: var(--on-ink);
  font-weight: 500;
}
.field .field-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}
.account-choices {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.field .account-choice {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  font-weight: 400;
  gap: 11px;
  margin: 0;
  min-width: 0;
  padding: 10px 12px;
  transition:
    border-color 0.12s ease,
    background-color 0.12s ease;
}
.account-choice:hover {
  border-color: var(--border-hover);
}
.account-choice:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}
.account-choice:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.account-choice input:focus-visible {
  outline: none;
}
.account-choice-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.account-choice-text strong {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-choice-text small {
  color: var(--muted);
  font-size: 12.5px;
  margin: 1px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-choice .status {
  flex: none;
}
.account-choices.ranked,
.account-choices.one-per-row {
  grid-template-columns: minmax(0, 1fr);
}
.account-choice-row {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}
.account-choice-row .account-choice {
  flex: 1;
}
.account-choice-row [hidden] {
  display: none;
}
.account-choices-empty {
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px 16px;
}
.field-enabled {
  align-items: center;
  display: flex;
  gap: 10px;
}
.field-enabled label {
  margin: 0;
  order: 2;
}
.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}

.form-key {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 13px;
  gap: 8px;
  margin: -4px 0 0;
  padding-bottom: 18px;
}
.field-marker {
  border-radius: 999px;
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  margin-left: 6px;
  padding: 1px 7px;
  vertical-align: 1px;
}
.form-key .field-marker {
  margin-left: 0;
}
.field-marker.required,
.field-marker.contextual {
  background: var(--accent-soft);
  color: var(--accent);
}
.field-marker.optional {
  background: var(--chip);
  color: var(--muted);
}
[data-fixed-quantity][hidden] {
  display: none !important;
}

/* Contextual help: a "?" beside a label opens a fuller explanation with an example. */
.field-head {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}
.field .field-head label,
.field-head .field-label {
  margin-bottom: 0;
}
.help-toggle {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  flex: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  height: 20px;
  justify-content: center;
  padding: 0;
  position: relative;
  width: 20px;
}
/* A bigger touch target than the visible circle. */
.help-toggle::before {
  content: "";
  inset: -10px;
  position: absolute;
}
.help-toggle:hover {
  border-color: var(--border-hover);
  color: var(--ink);
}
.help-toggle:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}
.help-toggle[aria-expanded="true"] {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}
html:not(.js) .help-toggle {
  display: none;
}
.field-help {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-border);
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 10px;
  padding: 10px 12px;
}
.js .field-help:not(.is-open) {
  display: none;
}
/* An open panel is too cramped in half a grid; give its field the full row. */
.policy-fields > .field:has(> .field-help.is-open) {
  grid-column: 1 / -1;
}
.field-help p,
.field-help ul,
.field-help ol {
  margin: 8px 0 0;
}
.field-help > :first-child {
  margin-top: 0;
}
.field-help li + li {
  margin-top: 2px;
}
.field-help ul,
.field-help ol {
  padding-left: 18px;
}
.field-help .help-example {
  color: var(--muted);
}
.field-help .help-example strong {
  color: var(--ink-2);
  font-weight: 600;
}

.security-note,
.settings-actions {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  height: max-content;
  padding: 20px;
}
.security-note strong {
  font-size: 15px;
}
.security-note p,
.settings-actions p {
  color: var(--muted);
  font-size: 14px;
  margin: 6px 0 0;
}
.settings-actions h2 {
  font-size: 15px;
  margin: 0;
}
.settings-actions form {
  margin-top: 14px;
}
.settings-actions hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}
.settings-actions p + p {
  margin-top: 10px;
}
.secret-state {
  align-items: center;
  color: var(--accent) !important;
  display: flex !important;
  font-weight: 500;
  gap: 8px;
}
.secret-state span {
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-soft);
  height: 7px;
  margin-left: 3px;
  width: 7px;
}

.rule-editor .form-panel {
  max-width: none;
}
.rule-form-flow,
.settings-form-flow {
  min-width: 0;
}
.rule-form-section,
.settings-form-section {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 28px;
  grid-template-columns: 180px minmax(0, 1fr);
  padding: 26px 0;
}
/* The rule in one sentence, above everything it is made from. */
.rule-sentence {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 22px;
  overflow-wrap: anywhere;
  padding: 12px 14px;
}
.form-key + .rule-form-section,
.form-key + .errorlist + .rule-form-section {
  border-top: 0;
}
.settings-form-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.rule-form-section header h2,
.settings-form-section header h2 {
  font-size: 15px;
  line-height: 1.3;
  margin: 0;
}
.rule-form-section header p,
.settings-form-section header p {
  color: var(--muted);
  font-size: 13px;
  margin: 5px 0 0;
}
.rule-form-fields,
.settings-form-fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.policy-fields {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr 1fr;
}
.time-fields {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr 1fr;
}
.activation-section {
  padding-bottom: 6px;
}
.activation-help {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: -12px;
  padding-left: 27px;
}
.settings-layout {
  grid-template-columns: minmax(0, 720px) minmax(250px, 1fr);
  max-width: 1120px;
}
.settings-save {
  border-top: 1px solid var(--line);
  margin-top: 0;
  padding-top: 22px;
}

.notification-choices {
  display: grid;
  gap: 8px;
}
.notification-choice {
  align-items: flex-start !important;
}
.notification-choice input {
  margin-top: 2px !important;
}
.notification-choice .account-choice-text small {
  white-space: normal;
}
.stage-field {
  border: 0;
  margin: 0;
  min-width: 0;
  padding: 0;
}
.stage-field legend {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  padding: 0;
}
.reminder-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.field .reminder-stage {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 400;
  gap: 8px;
  margin: 0;
  padding: 6px 12px 6px 10px;
  transition:
    border-color 0.12s ease,
    background-color 0.12s ease;
}
.reminder-stage:hover {
  border-color: var(--border-hover);
}
.reminder-stage:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}
.reminder-stage:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.reminder-stage input:focus-visible {
  outline: none;
}
.device-alerts {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}
.device-alerts p,
.notify-note {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
.device-alerts[data-state="on"] p {
  color: var(--accent);
  font-weight: 500;
}
.device-list {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}
.device-list li {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-width: 0;
}
.device-list li > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.device-list strong {
  font-size: 14px;
  font-weight: 500;
}
.device-list small {
  color: var(--muted);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.device-list .row-actions {
  flex: none;
  margin: -4px -8px 0 0;
}
.device-list form {
  margin: 0 !important;
}

.day-entry-grid {
  align-items: center;
  display: grid;
  gap: 8px 12px;
  grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr);
}
.day-entry-head {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}
.day-entry-row {
  display: contents;
}
.day-entry-row strong {
  font-size: 14px;
  font-weight: 500;
}
.day-entry-row[hidden] {
  display: none;
}
[data-entry-days-empty][hidden] {
  display: none;
}

.rule-preview-column {
  align-self: start;
  position: sticky;
  top: calc(var(--strip) + 20px);
}
.preview-box,
.profit-preview {
  background: var(--dark);
  border-radius: var(--radius-lg);
  color: #fff;
  padding: 22px;
}
.preview-box {
  margin-bottom: 10px;
}
.preview-box .preview-problems ul {
  margin: 12px 0 0;
}
.preview-box .preview-problems li {
  display: grid;
  gap: 2px;
  justify-content: stretch;
}
.preview-box .preview-problems li span {
  color: var(--dark-muted);
}
/* What a rules import left out, above the rule list until dismissed. */
.import-report {
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-sm);
  color: var(--amber-ink);
  font-size: 13.5px;
  margin: 0 0 16px;
  padding: 12px 14px;
}
.import-report header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}
.import-report h2 {
  font-size: 15px;
  margin: 0;
}
.import-report p {
  margin: 8px 0 0;
}
.import-report ul {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding-left: 18px;
}
.import-report li span {
  display: block;
}
.preview-overlap {
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-sm);
  color: var(--amber-ink);
  font-size: 13.5px;
  margin: 14px 0 0;
  padding: 10px 12px;
}
.preview-overlap p {
  margin: 4px 0 0;
}
.preview-overlap a {
  color: inherit;
  text-decoration: underline;
}
.preview-box h3 {
  font-size: 17px;
  margin: 0 0 6px;
}
.preview-box > p,
.preview-box > small {
  color: var(--dark-muted);
  display: block;
  font-size: 13.5px;
  margin: 0;
}
.preview-box > small {
  margin-top: 14px;
}
.preview-box > p + p {
  margin-top: 8px;
}
.preview-box ul {
  list-style: none;
  margin: 16px 0;
  padding: 0;
}
.preview-box li {
  border-top: 1px solid var(--dark-line);
  display: flex;
  font-size: 14px;
  gap: 12px;
  justify-content: space-between;
  padding: 9px 0;
}
.preview-box li strong {
  font-weight: 500;
}
.preview-box li span {
  color: var(--dark-muted);
}
/* Accounts and skipped events: the name on one line and its detail (an email, a reason) beneath, so neither squeezes
   the other. */
.preview-box .preview-stack li {
  display: grid;
  gap: 2px;
}
.preview-box .preview-stack li > * {
  min-width: 0;
  overflow-wrap: anywhere;
}
.preview-box .preview-stack li > span {
  font-size: 13px;
}
/* A preview or dry run opens over the editor, as the same dark box with room to spare. */
.rule-check-dialog {
  background: none;
  border: 0;
  color: #fff;
  max-height: calc(100dvh - 48px);
  max-width: calc(100vw - 32px);
  padding: 0;
  width: 640px;
}
.rule-check-dialog[open] {
  animation: dialog-in 0.16s ease-out;
}
.rule-check-dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(2px);
}
.rule-check-dialog .preview-box {
  margin: 0;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 26px;
}
.rule-check-close {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--dark-muted);
  cursor: pointer;
  display: inline-flex;
  float: right;
  height: 36px;
  justify-content: center;
  margin: -8px -10px 0 0;
  width: 36px;
}
.rule-check-close:hover {
  background: var(--dark-2);
  color: #fff;
}
.rule-check-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.rule-check-close svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
  width: 18px;
}
.rule-check-again {
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  margin-top: 10px;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.preview-total {
  border-top: 1px solid var(--dark-line);
  display: flex;
  font-size: 14px;
  gap: 12px;
  justify-content: space-between;
  padding: 9px 0;
}
.preview-total span {
  color: var(--dark-muted);
}
.preview-total strong {
  min-width: 0;
  overflow-wrap: break-word;
  text-align: right;
}
.rule-preview-column .button + .button {
  margin-top: 8px;
}
.dry-run-event {
  border-top: 1px solid var(--dark-line);
  padding-top: 12px;
  margin-top: 14px;
}
.dry-run-event h4 {
  font-size: 15px;
  font-weight: 500;
  margin: 0;
}
.dry-run-event > p {
  color: var(--dark-muted);
  font-size: 13px;
  margin: 2px 0 0;
}
.preview-box .dry-run-event ol {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.preview-box .dry-run-event li {
  justify-content: flex-start;
}
/* Each ticket type takes two lines: its name across the full width, and what the dry run would do with it beneath,
   so a long outcome never squeezes the name. */
.dry-run-ticket {
  flex: 1;
  min-width: 0;
}
.preview-box .dry-run-ticket strong {
  display: block;
  overflow-wrap: break-word;
}
.preview-box .dry-run-event li.skipped strong {
  color: var(--dark-muted);
}
.dry-run-plan {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 4px 8px;
  margin: 3px 0 0;
}
.preview-box .dry-run-plan .dry-run-tag {
  border: 1px solid var(--dark-line);
  border-radius: 999px;
  color: var(--dark-text);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  padding: 3px 8px;
}
.dry-run-order {
  color: var(--dark-muted);
  flex: none;
  font-variant-numeric: tabular-nums;
  width: 1.5em;
}
.preview-box li small {
  color: var(--dark-muted);
  font-size: 12.5px;
}
.dry-run-skipped {
  margin-top: 14px;
}
.dry-run-skipped summary {
  color: var(--dark-muted);
  cursor: pointer;
  font-size: 13.5px;
}
.dry-run-skipped ul {
  margin: 8px 0 0;
}

.sticky-actions {
  backdrop-filter: blur(10px);
  background: var(--glass);
  border-top: 1px solid var(--line);
  bottom: 0;
  margin: 16px -40px 0;
  padding: 14px 40px;
  position: sticky;
  z-index: 3;
}

/* --- Rule editor ------------------------------------------------------------- */

/* A new rule is built in steps and an existing one edited in tabs (RuleLayouts.tsx); both
   share the summary, the panels and the action bar. */
.rule-wizard > :not(.rule-actions) {
  max-width: 860px;
}
.rule-tabs-layout > :not(.rule-actions) {
  max-width: 1200px;
}
.rule-summary {
  background: var(--dark);
  border-radius: var(--radius-lg);
  color: #fff;
  margin-bottom: 18px;
  padding: 16px 20px;
}
.rule-summary .errorlist {
  margin-bottom: 12px;
}
.rule-summary-label {
  color: var(--dark-muted);
  display: block;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.rule-summary .rule-sentence {
  background: none;
  border: 0;
  font-size: 15.5px;
  margin: 0;
  padding: 0;
}
/* A new rule's draft: kept as it is built, and picked up again on any device. */
.rule-summary .rule-draft {
  color: var(--dark-muted);
  font-size: 12.5px;
  margin: 8px 0 0;
}
.rule-draft-reset {
  background: none;
  border: 0;
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rule-panel-head {
  margin-bottom: 20px;
}
.rule-panel-head h2 {
  font-size: 19px;
  line-height: 1.3;
  margin: 0;
}
.rule-panel-head h2:focus {
  outline: none;
}
.rule-panel-head p {
  color: var(--muted);
  margin: 6px 0 0;
}
.rule-panel-note {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  margin: 0;
  padding: 10px 12px;
}
.rule-panel-note[hidden],
.rule-subhead[hidden] {
  display: none;
}
.rule-subhead {
  border-top: 1px solid var(--line);
  font-size: 14px;
  margin: 6px 0 -4px;
  padding-top: 20px;
}
.rule-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 6px 0 0;
}
.rule-panel .rule-form-fields > .rule-subhead:first-child {
  border-top: 0;
  padding-top: 0;
}

/* The wizard: a row of numbered steps, one card at a time. */
.wizard-progress {
  margin-bottom: 18px;
}
.wizard-progress ol {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.wizard-progress li {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 6px;
  min-width: 0;
}
.wizard-progress li:not(:last-child)::after {
  background: var(--line-strong);
  content: "";
  flex: 1;
  height: 2px;
  min-width: 12px;
}
.wizard-progress li[data-state="done"]:not(:last-child)::after {
  background: var(--accent);
}
.wizard-progress li:last-child {
  flex: 0 0 auto;
}
.wizard-progress button {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 500;
  gap: 8px;
  padding: 4px 6px 4px 4px;
  white-space: nowrap;
}
.wizard-progress button:not(:disabled):hover {
  background: var(--hover);
}
.wizard-progress button:disabled {
  cursor: default;
}
.wizard-dot {
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  display: inline-flex;
  flex: none;
  font-size: 12px;
  font-weight: 650;
  height: 26px;
  justify-content: center;
  width: 26px;
}
.wizard-progress [data-state="done"] .wizard-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.wizard-progress [data-state="current"] button {
  color: var(--ink);
  font-weight: 650;
}
.wizard-progress [data-state="current"] .wizard-dot {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}
.wizard-progress [data-errors] .wizard-dot {
  background: var(--red-soft);
  border-color: var(--red);
  color: var(--red-ink);
}
.wizard-count {
  display: none;
}
.rule-wizard .rule-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
}

/* The tabs: one card, its tab strip on top, the checks beside it. */
.rule-tabs-body {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) 320px;
}
.rule-tabs-main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  min-width: 0;
}
/* The strip's bottom line is an inset shadow the selected tab's underline paints over. A border the tabs
   overlapped with a negative margin left them a pixel taller than the strip, which then scrolled vertically. */
.rule-tabs {
  box-shadow: inset 0 -1px 0 var(--line);
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 0 14px;
  scrollbar-width: none;
}
.rule-tabs::-webkit-scrollbar {
  display: none;
}
.rule-tabs [role="tab"] {
  align-items: center;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  display: inline-flex;
  flex: none;
  font-size: 13.5px;
  font-weight: 600;
  gap: 6px;
  padding: 13px 12px 11px;
  white-space: nowrap;
}
.rule-tabs [role="tab"]:hover {
  color: var(--ink);
}
.rule-tabs [role="tab"][aria-selected="true"] {
  border-bottom-color: var(--ink);
  color: var(--ink);
}
.rule-tabs [role="tab"]:focus-visible {
  border-radius: 6px 6px 0 0;
  box-shadow: inset 0 0 0 2px var(--focus-ring);
  outline: none;
}
.tab-problem {
  align-items: center;
  background: var(--red);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 10px;
  font-weight: 700;
  height: 15px;
  justify-content: center;
  width: 15px;
}
.rule-tabs-main .rule-panel {
  padding: 24px 26px 28px;
}
.rule-tabs-main .rule-panel-head h2 {
  font-size: 16px;
}

/* Reserve or alert, and how many: choices as cards. */
.choice-cards {
  border: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  padding: 0;
}
.choice-cards legend {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  padding: 0;
}
.choice-card {
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}
.choice-card:hover {
  border-color: var(--border-hover);
}
.choice-card:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.choice-card input {
  accent-color: var(--accent);
  flex: none;
  margin: 3px 0 0;
}
.choice-card strong {
  display: block;
  font-size: 14.5px;
}
.choice-card small {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 2px;
}
.choice-cards.compact .choice-card {
  padding: 11px 14px;
}

/* Days as a row of chips, with shortcuts below. */
.day-chips {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  max-width: 520px;
}
.day-chip {
  cursor: pointer;
  margin: 0;
  position: relative;
}
.day-chip input {
  inset: 0;
  margin: 0;
  opacity: 0;
  position: absolute;
}
.day-chip span {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  display: flex;
  font-size: 13.5px;
  font-weight: 500;
  height: 38px;
  justify-content: center;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease;
}
.day-chip:hover span {
  border-color: var(--border-hover);
}
.day-chip input:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}
.day-chip input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.day-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 6px 0 0 -7px;
}

/* Name patterns as tags. */
.pattern-input {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  cursor: text;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 40px;
  padding: 5px 8px;
}
.pattern-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.field .pattern-input input:not([type="checkbox"]):not([type="radio"]),
.field .pattern-input input:not([type="checkbox"]):not([type="radio"]):hover,
.field .pattern-input input:not([type="checkbox"]):not([type="radio"]):focus {
  background: none;
  border: 0;
  box-shadow: none;
  flex: 1;
  height: 30px;
  min-height: 0;
  min-width: 120px;
  outline: none;
  padding: 0 4px;
  width: auto;
}
.pattern-tag {
  align-items: center;
  background: var(--chip);
  border-radius: 6px;
  display: inline-flex;
  font-size: 13px;
  gap: 2px;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 3px 4px 3px 9px;
}
.pattern-tag button {
  background: none;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  padding: 2px 5px;
}
.pattern-tag button:hover {
  background: var(--hover);
  color: var(--ink);
}

/* The review's folded settings, each with a line saying what is set. */
.rule-folds {
  display: flex;
  flex-direction: column;
}
.rule-folds .rule-subhead {
  margin-bottom: 10px;
}
.rule-fold {
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.rule-fold + .rule-fold {
  margin-top: 8px;
}
.rule-fold[hidden] {
  display: none;
}
.rule-fold summary {
  align-items: baseline;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  list-style: none;
  padding: 13px 40px 13px 16px;
  position: relative;
}
.rule-fold summary::-webkit-details-marker {
  display: none;
}
.rule-fold summary::after {
  border: solid var(--faint);
  border-width: 0 1.5px 1.5px 0;
  content: "";
  height: 7px;
  position: absolute;
  right: 18px;
  top: 18px;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  width: 7px;
}
.rule-fold[open] summary::after {
  top: 21px;
  transform: rotate(225deg);
}
.rule-fold summary:hover {
  background: var(--row-hover);
}
.rule-fold-title {
  font-weight: 600;
  min-width: 170px;
}
.rule-fold-line {
  color: var(--muted);
  font-size: 13px;
}
.rule-fold-body {
  border-top: 1px solid var(--line);
  padding: 18px 16px 20px;
}

/* Preview and dry run: beside the tabs, inside the wizard's review. */
.rule-check-buttons {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}
.rule-wizard .rule-check-buttons {
  grid-template-columns: 1fr 1fr;
}
.js .field-help.is-inline {
  display: block;
}

/* The action bar runs the page's width; its buttons line up with the editor. */
.rule-editor .rule-actions {
  margin: 20px -40px 0;
  padding: 14px 40px;
}
.rule-actions-inner {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.rule-actions-inner > :first-child {
  margin-right: auto;
}
.rule-wizard .rule-actions-inner {
  max-width: 860px;
}
.rule-tabs-layout .rule-actions-inner {
  max-width: 1200px;
}
.narrow-only {
  display: none;
}

@media (max-width: 1050px) {
  .rule-tabs-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .rule-tabs-body .rule-preview-column {
    position: static;
  }
}

@media (max-width: 760px) {
  .rule-summary {
    border-radius: var(--radius);
    padding: 12px 14px;
  }
  .rule-summary .rule-sentence {
    font-size: 14.5px;
  }
  .rule-panel-head h2 {
    font-size: 18px;
  }
  /* Steps shrink to numbered dots, with the step named underneath. */
  .wizard-progress .wizard-label {
    display: none;
  }
  .wizard-progress li {
    gap: 4px;
  }
  .wizard-progress button {
    padding: 2px;
  }
  .wizard-count {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin: 10px 0 0;
  }
  .rule-wizard .rule-panel,
  .rule-tabs-main .rule-panel {
    padding: 20px 16px 24px;
  }
  .rule-wizard .rule-panel,
  .rule-tabs-main {
    border-radius: var(--radius);
  }
  /* Tabs scroll sideways under the finger, and stay in reach while a long tab scrolls. */
  .rule-tabs {
    background: var(--surface);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 0 6px;
    position: sticky;
    scroll-snap-type: x proximity;
    top: calc(56px + env(safe-area-inset-top));
    z-index: 2;
  }
  .rule-tabs [role="tab"] {
    font-size: 14px;
    padding: 14px 12px 12px;
    scroll-snap-align: start;
  }
  .choice-cards {
    grid-template-columns: 1fr;
  }
  .day-chips {
    gap: 4px;
  }
  .day-chip span {
    font-size: 13px;
    height: 42px;
  }
  .rule-fold-title {
    min-width: 0;
    width: 100%;
  }
  .rule-wizard .rule-check-buttons {
    grid-template-columns: 1fr;
  }
  .wide-only {
    display: none;
  }
  .rule-editor .rule-actions {
    margin: 16px -16px 0;
    padding-left: 16px;
    padding-right: 16px;
  }
  /* Buttons share the bar, each big enough for a thumb. */
  .rule-editor .rule-actions-inner > * {
    flex: 1;
    justify-content: center;
    min-height: 44px;
  }
  .rule-editor .rule-actions-inner > .button.primary {
    flex: 1.4;
  }
  .rule-editor .rule-actions-inner > :first-child {
    margin-right: 0;
  }
  .rule-tabs-layout .rule-cancel {
    flex: 0 0 auto;
  }
  .narrow-only {
    display: inline;
  }
}

/* --- Rules ----------------------------------------------------------------- */

.rule-ledger {
  overflow: hidden;
}
.rule-row {
  align-items: stretch;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
}
.rule-row:first-child {
  border-top: 0;
}
.rule-state {
  align-items: center;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  font-size: 12px;
  font-weight: 500;
  gap: 8px;
  justify-content: center;
}
.rule-state span {
  background: var(--line-strong);
  border-radius: 50%;
  height: 9px;
  width: 9px;
}
.rule-row.armed .rule-state {
  background: var(--accent-soft);
  color: var(--accent);
}
.rule-row.armed .rule-state span {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--focus-ring);
}
.rule-row.tripped .rule-state {
  background: var(--red-soft);
  color: var(--red);
}
.rule-row.tripped .rule-state span {
  background: var(--red);
}
.rule-row.snoozed .rule-state {
  background: var(--surface-2);
  color: var(--ink-2);
}
.rule-row.snoozed .rule-state span {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--ink-2);
}
.rule-row.expired {
  opacity: 0.72;
}
.rule-row.expired .rule-state {
  background: var(--surface-2);
  color: var(--muted);
}
.rule-main {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  padding: 18px 20px 18px 24px;
}
.rule-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}
.rule-title {
  min-width: 0;
}
.rule-title h2 {
  font-size: 16.5px;
  margin: 0;
  overflow-wrap: anywhere;
}
.rule-main p {
  color: var(--muted);
  font-size: 13px;
  margin: 3px 0;
}
.rule-main .failure-detail,
.rule-main .expiry-detail,
.rule-main .snooze-detail {
  margin: 0;
}
.rule-owner {
  align-items: center;
  display: flex;
  gap: 6px;
  margin: 6px 0 0 !important;
}
.rule-owner strong {
  background: var(--chip);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  padding: 1px 8px;
}
.rule-owner.own strong {
  background: var(--accent-soft);
  color: var(--accent);
}
.rule-owner a {
  color: var(--accent);
  font-weight: 500;
}
.rule-shared {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 0 !important;
}

/* A rule's share link, in its dialog. */
.share-dialog {
  width: 620px;
}
.share-link {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 20px 24px 24px;
}
.share-link p {
  color: var(--muted);
  margin: 0;
}
.share-link .link-box {
  box-sizing: border-box;
  width: 100%;
}
.share-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 560px) {
  .share-link {
    padding: 16px;
  }
  .share-link .link-box {
    align-items: stretch;
    flex-direction: column;
  }
}
.rule-scope {
  color: var(--ink-2);
  display: flex;
  flex-wrap: wrap;
  font-size: 13.5px;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.rule-scope li {
  max-width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow-wrap: anywhere;
  padding: 3px 9px;
}
.rule-scope li span {
  color: var(--muted);
  margin-right: 6px;
}
.rule-facts {
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 0;
  padding-top: 12px;
}
.rule-facts dt {
  color: var(--muted);
  font-size: 12px;
}
.rule-facts dd {
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  margin: 2px 0 0;
  white-space: nowrap;
}
.rule-facts .wide dd {
  white-space: normal;
}
.rule-actions {
  flex: none;
  margin: -4px -8px 0 0;
}
.row-menu {
  position: relative;
}
.row-menu summary {
  border-radius: 6px;
  color: var(--ink-2);
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 1px;
  list-style: none;
  padding: 7px 9px;
}
.row-menu summary::-webkit-details-marker {
  display: none;
}
.row-menu summary:hover,
.row-menu[open] summary {
  background: var(--surface-2);
  color: var(--ink);
}
.row-menu-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
  display: grid;
  max-height: var(--menu-max-height, calc(100vh - 16px));
  max-width: calc(100vw - 16px);
  min-width: 150px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  transform: translateX(var(--menu-shift-x, 0));
  z-index: 20;
}
.js .row-menu[open]:not(.menu-positioned) .row-menu-list {
  visibility: hidden;
}
.row-menu.menu-opens-up .row-menu-list {
  bottom: calc(100% + 4px);
  top: auto;
}
.row-menu-list form {
  margin: 0;
}
/* Panels clip their contents to their rounded corners; an open menu has to reach past them. */
.data-panel:has(.row-menu[open]),
.rule-ledger:has(.row-menu[open]) {
  overflow: visible;
}
.rule-row:has(.row-menu[open]) {
  position: relative;
  z-index: 21;
}
/* Pickers inside a menu keep their own buttons (see datetime-picker.js). */
.row-menu .row-menu-list a,
.row-menu .row-menu-list button:not(.picker *) {
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--ink-2);
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}
.row-menu .row-menu-list a:hover,
.row-menu .row-menu-list button:not(.picker *):hover {
  background: var(--surface-2);
  color: var(--ink);
}
.row-menu-group {
  border-block: 1px solid var(--line);
  display: grid;
  gap: 4px;
  margin: 4px 0;
  padding: 6px 4px;
}
.row-menu-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  padding: 0 6px;
}
.row-menu .snooze-lengths {
  display: flex;
  gap: 2px;
}
.row-menu .snooze-lengths button {
  flex: 1;
  padding: 6px 8px;
  text-align: center;
  white-space: nowrap;
  width: auto;
}
.row-menu-group {
  min-width: min(264px, calc(100vw - 26px));
}
.row-menu .snooze-until {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding-top: 8px;
}
.row-menu .snooze-when {
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) 104px;
  padding: 0 2px;
}
.row-menu .snooze-when .picker-field {
  font-size: 13px;
  min-height: 36px;
}
.row-menu .row-menu-list button.snooze-submit {
  background: var(--ink);
  color: var(--on-ink);
  text-align: center;
}
.row-menu .row-menu-list button.snooze-submit:hover {
  background: var(--ink-2);
  color: var(--on-ink);
}
.row-menu-list .danger-link {
  color: var(--red);
}
.snooze-alerts summary {
  letter-spacing: normal;
}
.snooze-alerts .row-menu-group {
  border: 0;
  margin: 0;
}
.row-menu-list .danger-link:hover {
  background: var(--red-soft);
}

/* --- Account menu (the signed-in person at the foot of the rail) ------------ */

.account-menu {
  border-top: 1px solid var(--line);
  margin-top: auto;
  padding-top: 10px;
}
.row-menu.account-menu > summary {
  align-items: center;
  color: var(--ink);
  display: grid;
  font-size: 13px;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  letter-spacing: normal;
  padding: 6px;
}
.rail-user strong,
.rail-user small,
.account-menu-who strong,
.account-menu-who small {
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-user small,
.account-menu-who small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.account-menu svg {
  fill: none;
  flex: none;
  height: 16px;
  stroke: var(--faint);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
  width: 16px;
}
.account-menu .avatar {
  position: relative;
}
.avatar-dot {
  background: var(--count);
  border: 2px solid var(--canvas);
  border-radius: 50%;
  height: 10px;
  position: absolute;
  right: -1px;
  top: -1px;
  width: 10px;
}
.avatar-dot[hidden] {
  display: none;
}
#password .section-head a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.password-change {
  display: grid;
  gap: 14px;
  max-width: 420px;
}
.password-change .field {
  margin: 0;
}
.account-menu[open] .account-menu-chevron {
  transform: rotate(180deg);
}
.account-menu .row-menu-list {
  left: 0;
  min-width: 0;
}
.account-menu-who {
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  padding: 8px 10px 10px;
}
.account-menu .row-menu-list a,
.account-menu .row-menu-list button:not(.picker *) {
  align-items: center;
  display: flex;
  gap: 10px;
}
.account-menu .row-menu-list a:hover svg,
.account-menu .row-menu-list button:hover svg {
  stroke: var(--ink-2);
}
.account-menu .row-menu-list a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}
.account-menu .row-menu-list a[aria-current="page"] svg {
  stroke: var(--accent);
}
.account-menu .account-menu-sign-out {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 4px;
}
/* Appearance, in the account menu: the theme as three segments, then the dense tables switch.
   Sign out's own rule closes the group, so it draws no line beneath. */
.account-menu .appearance {
  border-bottom: 0;
  margin-bottom: 0;
  min-width: 0;
  padding: 6px 0 2px;
}
.account-menu .appearance .row-menu-label {
  padding: 0 10px;
}
.appearance-themes {
  background: var(--surface-2);
  border-radius: 8px;
  display: flex;
  gap: 2px;
  margin: 0 6px;
  padding: 2px;
}
.account-menu .row-menu-list .appearance-themes button {
  border-radius: 6px;
  color: var(--muted);
  flex: 1;
  justify-content: center;
  padding: 5px 6px;
}
.account-menu .row-menu-list .appearance-themes button:hover {
  background: none;
  color: var(--ink);
}
.account-menu .row-menu-list .appearance-themes button[aria-pressed="true"] {
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12);
  color: var(--ink);
}
.account-menu .row-menu-list button.density-switch {
  display: none;
  justify-content: space-between;
}
@media (min-width: 1280px) {
  .account-menu .row-menu-list button.density-switch {
    display: flex;
  }
}
.switch-track {
  background: var(--line-strong);
  border-radius: 999px;
  flex: none;
  height: 16px;
  position: relative;
  transition: background-color 0.15s ease;
  width: 28px;
}
.switch-track::after {
  background: var(--surface);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
  content: "";
  height: 12px;
  left: 2px;
  position: absolute;
  top: 2px;
  transition: transform 0.15s ease;
  width: 12px;
}
[aria-checked="true"] > .switch-track {
  background: var(--accent);
}
[aria-checked="true"] > .switch-track::after {
  transform: translateX(12px);
}
/* The keyboard shortcuts button, bottom right. The keys it lists need scripts and a
   keyboard, so it is not offered without either. */
.shortcuts-fab {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  bottom: 20px;
  box-shadow: var(--shadow-pop);
  color: var(--ink-2);
  cursor: pointer;
  display: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  height: 40px;
  line-height: 1;
  justify-content: center;
  padding: 0;
  position: fixed;
  right: 20px;
  transition:
    border-color 0.12s ease,
    color 0.12s ease,
    bottom 0.2s ease;
  width: 40px;
  z-index: 12;
}
.js .shortcuts-fab {
  display: flex;
}
.shortcuts-fab:hover {
  border-color: var(--border-hover);
  color: var(--ink);
}
.shortcuts-fab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Clear of the save and bulk bars that stick to the foot of some pages. */
body:has(.sticky-actions) .shortcuts-fab,
body:has(.bulk-bar:not([hidden])) .shortcuts-fab {
  bottom: 84px;
}
@media (max-width: 760px) {
  .js .shortcuts-fab {
    display: none;
  }
}

/* --- Reservations history -------------------------------------------------- */

.history-timeline {
  padding: 8px 28px;
}
.history-item {
  display: grid;
  grid-template-columns: 88px 22px 1fr;
  position: relative;
}
.history-time {
  padding: 18px 14px 0 0;
  text-align: right;
}
.history-time time,
.history-time span {
  display: block;
}
.history-time time {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.history-time span {
  color: var(--faint);
  font-size: 12px;
}
.history-pin {
  background: var(--line-strong);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--chip);
  height: 10px;
  margin: 25px 0 0 6px;
  position: relative;
  width: 10px;
  z-index: 2;
}
.history-item::before {
  background: var(--line);
  bottom: 0;
  content: "";
  left: 98px;
  position: absolute;
  top: 0;
  width: 2px;
}
.history-item:first-child::before {
  top: 25px;
}
.history-item:last-child::before {
  bottom: auto;
  height: 25px;
}
.history-item:only-child::before {
  display: none;
}
.history-pin.active,
.history-pin.purchased {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.history-pin.purchased {
  background: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-soft);
}
.history-pin.failed,
.history-pin.rejected,
.history-pin.invalid {
  background: var(--red);
  box-shadow: 0 0 0 4px var(--red-soft);
}
.history-pin.pending,
.history-pin.reconciling {
  background: var(--amber);
  box-shadow: 0 0 0 4px var(--amber-soft);
}
.history-body {
  border-bottom: 1px solid var(--line);
  min-width: 0;
  padding: 16px 0 22px 12px;
}
.history-item:last-child .history-body {
  border-bottom: 0;
}
.history-facts {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  font-size: 14px;
  gap: 12px 0;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 14px 0;
  padding: 12px 0;
}
.history-facts span {
  border-left: 1px solid var(--line);
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 0 14px;
}
.history-facts span:first-child {
  border-left: 0;
}
.history-facts small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 2px;
}
.failure-detail {
  background: var(--red-soft);
  border-radius: 8px;
  color: var(--red-ink);
  font-size: 14px;
  margin: 10px 0;
  padding: 10px 14px;
}
.expiry-detail,
.snooze-detail {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  margin: 10px 0;
  padding: 10px 14px;
}
.history-body details {
  margin: 10px 0;
}
.history-body summary,
.upstream-response summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  width: max-content;
}
.history-body summary:hover,
.upstream-response summary:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.trace {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  margin: 8px 0 0;
  padding: 6px 12px;
}
.trace div {
  display: grid;
  grid-template-columns: 140px 1fr;
  padding: 5px 0;
}
.trace dt {
  color: var(--muted);
}
.trace dd {
  font-family: var(--mono);
  font-size: 12.5px;
  margin: 0;
  overflow-wrap: anywhere;
}
.upstream-response {
  margin-top: 8px;
}
.upstream-response pre {
  background: var(--dark);
  border-radius: 8px;
  color: var(--dark-text);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  margin: 8px 0 0;
  max-height: 260px;
  overflow: auto;
  padding: 12px 14px;
  tab-size: 2;
  white-space: pre-wrap;
  word-break: break-word;
}
.resale-line {
  align-items: center;
  border-top: 1px dashed var(--line-strong);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
}
.resale-progress small {
  color: var(--muted);
  display: block;
  font-size: 12px;
}
.resale-progress strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.resale-progress.complete strong {
  color: var(--accent);
}

/* --- Filters --------------------------------------------------------------- */

.filter-inline {
  align-items: center;
  display: flex;
  gap: 10px;
}
.filter-notice {
  background: var(--amber-soft);
  border-radius: var(--radius);
  color: var(--amber-ink);
  font-size: 14px;
  margin: 0 0 16px;
  padding: 12px 16px;
}
.filter-notice p {
  margin: 0;
}
.filter-notice p + p {
  margin-top: 6px;
}
.log-filters {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: 170px 1fr 160px 1fr auto;
  margin-bottom: 18px;
  padding: 16px 18px;
}
.log-filters label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}
.log-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.collection-filters {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  margin-bottom: 18px;
  padding: 18px 20px;
}
.filter-intro strong {
  font-size: 14.5px;
}
.filter-intro p {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}
.filter-fields {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  min-width: 0;
}
.filter-field {
  min-width: 0;
}
.filter-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  margin-bottom: 6px;
}
.filter-field select[multiple] {
  background: var(--surface-2);
  min-height: 134px;
  padding: 4px;
}
.filter-field select[multiple] option {
  border-radius: 6px;
  padding: 7px 9px;
}
.filter-field select[multiple] option:checked {
  background: linear-gradient(var(--ink), var(--ink));
  color: var(--on-ink);
}
.filter-field select[data-filter-multiselect][hidden] {
  display: none;
}
/* Until filter-multiselect.js swaps it for a dropdown, reserve the trigger's footprint instead of painting the open list box. */
.js .filter-field select[data-filter-multiselect]:not([data-dropdown-enhanced]) {
  height: 40px;
  min-height: 40px;
  overflow: hidden;
  visibility: hidden;
}
.filter-field small {
  color: var(--muted);
  display: block;
  font-size: 12.5px;
  margin-top: 5px;
}
.filter-actions {
  align-self: start;
  display: flex;
  gap: 8px;
  margin-top: 26px;
}
/* Fields and buttons sit in the panel's grid as if unwrapped; only a phone folds them away. */
.filter-body {
  display: contents;
}
.filter-toggle {
  display: none;
}

.filter-multiselect {
  position: relative;
}
.filter-multiselect-trigger {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 1px 1px rgba(20, 23, 26, 0.03);
  display: flex;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  text-align: left;
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
  width: 100%;
}
.filter-multiselect-trigger:hover {
  border-color: var(--border-hover);
}
.filter-multiselect-trigger::after {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2362696f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E")
    center / 12px no-repeat;
  content: "";
  flex: none;
  height: 12px;
  margin-left: auto;
  transition: transform 0.15s ease;
  width: 12px;
}
.filter-multiselect.open .filter-multiselect-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.filter-multiselect.open .filter-multiselect-trigger::after {
  transform: rotate(180deg);
}
.filter-multiselect-summary {
  color: var(--ink-2);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-multiselect[data-has-selection="true"] .filter-multiselect-summary {
  color: var(--ink);
  font-weight: 500;
}
.filter-multiselect-count {
  background: var(--ink);
  border-radius: 999px;
  color: var(--on-ink);
  flex: none;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 18px;
  min-width: 20px;
  padding: 0 6px;
  text-align: center;
}
.filter-multiselect-count[hidden] {
  display: none;
}

.filter-multiselect-menu {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  left: 0;
  max-width: calc(100vw - 32px);
  min-width: 100%;
  overflow: hidden;
  position: absolute;
  top: calc(100% + 6px);
  width: max(100%, 300px);
  z-index: 40;
}
.filter-multiselect-menu[hidden] {
  display: none;
}
.filter-multiselect-menu:focus {
  outline: none;
}
.filter-multiselect-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 8px 8px 8px 14px;
}
.filter-multiselect-head span {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}
.filter-multiselect-clear {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 8px;
}
.filter-multiselect-clear:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--ink);
}
.filter-multiselect-clear:disabled {
  color: var(--faint);
  cursor: default;
}
.filter-multiselect-search {
  background: var(--surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238d949a' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='6.2' cy='6.2' r='4.2'/%3E%3Cpath d='m9.5 9.5 3 3'/%3E%3C/svg%3E")
    14px center / 14px no-repeat;
  border: 0;
  border-bottom: 1px solid var(--line);
  display: block;
  font-size: 14px;
  padding: 10px 14px 10px 36px;
  width: 100%;
}
.filter-multiselect-search:focus {
  outline: none;
  background-color: var(--surface-2);
}
.filter-multiselect-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.filter-multiselect-options {
  display: grid;
  gap: 1px;
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 5px;
}
.filter-field .filter-multiselect-option,
.filter-multiselect-option {
  align-items: center;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  font-size: 14px;
  font-weight: 400;
  gap: 11px;
  line-height: 1.3;
  margin: 0;
  padding: 8px 10px;
  position: relative;
}
.filter-multiselect-option[hidden] {
  display: none;
}
.filter-multiselect-option:hover {
  background: var(--surface-2);
}
.filter-multiselect-option:has(input:checked) {
  background: var(--accent-soft);
}
.filter-multiselect-option:has(input:focus-visible) {
  box-shadow: inset 0 0 0 2px var(--accent);
}
/* The real checkbox stays in the tab order and the accessibility tree; the
   drawn box beside it is what people see. */
.filter-multiselect-option input {
  height: 1px;
  margin: 0;
  opacity: 0;
  position: absolute;
  width: 1px;
}
.filter-multiselect-box {
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  flex: none;
  height: 17px;
  transition:
    background-color 0.1s ease,
    border-color 0.1s ease;
  width: 17px;
}
.filter-multiselect-option:hover .filter-multiselect-box {
  border-color: var(--border-hover);
}
.filter-multiselect-option input:checked + .filter-multiselect-box {
  background: var(--accent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2.5 6.2 2.4 2.4 4.6-5'/%3E%3C/svg%3E")
    center / 12px no-repeat;
  border-color: var(--accent);
}
.filter-multiselect-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.filter-multiselect-text strong {
  color: var(--ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-multiselect-text small {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-multiselect-empty {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  padding: 16px 10px;
  text-align: center;
}
.filter-multiselect-empty[hidden] {
  display: none;
}

/* On a phone the dropdown is a sheet rising from the bottom over a dimmed page, worded and laid
   out like the phone's own pickers: Clear, the field's name and Done along the top, then
   full-width rows split by hairlines with a tick at the end of each chosen one. */
html.sheet-locked {
  overflow: hidden;
}
.filter-sheet-scrim {
  background: var(--backdrop);
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  touch-action: none;
  transition: opacity 0.3s ease;
  z-index: 60;
}
.filter-sheet-scrim.is-open {
  opacity: 1;
  pointer-events: auto;
}
.filter-multiselect-menu.is-sheet {
  border: 0;
  border-radius: 14px 14px 0 0;
  bottom: 0;
  box-shadow: 0 -10px 34px rgb(0 0 0 / 0.18);
  display: flex;
  flex-direction: column;
  left: 0;
  max-height: calc(100dvh - 56px - env(safe-area-inset-top));
  max-width: none;
  min-width: 0;
  padding: 6px max(16px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(16px, env(safe-area-inset-left));
  position: fixed;
  right: 0;
  top: auto;
  transform: translateY(105%);
  transition:
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 0.3s;
  visibility: hidden;
  width: auto;
  z-index: 61;
  -webkit-tap-highlight-color: transparent;
}
.filter-multiselect-menu.is-sheet.is-open {
  transform: translateY(var(--sheet-drag, 0px));
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  visibility: visible;
}
.filter-multiselect-menu.is-sheet.is-dragging {
  transition: none;
}
.filter-sheet-head {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto 1fr;
  padding: 0 0 12px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.filter-sheet-head strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-sheet-clear,
.filter-sheet-done {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-size: 17px;
  min-height: 44px;
  padding: 0;
}
.filter-sheet-clear {
  justify-self: start;
}
.filter-sheet-clear:disabled {
  color: var(--faint);
}
.filter-sheet-done {
  font-weight: 600;
  justify-self: end;
}
.filter-sheet-clear:active:not(:disabled),
.filter-sheet-done:active {
  opacity: 0.5;
}
/* 16px text keeps iOS from zooming the page when the search is tapped. */
.is-sheet .filter-multiselect-search {
  background-color: var(--surface-2);
  background-position: 11px center;
  border: 0;
  border-radius: 10px;
  flex: none;
  font-size: 16px;
  margin-bottom: 8px;
  padding: 9px 12px 9px 32px;
}
.is-sheet .filter-multiselect-options {
  flex: 1 1 auto;
  gap: 0;
  max-height: none;
  min-height: 0;
  padding: 0 0 12px;
}
.is-sheet .filter-multiselect-option {
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-size: 16px;
  gap: 12px;
  min-height: 52px;
  padding: 10px 2px;
  -webkit-user-select: none;
  user-select: none;
}
/* The last row still showing has no line under it. */
.is-sheet .filter-multiselect-option:not(:has(~ .filter-multiselect-option:not([hidden]))) {
  border-bottom: 0;
}
.is-sheet .filter-multiselect-option:hover,
.is-sheet .filter-multiselect-option:has(input:checked) {
  background: transparent;
}
.is-sheet .filter-multiselect-option:active {
  background: var(--surface-2);
}
/* The ticks are a column of circles, as in Mail's own lists, and the column is a wide strip
   down the row's right edge: sliding a finger along it chooses rows instead of scrolling. */
.is-sheet .filter-multiselect-box,
.is-sheet .filter-multiselect-option:hover .filter-multiselect-box,
.is-sheet .filter-multiselect-option input:checked + .filter-multiselect-box {
  align-items: center;
  align-self: stretch;
  background: transparent;
  border: 0;
  border-radius: 0;
  display: flex;
  height: auto;
  justify-content: flex-end;
  margin: -10px -2px -10px auto;
  order: 2;
  padding-right: 2px;
  touch-action: none;
  width: 64px;
}
.is-sheet .filter-multiselect-box::before {
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  box-sizing: border-box;
  content: "";
  height: 23px;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease;
  width: 23px;
}
.is-sheet .filter-multiselect-option input:checked + .filter-multiselect-box::before {
  background: var(--accent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 7.3 2.7 2.7 5.3-6'/%3E%3C/svg%3E")
    center / 14px no-repeat;
  border-color: var(--accent);
}
.is-sheet .filter-multiselect-option {
  -webkit-touch-callout: none;
}
.is-sheet .filter-multiselect-text strong {
  font-weight: 400;
}
.is-sheet .filter-multiselect-text small {
  font-size: 13.5px;
}
@media (prefers-reduced-motion: reduce) {
  .filter-sheet-scrim,
  .filter-multiselect-menu.is-sheet,
  .filter-multiselect-menu.is-sheet.is-open {
    transition: none;
  }
}

/* "Sold via": a text box with its own dropdown of channels (channel-combobox.js). */
.combobox {
  position: relative;
}
.field .combobox input:not([type="checkbox"]):not([type="radio"]) {
  padding-right: 38px;
}
.combobox-toggle {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2362696f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E")
    center / 12px no-repeat;
  border: 0;
  border-radius: 6px;
  height: 30px;
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.15s ease;
  width: 30px;
}
.combobox-toggle:hover {
  background-color: var(--surface-2);
}
.combobox.open .combobox-toggle {
  transform: translateY(-50%) rotate(180deg);
}
.combobox-menu {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  display: grid;
  gap: 1px;
  left: 0;
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 5px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
}
.combobox-menu[hidden] {
  display: none;
}
.combobox-option {
  align-items: baseline;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  font-size: 14px;
  gap: 10px;
  line-height: 1.3;
  padding: 8px 10px 8px 32px;
  position: relative;
}
.combobox-option:hover,
.combobox-option.active {
  background: var(--surface-2);
}
.combobox-option.active {
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.combobox-option strong {
  color: var(--ink);
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.combobox-option small {
  color: var(--muted);
  font-size: 12.5px;
  margin-left: auto;
  white-space: nowrap;
}
.combobox-option.current::before,
.combobox-option.create::before {
  content: "";
  height: 14px;
  left: 10px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
}
.combobox-option.current::before {
  background: var(--accent);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 7.2 2.8 2.8 5.2-5.8'/%3E%3C/svg%3E")
    center / 14px no-repeat;
}
.combobox-option.create {
  border-top: 1px solid var(--line);
  border-radius: 0 0 7px 7px;
}
.combobox-option.create:first-child {
  border-top: 0;
  border-radius: 7px;
}
.combobox-option.create strong {
  color: var(--accent);
}
.combobox-option.create::before {
  background: var(--accent);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 2.5v9M2.5 7h9'/%3E%3C/svg%3E")
    center / 14px no-repeat;
}
.combobox-empty {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  padding: 12px 10px;
  text-align: center;
}

/* --- People ---------------------------------------------------------------- */

.split-layout {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: 380px 1fr;
}
.split-layout .form-panel {
  display: block;
  padding: 24px;
}
.generated-link {
  background: var(--amber-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.generated-link p {
  color: var(--amber-ink);
  font-size: 13px;
  margin: 4px 0 10px;
}
.user-access {
  margin-top: 20px;
}
.user-detail-link {
  display: block;
}
.user-detail-link span {
  color: var(--accent);
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  margin-top: 4px;
}
.user-detail-link:hover strong {
  color: var(--accent);
}

.user-operations-strip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin-bottom: 20px;
}
.user-operations-strip > div {
  border-left: 1px solid var(--line);
  padding: 16px 22px;
}
.user-operations-strip > div:first-child {
  border-left: 0;
}
.user-operations-strip span {
  color: var(--muted);
  display: block;
  font-size: 13px;
}
.user-operations-strip strong:not(.status) {
  display: block;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 4px;
}
.user-operations-strip strong small {
  color: var(--muted);
  font-size: 16px;
  letter-spacing: 0;
}
.user-operations-strip .status {
  margin-top: 8px;
}
.user-detail-section {
  margin-top: 20px;
}
.user-section-head {
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
}
.user-section-head:last-child {
  border-bottom: 0;
}
.user-section-head + .table-head {
  border-top: 0;
}

/* --- Checkout -------------------------------------------------------------- */

.checkout-layout {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 340px) minmax(0, 560px);
}
.checkout-summary,
.checkout-panel {
  padding: 24px;
}
.checkout-summary dl {
  margin: 0 0 18px;
}
.checkout-summary dl div {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.checkout-summary dl div:first-child {
  border-top: 0;
  padding-top: 0;
}
.checkout-summary dt {
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 2px;
}
.checkout-summary dd {
  margin: 0;
}
.checkout-summary dd.data {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.checkout-message {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 16px;
  min-height: 1.4em;
}
.checkout-message:empty {
  display: none;
}
.checkout-message[data-tone] {
  border-radius: 8px;
  padding: 10px 14px;
}
.checkout-message[data-tone="error"] {
  background: var(--red-soft);
  color: var(--red-ink);
}
.checkout-message[data-tone="warning"] {
  background: var(--amber-soft);
  color: var(--amber-ink);
}
.checkout-message[data-tone="success"] {
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.checkout-element {
  margin-bottom: 20px;
}
.checkout-element:empty {
  margin: 0;
}
.checkout-panel .button + .button {
  margin-top: 8px;
}
.checkout-panel .button[hidden] {
  display: none;
}
.checkout-card {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 12px 14px;
}
.checkout-card[hidden] {
  display: none;
}
.checkout-card small {
  color: var(--muted);
  display: block;
  font-size: 12.5px;
}
.checkout-card button {
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  padding: 0;
}

/* The checkout queue: the hold being paid for, with the rest of the queue beside it. */
.queue-checkout {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 580px) minmax(0, 340px);
}
.queue-step {
  display: grid;
  gap: 20px;
}
.queue-step-summary h2 {
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 0;
  overflow-wrap: anywhere;
}
.queue-step-when {
  color: var(--muted);
  font-size: 14px;
  margin: 2px 0 18px;
}
.queue-step-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding-top: 16px;
}
.queue-step-actions form {
  margin: 0;
}
.queue-head {
  max-width: 940px;
}
/* Two by two, so the payment form starts nearer the top of the screen. */
.queue-step-summary dl {
  column-gap: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 16px;
}
.queue-step-summary dl div:nth-child(2) {
  border-top: 0;
  padding-top: 0;
}
.queue-step-summary dd {
  overflow-wrap: anywhere;
}
.queue-notice p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 18px;
}
.queue-notice p:last-child {
  margin-bottom: 0;
}
/* "Back to <event name>" can be long enough to need a second line. */
.queue-notice .button {
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
}
.queue-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  margin: 0 0 18px;
}
.queue-summary div {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.queue-summary .spent {
  grid-column: 1 / -1;
}
.queue-summary dt {
  color: var(--muted);
  font-size: 12.5px;
}
.queue-summary dd {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  margin: 2px 0 0;
}
.queue-summary .bought dd {
  color: var(--blue);
}
.queue-rail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
}
.queue-list {
  display: grid;
  gap: 2px;
  list-style: none;
  margin: 14px -10px 0;
  padding: 0;
}
.queue-entry {
  align-items: start;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  padding: 10px;
}
.queue-entry-star {
  margin: 0;
}
.queue-entry-star .hold-star {
  font-size: 18px;
  line-height: 1;
  min-height: 32px;
  min-width: 32px;
}
.queue-entry.current {
  background: var(--accent-soft);
}
.queue-entry.paid,
.queue-entry.gone,
.queue-entry.elapsed {
  opacity: 0.65;
}
.queue-entry-mark {
  font-family: var(--mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  padding-top: 1px;
}
.queue-entry.paid .queue-entry-mark {
  color: var(--blue);
}
.queue-entry.gone .queue-entry-mark {
  color: var(--muted);
}
.queue-entry.urgent .queue-entry-clock {
  color: var(--red);
}
.queue-entry-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.queue-entry-main > strong,
.queue-entry-main > a {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.queue-entry-main > a {
  color: var(--ink);
}
.queue-entry-main > a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.queue-entry-main > span:not(.status) {
  color: var(--muted);
  font-size: 13px;
}
.queue-entry-main > .status {
  margin-top: 4px;
  white-space: normal;
}
.section-head:has(> .queue-start) {
  align-items: center;
}
.section-head > .queue-start {
  margin: 0 0 0 auto;
}
.section-head > .queue-start ~ .bulk-all {
  margin-left: 0;
}

/* --- Revenue --------------------------------------------------------------- */

.revenue-filters .filter-fields {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.revenue-filters.preset-range .field-start,
.revenue-filters.preset-range .field-end {
  display: none;
}
.period-caption {
  align-items: baseline;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  gap: 6px 14px;
  margin: 0 0 14px;
}
.period-caption strong {
  color: var(--ink);
  font-size: 16px;
}

.kpi-grid {
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: grid;
  gap: 1px;
  grid-template-columns: 1.4fr repeat(5, minmax(0, 1fr));
  margin-bottom: 20px;
  overflow: hidden;
}
.kpi {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 18px 20px;
}
.kpi > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.kpi > strong {
  font-size: 26px;
  letter-spacing: -0.025em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.kpi small {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}
.kpi.hero {
  background: var(--dark);
  color: #fff;
}
.kpi.hero > span,
.kpi.hero small {
  color: var(--dark-muted);
}
.kpi.hero > strong {
  color: var(--dark-positive);
  font-size: 38px;
}
.kpi.hero.loss > strong {
  color: var(--dark-negative);
}
.change {
  font-weight: 500;
}
.change.up {
  color: var(--accent);
}
.change.down {
  color: var(--red);
}
.kpi.hero .change.up {
  color: var(--dark-positive);
}
.kpi.hero .change.down {
  color: var(--dark-negative);
}

.chart-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 20px;
}
.chart-card {
  grid-column: span 3;
  min-width: 0;
  padding: 20px 22px 18px;
}
.chart-card.wide {
  grid-column: 1 / -1;
}
.chart-card.third {
  grid-column: span 2;
}
.chart-card header h2 {
  font-size: 16px;
  margin: 0;
}
.chart-card header p {
  color: var(--muted);
  font-size: 13px;
  margin: 2px 0 14px;
}
.chart {
  min-height: 200px;
  width: 100%;
}
.chart svg {
  display: block;
  max-width: 100%;
  overflow: visible;
}
.chart-axis {
  fill: var(--faint);
  font-family: "Geist", system-ui, sans-serif;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.chart-value {
  fill: var(--ink);
  font-family: "Geist", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 4px;
}
.chart-hit {
  cursor: crosshair;
  outline: none;
}
.chart-hit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.chart-hit.active {
  fill: var(--hover);
}
.chart-bar {
  transition: opacity 0.12s ease;
}
.chart-legend {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 6px 8px;
  margin: -6px 0 10px;
}
.chart-legend .key {
  border-radius: 2px;
  display: inline-block;
  height: 3px;
  margin-left: 12px;
  width: 16px;
}
.chart-legend .key:first-child {
  margin-left: 0;
}
.chart-legend .key.revenue {
  background: var(--chart-gain);
}
.chart-legend .key.outgoings {
  background: var(--chart-cost);
}

.chart-tooltip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  color: var(--ink);
  font-size: 13px;
  min-width: 160px;
  padding: 10px 12px;
  pointer-events: none;
  position: absolute;
  z-index: 50;
}
.chart-tooltip[hidden] {
  display: none;
}
.chart-tooltip-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 5px;
}
.chart-tooltip-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 14px auto 1fr;
  padding: 2px 0;
}
.chart-tooltip-row i {
  border-radius: 2px;
  height: 3px;
  width: 14px;
}
.chart-tooltip-row strong {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.chart-tooltip-row span {
  color: var(--muted);
}

.bar-list {
  display: grid;
  gap: 2px;
}
.bar-row {
  border-radius: 8px;
  display: grid;
  gap: 6px 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 0 -8px;
  padding: 8px;
}
.bar-row:hover,
.bar-row:focus-visible {
  background: var(--surface-2);
}
.bar-label {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-value {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.bar-value.negative {
  color: var(--red);
}
.bar-track {
  background: var(--track);
  border-radius: 999px;
  grid-column: 1 / -1;
  height: 6px;
  position: relative;
}
.bar-track i {
  background: var(--chart-gain);
  border-radius: 999px;
  height: 6px;
  left: 0;
  position: absolute;
  top: 0;
}
.bar-track.split::before {
  background: var(--line-strong);
  content: "";
  height: 12px;
  left: 50%;
  position: absolute;
  top: -3px;
  width: 1px;
}
.bar-track.split i.gain {
  border-radius: 0 999px 999px 0;
  left: 50%;
}
.bar-track i.loss {
  background: var(--red);
  border-radius: 999px 0 0 999px;
  left: auto;
  right: 50%;
}
.bar-list-empty {
  color: var(--muted);
  font-size: 14px;
  margin: 20px 0;
  text-align: center;
}

.chart-table {
  padding: 0;
}
.chart-table summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  padding: 15px 22px;
}
.table-scroll {
  overflow-x: auto;
}
.chart-table table {
  border-collapse: collapse;
  font-size: 14px;
  width: 100%;
}
.chart-table th,
.chart-table td {
  border-top: 1px solid var(--line);
  padding: 9px 22px;
  text-align: right;
  white-space: nowrap;
}
.chart-table th:first-child {
  text-align: left;
}
.chart-table thead th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}
.chart-table tbody th {
  font-weight: 500;
}
.chart-table td {
  font-variant-numeric: tabular-nums;
}
.chart-table .negative,
.profit-cell.negative {
  color: var(--red);
}
.profit-cell.positive {
  color: var(--accent);
}

.revenue-section {
  margin-bottom: 20px;
}
.revenue-section-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 20px;
  padding: 18px 20px;
}
.revenue-section-head + .table-head {
  border-top: 0;
}
/* Leave room for the rename box's dropdown to spill past the panel. */
.data-panel.channel-panel {
  overflow: visible;
}
.channel-columns {
  grid-template-columns: minmax(0, 1fr) 70px 110px minmax(260px, 1.2fr);
}
/* The count says "sales" itself only where the column heading is hidden. */
.channel-uses-unit {
  display: none;
}
.channel-rename {
  align-items: center;
  display: flex;
  gap: 10px;
}
.channel-rename .field {
  flex: 1;
  margin: 0;
}
.stock-pointer {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 16px 20px;
}
.stock-pointer h2 {
  font-size: 16px;
  margin: 0 0 2px;
}
.stock-pointer p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
.ledger-columns > .data {
  font-size: 14px;
}
.ledger-columns > .data small,
.ledger-columns > span > small {
  color: var(--muted);
  display: block;
  font-family: inherit;
  font-size: 12px;
}
.passed {
  color: var(--amber);
  font-weight: 500;
}
.countdown {
  color: var(--ink-2);
  font-weight: 500;
}
.countdown.soon {
  color: var(--amber);
}
.countdown.passed {
  color: var(--muted);
  font-weight: 400;
}
.inventory-columns > div > .data {
  font-size: 14px;
}
.inventory-columns .row-actions form {
  display: contents;
}
/* Every action here is a real button: stack them at one width, lined up with the row. */
.inventory-columns > .row-actions {
  align-items: stretch;
  flex-direction: column;
  gap: 6px;
  margin-left: 0;
}
.row-detail {
  grid-column: 1 / -1;
  margin-top: -6px;
}
.row-detail summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}
.row-detail summary:hover {
  color: var(--ink);
}
.row-detail-body {
  display: grid;
  gap: 14px;
  padding: 12px 0 4px;
}
.inventory-sales {
  display: grid;
  font-size: 13.5px;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* --- Bulk selection --------------------------------------------------------
   Tick rows, then act on them together from a bar that follows the reader down
   the list. The bar sits after the rows so it can stick to the bottom edge. */

.bulk-check {
  align-items: center;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 13.5px;
  gap: 6px;
  /* Shift-clicking the label ticks a run of rows; it shouldn't also select text. */
  user-select: none;
}
.bulk-check:hover {
  color: var(--ink);
}
.bulk-all {
  margin-left: auto;
  white-space: nowrap;
}
.bulk-check input,
.bulk-cell input {
  accent-color: var(--accent);
  cursor: pointer;
  flex: none;
  height: 17px;
  margin: 0;
  width: 17px;
}
.bulk-check input:disabled {
  cursor: not-allowed;
}
.bulk-cell {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  min-width: 0;
}
.table-head .bulk-cell {
  align-items: center;
}
/* On a touch screen a finger slides up or down from a row's box to tick a run of rows
   (components/bulk.tsx), so a slide starting there doesn't scroll, and the boxes are bigger. */
@media (pointer: coarse) {
  [data-bulk-drag] {
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
  .bulk-cell input[data-bulk-id],
  .bulk-check input[data-bulk-id],
  .inbox-item > input[data-bulk-id] {
    height: 22px;
    width: 22px;
  }
}
.bulk-cell > div {
  min-width: 0;
}
.table-row.is-selected,
.hold-card.is-selected {
  background: var(--accent-soft);
}
.bulk-bar {
  align-items: center;
  backdrop-filter: blur(10px);
  background: var(--glass);
  border-top: 1px solid var(--line);
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 12px 20px;
  position: sticky;
  z-index: 3;
}
.bulk-bar[hidden] {
  display: none;
}
/* hidden would make the panel its own scroller, and the bar would stop sticking. */
.data-panel[data-bulk] {
  overflow: clip;
}
.bulk-bar strong {
  font-size: 14px;
  font-weight: 600;
  margin-right: auto;
}
.bulk-elsewhere {
  color: var(--muted);
  font-weight: 400;
}
.bulk-bar form {
  margin: 0;
}
.hold-section .bulk-bar,
.queue-panel .bulk-bar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 12px;
}
.bulk-quantities {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 14px 16px 16px;
}
.bulk-quantities legend {
  font-size: 14px;
  font-weight: 600;
  padding: 0 6px;
}
.form-note {
  background: var(--amber-soft);
  border-radius: var(--radius-sm);
  color: var(--amber-ink);
  font-size: 13.5px;
  margin: 0;
  padding: 9px 12px;
}

.segmented {
  background: var(--chip);
  border-radius: 9px;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
}
.segmented label {
  cursor: pointer;
  margin: 0;
  position: relative;
}
.segmented input {
  opacity: 0;
  position: absolute;
}
.segmented span {
  border-radius: 7px;
  color: var(--muted);
  display: block;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
}
.segmented label:hover span {
  color: var(--ink);
}
.segmented input:checked + span {
  background: var(--surface);
  box-shadow:
    0 1px 2px rgba(20, 23, 26, 0.1),
    0 0 0 1px var(--hover);
  color: var(--ink);
}
.segmented input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.profit-preview {
  height: max-content;
  position: sticky;
  top: calc(var(--strip) + 20px);
}
.profit-preview .kicker {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.profit-preview dl {
  margin: 12px 0 16px;
}
.profit-preview dl div {
  border-top: 1px solid var(--dark-line);
  display: flex;
  font-size: 14px;
  gap: 12px;
  justify-content: space-between;
  padding: 9px 0;
}
.profit-preview dt {
  color: var(--dark-muted);
}
.profit-preview dd {
  margin: 0;
  text-align: right;
}
.preview-math {
  background: var(--dark-2);
  border-radius: var(--radius);
  padding: 6px 14px;
}
.preview-math div {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
}
.preview-math span {
  color: var(--dark-muted);
  font-size: 14px;
}
.preview-math strong {
  font-size: 16px;
  font-weight: 500;
}
.preview-profit {
  border-top: 1px solid var(--dark-line);
  margin-top: 4px;
  padding-top: 12px !important;
}
.preview-profit strong {
  font-size: 26px !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em;
}
.preview-profit[data-sign="gain"] strong {
  color: var(--dark-positive);
}
.preview-profit[data-sign="loss"] strong {
  color: var(--dark-negative);
}
.preview-note {
  color: var(--dark-muted);
  font-size: 13px;
  margin: 12px 0 0;
}

/* --- Sign in and recovery -------------------------------------------------- */

.auth-shell {
  background: var(--canvas);
  display: grid;
  grid-template-columns: minmax(440px, 580px) 1fr;
  min-height: 100vh;
}
.auth-panel {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px clamp(32px, 6vw, 88px) 48px;
  position: relative;
}
.auth-brand {
  align-items: center;
  display: flex;
  gap: 11px;
  left: clamp(32px, 6vw, 88px);
  position: absolute;
  top: 36px;
}
.auth-brand .brand-mark::after {
  border-color: var(--surface);
}
.auth-brand strong,
.auth-brand small {
  display: block;
}
.auth-brand strong {
  font-size: 15px;
  line-height: 1.2;
}
.auth-brand small {
  color: var(--muted);
  font-size: 12.5px;
}
.auth-copy > p:first-child {
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}
.auth-copy h1 {
  font-size: 34px;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 8px 0 10px;
  max-width: 18ch;
}
.auth-copy > p:last-child {
  color: var(--muted);
  margin: 0;
  max-width: 44ch;
}
.auth-form {
  margin-top: 30px;
  max-width: 420px;
}
.fine-print {
  color: var(--muted);
  font-size: 13px;
  margin-top: 28px;
  max-width: 420px;
}
.fine-print a,
.legal a:not(.button, .legal-brand) {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-links {
  display: flex;
  font-size: 13px;
  gap: 16px;
  margin: 14px 0 0;
}
.legal-links a {
  color: var(--muted);
}
.legal-links a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* The privacy notice and terms: one column of reading across the whole signed-out frame. */
.legal {
  background: var(--surface);
  grid-column: 1 / -1;
  padding: 36px clamp(20px, 6vw, 88px) 72px;
}
.legal > * {
  margin-left: auto;
  margin-right: auto;
  max-width: 680px;
}
/* Clear of the theme button fixed in the corner. */
.legal-head {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 64px;
  padding-right: 48px;
}
.legal-brand {
  align-items: center;
  color: var(--ink);
  display: flex;
  font-size: 15px;
  gap: 11px;
  text-decoration: none;
}
.legal-brand .brand-mark::after {
  border-color: var(--surface);
}
.legal-head nav {
  display: flex;
  font-size: 14px;
  font-weight: 500;
  gap: 20px;
}
.legal-head nav a:not([aria-current="page"]) {
  color: var(--muted);
  text-decoration: none;
}
.legal-head nav a:hover {
  color: var(--ink);
}
.legal-updated {
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 0;
  margin-top: 0;
}
.legal h1 {
  font-size: 34px;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 12px;
  margin-top: 8px;
}
.legal-lead {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 8px;
  margin-top: 0;
}
.legal h2 {
  font-size: 18px;
  letter-spacing: -0.01em;
  margin: 36px 0 8px;
}
.legal section p,
.legal section li {
  color: var(--ink-2);
  line-height: 1.6;
}
.legal section p {
  margin: 0;
}
.legal ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}
.legal li strong {
  color: var(--ink);
}
.legal-foot {
  border-top: 1px solid var(--line);
  margin-top: 48px;
  padding-top: 24px;
}

.auth-visual {
  align-items: center;
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: 48px;
}
.stub {
  background: var(--dark);
  border-radius: 18px;
  box-shadow: 0 40px 80px -30px rgba(20, 23, 26, 0.45);
  color: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  max-width: 560px;
  min-height: 260px;
  transform: rotate(-4deg);
  width: 100%;
  /* The punched notches either side of the tear line */
  -webkit-mask:
    radial-gradient(circle 14px at calc(100% - 150px) 0, transparent 98%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle 14px at calc(100% - 150px) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
  mask:
    radial-gradient(circle 14px at calc(100% - 150px) 0, transparent 98%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle 14px at calc(100% - 150px) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
}
.stub small {
  color: var(--dark-muted);
  display: block;
  font-size: 13px;
}
.stub-main {
  display: flex;
  flex-direction: column;
  padding: 32px 34px;
}
.stub-main strong {
  font-size: 44px;
  letter-spacing: -0.035em;
  line-height: 1;
  margin-top: 6px;
}
.stub-main p {
  color: var(--dark-muted);
  font-size: 14px;
  margin: auto 0 0;
  max-width: 34ch;
  padding-top: 28px;
}
.stub-tear {
  background: repeating-linear-gradient(var(--dark-line) 0 6px, transparent 6px 12px) left / 1px 100% no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px 24px;
}
.stub-tear strong {
  color: var(--dark-positive);
  font-size: 16px;
  margin-top: 4px;
}

/* --- Not found ------------------------------------------------------------- */

.not-found-panel {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  margin-top: 6vh;
  max-width: 900px;
  min-height: 340px;
  overflow: hidden;
}
.not-found-signal {
  background: var(--dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px;
}
.not-found-signal strong {
  font-size: 84px;
  letter-spacing: -0.06em;
  line-height: 0.9;
}
.not-found-signal span {
  color: var(--dark-muted);
  font-size: 14px;
  margin-top: 12px;
}
.not-found-signal i {
  background: repeating-linear-gradient(90deg, var(--dark-line) 0 6px, transparent 6px 12px);
  height: 1px;
  margin-top: 28px;
  width: 100%;
}
.not-found-copy {
  align-self: center;
  padding: 48px 52px;
}
.not-found-copy h1 {
  font-size: 28px;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0;
}
.not-found-copy > p {
  color: var(--muted);
  margin: 10px 0 24px;
  max-width: 48ch;
}
.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.not-found-auth {
  align-items: center;
  background: var(--canvas);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 6vw;
}
.not-found-auth .not-found-panel {
  margin: 0;
  width: min(900px, 100%);
}

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

.nav-backdrop {
  background: var(--backdrop);
  inset: 0;
  position: fixed;
  z-index: 20;
}
.tab-bar {
  display: none;
}
.nav-backdrop[hidden] {
  display: none;
}
.install-app[hidden] {
  display: none;
}
.nav-back {
  align-items: center;
  color: var(--ink);
  display: flex;
  font-size: 15px;
  font-weight: 500;
  gap: 2px;
  margin-left: -8px;
  min-height: 40px;
  padding: 0 10px 0 4px;
}
.nav-back[hidden] {
  display: none;
}
.nav-back svg {
  fill: none;
  height: 22px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 22px;
}
.nav-back:not([hidden]) + .brand {
  display: none;
}
.strip-back {
  font-size: 13.5px;
  min-height: 32px;
}
.strip-back svg {
  height: 18px;
  width: 18px;
}

/* No browser chrome in the installed app, so page loads get their own indicator. */
.nav-progress {
  background: var(--accent);
  height: 2px;
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  transform: scaleX(0);
  transform-origin: left;
  width: 100%;
  z-index: 50;
}
.nav-progress.active {
  animation: nav-progress 8s cubic-bezier(0.1, 0.7, 0.2, 1) forwards;
  opacity: 1;
}
@keyframes nav-progress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(0.92);
  }
}

/* --- Phone app ------------------------------------------------------------ */

.alert-setup {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  padding: 16px 48px 16px 18px;
  position: relative;
}
.alert-setup[hidden],
.alert-setup [hidden] {
  display: none;
}
.alert-setup strong {
  display: block;
  font-size: 15px;
}
.alert-setup p {
  color: var(--ink-2);
  font-size: 14px;
  margin: 4px 0 12px;
}
.alert-setup > div > p:last-child {
  margin-bottom: 0;
}
.alert-setup .message-dismiss {
  position: absolute;
  right: 10px;
  top: 10px;
}

.setup-checklist {
  background: var(--surface);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  padding: 18px 18px 8px;
}
.setup-checklist-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}
.setup-checklist h2 {
  font-size: 16px;
  margin: 0;
}
.setup-checklist-head p {
  color: var(--muted);
  font-size: 14px;
  margin: 2px 0 0;
}
.setup-checklist ol {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.setup-checklist li {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  padding: 12px 0;
}
.setup-checklist li strong {
  font-size: 14px;
}
.setup-checklist li p {
  color: var(--muted);
  font-size: 13px;
  margin: 2px 0 0;
}
.setup-step-mark {
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 600;
  height: 28px;
  justify-content: center;
  width: 28px;
}
.setup-checklist li.next .setup-step-mark {
  border-color: var(--accent);
  color: var(--accent);
}
.setup-checklist li.done .setup-step-mark {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-ink);
}
.setup-checklist li.done strong {
  color: var(--muted);
  text-decoration: line-through;
}
@media (max-width: 760px) {
  .setup-checklist li {
    grid-template-columns: 28px minmax(0, 1fr);
  }
  .setup-checklist li .button {
    grid-column: 2;
    justify-self: start;
  }
}

.offline-shell {
  background: var(--canvas);
  display: grid;
  min-height: 100vh;
  padding: 24px 16px;
  place-items: center;
}
.offline-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  max-width: 380px;
  padding: 32px 24px;
  text-align: center;
}
.offline-panel .brand-mark {
  margin-bottom: 16px;
}
.offline-panel .brand-mark::after {
  display: none;
}
.offline-panel h1 {
  font-size: 22px;
  margin: 0 0 6px;
}
.offline-panel p {
  color: var(--muted);
  margin: 0 0 20px;
}
.offline-panel .button {
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  min-height: 52px;
}

/* Paying is the one action a hold exists for; make it hard to miss. */
.checkout-panel [data-confirm-payment] {
  font-size: 16px;
  font-weight: 600;
  min-height: 52px;
}

/* --- Responsive ------------------------------------------------------------ */

@media (max-width: 1250px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  /* Intro, fields and buttons no longer fit on one row; stack them. */
  .collection-filters {
    gap: 14px;
    grid-template-columns: minmax(0, 1fr);
  }
  .filter-intro p {
    display: inline;
    margin-left: 4px; /* plus the space between it and the <strong> */
  }
  .filter-actions {
    margin-top: 0;
  }
}

/* Below this the fixed inventory columns no longer leave room for an actions column,
   so the actions move to their own line under the row. */
@media (max-width: 1400px) {
  .inventory-columns {
    grid-template-columns: minmax(0, 1.6fr) 80px 104px 84px 124px 88px 112px;
  }
  .inventory-columns > .row-actions {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .table-head.inventory-columns > :last-child {
    display: none;
  }
}

/* Half a desktop screen has no room for six account columns: "Last accepted" and "Used by"
   fold into a line under the email, and below 900px the rows stack as on a phone. */
@media (max-width: 1250px) {
  .account-columns {
    grid-template-columns: minmax(0, 1.4fr) minmax(128px, 1fr) 170px 44px;
  }
  .account-columns > .account-last,
  .account-columns > .account-rules {
    display: none;
  }
  .account-meta {
    display: block !important;
  }
}
@media (max-width: 900px) {
  .table-head.account-columns {
    display: none;
  }
  .table-row.account-columns {
    align-items: start;
    gap: 8px 14px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 16px;
  }
  .table-row.account-columns > * {
    grid-column: 1;
  }
  .table-row.account-columns > .status {
    grid-column: 2;
    grid-row: 1;
  }
  .table-row.account-columns > .account-menu-actions {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }
}
@media (max-width: 1050px) {
  :root {
    --rail: 220px;
  }
  .control-panel.span-1,
  .control-panel.span-2 {
    grid-column: 1 / -1;
  }
  .account-columns .row-actions {
    grid-column: auto;
    justify-content: flex-end;
    margin-left: 0;
  }
  .history-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .history-facts span:nth-child(4) {
    border-left: 0;
  }
  .log-filters {
    grid-template-columns: 1fr 1fr;
  }
  .log-columns {
    grid-template-columns: 100px 1fr 100px 100px;
  }
  .audit-columns {
    grid-template-columns: 130px minmax(0, 1fr) 140px minmax(0, 1fr);
  }
  .audit-columns > :nth-child(5),
  .audit-columns > :nth-child(6) {
    grid-column: 1 / -1;
  }
  .log-columns > *:nth-child(5),
  .log-columns > *:nth-child(6) {
    display: none;
  }
  /* The correlation column is hidden here, so its link stays as an invisible layer over the row. */
  .log-columns > .row-link {
    align-self: stretch;
    display: block;
    inset: 0;
    justify-self: stretch;
    position: absolute;
  }
  .log-columns > .row-link > * {
    display: none;
  }
  .split-layout {
    grid-template-columns: 1fr;
  }
  .auth-visual {
    display: none;
  }
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-panel {
    border-right: 0;
    min-height: 100vh;
  }
  /* minmax(0, …): a bare 1fr column grows to fit unbreakable content and pushes the page wider than the screen. */
  .checkout-layout,
  .queue-checkout {
    grid-template-columns: minmax(0, 1fr);
  }
  .chart-grid {
    grid-template-columns: 1fr;
  }
  .chart-card,
  .chart-card.third {
    grid-column: 1 / -1;
  }
  .ledger-columns {
    grid-template-columns: 90px minmax(0, 1.6fr) 52px 92px 100px 116px;
  }
  .ledger-columns > :nth-child(3),
  .ledger-columns > :nth-child(6) {
    display: none;
  }
  .inventory-columns {
    grid-template-columns: minmax(0, 1.6fr) 80px 84px 124px 112px;
  }
  .inventory-columns > :nth-child(3),
  .inventory-columns > :nth-child(6) {
    display: none;
  }
}

/* Five inventory columns stop fitting well before the phone layout starts (the event
   name collapses to nothing), so inventory switches to stacked cards early. */
@media (max-width: 900px) {
  .table-head.inventory-columns {
    display: none;
  }
  .sort-bar.inventory-sort {
    border-bottom: 1px solid var(--line);
    display: flex;
  }
  /* The purchase and its transfer state across the top, then its figures in labelled
     pairs (the column names are gone with the header), then the actions. */
  .table-row.inventory-columns {
    align-items: start;
    gap: 12px 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px;
  }
  .table-row.inventory-columns > * {
    grid-column: 1 / -1;
  }
  .table-row.inventory-columns > .bulk-cell {
    order: -2;
  }
  .table-row.inventory-columns > .status {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-self: start;
    order: -1;
  }
  .table-row.inventory-columns > [data-label] {
    display: block;
    grid-column: auto;
  }
  .inventory-columns > [data-label]::before {
    color: var(--muted);
    content: attr(data-label);
    display: block;
    font-size: 11.5px;
    font-weight: 500;
    margin-bottom: 2px;
  }
  .table-row.inventory-columns > .profit-stack {
    text-align: left;
  }
}

@media (max-width: 760px) {
  .hold-section {
    padding: 16px 14px;
  }
  .hold-card {
    grid-template-areas: "art main" "clock pay" "warn warn" "more more";
    grid-template-columns: 64px minmax(0, 1fr);
    padding: 12px 12px 0;
    row-gap: 12px;
  }
  .hold-clock {
    height: 64px;
    width: 64px;
  }
  .hold-seconds {
    font-size: 15px;
  }
  .hold-pay {
    align-items: center;
    column-gap: 12px;
    grid-template-columns: auto 1fr;
    justify-items: start;
    text-align: left;
  }
  .hold-pay small {
    grid-column: 1;
  }
  .hold-pay strong {
    grid-column: 1;
    margin: 0;
  }
  .hold-pay > a,
  .hold-pay > form {
    grid-column: 2;
    grid-row: 1 / 3;
    justify-self: stretch;
  }
  /* It shares the line with the total, so on a narrow phone it gives up its desktop width. */
  .hold-pay-button {
    min-height: 48px;
    min-width: 0;
    width: 100%;
  }
  .hold-pay small {
    white-space: nowrap;
  }
  .hold-warning {
    margin-top: 0;
  }
  /* A row of small text actions under a thumb: each gets a finger-sized strip to land on. */
  .hold-more {
    gap: 0 20px;
    margin-top: 12px;
    padding: 2px 0;
  }
  .hold-more > .bulk-check,
  .hold-more > .hold-star,
  .hold-more > .table-action,
  .hold-more > .hold-ignore,
  .hold-more > form > button {
    align-items: center;
    display: inline-flex;
    min-height: 40px;
  }
  .section-head:has(> .queue-start) {
    flex-wrap: wrap;
  }
  .section-head > .queue-start {
    flex-basis: 100%;
    order: 5;
  }
  .section-head > .queue-start ~ .bulk-all {
    margin-left: auto;
  }
  .queue-start .button {
    min-height: 44px;
    width: 100%;
  }
}

@media (max-width: 760px) {
  :root {
    --strip: 44px;
    --tab-bar: 56px;
    --tab-bar-space: calc(var(--tab-bar) + env(safe-area-inset-bottom));
  }
  .app-shell {
    margin-left: 0;
  }
  /* Phones have the tab bar and the More sheet in place of the rail. */
  .rail {
    display: none;
  }
  .avatar-dot {
    border-color: var(--surface);
  }
  body.nav-open {
    overflow: hidden;
  }
  body.nav-open .nav-backdrop {
    animation: fade-in 0.22s ease;
  }
  /* The app bar holds the way back and the menu, so it stays in reach while reading. */
  .mobile-bar {
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    height: 56px;
    justify-content: space-between;
    padding: 8px 16px;
    position: sticky;
    top: 0;
    z-index: 5;
  }
  .system-strip {
    position: static;
  }
  .strip-back {
    display: none;
  }
  .mobile-bar .brand {
    padding: 0;
  }
  .mobile-bar .brand strong {
    font-size: 15px;
    transition: opacity 0.18s ease;
  }
  /* The page's name, in the middle of the bar once its heading has scrolled up under it.
     The brand gives up its name to make room, keeping its mark. */
  .bar-title {
    bottom: 0;
    display: block;
    font-size: 16px;
    font-weight: 600;
    height: 56px;
    left: 64px;
    letter-spacing: -0.01em;
    line-height: 56px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    position: absolute;
    right: 64px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: translateY(6px);
    transition:
      opacity 0.18s ease,
      transform 0.18s ease;
  }
  .bar-title:empty {
    display: none;
  }
  .mobile-bar.is-condensed .bar-title {
    opacity: 1;
    transform: none;
  }
  .mobile-bar.is-condensed .brand strong {
    opacity: 0;
  }
  .mobile-bar.is-condensed {
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
    background: var(--glass);
  }

  /* A page below a section (a form, a checkout) drops the tab bar, as an app's pushed
     screens do; what was sticky above the tab bar sits at the foot, clear of the home
     indicator. */
  body.no-tab-bar {
    --tab-bar-space: 0px;
  }
  body.no-tab-bar .tab-bar {
    display: none;
  }
  body.no-tab-bar main#main-content {
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }
  body.no-tab-bar .sticky-actions,
  body.no-tab-bar .bulk-bar {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  body.no-tab-bar .checkout-panel [data-confirm-payment] {
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .mobile-bar .brand-mark {
    border-radius: 8px;
    font-size: 15px;
    height: 30px;
    width: 30px;
  }
  .mobile-bar,
  .tab-bar,
  .rail nav,
  .system-strip {
    -webkit-user-select: none;
    user-select: none;
  }
  .mobile-bar a,
  .tab-bar a,
  .rail nav a {
    -webkit-touch-callout: none;
  }

  .tab-bar {
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
    background: var(--glass);
    border-top: 1px solid var(--line);
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    left: 0;
    padding: 0 max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-left));
    position: fixed;
    right: 0;
    transition: transform 0.2s ease;
    z-index: 15;
  }
  .tab-bar a,
  .tab-bar button {
    align-items: center;
    background: none;
    border: 0;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    font-size: 11px;
    font-weight: 500;
    gap: 3px;
    height: var(--tab-bar);
    justify-content: center;
    letter-spacing: 0.01em;
    padding: 0;
    transition:
      color 0.12s ease,
      transform 0.1s ease;
  }
  .tab-bar a:active,
  .tab-bar button:active {
    transform: scale(0.92);
  }
  .tab-bar [aria-current="page"],
  .tab-bar [aria-expanded="true"] {
    color: var(--ink);
  }
  .tab-icon {
    display: grid;
    height: 26px;
    place-items: center;
    position: relative;
    width: 44px;
  }
  .tab-bar [aria-current="page"] .tab-icon {
    background: var(--accent-soft);
    border-radius: 999px;
  }
  .tab-bar svg {
    fill: none;
    height: 22px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
    width: 22px;
  }
  .tab-bar [aria-current="page"] svg {
    stroke: var(--accent);
    stroke-width: 2;
  }
  .tab-bar .nav-count {
    font-size: 10.5px;
    height: 17px;
    left: 50%;
    min-width: 17px;
    padding: 0 5px;
    position: absolute;
    top: -4px;
  }
  body.keyboard-open .tab-bar {
    transform: translateY(100%);
  }
  body.keyboard-open {
    --tab-bar-space: 0px;
  }

  /* Taps answer at once, as there is no hover to preview them. */
  .button:active:not(:disabled),
  .nav-back:active,
  .theme-toggle:active,
  .live-toggle:active {
    transform: scale(0.97);
  }
  .button {
    transition:
      background-color 0.12s ease,
      border-color 0.12s ease,
      transform 0.1s ease;
  }
  a.table-row:active,
  .rail nav a:active {
    background: var(--hover);
  }
  /* iOS zooms into any field set below 16px when it takes focus. */
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px !important;
  }
  .system-strip {
    gap: 12px;
    padding: 0 16px;
  }
  .strip-window {
    display: none;
  }
  .live-toggle span {
    display: none;
  }
  .live-toggle {
    padding: 6px 8px;
  }
  main#main-content {
    padding: 24px 16px calc(40px + var(--tab-bar-space));
  }
  .maintenance-banner {
    margin-top: 12px;
    width: calc(100% - 32px);
  }
  .messages {
    left: 16px;
    right: 16px;
    top: calc(56px + var(--strip) + 10px);
  }
  .message {
    max-width: none;
  }

  .page-head {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 22px;
  }
  .page-head h1 {
    font-size: 26px;
  }
  .page-head p {
    font-size: 14px;
  }
  .page-head .button {
    white-space: nowrap;
  }
  .head-metrics {
    width: 100%;
  }
  .head-metrics div {
    flex: 1;
    min-width: 0;
  }
  .head-actions,
  .page-head > .form-actions {
    flex-wrap: wrap;
  }
  .page-head > .form-actions {
    justify-content: flex-start;
    margin-top: 0;
  }

  .work-status {
    grid-template-columns: 1fr 1fr;
  }
  .work-status > div {
    padding: 14px 16px;
  }
  .work-status > div:first-child {
    border-bottom: 1px solid var(--dark-line);
    grid-column: 1 / -1;
  }
  .work-status > div:nth-child(2) {
    border-left: 0;
  }
  .control-grid {
    gap: 16px;
  }
  .queue-panel,
  .action-panel,
  .recent-strip {
    padding: 18px;
  }
  .queue-panel > .pagination {
    margin: 12px -18px -18px;
    padding: 10px 18px;
  }
  .timeline-item {
    grid-template-columns: 40px 16px 1fr;
  }
  .timeline-item::before {
    left: 46px;
  }
  /* The event's name gets the line to itself, with when it happened under it, so it is
     not cut to a few letters beside the time and status. */
  .compact-row {
    gap: 2px 12px;
    grid-template-areas: "event status" "time status";
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .compact-row > strong {
    grid-area: event;
  }
  .compact-row > time {
    font-size: 12.5px;
    grid-area: time;
  }
  .compact-row > .status {
    grid-area: status;
  }
  .compact-row > span:nth-child(3),
  .compact-row > span:nth-child(5) {
    display: none;
  }

  .table-head {
    display: none !important;
  }
  .table-row,
  .account-columns,
  .mailbox-columns,
  .log-columns,
  .audit-columns,
  .invite-columns,
  .failed-alert-columns,
  .access-columns,
  .group-columns,
  .user-account-columns,
  .user-rule-columns,
  .user-reservation-columns,
  .ledger-columns,
  .inventory-columns,
  .operation-columns,
  .step-columns {
    align-items: start;
    display: grid;
    gap: 8px 14px;
    grid-template-columns: 1fr auto;
    padding: 16px;
  }
  .table-row > * {
    grid-column: 1;
  }
  .table-row > .status {
    grid-column: 2;
    grid-row: 1;
  }
  .account-columns .account-menu-actions {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }
  .log-columns > *:nth-child(5),
  .log-columns > *:nth-child(6) {
    display: none;
  }
  .log-columns > .row-link {
    align-self: auto;
    display: inline-flex;
    justify-self: start;
    position: static;
  }
  .log-columns > .row-link > * {
    display: revert;
  }
  .operation-columns > *:nth-child(6),
  .step-columns > .stage-tag {
    display: none;
  }
  .operation-columns > *:nth-child(5),
  .step-columns > *:nth-child(5) {
    text-align: left;
  }
  .step-columns .call-sizes {
    justify-content: start;
  }
  .operation-pipeline {
    grid-template-columns: 1fr 1fr;
  }
  .waterfall {
    --wf-label: 150px;
    --wf-gutter: 16px;
  }
  .wf-jumps {
    margin-left: 0;
  }
  .wf-tick.minor {
    visibility: hidden;
  }
  .wf-label-col {
    padding: 0 8px 0 12px;
  }
  .wf-row .step-method {
    flex-basis: 34px;
  }
  .wf-value:not(:has(.wf-failed)) {
    display: none;
  }
  /* With the header row hidden, each sale becomes a card: event and profit on top,
     then a labelled grid of the remaining figures. */
  .table-row.ledger-columns {
    grid-template-areas: "event event profit" "sold via qty" "price costs ." "actions actions actions";
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 12px;
  }
  .ledger-columns > :nth-child(3),
  .ledger-columns > :nth-child(6) {
    display: block;
  }
  .ledger-columns > :nth-child(1) {
    grid-area: sold;
  }
  .ledger-columns > :nth-child(2) {
    grid-area: event;
  }
  .ledger-columns > :nth-child(3) {
    grid-area: via;
  }
  .ledger-columns > :nth-child(4) {
    grid-area: qty;
  }
  .ledger-columns > :nth-child(5) {
    grid-area: price;
  }
  .ledger-columns > :nth-child(6) {
    grid-area: costs;
  }
  .ledger-columns > .profit-cell {
    font-size: 16px;
    grid-area: profit;
    text-align: right;
  }
  .ledger-columns > .row-actions {
    grid-area: actions;
  }
  .ledger-columns > [data-label]::before,
  .group-columns > [data-label]::before {
    color: var(--muted);
    content: attr(data-label);
    display: block;
    font-size: 11.5px;
    font-weight: 500;
    margin-bottom: 2px;
  }
  .inventory-columns > :nth-child(3),
  .inventory-columns > :nth-child(6) {
    display: block;
  }
  .row-actions {
    justify-content: flex-start;
    margin-left: -8px;
  }

  .form-panel,
  .form-panel.single {
    display: block;
    padding: 20px;
  }
  .form-panel aside {
    margin-top: 24px;
  }
  .field-weekdays > div {
    grid-template-columns: 1fr 1fr;
  }
  .rule-form-section,
  .settings-form-section {
    display: block;
    padding: 22px 0;
  }
  .rule-form-section header,
  .settings-form-section header {
    margin-bottom: 16px;
  }
  .policy-fields,
  .time-fields {
    grid-template-columns: 1fr;
  }
  .rule-preview-column,
  .profit-preview {
    position: static;
  }
  .day-entry-grid {
    grid-template-columns: 84px minmax(0, 1fr) minmax(0, 1fr);
  }
  .sticky-actions {
    bottom: var(--tab-bar-space);
    margin: 16px -16px 0;
    padding: 12px 16px;
  }
  .bulk-bar {
    bottom: var(--tab-bar-space);
    padding: 12px 16px;
  }
  .bulk-bar .button {
    min-height: 44px;
  }

  /* The state column becomes a strip across the top, giving the rule the full width. */
  .rule-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .rule-state {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    flex-direction: row;
    justify-content: flex-start;
    padding: 7px 16px;
  }
  .rule-main {
    padding: 16px;
  }
  .rule-facts {
    display: grid;
    gap: 10px 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rule-facts .wide {
    grid-column: 1 / -1;
  }

  .history-timeline {
    padding: 4px 14px;
  }
  .history-item {
    grid-template-columns: 48px 18px 1fr;
  }
  .history-time {
    padding-right: 8px;
  }
  .history-time time {
    font-size: 14px;
  }
  .history-pin {
    margin-left: 3px;
  }
  .history-item::before {
    left: 55px;
  }
  .history-body {
    padding-left: 8px;
  }
  .history-facts {
    grid-template-columns: 1fr 1fr;
  }
  /* The account (label and email) takes a line of its own rather than breaking mid-address;
     the rest pair up beneath it. */
  .history-facts span:first-child {
    grid-column: 1 / -1;
  }
  .history-facts span:nth-child(even) {
    border-left: 0;
  }
  .history-facts span:nth-child(odd):not(:first-child) {
    border-left: 1px solid var(--line);
  }
  .trace div {
    display: block;
  }

  .log-filters {
    grid-template-columns: 1fr;
  }
  .collection-filters {
    display: block;
    padding: 6px 16px;
  }
  .collection-filters.is-open {
    padding-bottom: 16px;
  }
  .filter-intro > strong,
  .filter-intro > p {
    display: none;
  }
  .filter-toggle {
    align-items: center;
    background: none;
    border: 0;
    color: inherit;
    display: flex;
    font: inherit;
    gap: 12px;
    justify-content: space-between;
    min-height: 48px;
    padding: 6px 0;
    text-align: left;
    width: 100%;
  }
  .filter-toggle > span:first-child {
    min-width: 0;
  }
  .filter-toggle strong {
    display: block;
    font-size: 14.5px;
  }
  .filter-toggle small {
    color: var(--muted);
    display: block;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .filter-toggle-label {
    color: var(--accent);
    flex: none;
    font-size: 14px;
    font-weight: 500;
  }
  .collection-filters:not(.is-open) .filter-body {
    display: none;
  }
  .collection-filters.is-open .filter-body {
    display: block;
  }
  .filter-fields {
    grid-template-columns: 1fr !important;
    margin: 14px 0;
  }
  .filter-actions {
    margin-top: 0;
  }
  .filter-actions .button {
    flex: 1;
  }
  .pagination {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
  .pagination-controls {
    justify-content: space-between;
  }

  .split-layout {
    display: block;
  }
  .split-layout > * {
    margin-bottom: 16px;
  }
  .user-operations-strip {
    grid-template-columns: 1fr 1fr;
  }
  .user-operations-strip > div {
    padding: 14px 16px;
  }
  .user-operations-strip > div:nth-child(2n + 1) {
    border-left: 0;
  }
  .user-operations-strip > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .checkout-summary,
  .checkout-panel {
    padding: 18px;
  }
  .checkout-summary .countdown {
    font-size: 20px;
  }
  /* Kept in reach of the thumb while the card form scrolls past. */
  .checkout-panel [data-confirm-payment] {
    border-radius: 12px;
    bottom: calc(12px + var(--tab-bar-space));
    box-shadow: var(--shadow-pop);
    font-size: 17px;
    min-height: 56px;
    position: sticky;
    z-index: 3;
  }
  .checkout-panel [data-checkout-done] {
    min-height: 48px;
  }
  .item-actions .checkout-actions {
    width: 100%;
  }
  .queue-step-summary h2 {
    font-size: 20px;
  }
  .queue-step-actions .button {
    min-height: 44px;
  }
  .queue-step-actions .table-action,
  .queue-step-actions .hold-ignore {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .queue-notice .button {
    min-height: 48px;
  }
  .queue-rail {
    padding: 16px;
  }
  .queue-list {
    margin: 10px -8px 0;
  }
  .queue-entry {
    gap: 10px;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    padding: 10px 8px;
  }
  .queue-entry-main > a {
    padding: 4px 0;
  }
  .item-actions .checkout-actions .button {
    flex: 1;
    font-size: 15px;
    min-height: 48px;
  }
  .item-actions .checkout-actions .button.primary {
    font-weight: 600;
  }
  .timeline-item .countdown {
    font-size: 16px;
  }
  .system-strip:has(.install-app:not([hidden])) .strip-clock {
    display: none;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi.hero {
    grid-column: 1 / -1;
  }
  .kpi:last-child:nth-child(even) {
    grid-column: 1 / -1;
  }
  .kpi > strong {
    font-size: 22px;
  }
  .kpi.hero > strong {
    font-size: 32px;
  }
  .chart-card {
    padding: 16px 14px;
  }
  .revenue-section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .channel-columns {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .table-head.channel-columns > :nth-child(n + 3),
  .channel-columns > [data-label="Last sale"] {
    display: none;
  }
  .channel-rename {
    grid-column: 1 / -1;
  }
  .channel-uses-unit {
    display: inline;
  }
  .stock-pointer {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-panel {
    justify-content: flex-start;
    padding: 104px 20px 36px;
  }
  .auth-brand {
    left: 20px;
    top: 28px;
  }
  .auth-copy h1 {
    font-size: 28px;
  }

  .not-found-panel {
    display: block;
    margin-top: 2vh;
    min-height: 0;
  }
  .not-found-signal {
    min-height: 150px;
    padding: 24px;
  }
  .not-found-signal strong {
    font-size: 60px;
  }
  .not-found-copy {
    padding: 28px 22px 32px;
  }
  .not-found-copy h1 {
    font-size: 24px;
  }
  .not-found-actions .button {
    width: 100%;
  }
  .not-found-auth {
    padding: 16px;
  }
}

/* Installed app: clear the notch, and behave like an app rather than a web page. */
@media (display-mode: standalone) {
  .mobile-bar {
    height: auto;
    min-height: 56px;
    padding-top: max(8px, env(safe-area-inset-top));
  }
  /* No rubber-banding past the app bar; pull-to-refresh (pwa.js) stands in for the browser's. */
  html,
  body {
    overscroll-behavior-y: none;
  }
}
@media (display-mode: standalone) and (min-width: 761px) {
  main#main-content {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }
}
@media (display-mode: standalone) and (max-width: 760px) {
  .messages {
    top: calc(56px + env(safe-area-inset-top) + var(--strip) + 10px);
  }
}

.pull-refresh {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: var(--shadow-pop);
  color: var(--muted);
  display: flex;
  height: 38px;
  justify-content: center;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: calc(env(safe-area-inset-top) + 40px);
  transform: translate(-50%, 0);
  width: 38px;
  z-index: 25;
}
.pull-refresh.settling {
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}
.pull-refresh.ready {
  color: var(--accent);
}
.pull-refresh svg {
  fill: none;
  height: 20px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  width: 20px;
}
.pull-refresh.refreshing svg {
  animation: spin 0.7s linear infinite;
}

/* Swiping in from the left edge of the installed iPhone app goes back (pwa.ts), as the
   system does in other apps; this follows the finger and fills in once letting go will go. */
.edge-back {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: var(--shadow-pop);
  color: var(--muted);
  display: flex;
  height: 40px;
  justify-content: center;
  left: -44px;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: 50%;
  width: 40px;
  z-index: 25;
}
.edge-back.settling {
  transition:
    transform 0.22s ease,
    opacity 0.22s ease;
}
.edge-back.ready {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-ink);
}
.edge-back svg {
  fill: none;
  height: 20px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  width: 20px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}

/* Rule editor: what to watch. */
.rule-editor [hidden] {
  display: none !important;
}
.target-search {
  position: relative;
}
.field .target-search input[type="search"] {
  background: var(--surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238d949a' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='6.2' cy='6.2' r='4.2'/%3E%3Cpath d='m9.5 9.5 3 3'/%3E%3C/svg%3E")
    13px center / 15px no-repeat;
  font-size: 15px;
  min-height: 46px;
  padding-left: 38px;
  padding-right: 40px;
}
.target-spinner {
  animation: spin 0.7s linear infinite;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  border-top-color: var(--accent);
  height: 16px;
  position: absolute;
  right: 14px;
  top: 15px;
  width: 16px;
}
.target-results {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  left: 0;
  max-height: min(420px, 60vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
}
.target-group {
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin: 8px 8px 4px;
  text-transform: uppercase;
}
.target-option {
  align-items: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  gap: 11px;
  padding: 8px;
}
.target-option:hover,
.target-option[aria-selected="true"] {
  background: var(--hover);
}
.target-option[aria-selected="true"] {
  box-shadow: inset 0 0 0 1px var(--accent-border);
}
.target-option-text,
.target-card-text,
.ticket-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.target-option-text strong,
.target-card-text strong,
.ticket-text strong {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.target-option-text small,
.target-card-text small,
.ticket-text small {
  color: var(--muted);
  font-size: 12.5px;
  margin: 1px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.target-thumb {
  background: var(--chip);
  border-radius: var(--radius-sm);
  flex: none;
  height: 40px;
  object-fit: cover;
  width: 40px;
}
.target-thumb.placeholder {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-weight: 600;
  justify-content: center;
}
.target-thumb.placeholder.kind-event {
  background: var(--accent-soft);
  color: var(--accent);
}
.target-thumb.placeholder.kind-venue {
  background: var(--blue-soft);
  color: var(--blue);
}
.target-empty {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
  padding: 12px 10px;
}
.target-empty.inline {
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 12px 14px;
}
.target-empty[data-tone="error"] {
  background: var(--red-soft);
  border-color: transparent;
  color: var(--red-ink);
}
.target-empty[data-tone="warning"] {
  background: var(--amber-soft);
  border-color: var(--amber-border);
  border-style: solid;
  color: var(--amber-ink);
}
.pick-mode {
  border: 0;
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
}
.pick-mode legend {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  padding: 0;
}
.field .pick-mode-choice {
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  font-weight: 500;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
}
.pick-mode-choice:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}
.pick-mode-choice input {
  margin-top: 2px !important;
}
.pick-mode-choice small {
  color: var(--muted);
  display: block;
  font-size: 12.5px;
  font-weight: 400;
  margin-top: 2px;
}
.target-card {
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  display: flex;
  gap: 12px;
  padding: 10px 12px;
}
.target-card .target-thumb {
  height: 52px;
  width: 52px;
}
/* The venue card has two buttons; on a phone they drop under the name. */
.target-venue .target-card {
  flex-wrap: wrap;
}
.target-card-text strong {
  display: -webkit-box;
  font-size: 15.5px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  white-space: normal;
}
/* Ticket names carry the entry time or release, so they wrap rather than truncate. */
.ticket-text strong,
.ticket-text small {
  overflow-wrap: anywhere;
  white-space: normal;
}
.kind-chip {
  align-self: flex-start;
  background: var(--surface);
  border-radius: 999px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
  padding: 1px 8px;
  text-transform: uppercase;
}
.kind-chip.kind-venue {
  color: var(--blue);
}
.kind-chip.kind-organiser {
  color: var(--ink-2);
}
.target-status {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 0;
}
.target-status:empty {
  display: none;
}
.field small.target-hint {
  margin: 0 0 10px;
}
.target-event-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px;
}
/* Ticket boards open under ticked events: let the page scroll rather than a box inside it. */
.target-event-list:has(.event-ticket-board:not([hidden])) {
  max-height: none;
  overflow: visible;
}
.field .target-event {
  padding: 8px 12px;
}
.target-event .target-thumb {
  height: 34px;
  width: 34px;
}
.target-event.is-missing {
  opacity: 0.7;
}
.target-event-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.event-ticket-board {
  border-left: 2px solid var(--accent-border);
  margin-left: 20px;
  padding: 2px 0 6px 14px;
}
.event-ticket-board .target-group {
  margin: 2px 0 0;
}
.target-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.ticket-board {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ticket-summary {
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 13.5px;
  margin: 0;
  padding: 9px 12px;
}
.ticket-summary strong {
  font-weight: 600;
}
.ticket-picks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ticket-pick {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  padding: 6px 8px 6px 12px;
  transition:
    border-color 0.12s ease,
    background-color 0.12s ease;
}
.ticket-pick:hover {
  border-color: var(--border-hover);
}
.ticket-pick.is-picked {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}
.ticket-pick:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.field .ticket-pick-main {
  align-items: center;
  cursor: pointer;
  display: flex;
  flex: 1;
  font-weight: 400;
  gap: 10px;
  margin: 0;
  min-width: 0;
  padding: 4px 0;
}
.ticket-pick-main input:focus-visible {
  outline: none;
}
.ticket-rank {
  align-items: center;
  background: var(--accent);
  border-radius: 50%;
  color: var(--on-ink);
  display: inline-flex;
  flex: none;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  height: 22px;
  justify-content: center;
  width: 22px;
}
.ticket-state {
  border-radius: 999px;
  flex: none;
  font-size: 11.5px;
  font-weight: 500;
  padding: 2px 8px;
  white-space: nowrap;
}
.ticket-state.state-available {
  background: var(--accent-soft);
  color: var(--accent);
}
.ticket-pick.is-picked .ticket-state.state-available {
  background: var(--surface);
}
.ticket-state.state-sold_out,
.ticket-state.state-ended {
  background: var(--red-soft);
  color: var(--red);
}
.ticket-state.state-upcoming {
  background: var(--amber-soft);
  color: var(--amber);
}
.ticket-state.state-locked,
.ticket-state.state-missing {
  background: var(--chip);
  color: var(--muted);
}
/* Spelt like the rule that sizes every field's inputs, so this one's size wins over it. */
.field .ticket-pick input.ticket-promo:not([type="checkbox"]):not([type="radio"]) {
  flex: none;
  font-size: 13px;
  height: 32px;
  margin: 0;
  min-height: 0;
  padding: 0 8px;
  width: 130px;
}
.ticket-move {
  display: flex;
  flex: none;
  gap: 2px;
}
.ticket-move button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font-size: 15px;
  height: 32px;
  justify-content: center;
  padding: 0;
  width: 32px;
}
.ticket-move button:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--border-hover);
}
.ticket-move button:disabled {
  cursor: default;
  opacity: 0.35;
}
.ticket-move button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.rule-target {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 13.5px;
  gap: 7px;
  margin: 2px 0 0;
  min-width: 0;
}
.rule-target > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rule-target .kind-chip {
  background: var(--chip);
  margin: 0;
}
@media (max-width: 760px) {
  .ticket-pick {
    flex-wrap: wrap;
  }
  .field .ticket-pick-main {
    flex-basis: 100%;
  }
  .ticket-pick .ticket-state {
    margin-left: 32px;
  }
  .field .ticket-pick input.ticket-promo:not([type="checkbox"]):not([type="radio"]) {
    flex: 1;
    height: 40px;
    min-width: 0;
    width: auto;
  }
  .ticket-move {
    margin-left: auto;
  }
  .ticket-move button {
    height: 40px;
    width: 40px;
  }
}

/* The phone's More sheet (shell/MoreSheet.tsx): every section without a tab, the
   administration pages and the account's own, rising from the bottom over the tab bar. */
.more-sheet {
  display: none;
}
@media (max-width: 760px) {
  .more-sheet {
    background: var(--surface);
    border-radius: 18px 18px 0 0;
    bottom: 0;
    box-shadow: 0 -10px 34px rgb(0 0 0 / 0.18);
    display: block;
    left: 0;
    max-height: calc(100dvh - 40px - env(safe-area-inset-top));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px max(16px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
    position: fixed;
    right: 0;
    transform: translateY(105%);
    transition:
      transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
      visibility 0s linear 0.3s;
    visibility: hidden;
    -webkit-user-select: none;
    user-select: none;
    z-index: 25;
  }
  .more-sheet.is-open {
    transform: translateY(var(--sheet-drag, 0px));
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    visibility: visible;
  }
  .more-sheet.is-dragging {
    transition: none;
  }
  .sheet-grabber {
    background: var(--line-strong);
    border-radius: 3px;
    height: 5px;
    margin: 2px auto 10px;
    width: 38px;
  }
  .sheet-head {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
  }
  .sheet-who {
    align-items: center;
    color: var(--ink);
    display: flex;
    flex: 1;
    gap: 12px;
    min-width: 0;
    text-decoration: none;
  }
  .sheet-who .avatar {
    flex: none;
    font-size: 16px;
    height: 42px;
    width: 42px;
  }
  .sheet-who > span:last-child {
    min-width: 0;
  }
  .sheet-who strong,
  .sheet-who small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sheet-who strong {
    font-size: 16px;
  }
  .sheet-who small {
    color: var(--muted);
    font-size: 13px;
  }
  .sheet-close {
    align-items: center;
    background: var(--surface-2);
    border: 0;
    border-radius: 50%;
    color: var(--muted);
    display: flex;
    flex: none;
    height: 36px;
    justify-content: center;
    width: 36px;
  }
  .sheet-close svg,
  .sheet-tile-icon svg,
  .sheet-list svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .sheet-close svg {
    height: 18px;
    stroke-width: 2;
    width: 18px;
  }
  .sheet-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .sheet-grid a {
    align-items: center;
    background: var(--surface-2);
    border-radius: 14px;
    color: var(--ink-2);
    display: flex;
    flex-direction: column;
    font-size: 12.5px;
    font-weight: 500;
    gap: 7px;
    min-width: 0;
    padding: 12px 4px 10px;
    text-align: center;
    text-decoration: none;
    -webkit-touch-callout: none;
    transition: transform 0.1s ease;
  }
  .sheet-grid a > span:last-child {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sheet-grid a:active {
    background: var(--hover);
    transform: scale(0.96);
  }
  .sheet-grid a[aria-current="page"] {
    background: var(--accent-soft);
    color: var(--accent);
  }
  .sheet-tile-icon {
    align-items: center;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
    display: flex;
    height: 40px;
    justify-content: center;
    position: relative;
    width: 40px;
  }
  .sheet-tile-icon svg {
    height: 22px;
    stroke-width: 1.7;
    width: 22px;
  }
  .sheet-tile-icon .nav-count {
    font-size: 10.5px;
    height: 17px;
    min-width: 17px;
    padding: 0 5px;
    position: absolute;
    right: -9px;
    top: -6px;
  }
  .sheet-head + section .sheet-label {
    margin-top: 4px;
  }
  .sheet-part {
    border-top: 1px solid var(--line);
    font-size: 15px;
    font-weight: 600;
    margin: 22px 0 0;
    padding-top: 18px;
  }
  .sheet-part + section .sheet-label {
    margin-top: 10px;
  }
  .sheet-label {
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 20px 2px 8px;
  }
  .sheet-list {
    border-top: 1px solid var(--line);
    display: grid;
    margin-top: 20px;
  }
  .sheet-list > a,
  .sheet-list .account-menu-sign-out button {
    align-items: center;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    display: flex;
    font-size: 15.5px;
    font-weight: 500;
    gap: 14px;
    min-height: 52px;
    padding: 0 4px;
    text-align: left;
    text-decoration: none;
    width: 100%;
  }
  .sheet-list > a:active,
  .sheet-list .account-menu-sign-out button:active {
    background: var(--hover);
  }
  .sheet-list > a[aria-current="page"] {
    color: var(--accent);
  }
  .sheet-list svg {
    color: var(--muted);
    flex: none;
    height: 20px;
    stroke-width: 1.75;
    width: 20px;
  }
  .sheet-list .nav-count {
    margin-left: auto;
  }
  .sheet-list .account-menu-sign-out {
    margin: 0;
  }
  .sheet-list .account-menu-sign-out button,
  .sheet-list .account-menu-sign-out svg {
    border-bottom: 0;
    color: var(--red);
  }
  .sheet-list .appearance {
    border: 0;
    border-bottom: 1px solid var(--line);
    gap: 10px;
    margin: 0;
    min-width: 0;
    padding: 14px 4px;
  }
  .sheet-list .appearance .row-menu-label {
    font-size: 13px;
    padding: 0;
  }
  .sheet-list .appearance-themes {
    margin: 0;
  }
  .sheet-list .appearance-themes button {
    background: none;
    border: 0;
    border-radius: 6px;
    color: var(--muted);
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 6px;
  }
  .sheet-list .appearance-themes button[aria-pressed="true"] {
    background: var(--surface);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.12);
    color: var(--ink);
  }
  .sheet-list .density-switch {
    display: none;
  }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .more-sheet,
  .more-sheet.is-open {
    transition: none;
  }
}

/* Moving between pages on a phone: the bars stay put and the page slides in, as an app would. */
@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
  .mobile-bar {
    view-transition-name: app-bar;
  }
  .tab-bar {
    view-transition-name: tab-bar;
  }
  ::view-transition-old(root) {
    animation: page-out 0.16s ease-in both;
  }
  ::view-transition-new(root) {
    animation: page-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
}
@keyframes page-out {
  to {
    opacity: 0;
  }
}
@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* --- Workers ---------------------------------------------------------------- */

.worker-section {
  margin-bottom: 20px;
}
.worker-section .user-section-head h2 {
  font-size: 16px;
  margin: 0;
}
.worker-section .user-section-head p {
  color: var(--muted);
  font-size: 13.5px;
  margin: 2px 0 0;
}
.worker-section .user-section-head.section-head {
  align-items: center;
  flex-wrap: wrap;
}
.worker-strip strong small,
.concurrency-strip strong small {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
}
.worker-strip small,
.concurrency-strip small {
  color: var(--muted);
  display: block;
  font-size: 12.5px;
  margin-top: 6px;
}
.worker-strip strong small,
.concurrency-strip strong small {
  display: inline;
}
.worker-strip .status {
  font-size: 12px;
}
.concurrency-strip {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}
.worker-columns {
  grid-template-columns: minmax(0, 1.4fr) 120px 130px 140px 100px 140px;
}
.schedule-columns {
  align-items: start;
  grid-template-columns: minmax(0, 1.4fr) 110px minmax(0, 1.2fr) 100px 80px 140px 140px;
}
.schedule-columns > .status {
  margin-top: 1px;
}
.task-columns {
  grid-template-columns: minmax(0, 1.4fr) 70px 100px 150px 150px minmax(0, 1fr);
}
.task-results {
  color: var(--muted);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.running-columns {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 56px;
}
.running-columns > .data {
  text-align: right;
}
.cell-label {
  display: none;
}
.run-error {
  font-family: var(--mono);
  font-size: 12px !important;
  overflow-wrap: anywhere;
}
.worker-pair {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
/* PostgreSQL and Redis side by side read as one row, so the shorter panel stretches to match. */
.server-pair {
  align-items: stretch;
}
.run-history {
  grid-column: 1 / -1;
  margin-top: -4px;
}
.run-history summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.run-history ol {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}
.run-history li {
  align-items: baseline;
  display: grid;
  font-size: 13px;
  gap: 12px;
  grid-template-columns: 64px 130px 72px minmax(0, 1fr);
}
.run-history li .status {
  font-size: 11.5px;
  justify-self: start;
  padding: 1px 7px;
}
.run-history li small {
  margin: 0;
  overflow-wrap: anywhere;
}
.concurrency-advice {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 16px 20px;
}
.concurrency-advice:empty {
  display: none;
}
.concurrency-advice li {
  border-radius: 8px;
  font-size: 14px;
  padding: 10px 14px;
}
.concurrency-advice li.warn {
  background: var(--amber-soft);
  color: var(--amber-ink);
}
.concurrency-advice li.info {
  background: var(--blue-soft);
  color: var(--blue);
}
.concurrency-advice li.ok {
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.concurrency-advice li.neutral {
  background: var(--surface-2);
  color: var(--ink-2);
}
.concurrency-panel {
  max-width: none;
  scroll-margin-top: 80px;
}
.concurrency-panel .panel-heading + p {
  margin-bottom: 0;
}
.concurrency-panel input[type="number"] {
  max-width: 180px;
}
.schedule-panel {
  grid-template-columns: minmax(0, 1fr);
}
.schedule-dialog {
  width: 820px;
}
.schedule-edit-columns {
  align-items: center;
  grid-template-columns: minmax(0, 1.5fr) 200px 60px;
}
.schedule-edit-columns .field small {
  margin-top: 0;
}
.schedule-edit-columns .schedule-locked {
  color: var(--muted);
  grid-column: 2 / -1;
}

/* --- Server ----------------------------------------------------------------- */

.server-strip {
  grid-template-columns: repeat(3, 1fr);
}
.server-strip > div:nth-child(4) {
  border-left: 0;
}
.server-strip > div:nth-child(n + 4) {
  border-top: 1px solid var(--line);
}
.server-advice {
  margin-bottom: 20px;
  padding: 0;
}
.server-charts {
  margin: 0;
  padding: 20px;
}
.server-charts .chart-card {
  box-shadow: none;
}
.container-columns {
  grid-template-columns: minmax(0, 1.2fr) 120px 90px minmax(0, 1.1fr) 100px 120px;
}
.container-columns small {
  color: var(--muted);
  display: block;
  font-size: 12.5px;
}
.container-note {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  padding: 12px 20px 16px;
}
.server-facts {
  display: grid;
  margin: 0;
}
.server-facts > div {
  align-items: baseline;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  padding: 11px 20px;
}
.server-facts dt {
  color: var(--muted);
  font-size: 14px;
}
.server-facts dd {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  margin: 0;
}
.server-facts dd small {
  color: var(--muted);
  display: block;
  font-size: 12.5px;
  font-weight: 400;
  margin-top: 2px;
}

@media (max-width: 1050px) {
  .worker-pair {
    gap: 0;
    grid-template-columns: 1fr;
  }
  .task-columns {
    grid-template-columns: minmax(0, 1.4fr) 60px 90px 140px 140px;
  }
  .task-columns > :nth-child(6) {
    display: none;
  }
  .container-columns {
    grid-template-columns: minmax(0, 1.2fr) 110px 80px minmax(0, 1.1fr) 90px;
  }
  .container-columns > :nth-child(6) {
    display: none;
  }
}

@media (max-width: 760px) {
  .worker-columns,
  .schedule-columns,
  .task-columns,
  .running-columns {
    align-items: start;
    gap: 6px 14px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 14px 16px;
  }
  .worker-columns > *,
  .schedule-columns > *,
  .task-columns > * {
    grid-column: 1;
  }
  .worker-columns > .status,
  .schedule-columns > .status {
    grid-column: 2;
    grid-row: 1;
  }
  .task-columns > :nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }
  .task-columns > :nth-child(2)::after {
    content: " runs";
  }
  .task-columns > :nth-child(6) {
    display: block;
  }
  .worker-columns > :nth-child(5),
  .worker-columns > :nth-child(6) {
    display: none;
  }
  .cell-label {
    color: var(--muted);
    display: inline;
    font-family: "Geist", system-ui, sans-serif;
    font-size: 12.5px;
    font-weight: 400;
  }
  .cell-label::after {
    content: ": ";
  }
  .schedule-columns > :nth-child(5) {
    display: block;
  }
  .schedule-columns > .run-history {
    grid-column: 1 / -1;
  }
  .run-history li {
    grid-template-columns: 60px auto minmax(0, 1fr);
  }
  .run-history li small {
    grid-column: 1 / -1;
  }
  .running-columns > .data {
    grid-column: 2;
  }
  .worker-section .user-section-head {
    padding: 14px 16px;
  }
  .concurrency-advice {
    padding: 14px 16px;
  }
  .concurrency-panel {
    scroll-margin-top: calc(var(--strip) + 12px);
  }
  .schedule-edit-columns {
    align-items: start;
    gap: 6px 14px;
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 0;
  }
  .schedule-edit-columns .schedule-locked {
    grid-column: 1;
  }
  .container-columns {
    align-items: start;
    gap: 6px 14px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 14px 16px;
  }
  .container-columns > * {
    grid-column: 1;
  }
  .container-columns > .status {
    grid-column: 2;
    grid-row: 1;
  }
  .container-columns > :nth-child(6) {
    display: block;
  }
  .server-strip {
    grid-template-columns: 1fr 1fr;
  }
  .server-strip > div:nth-child(odd) {
    border-left: 0;
  }
  .server-strip > div:nth-child(4) {
    border-left: 1px solid var(--line);
  }
  .server-charts {
    padding: 12px;
  }
  .server-facts > div {
    padding: 10px 16px;
  }
  .container-note {
    padding: 10px 16px 14px;
  }
}

/* --- Inbox -----------------------------------------------------------------
   Every alert kept for one person. Unread alerts carry an accent edge and a
   heavier title; acknowledged ones fade back, since they are kept for the record. */

.inbox-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}
.inbox-toolbar .segmented a {
  white-space: nowrap;
}
/* .segmented span styles the radio variant's pills; a count is plain text inside a link. */
.segmented .inbox-tab-count,
.segmented .tab-count {
  color: var(--faint);
  display: inline;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  margin-left: 2px;
  padding: 0;
}
.segmented a[aria-current="true"] .inbox-tab-count,
.segmented a[aria-current="true"] .tab-count {
  color: var(--muted);
}
.inbox-search {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  gap: 8px;
  justify-content: flex-end;
  margin: 0;
}
.inbox-search .filter-field select {
  min-width: 190px;
}
.inbox-query {
  width: min(300px, 100%);
}
.inbox-panel {
  overflow: clip;
}
.inbox-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  padding: 10px 20px;
}
.inbox-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.inbox-item {
  align-items: flex-start;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px 14px;
  grid-template-columns: 17px minmax(0, 1fr) auto;
  padding: 16px 20px;
  position: relative;
}
.inbox-item:first-child {
  border-top: 0;
}
.inbox-item:hover {
  background: var(--row-hover);
}
.inbox-item.is-selected {
  background: var(--accent-soft);
}
.inbox-item > input {
  accent-color: var(--accent);
  cursor: pointer;
  height: 17px;
  margin: 2px 0 0;
  width: 17px;
}
.inbox-item.unread::before {
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  bottom: 14px;
  content: "";
  left: 0;
  position: absolute;
  top: 14px;
  width: 3px;
}
.inbox-body {
  min-width: 0;
}
/* Announcements an administrator sent, on their page. */
.announcement-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.announcement-list > li {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
  padding: 16px 20px;
}
.announcement-list > li:first-child {
  border-top: 0;
}
.announcement-list p {
  color: var(--ink-2);
  margin: 0;
  overflow-wrap: anywhere;
}
.announcement-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12.5px;
  gap: 4px 10px;
}
.announcement-foot {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  justify-content: space-between;
  margin-top: 4px;
}
.inbox-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12.5px;
  gap: 4px 10px;
  margin-bottom: 4px;
}
.inbox-unread-label {
  color: var(--accent);
  font-weight: 600;
}
.inbox-kind {
  background: var(--chip);
  border-radius: 999px;
  color: var(--ink-2);
  font-weight: 500;
  padding: 1px 8px;
  white-space: nowrap;
}
.inbox-kind.hold,
.inbox-kind.reminder,
.inbox-kind.transfer,
.inbox-kind.unsold,
.inbox-kind.write_off {
  background: var(--amber-soft);
  color: var(--amber);
}
.inbox-kind.lapsed,
.inbox-kind.account,
.inbox-kind.rule,
.inbox-kind.server {
  background: var(--red-soft);
  color: var(--red);
}
.inbox-kind.purchased {
  background: var(--blue-soft);
  color: var(--blue);
}
.inbox-kind.summary,
.inbox-kind.joined,
.inbox-kind.announcement {
  background: var(--accent-soft);
  color: var(--accent);
}
.inbox-title {
  color: var(--ink);
  display: inline-block;
  font-size: 15px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.inbox-item.unread .inbox-title {
  font-weight: 650;
}
.inbox-title:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.inbox-body p {
  color: var(--ink-2);
  font-size: 14px;
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}
.inbox-item.done .inbox-title,
.inbox-item.done .inbox-body p {
  color: var(--muted);
}
.inbox-actions {
  flex-wrap: wrap;
  margin: -4px -8px 0 0;
}
.inbox-actions .inbox-acknowledge {
  color: var(--accent) !important;
}
.inbox-panel .pagination {
  border-radius: 0;
  border-width: 1px 0 0;
}
.inbox-views {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.inbox-event-filter {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  gap: 6px 14px;
  justify-content: space-between;
  padding: 12px 20px;
}
.inbox-event-filter a:not(.form-link) {
  color: var(--ink);
  font-weight: 600;
}
.inbox-group + .inbox-group {
  border-top: 1px solid var(--line);
}
.inbox-group-head {
  align-items: center;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  padding: 12px 20px;
}
.inbox-group-head .target-thumb {
  height: 36px;
  width: 36px;
}
.inbox-group-head .target-thumb svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 18px;
}
.inbox-group-title {
  flex: 1 1 auto;
  min-width: 0;
}
.inbox-group-title h3 {
  font-size: 15px;
  font-weight: 650;
  margin: 0;
  overflow-wrap: anywhere;
}
.inbox-group-title h3 a {
  color: var(--ink);
  text-decoration: none;
}
.inbox-group-title h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.inbox-group-title small {
  color: var(--muted);
  display: block;
  font-size: 12.5px;
  margin-top: 2px;
}
.inbox-group-actions {
  flex: none;
  margin: 0;
}
.inbox-group-more {
  border-top: 1px solid var(--line);
  color: var(--accent);
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 20px 10px 52px;
}
.head-actions [data-settings-open] {
  gap: 6px;
}
.head-actions [data-settings-open] svg {
  fill: none;
  height: 15px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
  width: 15px;
}

/* Notification settings open over the inbox. The body scrolls, not the dialog,
   so a click on the scrollbar is never mistaken for one on the backdrop. */
.settings-dialog {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  color: var(--ink);
  display: none;
  flex-direction: column;
  max-height: calc(100dvh - 48px);
  max-width: calc(100vw - 32px);
  overflow: hidden;
  padding: 0;
  width: 1040px;
}
.settings-dialog[open] {
  animation: dialog-in 0.16s ease-out;
  display: flex;
}
/* Back after one of its own actions: it never really left, so it does not animate in. */
.settings-dialog.returning[open] {
  animation: none;
}
/* Opened on load, the browser focuses the dialog itself; its frame is focus enough. */
.settings-dialog:focus {
  outline: none;
}
.settings-dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(2px);
}
.settings-dialog-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex: none;
  gap: 16px;
  justify-content: space-between;
  padding: 20px 24px;
}
.settings-dialog-head h2 {
  font-size: 19px;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin: 0;
}
.settings-dialog-head p {
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0 0;
  max-width: 70ch;
}
.settings-dialog-close {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  flex: none;
  height: 36px;
  justify-content: center;
  margin: -6px -8px 0 0;
  width: 36px;
}
.settings-dialog-close:hover {
  background: var(--hover);
  color: var(--ink);
}
.settings-dialog-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.settings-dialog-close svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
  width: 18px;
}
.shortcuts-dialog {
  width: 720px;
}
.shortcuts-dialog .settings-dialog-head kbd {
  font-size: 12px;
}
.shortcuts-body {
  display: grid;
  gap: 20px 32px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 24px 24px;
}
.shortcuts-body h3 {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0 0 6px;
  text-transform: uppercase;
}
.shortcuts-body dl {
  margin: 0;
}
.shortcuts-body dl > div {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 7px 0;
}
.shortcuts-body dl > div:last-child {
  border-bottom: 0;
}
.shortcuts-body dt {
  color: var(--ink-2);
  font-size: 13.5px;
}
.shortcuts-body dd {
  align-items: center;
  color: var(--faint);
  display: inline-flex;
  flex: none;
  font-size: 12px;
  gap: 3px;
  margin: 0;
}
.shortcuts-body dd span {
  margin: 0 2px;
}
@media (max-width: 760px) {
  .shortcuts-body {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }
}
.settings-dialog .form-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  max-width: none;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (max-width: 760px) {
  .inbox-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .inbox-toolbar .segmented {
    align-self: flex-start;
    max-width: 100%;
    overflow-x: auto;
  }
  .inbox-search {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .inbox-search .filter-field {
    flex: 1 1 140px;
  }
  .inbox-query {
    width: auto;
  }
  .inbox-search .filter-field select {
    min-width: 0;
  }
  .inbox-head,
  .inbox-item {
    padding-left: 16px;
    padding-right: 16px;
  }
  .inbox-group-head,
  .inbox-event-filter {
    padding-left: 16px;
    padding-right: 16px;
  }
  .inbox-group-head {
    flex-wrap: wrap;
  }
  .inbox-group-actions {
    margin-left: 48px;
  }
  .inbox-group-more {
    padding-left: 48px;
  }
  .inbox-item {
    grid-template-columns: 17px minmax(0, 1fr);
  }
  .inbox-actions {
    grid-column: 2;
    justify-content: flex-start;
    margin: 4px 0 0 -8px;
  }
  /* A full-screen sheet on phones. */
  .settings-dialog {
    border: 0;
    border-radius: 0;
    height: 100dvh;
    margin: 0;
    max-height: none;
    max-width: none;
    width: 100vw;
  }
  .settings-dialog-head {
    padding: max(14px, env(safe-area-inset-top)) 16px 14px;
  }
}

/* --- Events: search, event pages, favourites and the watchlist ------------- */

.event-search {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  padding: 8px 8px 8px 16px;
  min-height: 56px;
}
/* No button to press: the spinner shows while the search as you type is on its way. */
.event-search .event-search-spinner {
  flex: none;
  margin-right: 8px;
  position: static;
  visibility: hidden;
}
.event-search.is-searching .event-search-spinner {
  visibility: visible;
}
.event-search:focus-within {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 4px var(--focus-ring);
}
.event-search > svg {
  fill: none;
  flex: none;
  height: 18px;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 2;
  width: 18px;
}
.event-search input {
  background: none;
  border: 0;
  box-shadow: none;
  flex: 1;
  font-size: 15px;
  min-width: 0;
  outline: none;
  padding: 8px 0;
}
.event-results {
  margin-bottom: 20px;
  padding-bottom: 10px;
}
.event-results .target-group {
  margin: 12px 20px 4px;
}
.event-columns {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.event-panel-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 16px 20px 10px;
}
.event-panel-head h2 {
  font-size: 16px;
  margin: 0;
}
.event-panel-head p {
  color: var(--muted);
  font-size: 13px;
  margin: 2px 0 0;
}
.event-panel-head > a {
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.event-panel-head > a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.count-chip {
  background: var(--chip);
  border-radius: 999px;
  color: var(--ink-2);
  flex: none;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  padding: 2px 9px;
}
.event-empty {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
  padding: 4px 20px 18px;
}
.result-list {
  list-style: none;
  margin: 0;
  padding: 0 8px 8px;
}
.result-row {
  align-items: center;
  border-radius: var(--radius);
  display: flex;
  gap: 4px;
  padding-right: 6px;
}
.result-row:hover {
  background: var(--hover);
}
.result-row.is-paused .target-option-text {
  opacity: 0.6;
}
.result-link {
  align-items: center;
  border-radius: var(--radius);
  color: inherit;
  display: flex;
  flex: 1;
  gap: 12px;
  min-width: 0;
  padding: 9px 12px;
}
.result-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.result-link .kind-chip {
  background: var(--chip);
  margin-right: 4px;
  vertical-align: 1px;
}
.result-row .row-menu summary {
  padding: 7px 9px;
}
.star-form {
  margin: 0;
}
.star-button {
  align-items: center;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--faint);
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
  padding: 0 8px;
}
.star-button svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 18px;
}
.star-button:hover {
  background: var(--hover);
  color: var(--ink);
}
.star-button.is-starred {
  color: var(--count);
}
.star-button.is-starred svg {
  fill: currentColor;
}
.star-button.labelled {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  min-height: 38px;
  padding: 0 13px;
}
.star-button.labelled.is-starred svg {
  color: var(--count);
}
.event-past {
  border-top: 1px solid var(--line);
  padding: 10px 20px 12px;
}
.event-past summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 13.5px;
  width: fit-content;
}
.event-past[open] summary {
  margin-bottom: 8px;
}
.event-past .result-list {
  padding: 0;
}
.event-past .table-row {
  padding-left: 0;
  padding-right: 0;
}

.event-hero {
  align-items: center;
  display: flex;
  gap: 18px;
  margin-bottom: 24px;
}
.target-thumb.large {
  border-radius: var(--radius);
  font-size: 26px;
  height: 76px;
  width: 76px;
}
.event-hero-text {
  flex: 1;
  min-width: 0;
}
.event-hero-text .kicker a {
  color: var(--muted);
}
.event-hero-text .kicker a:hover {
  color: var(--ink);
}
.event-hero-text h1 {
  font-size: 28px;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0;
  overflow-wrap: anywhere;
}
.event-hero-text .event-hero-address {
  color: var(--ink-2);
  margin: 6px 0 0;
}
.event-hero-text > p:last-child {
  color: var(--muted);
  margin: 6px 0 0;
}
.event-hero-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.event-notice {
  margin: 0 0 16px;
}
.event-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.event-kpis .kpi.loss > strong {
  color: var(--red);
}
.event-layout {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) 340px;
}
.event-main,
.event-side {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.ticket-columns {
  grid-template-columns: 44px minmax(0, 2.4fr) 80px minmax(0, 1.1fr) 150px;
}
label.table-row {
  cursor: pointer;
  font-weight: 400;
  margin: 0;
}
.ticket-columns > span:first-child input {
  margin: 0;
}
.holding-columns {
  grid-template-columns: minmax(0, 2.4fr) auto 90px 110px;
}
.holding-columns > span:last-child {
  text-align: right;
}
.event-form-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 14px 20px;
}
.event-form-actions small {
  color: var(--muted);
  flex: 1;
  font-size: 12.5px;
  min-width: 200px;
}
.fact-list {
  margin: 0;
  padding: 0 20px 14px;
}
.fact-list div {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 120px minmax(0, 1fr);
  padding: 9px 0;
}
.fact-list div:first-child {
  border-top: 0;
}
.fact-list dt {
  color: var(--muted);
  font-size: 13.5px;
}
.fact-list dd {
  font-size: 14px;
  margin: 0;
  overflow-wrap: anywhere;
}
.fact-list dd small {
  color: var(--muted);
  display: block;
  font-size: 12.5px;
  margin-top: 2px;
}
.fact-list dd a {
  color: var(--accent);
}

@media (max-width: 1100px) {
  .event-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .event-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .event-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .event-hero {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .target-thumb.large {
    height: 56px;
    width: 56px;
  }
  .event-hero-text h1 {
    font-size: 22px;
  }
  .event-hero-actions {
    justify-content: flex-start;
    width: 100%;
  }
  .event-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .event-kpis .kpi:last-child {
    grid-column: 1 / -1;
  }
  .ticket-columns {
    grid-template-areas: "watch name state" "watch price yours";
    grid-template-columns: 28px minmax(0, 1fr) auto;
    row-gap: 4px;
  }
  .ticket-columns > :nth-child(1) {
    grid-area: watch;
  }
  .ticket-columns > :nth-child(2) {
    grid-area: name;
  }
  .ticket-columns > :nth-child(3) {
    grid-area: price;
  }
  .ticket-columns > :nth-child(4) {
    grid-area: yours;
    text-align: right;
  }
  .ticket-columns > :nth-child(5) {
    grid-area: state;
  }
  .table-head.ticket-columns {
    display: none;
  }
  .holding-columns {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 6px;
  }
  .holding-columns > span:nth-child(3) {
    text-align: left;
  }
  .fact-list div {
    grid-template-columns: 100px minmax(0, 1fr);
  }
}

/* --- Date and time pickers (datetime-picker.js) ------------------------------ */

.picker {
  display: block;
  min-width: 0;
  position: relative;
}
.picker-field {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 1px 1px rgba(20, 23, 26, 0.03);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 14.5px;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  text-align: left;
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
  width: 100%;
}
.picker-field:hover {
  border-color: var(--border-hover);
}
.picker-field:focus-visible,
.picker-field:focus-within,
.picker-field[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}
.picker-field[aria-invalid="true"],
.picker-field:has([aria-invalid="true"]) {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}
.picker-field:disabled,
.picker-field:has(:disabled) {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}
.picker-field svg {
  fill: none;
  flex: none;
  height: 16px;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  width: 16px;
}
.picker-field.empty .picker-text {
  color: var(--faint);
}
.picker-text {
  flex: 1;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.picker-time {
  cursor: text;
  padding-right: 4px;
}
.picker-field.picker-time input.picker-time-text,
.field .picker-field.picker-time input.picker-time-text,
.field .picker-field.picker-time input.picker-time-text:hover,
.field .picker-field.picker-time input.picker-time-text:focus {
  background: none;
  border: 0;
  box-shadow: none;
  color: inherit;
  flex: 1;
  font: inherit;
  font-variant-numeric: tabular-nums;
  min-height: 0;
  min-width: 0;
  outline: none;
  padding: 0;
  width: 100%;
}
.picker-time-toggle {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex: none;
  height: 30px;
  justify-content: center;
  padding: 0;
  width: 30px;
}
.picker-time-toggle:hover,
.picker-time-toggle[aria-expanded="true"] {
  background: var(--surface-2);
}
.picker-time-toggle:hover svg {
  stroke: var(--ink);
}

.picker-popover {
  background: var(--surface);
  font-size: 14px;
  font-weight: 400;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  color: var(--ink);
  inset: auto;
  margin: 0;
  padding: 10px;
  position: fixed;
  width: 284px;
}
.picker-popover-time {
  width: auto;
}
.picker-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.picker-title {
  font-size: 14px;
  font-weight: 600;
}
.picker-step {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 7px;
  color: var(--ink-2);
  cursor: pointer;
  display: flex;
  height: 32px;
  justify-content: center;
  width: 32px;
}
.picker-step:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--ink);
}
.picker-step:disabled {
  cursor: default;
  opacity: 0.35;
}
.picker-step svg {
  fill: none;
  height: 16px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 16px;
}
.picker-days {
  display: grid;
  gap: 2px;
}
.picker-row {
  display: grid;
  gap: 2px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.picker-weekday {
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 0;
  text-align: center;
}
.picker-day {
  aspect-ratio: 1;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  padding: 0;
}
.picker-day:hover:not(:disabled) {
  background: var(--surface-2);
}
.picker-day:focus-visible,
.picker-option:focus-visible,
.picker-link:focus-visible,
.picker-step:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
  outline: none;
}
.picker-day.outside {
  color: var(--faint);
}
.picker-day.today {
  box-shadow: inset 0 0 0 1px var(--accent-border);
  color: var(--accent);
  font-weight: 600;
}
.picker-day[aria-selected="true"],
.picker-option[aria-selected="true"] {
  background: var(--ink);
  box-shadow: none;
  color: var(--on-ink);
  font-weight: 600;
}
.picker-day:disabled {
  color: var(--line-strong);
  cursor: default;
}
.picker-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
}
.picker-link {
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 8px;
}
.picker-link:hover {
  background: var(--accent-soft);
}
.picker-columns {
  display: flex;
  gap: 6px;
}
.picker-column {
  display: grid;
  gap: 2px;
  max-height: 232px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-width: thin;
}
.picker-option {
  background: none;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  padding: 7px 16px;
}
.picker-option:hover:not([aria-selected="true"]) {
  background: var(--surface-2);
}
@media (max-width: 640px) {
  .picker-popover {
    width: min(320px, calc(100vw - 16px));
  }
  .picker-popover-time {
    width: auto;
  }
  .picker-option {
    padding: 9px 18px;
  }
}

/* Swipe actions (static/swipe-actions.js). A swiped row keeps its own box and
   background; its contents slide by --swipe-x and the tray fills the strip they
   leave. Buttons take the text colour of the surface, which reads on each tone
   in both themes. */
@media (pointer: coarse) {
  [data-swipe-row] {
    touch-action: pan-y;
  }
  /* Keyboard shortcuts mean nothing on a touch screen with no keyboard. */
  .keyboard-only {
    display: none;
  }
  /* The default 13px box is a small thing to hit with a finger. */
  input:is([type="checkbox"], [type="radio"]):not(.visually-hidden),
  .field input:is([type="checkbox"], [type="radio"]) {
    height: 20px;
    width: 20px;
  }
}
[data-swipe-row].is-swiped {
  overflow: hidden;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}
[data-swipe-row].is-swiped > :not(.swipe-tray) {
  transform: translateX(var(--swipe-x, 0px));
}
[data-swipe-row].is-settling > :not(.swipe-tray) {
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
[data-swipe-row].is-settling > .swipe-tray {
  transition: width 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
[data-swipe-row] > .swipe-tray {
  bottom: 0;
  display: flex;
  grid-area: auto;
  overflow: hidden;
  position: absolute;
  top: 0;
  width: 0;
  z-index: 2;
}
.swipe-tray[data-side="start"] {
  left: 0;
}
.swipe-tray[data-side="end"] {
  flex-direction: row-reverse;
  right: 0;
}
.swipe-action {
  align-items: center;
  background: var(--ink-2);
  border: 0;
  color: var(--surface);
  display: flex;
  flex: 1 1 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  justify-content: center;
  line-height: 1.2;
  min-width: 0;
  overflow: hidden;
  padding: 0 6px;
  text-align: center;
  transition:
    flex-grow 0.16s ease,
    padding 0.16s ease;
}
.swipe-action > span {
  flex: none;
  width: 76px;
}
.swipe-action[data-tone="go"] {
  background: var(--accent);
}
.swipe-action[data-tone="warn"] {
  background: var(--amber);
}
.swipe-action[data-tone="danger"] {
  background: var(--red);
}
.swipe-tray.is-full .swipe-action:not(:first-child) {
  flex-grow: 0;
  padding: 0;
}

/* --- Sign-in & security ------------------------------------------------------ */

.passkey-sign-in {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
  max-width: 420px;
}
.passkey-sign-in[hidden],
.passkey-register[hidden] {
  display: none;
}
.passkey-sign-in > small {
  color: var(--muted);
  font-size: 13px;
}
.passkey-sign-in .button svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
  width: 18px;
}
.passkey-sign-in .button {
  gap: 8px;
}
.passkey-sign-in + .auth-form {
  margin-top: 8px;
}
.auth-divider {
  align-items: center;
  color: var(--faint);
  display: flex;
  font-size: 13px;
  gap: 12px;
  margin: 4px 0;
}
.auth-divider::before,
.auth-divider::after {
  border-top: 1px solid var(--line);
  content: "";
  flex: 1;
}
.security-callout {
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius);
  color: var(--amber-ink);
  margin-bottom: 20px;
  max-width: 820px;
  padding: 16px 20px;
}
.security-callout p {
  margin: 4px 0 0;
}
.security-section {
  margin-bottom: 20px;
  max-width: 820px;
}
.security-section > .section-head {
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
}
.security-section > .section-head:last-child {
  border-bottom: 0;
}
.security-row {
  grid-template-columns: minmax(0, 1fr) auto;
}
.security-row small {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}
.security-empty {
  padding: 24px 20px;
}
.security-body,
.passkey-register {
  border-top: 1px solid var(--line);
  padding: 18px 20px;
}
.section-head + .security-body {
  border-top: 0;
}
.passkey-register {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.passkey-register .field {
  flex: 1 1 240px;
  margin: 0;
}
.passkey-error {
  background: var(--red-soft);
  border-radius: 8px;
  color: var(--red-ink);
  font-size: 14px;
  margin: 0;
  padding: 10px 14px;
}
.passkey-register .passkey-error {
  flex-basis: 100%;
  margin: 0;
}
.security-unsupported {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  margin: 0;
  padding: 18px 20px;
}
.security-inline-form {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.security-inline-form .field {
  flex: 0 1 220px;
  margin: 0;
}
.security-actions {
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 14px 20px;
}
.recovery-codes-fresh {
  border-color: var(--accent-border);
}
.recovery-code-list {
  display: grid;
  gap: 8px 24px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  list-style: none;
  margin: 0;
  padding: 18px 20px;
}
.recovery-code-list code,
.totp-secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 0.04em;
}
.totp-setup {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  grid-column: 1 / -1;
}
.totp-qr {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  height: auto;
  max-width: 220px;
  padding: 8px;
  width: 100%;
}
.totp-manual {
  flex: 1 1 240px;
}
.totp-manual p {
  color: var(--muted);
  font-size: 14px;
  margin: 6px 0;
}
.totp-secret {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-block;
  overflow-wrap: anywhere;
  padding: 8px 12px;
}
.security-confirm-passkey {
  margin-top: 0;
}
.security-reset .section-head {
  align-items: center;
  flex-wrap: wrap;
}

/* --- Command palette ------------------------------------------------------- */

/* The strip's Search button: a field-shaped pill so it reads as somewhere to type. */
.search-trigger {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  color: var(--muted);
  display: inline-flex;
  flex: 0 1 340px;
  font-size: 12.5px;
  gap: 8px;
  min-width: 160px;
  padding: 4px 6px 4px 10px;
  text-decoration: none;
}
.search-trigger:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.search-trigger svg,
.palette-field > svg,
.mobile-search svg {
  fill: none;
  flex: none;
  height: 15px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
  width: 15px;
}
.search-trigger span {
  flex: 1;
}
kbd {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  padding: 2px 5px;
  white-space: nowrap;
}
.mobile-search {
  display: none;
}
/* Too narrow for a bar in the middle: just the icon, in line with the other tools. */
@media (max-width: 1279px) {
  .search-trigger {
    flex: none;
    min-width: 0;
    padding: 6px;
  }
  .search-trigger span,
  .search-trigger kbd {
    display: none;
  }
}
/* The search icon needs the room; the control room still shows the operating window. */
@media (max-width: 960px) {
  .strip-window {
    display: none;
  }
}
@media (max-width: 760px) {
  .search-trigger {
    display: none;
  }
  .mobile-search {
    display: inline-flex;
    height: 38px;
    margin-left: auto;
    width: 38px;
  }
  .mobile-search svg {
    height: 19px;
    width: 19px;
  }
}

.command-palette {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  color: var(--ink);
  flex-direction: column;
  margin: 12vh auto auto;
  max-height: min(560px, 76vh);
  max-width: calc(100vw - 32px);
  overflow: hidden;
  padding: 0;
  width: 620px;
}
.command-palette[open] {
  animation: dialog-in 0.14s ease-out;
  display: flex;
}
.command-palette::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(2px);
}
.palette-field {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex: none;
  gap: 10px;
  padding: 0 14px 0 16px;
}
.palette-field > svg {
  color: var(--muted);
  height: 18px;
  width: 18px;
}
.palette-field input {
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--ink);
  flex: 1;
  font: inherit;
  font-size: 16px;
  min-width: 0;
  outline: none;
  padding: 16px 0;
}
.palette-field input::-webkit-search-cancel-button {
  display: none;
}
.palette-results {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
}
.palette-foot {
  border-top: 1px solid var(--line);
  color: var(--faint);
  display: flex;
  flex: none;
  font-size: 12px;
  gap: 16px;
  margin: 0;
  padding: 9px 16px;
}
.palette-foot span {
  align-items: center;
  display: inline-flex;
  gap: 4px;
}
.palette-cancel {
  display: none;
}
/* A phone: a sheet from the top that is only as tall as its results, leaving the page
   visible below to tap away; a Cancel button stands in for Esc. */
@media (max-width: 760px) {
  .command-palette {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border-top: 0;
    margin: 0 auto auto;
    /* --palette-room is the height the keyboard leaves visible (search.tsx). */
    max-height: min(560px, 72dvh, calc(var(--palette-room, 100dvh) - 12px));
    max-width: 100vw;
    padding-top: env(safe-area-inset-top);
    width: 100vw;
  }
  .command-palette[open] {
    animation: palette-drop 0.18s ease-out;
  }
  .palette-field {
    gap: 8px;
    padding: 8px 6px 8px 14px;
  }
  .palette-field input {
    background: var(--surface-2);
    border-radius: 999px;
    padding: 9px 14px;
  }
  .palette-field > svg {
    display: none;
  }
  .palette-esc,
  .palette-foot {
    display: none;
  }
  .palette-cancel {
    background: none;
    border: 0;
    color: var(--accent);
    display: block;
    flex: none;
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    padding: 10px 8px;
  }
  .palette-results {
    padding: 4px 8px 10px;
  }
  /* A swipe that reaches the end of the results, or a short list with nothing to scroll,
     would otherwise move the page behind the sheet. */
  html:has(.command-palette[open]),
  html:has(.command-palette[open]) body {
    overflow: hidden;
  }
  .search-item {
    min-height: 44px;
    padding: 10px 12px;
  }
  .search-item-text strong {
    font-size: 15px;
  }
  /* Touch has no arrow keys, so the highlighted option is only a distraction. */
  .command-palette .search-item[aria-selected="true"],
  .command-palette .search-all[aria-selected="true"] {
    background: none;
    box-shadow: none;
  }
  .command-palette .search-item:active {
    background: var(--hover);
  }
}
@keyframes palette-drop {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
}

.search-group + .search-group {
  margin-top: 4px;
}
.search-group-head {
  align-items: baseline;
  color: var(--muted);
  display: flex;
  font-size: 11.5px;
  font-weight: 600;
  justify-content: space-between;
  letter-spacing: 0.04em;
  margin: 0;
  padding: 10px 10px 4px;
  text-transform: uppercase;
}
.search-all {
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  padding: 2px 6px;
  text-decoration: none;
  text-transform: none;
}
.search-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.search-item {
  align-items: center;
  border-radius: var(--radius);
  color: var(--ink);
  display: flex;
  gap: 12px;
  padding: 8px 10px;
  text-decoration: none;
}
.search-item-text {
  display: grid;
  flex: 1;
  gap: 1px;
  min-width: 0;
}
.search-item-text strong {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-item-text small {
  color: var(--muted);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-item .data {
  color: var(--ink-2);
  flex: none;
  font-size: 13px;
}
.search-item .status {
  flex: none;
}
.search-item:hover,
.search-all:hover,
.search-item:focus-visible {
  background: var(--hover);
}
/* The option the arrow keys are on. */
.search-item[aria-selected="true"],
.search-all[aria-selected="true"] {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-border);
}
.search-hint {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0;
  padding: 14px 10px;
}
.search-page {
  padding: 8px;
}

/* Inventory: unsold tickets for events that are over, suggested for writing off. */
.write-off-suggestions {
  border-left: 3px solid var(--amber);
  margin-bottom: 20px;
}
.write-off-suggestions > .section-head {
  padding: 16px 20px 12px;
}
.write-off-suggestions > .section-head form {
  margin: 0;
}
.write-off-suggestion-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.write-off-suggestion {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 12px 20px;
}
.write-off-suggestion small {
  color: var(--muted);
  display: block;
}
.write-off-suggestion-more {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
  margin: 0;
  padding: 10px 20px;
}
@media (max-width: 760px) {
  .write-off-suggestions > .section-head {
    flex-direction: column;
  }
  .write-off-suggestion {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .write-off-suggestion .row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* Calendar: a month grid of events with something to do. Phones get an agenda of the days that have any. */
.calendar-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 16px 18px;
}
.calendar-head h2 {
  font-size: 18px;
  margin: 0;
}
.calendar-grid {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.calendar-weekday {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
}
.calendar-day {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 112px;
  min-width: 0;
  padding: 8px;
}
.calendar-day:nth-child(7n) {
  border-right: 0;
}
.calendar-day.is-outside {
  background: var(--track);
}
.calendar-day.is-outside .calendar-date {
  color: var(--faint);
}
.calendar-date {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.calendar-day.is-today .calendar-date {
  color: var(--accent);
}
.calendar-weekday-inline,
.calendar-month-inline {
  display: none;
}
.calendar-event {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  text-decoration: none;
}
.calendar-event:hover {
  border-color: var(--border-hover);
}
.calendar-event strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-event small {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.calendar-tag {
  background: var(--chip);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
}
.calendar-tag.is-held {
  background: var(--amber-soft);
  color: var(--amber-ink);
}
.calendar-tag.is-sell {
  background: var(--blue-soft);
  color: var(--blue);
}
.calendar-tag.is-send {
  background: var(--accent-soft);
  color: var(--accent);
}
@media (max-width: 760px) {
  .calendar-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .calendar-weekday,
  .calendar-day.is-empty,
  .calendar-day.is-outside {
    display: none;
  }
  .calendar-day {
    border-right: 0;
    min-height: 0;
  }
  .calendar-weekday-inline,
  .calendar-month-inline {
    display: inline;
  }
}
.calendar-subscribe {
  margin-bottom: 16px;
  padding: 14px 18px;
}
.calendar-subscribe summary {
  cursor: pointer;
  font-weight: 600;
}
.calendar-subscribe[open] summary {
  margin-bottom: 12px;
}
.calendar-subscribe p {
  color: var(--muted);
}
.calendar-subscribe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* Organiser and venue insights */
.organiser-columns {
  grid-template-columns: minmax(0, 1.6fr) repeat(6, minmax(0, 1fr));
}
.account-insight-columns {
  grid-template-columns: minmax(0, 1.8fr) repeat(5, minmax(0, 1fr));
}
.organiser-columns > span,
.account-insight-columns > span {
  text-align: right;
}
.table-head.organiser-columns > span:first-child,
.table-head.account-insight-columns > span:first-child {
  text-align: left;
}
.organiser-table,
.release-heatmap {
  margin-bottom: 20px;
}
.release-heatmap {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
}
.release-heatmap .table-empty {
  padding: 24px 0 8px;
}
.release-filter {
  align-items: center;
  display: flex;
  gap: 8px;
}
.release-filter select {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  max-width: 220px;
  min-height: 38px;
  padding: 7px 10px;
}
.release-summary {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0;
}
.release-grid {
  display: grid;
  gap: 3px;
  overflow-x: auto;
}
.release-row {
  align-items: center;
  display: grid;
  gap: 3px;
  grid-template-columns: 36px repeat(24, minmax(12px, 1fr));
  max-width: 900px;
  min-width: 420px;
}
.release-day,
.release-hour {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 760px) {
  .release-heatmap > .section-head {
    flex-direction: column;
  }
}
.release-cell {
  height: 22px;
  background: var(--track);
  border-radius: 3px;
}
.release-cell.level-1 {
  background: color-mix(in srgb, var(--accent) 22%, var(--track));
}
.release-cell.level-2 {
  background: color-mix(in srgb, var(--accent) 45%, var(--track));
}
.release-cell.level-3 {
  background: color-mix(in srgb, var(--accent) 70%, var(--track));
}
.release-cell.level-4 {
  background: var(--accent);
}
/* A filter waiting on another's choice (Inventory's "Sent to buyers" until Stock is Sold) */
.filter-field.is-disabled > label,
.filter-field.is-disabled > small {
  color: var(--faint);
}
.filter-field select:disabled {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--faint);
  cursor: not-allowed;
}

/* Saved filters on Reservations, Inventory and Events */
.saved-filters {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: -6px 0 18px;
}
.saved-filters-label {
  color: var(--muted);
  font-size: 13px;
}
.saved-filters ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.saved-filters li {
  align-items: center;
  background: var(--chip);
  border: 1px solid transparent;
  border-radius: 999px;
  display: flex;
  min-height: 32px;
}
.saved-filters li.is-current {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}
.saved-filters li > a {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  padding: 5px 4px 5px 12px;
  text-decoration: none;
}
.saved-filters li.is-current > a {
  color: var(--accent);
}
.saved-filter-remove {
  background: none;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  height: 28px;
  line-height: 1;
  margin-right: 2px;
  width: 28px;
}
.saved-filter-remove:hover {
  background: var(--hover);
  color: var(--ink);
}
.saved-filter-default {
  background: none;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  height: 28px;
  line-height: 1;
  margin-left: 2px;
  width: 28px;
}
.saved-filter-default:hover {
  background: var(--hover);
  color: var(--ink);
}
.saved-filter-default.is-default {
  color: var(--accent);
}
.saved-filters li:has(.saved-filter-default) > a {
  padding-left: 2px;
}
.saved-filter-new {
  align-items: center;
  display: flex;
  flex: 1 1 300px;
  gap: 8px;
  max-width: 420px;
}
.saved-filter-new input {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  flex: 1 1 140px;
  min-height: 34px;
  min-width: 0;
  padding: 6px 10px;
}
.saved-filter-new .button {
  flex: none;
}

/* Hold speed */
.speed-panel {
  margin-bottom: 20px;
}
.speed-no-target {
  margin: -8px 0 20px;
}
.speed-week-columns {
  grid-template-columns: minmax(0, 1.4fr) repeat(5, minmax(0, 1fr));
}
.speed-hold-columns {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.1fr) minmax(0, 1.1fr) repeat(2, minmax(0, 0.8fr));
}
.speed-week-columns > span,
.speed-hold-columns > span {
  text-align: right;
}
.table-head.speed-week-columns > span:first-child,
.table-head.speed-hold-columns > span:first-child {
  text-align: left;
}
.speed-time .status {
  margin-left: 8px;
}
.speed-release {
  color: var(--muted);
  display: block;
  font-size: 12px;
}
/* A hold's latency budget: its booking calls as one bar, under the hold's row. */
.latency-budget {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  min-width: 0;
}
.latency-bar {
  background: var(--track);
  border-radius: 999px;
  display: flex;
  gap: 2px;
  height: 8px;
  overflow: hidden;
}
.latency-segment {
  background: var(--line-strong);
  min-width: 2px;
}
.latency-segment.slowest {
  background: var(--amber);
}
.latency-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.latency-steps li {
  align-items: baseline;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  gap: 5px;
}
.latency-steps strong {
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.latency-steps li.skipped strong {
  color: var(--faint);
  font-weight: 400;
}
.latency-steps li.slowest strong,
.latency-steps em {
  color: var(--amber-ink);
}
.latency-steps em {
  background: var(--amber-soft);
  border-radius: 999px;
  font-style: normal;
  padding: 0 6px;
}
.latency-steps .latency-failed {
  color: var(--red-ink);
}
.latency-steps li.latency-between {
  margin-left: auto;
}
@media (min-width: 761px) and (max-width: 1100px) {
  .speed-strip {
    grid-template-columns: repeat(3, 1fr);
  }
  .speed-strip > div:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }
  .speed-strip > div:nth-child(4) {
    border-left: 0;
  }
}
@media (max-width: 760px) {
  .table-head.organiser-columns,
  .table-head.account-insight-columns,
  .table-head.speed-week-columns,
  .table-head.speed-hold-columns {
    display: none;
  }
  .table-row.organiser-columns,
  .table-row.account-insight-columns,
  .table-row.speed-week-columns,
  .table-row.speed-hold-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 8px;
  }
  .table-row.organiser-columns > div,
  .table-row.account-insight-columns > div,
  .table-row.speed-week-columns > strong,
  .table-row.speed-hold-columns > div {
    grid-column: 1 / -1;
  }
  .table-row.organiser-columns > span,
  .table-row.account-insight-columns > span,
  .table-row.speed-week-columns > span,
  .table-row.speed-hold-columns > span {
    text-align: left;
  }
  .table-row.organiser-columns > span::before,
  .table-row.account-insight-columns > span::before,
  .table-row.speed-week-columns > span::before,
  .table-row.speed-hold-columns > span::before {
    color: var(--muted);
    content: attr(data-label);
    display: block;
    font-size: 12px;
  }
}

/* A control room panel too narrow for its desktop layout takes its phone one. Last, so it
   outranks the desktop rules it replaces. */
@container control-panel (max-width: 600px) {
  .work-status {
    grid-template-columns: 1fr 1fr;
  }
  .work-status > div {
    padding: 14px 16px;
  }
  .work-status > div:first-child {
    border-bottom: 1px solid var(--dark-line);
    grid-column: 1 / -1;
  }
  .work-status > div:nth-child(2) {
    border-left: 0;
  }
  .queue-panel,
  .action-panel,
  .recent-strip,
  .extra-panel {
    padding: 18px;
  }
  .queue-panel > .pagination {
    margin: 12px -18px -18px;
    padding: 10px 18px;
  }
  .pagination {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
  .pagination-controls {
    justify-content: space-between;
  }
  .section-head:has(> .queue-start) {
    flex-wrap: wrap;
  }
  .section-head > .queue-start {
    flex-basis: 100%;
    order: 5;
  }
  .section-head > .queue-start ~ .bulk-all {
    margin-left: auto;
  }
  .queue-start .button {
    width: 100%;
  }
  .hold-card {
    grid-template-areas:
      "art main"
      "clock pay"
      "warn warn"
      "more more";
    grid-template-columns: 64px minmax(0, 1fr);
    padding: 12px 12px 0;
    row-gap: 12px;
  }
  .hold-clock {
    height: 64px;
    width: 64px;
  }
  .hold-seconds {
    font-size: 15px;
  }
  .hold-pay {
    align-items: center;
    column-gap: 12px;
    grid-template-columns: auto 1fr;
    justify-items: start;
    text-align: left;
  }
  .hold-pay small {
    grid-column: 1;
  }
  .hold-pay strong {
    grid-column: 1;
    margin: 0;
  }
  .hold-pay > a,
  .hold-pay > form {
    grid-column: 2;
    grid-row: 1 / 3;
    justify-self: stretch;
  }
  .hold-pay-button {
    min-width: 0;
    width: 100%;
  }
  .hold-pay small {
    white-space: nowrap;
  }
  .hold-warning {
    margin-top: 0;
  }
  .hold-more {
    margin-top: 12px;
  }
  .compact-row {
    gap: 2px 12px;
    grid-template-areas: "event status" "time status";
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .compact-row > strong {
    grid-area: event;
  }
  .compact-row > time {
    font-size: 12.5px;
    grid-area: time;
  }
  .compact-row > .status {
    grid-area: status;
  }
  .compact-row > span:nth-child(3),
  .compact-row > span:nth-child(5) {
    display: none;
  }
}

/* Compact filter panels. On a wide screen a filter's help would add a line or two under every
   field and push the list down; it shows instead as a hint under the field while it is pointed
   at or in use, over the panel rather than in it, so nothing below moves. */
@media (min-width: 761px) {
  .collection-filters {
    gap: 18px;
    grid-template-columns: 150px minmax(0, 1fr) auto;
    padding: 14px 18px;
  }
  .collection-filters .filter-intro p {
    font-size: 12.5px;
    line-height: 1.45;
  }
  .collection-filters .filter-fields {
    gap: 12px 14px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }
  .collection-filters .filter-field {
    position: relative;
  }
  .collection-filters .filter-field label {
    margin-bottom: 4px;
  }
  .collection-filters .filter-field > small {
    background: var(--ink);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-pop);
    color: var(--on-ink);
    font-size: 12px;
    left: 0;
    line-height: 1.45;
    margin-top: 6px;
    max-width: 280px;
    opacity: 0;
    padding: 7px 10px;
    pointer-events: none;
    position: absolute;
    top: 100%;
    transform: translateY(-3px);
    transition:
      opacity 0.12s ease,
      transform 0.12s ease;
    transition-delay: 0s;
    z-index: 35;
  }
  .collection-filters .filter-field:hover > small,
  .collection-filters .filter-field:focus-within > small {
    opacity: 1;
    transform: none;
    transition-delay: 0.35s;
  }
  /* An open dropdown is answer enough; its hint would only sit under it. */
  .collection-filters .filter-field:has(.filter-multiselect.open) > small {
    opacity: 0;
  }
  .collection-filters .filter-actions {
    margin-top: 24px;
  }
}
@media (min-width: 761px) and (max-width: 1250px) {
  .collection-filters {
    grid-template-columns: minmax(0, 1fr);
  }
  .collection-filters .filter-actions {
    margin-top: 0;
  }
}

/* With an administrator's sections open, the sidebar can hold more than a laptop screen has
   room for beside the brand and account menu. The links scroll on their own, so the account
   menu stays at the foot of the rail, and on shorter screens they sit closer so most never
   need to. */
.rail {
  height: 100dvh;
}
.rail nav {
  flex: 1 1 auto;
  margin-left: -4px;
  margin-right: -4px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1px 4px;
  scrollbar-width: thin;
}
.rail > .account-menu {
  flex: none;
}
@media (max-height: 960px) {
  .rail nav {
    margin-top: 22px;
  }
  .rail nav a,
  .rail-group-head {
    padding-bottom: 6px;
    padding-top: 6px;
  }
}

/* A section of several pages in the rail (shell/RailNav.tsx): a heading like any link, with a
   chevron, that opens to show its pages along a guide line. They open by easing their row
   from nothing to their full height. */
.rail-group-head {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--ink-2);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  gap: 11px;
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
  width: 100%;
}
.rail-group-head .nav-label {
  flex: 1;
}
.rail-group-head:hover {
  background: var(--hover);
  color: var(--ink);
}
.rail-group-head:hover svg {
  stroke: var(--ink-2);
}
.rail-group-head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.rail-group.is-current > .rail-group-head {
  color: var(--ink);
}
.rail-group.is-current > .rail-group-head svg:first-child {
  stroke: var(--accent);
}
.rail nav .rail-group-chevron {
  height: 15px;
  transition: transform 0.18s ease;
  width: 15px;
}
.rail-group-head[aria-expanded="true"] .rail-group-chevron {
  transform: rotate(180deg);
}
.rail-group-items {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.2s ease;
}
.rail-group-items.is-open {
  grid-template-rows: 1fr;
}
.rail-group-items > div {
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 19px;
  min-height: 0;
  overflow: hidden;
  padding: 0 1px 0 8px;
}
/* Room for the page-you-are-on's outline, which the clipping would otherwise cut. */
.rail-group-items.is-open > div {
  padding-bottom: 4px;
  padding-top: 3px;
}
.rail nav .rail-group-items a {
  font-size: 13.5px;
  padding: 6px 10px;
}
.rail-flyout-title {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .rail-group-items,
  .rail nav .rail-group-chevron {
    transition: none;
  }
}

/* Folded to its icons, the rail opens a section as a small menu beside it instead. */
@media (min-width: 761px) {
  [data-rail="collapsed"] .rail nav {
    overflow: visible;
  }
  [data-rail="collapsed"] .rail-group {
    position: relative;
  }
  [data-rail="collapsed"] .rail-group-head {
    justify-content: center;
    padding: 9px 0;
    position: relative;
  }
  [data-rail="collapsed"] .rail-group.is-current > .rail-group-head {
    background: var(--surface);
    box-shadow:
      0 0 0 1px var(--line),
      var(--shadow);
  }
  [data-rail="collapsed"] .rail-group-chevron {
    display: none;
  }
  [data-rail="collapsed"] .rail-group-items {
    display: none;
  }
  [data-rail="collapsed"] .rail-group-items.is-open {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-pop);
    display: block;
    left: calc(100% + 12px);
    min-width: 200px;
    padding: 6px;
    position: absolute;
    top: -6px;
    z-index: 30;
  }
  [data-rail="collapsed"] .rail-group-items > div {
    border: 0;
    margin: 0;
    overflow: visible;
    padding: 0;
  }
  [data-rail="collapsed"] .rail-flyout-title {
    color: var(--faint);
    display: block;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px 6px;
  }
  [data-rail="collapsed"] .rail nav .rail-group-items a {
    justify-content: flex-start;
    padding: 7px 10px;
  }
  [data-rail="collapsed"] .rail-group-items .nav-label {
    clip: auto;
    clip-path: none;
    height: auto;
    overflow: visible;
    position: static;
    width: auto;
  }
  [data-rail="collapsed"] .rail nav .rail-group-items .nav-count {
    font-size: 11.5px;
    height: 20px;
    margin-left: auto;
    min-width: 20px;
    padding: 0 6px;
    position: static;
  }
}

/* Profile's times panel is a card of its own, spaced like every other stacked panel. */
.form-panel.profile-times {
  border-top: 1px solid var(--line);
  margin-top: 18px;
}

/* A figure strip spreads whatever figures it has across its width, rather than keeping six
   columns and leaving a blank band where a page shows four. */
@media (min-width: 761px) {
  .user-operations-strip {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

/* Folding sections ("View response", a row's "Details", the calendar link and the
   rest) open on a small chevron that turns as they open, in the link's own colour, rather than
   the browser's solid triangle. Menus drawn as buttons keep their own look. */
:is(
    .calendar-subscribe,
    .chart-table,
    .row-detail,
    .upstream-response,
    .history-body details,
    .run-history,
    .event-past,
    .dry-run-skipped
  )
  > summary {
  list-style: none;
}
:is(
    .calendar-subscribe,
    .chart-table,
    .row-detail,
    .upstream-response,
    .history-body details,
    .run-history,
    .event-past,
    .dry-run-skipped
  )
  > summary::-webkit-details-marker {
  display: none;
}
:is(
    .calendar-subscribe,
    .chart-table,
    .row-detail,
    .upstream-response,
    .history-body details,
    .run-history,
    .event-past,
    .dry-run-skipped
  )
  > summary::before {
  border-bottom: 1.6px solid currentColor;
  border-right: 1.6px solid currentColor;
  content: "";
  display: inline-block;
  height: 6px;
  margin: 0 10px 0 2px;
  opacity: 0.8;
  transform: translateY(-2px) rotate(-45deg);
  transition: transform 0.15s ease;
  vertical-align: middle;
  width: 6px;
}
:is(
    .calendar-subscribe,
    .chart-table,
    .row-detail,
    .upstream-response,
    .history-body details,
    .run-history,
    .event-past,
    .dry-run-skipped
  )[open]
  > summary::before {
  transform: translateY(-3px) rotate(45deg);
}

/* Inventory's Tickets menu: a button like the row's others, opening a menu of ticket files. */
.row-menu.ticket-menu > summary.button {
  display: flex;
  font-size: 13px;
  letter-spacing: normal;
  padding-left: 12px;
  padding-right: 12px;
}
.row-menu.ticket-menu > summary.button::after {
  border-bottom: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  content: "";
  height: 5px;
  margin-left: 2px;
  opacity: 0.7;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s ease;
  width: 5px;
}
.row-menu.ticket-menu[open] > summary.button::after {
  transform: translateY(1px) rotate(-135deg);
}
.row-menu.ticket-menu[open] > summary.button {
  background: var(--surface-2);
  border-color: var(--border-hover);
}
.row-menu.ticket-menu .row-menu-list {
  min-width: 190px;
}
/* The ticket actions are drawn as buttons elsewhere; in the menu they read as its items. */
.row-menu .row-menu-list .button {
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--ink-2);
  display: flex;
  font-size: 13.5px;
  justify-content: flex-start;
  min-height: 0;
  padding: 8px 10px;
  width: 100%;
}
.row-menu .row-menu-list .button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

/* A note about how a page's figures are worked out: read once, then out of the way. */
.page-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin: 18px 0 0;
  max-width: 90ch;
}
.page-note.speed-no-target {
  margin: -8px 0 20px;
}

/* A period switch's choices ("7 days") stay on one line however little room the header leaves. */
.segmented a {
  white-space: nowrap;
}
@media (min-width: 761px) {
  .segmented {
    flex: none;
  }
}

/* A section's tabs along the top of its pages (shell/SectionTabs.tsx). On a phone the strip
   runs edge to edge and scrolls sideways when its tabs need more room than the screen has. */
.section-tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 4px;
  margin: -12px 0 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.section-tabs::-webkit-scrollbar {
  display: none;
}
.section-tabs a {
  border-bottom: 2px solid transparent;
  color: var(--muted);
  flex: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: -1px;
  padding: 8px 12px 10px;
  text-decoration: none;
  white-space: nowrap;
}
.section-tabs a:first-child {
  margin-left: -12px;
}
.section-tabs a:hover {
  color: var(--ink);
}
.section-tabs a[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--ink);
  font-weight: 600;
}
.section-tabs a:focus-visible {
  border-radius: 6px;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
@media (max-width: 760px) {
  .section-tabs {
    margin: -8px -16px 18px;
    padding: 0 16px;
    -webkit-user-select: none;
    user-select: none;
  }
  .section-tabs a {
    padding: 10px 12px 12px;
  }
}
