/* Kumote web client: phone-first design tokens and layout (bead hail-5em.2).
   360px baseline, bottom tab bar on phones, side nav from 900px, 44px touch
   targets, safe-area insets, light/dark via prefers-color-scheme, reduced
   motion respected. No inline styles anywhere (CSP style-src 'self'). */

:root {
  color-scheme: light dark;

  /* Color */
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #eeeeeb;
  --text: #17171b;
  --text-muted: #5b6472;
  --border: #d9d9d4;
  --accent: #f5a524;
  --accent-strong: #c47d08;
  --accent-text: #17171b;
  --danger: #b3261e;
  --danger-text: #ffffff;
  --success: #1b7f4b;
  --focus: #1f5eff;
  --nav-bg: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.05);

  /* Spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;

  /* Type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.625rem;
  --fs-2xl: 2.25rem;
  --lh: 1.45;

  /* Shape and sizing */
  --radius: 12px;
  --radius-sm: 8px;
  --tap: 44px;
  --nav-h: 60px;
  --side-nav-w: 240px;
  --content-max: 960px;
  --gutter: 16px;

  /* Safe areas (iOS notch, Android gesture bar) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #181b21;
    --surface-2: #22262e;
    --text: #f2f3f5;
    --text-muted: #a3acb9;
    --border: #2e333c;
    --accent: #f5a524;
    --accent-strong: #ffc45c;
    --accent-text: #17171b;
    --danger: #ff7b72;
    --danger-text: #17171b;
    --success: #4cc38a;
    --focus: #8ab4ff;
    --nav-bg: #14161b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.35);
  }
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-wrap: anywhere;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
}
h2 {
  font-size: var(--fs-lg);
  font-weight: 650;
}
h3 {
  font-size: var(--fs-md);
  font-weight: 650;
}
a {
  color: inherit;
  text-underline-offset: 0.15em;
}
code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
img,
svg {
  display: block;
  max-width: 100%;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: absolute;
  top: -100px;
  left: var(--s-4);
  z-index: 100;
  padding: var(--s-2) var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.skip:focus {
  top: calc(var(--safe-top) + var(--s-2));
}

/* Shell layout: phone first */
.shell {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
}
.shell.shell--bare {
  padding-bottom: var(--safe-bottom);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: calc(var(--tap) + var(--s-2));
  padding: calc(var(--safe-top) + var(--s-2)) calc(var(--gutter) + var(--safe-right)) var(--s-2)
    calc(var(--gutter) + var(--safe-left));
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 700;
  font-size: var(--fs-lg);
  text-decoration: none;
}
.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}
.topbar h1 {
  font-size: var(--fs-lg);
}
/* On phones the screen title is the headline; the mark alone identifies the app. */
@media (max-width: 899px) {
  .topbar.has-title .brand-text {
    display: none;
  }
}
.topbar .grow {
  flex: 1;
}
.main {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--s-4) calc(var(--gutter) + var(--safe-right)) var(--s-6)
    calc(var(--gutter) + var(--safe-left));
}
.main:focus {
  outline: none;
}

/* Bottom tab bar */
.nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  background: var(--nav-bg);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
}
.nav ul {
  list-style: none;
  margin: 0;
  padding: 0 var(--safe-right) 0 var(--safe-left);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  height: var(--nav-h);
}
.nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 100%;
  min-width: var(--tap);
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--fs-xs);
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.nav .nav-icon {
  width: 24px;
  height: 24px;
}
.nav a[aria-current="page"] {
  color: var(--text);
}
.nav a[aria-current="page"] .nav-icon {
  color: var(--accent-strong);
}
.nav .nav-brand {
  display: none;
}

/* Side nav from 900px */
@media (min-width: 900px) {
  .shell {
    grid-template-columns: var(--side-nav-w) 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "nav top"
      "nav main";
    padding-bottom: 0;
  }
  .shell.shell--bare {
    grid-template-columns: 1fr;
    grid-template-areas:
      "top"
      "main";
  }
  .topbar {
    grid-area: top;
  }
  .main {
    grid-area: main;
  }
  .nav {
    grid-area: nav;
    position: sticky;
    inset: auto;
    top: 0;
    height: 100dvh;
    border-top: 0;
    border-right: 1px solid var(--border);
    padding: calc(var(--safe-top) + var(--s-4)) var(--s-3) var(--s-4)
      calc(var(--s-3) + var(--safe-left));
  }
  .nav .nav-brand {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-2) var(--s-3) var(--s-5);
    font-weight: 700;
    font-size: var(--fs-lg);
  }
  .nav ul {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
    height: auto;
    padding: 0;
  }
  .nav a {
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--s-3);
    height: var(--tap);
    padding: 0 var(--s-3);
    font-size: var(--fs-md);
    font-weight: 600;
  }
  .nav a[aria-current="page"] {
    background: var(--surface-2);
  }
  .topbar .brand {
    display: none;
  }
}

/* Components */
.stack {
  display: grid;
  gap: var(--s-4);
}
.stack-sm {
  display: grid;
  gap: var(--s-2);
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
}
.row .grow {
  flex: 1 1 auto;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-4);
  box-shadow: var(--shadow);
}
.muted {
  color: var(--text-muted);
}
.card-accent {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
}
.card-accent .muted {
  color: rgba(23, 23, 27, 0.72);
}
.small {
  font-size: var(--fs-sm);
}
.balance {
  font-size: var(--fs-2xl);
  font-weight: 750;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.eyebrow {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--danger-text);
}
.btn-ghost {
  background: transparent;
}
.btn-block {
  width: 100%;
}
.btn svg {
  width: 20px;
  height: 20px;
}

.field {
  display: grid;
  gap: var(--s-1);
}
.field label {
  font-weight: 600;
  font-size: var(--fs-sm);
}
.input {
  min-height: var(--tap);
  width: 100%;
  padding: 0 var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}
.input:focus {
  border-color: var(--focus);
}
.hint {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.notice {
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.notice-danger {
  border-color: var(--danger);
  background: var(--surface);
}
.notice-danger strong {
  color: var(--danger);
}
.notice-warn {
  border-color: var(--accent-strong);
}

.keybox {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-3);
  border: 2px dashed var(--accent-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.keybox code {
  display: block;
  padding: var(--s-2);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: var(--fs-sm);
  user-select: all;
  -webkit-user-select: all;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-2);
}
.list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  min-height: var(--tap);
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.list-item .grow {
  flex: 1 1 160px;
  min-width: 0;
}
.pill {
  display: inline-block;
  padding: 2px var(--s-2);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text);
}
.pill-revoked {
  text-decoration: line-through;
  color: var(--text-muted);
}
.amount-pos {
  color: var(--success);
}
.amount-neg {
  color: var(--danger);
}

.empty {
  display: grid;
  gap: var(--s-2);
  justify-items: center;
  text-align: center;
  padding: var(--s-6) var(--s-4);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}
.empty svg {
  width: 40px;
  height: 40px;
  color: var(--accent-strong);
}

.quick {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-2);
}
.quick .btn {
  flex-direction: column;
  gap: var(--s-1);
  min-height: 72px;
  padding: var(--s-2);
}
@media (min-width: 600px) {
  .quick {
    grid-template-columns: repeat(4, 1fr);
  }
}

.hero {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-5) 0 var(--s-3);
}
.hero .logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}
.hero h1 {
  font-size: var(--fs-2xl);
}

.toast-region {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + var(--s-3));
  transform: translateX(-50%);
  z-index: 30;
  width: min(100% - 2 * var(--gutter), 480px);
  display: grid;
  gap: var(--s-2);
}
.shell--bare ~ .toast-region {
  bottom: calc(var(--safe-bottom) + var(--s-3));
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow);
}
.toast .btn {
  min-height: 36px;
  background: transparent;
  color: inherit;
  border-color: currentColor;
}
.toast-danger {
  background: var(--danger);
  color: var(--danger-text);
}

.sheet {
  border: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: var(--s-4) var(--s-4) calc(var(--s-4) + var(--safe-bottom));
  width: 100%;
  max-width: 100%;
  margin: auto 0 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.sheet::backdrop {
  background: rgba(0, 0, 0, 0.45);
}
@media (min-width: 600px) {
  .sheet {
    border-radius: var(--radius);
    width: min(100%, 480px);
    margin: auto;
  }
}
.sheet ol {
  padding-left: var(--s-5);
  margin: 0;
}

.dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--s-2) var(--s-4);
  margin: 0;
}
.dl dt {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.dl dd {
  margin: 0;
  min-width: 0;
}
.online-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-muted);
}
.online-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}
.online-dot.is-offline::before {
  background: var(--danger);
}
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-strong);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    /* biome-ignore lint/complexity/noImportantStyles: reduced-motion must beat every component rule */
    animation-duration: 0.001ms !important;
    /* biome-ignore lint/complexity/noImportantStyles: reduced-motion must beat every component rule */
    animation-iteration-count: 1 !important;
    /* biome-ignore lint/complexity/noImportantStyles: reduced-motion must beat every component rule */
    transition-duration: 0.001ms !important;
    /* biome-ignore lint/complexity/noImportantStyles: reduced-motion must beat every component rule */
    scroll-behavior: auto !important;
  }
}

/* Jobs, live view and supplier mode (beads hail-3th.2, hail-5em.3) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px var(--s-2);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.6;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip-info {
  background: color-mix(in srgb, var(--focus) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--focus) 40%, transparent);
}
.chip-warn {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  border-color: var(--accent-strong);
}
/* Tinted background + coloured border; text stays --text so 12px bold chips keep >= 4.5:1. */
.chip-success {
  background: color-mix(in srgb, var(--success) 16%, var(--surface));
  border-color: var(--success);
}
.chip-danger {
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
  border-color: var(--danger);
}
.chip-neutral {
  color: var(--text-muted);
  border-color: var(--border);
}
.chip-tag {
  background: var(--surface);
  border-color: var(--border);
  font-family: var(--font-mono);
  font-weight: 600;
}
.chip-x {
  border: 0;
  background: transparent;
  padding: 0 2px;
  min-width: var(--tap);
  min-height: var(--tap);
  margin: -12px -8px -12px 0;
  cursor: pointer;
  color: inherit;
  font-size: var(--fs-md);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-2);
  min-height: 20px;
}
.danger-text {
  color: var(--danger);
}

.segmented {
  display: flex;
  gap: var(--s-1);
  padding: var(--s-1);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar {
  display: none;
}
.seg {
  flex: 1 0 auto;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 var(--s-3);
  border: 0;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
}
.seg.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.seg-count {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.job-row {
  text-decoration: none;
  color: inherit;
}
.job-row .title {
  font-weight: 650;
  min-width: 0;
  overflow-wrap: anywhere;
}
.job-head {
  display: grid;
  gap: var(--s-2);
}
.job-head h2 {
  overflow-wrap: anywhere;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-3);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 var(--s-4);
  border-left: 2px solid var(--border);
  display: grid;
  gap: var(--s-3);
}
.timeline li {
  position: relative;
  min-width: 0;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--s-4) - 6px);
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
}
.timeline li.is-current::before {
  background: var(--accent-strong);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}
.timeline li.is-danger::before {
  background: var(--danger);
}
.timeline li.is-success::before {
  background: var(--success);
}
.timeline .when {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.timeline .detail {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.pre {
  margin: 0;
  padding: var(--s-3);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 60vh;
  overflow: auto;
}
.photo {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.textarea {
  min-height: 112px;
  padding: var(--s-2) var(--s-3);
  resize: vertical;
  line-height: var(--lh);
}
.input.mono,
.textarea.mono {
  font-family: var(--font-mono);
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-2);
}
.criterion {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-3);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.hb {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-sm);
}
.hb-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 1.2s ease-in-out infinite;
}
.hb-dot.is-paused {
  background: var(--danger);
  animation: none;
}
@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}
.file-input {
  min-height: var(--tap);
  padding: var(--s-2) 0;
}
.verify-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-1);
}
.verify-list li {
  display: flex;
  gap: var(--s-2);
  align-items: baseline;
  flex-wrap: wrap;
}
.sticky-actions {
  position: sticky;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + var(--s-2));
  z-index: 5;
}
.shell--bare .sticky-actions {
  bottom: calc(var(--safe-bottom) + var(--s-2));
}
.big-amount {
  font-size: var(--fs-xl);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

/* Owner metrics (hail-163.12): KPI tiles, outcome bar, legend */
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-2);
  margin: 0;
}
@media (min-width: 600px) {
  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.stat {
  display: grid;
  gap: 2px;
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  min-width: 0;
}
.stat dt {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.stat dd {
  margin: 0;
  display: grid;
  gap: 2px;
}
.stat-value {
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.segbar {
  width: 100%;
  height: 8px;
  display: block;
}
.seg-settled {
  fill: var(--success);
}
.seg-failed {
  fill: var(--danger);
}
.seg-cancelled {
  fill: var(--text-muted);
}
.seg-empty {
  fill: var(--border);
}
.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-4);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend strong {
  color: var(--text);
}
.swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--border);
}
.swatch.seg-settled {
  background: var(--success);
}
.swatch.seg-failed {
  background: var(--danger);
}
.swatch.seg-cancelled {
  background: var(--text-muted);
}

/* Legal drafts (hail-163.11): footer links and rendered markdown */
.footer-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-4);
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.prose {
  display: grid;
  gap: var(--s-3);
  line-height: 1.6;
}
.prose h1 {
  font-size: var(--fs-xl);
}
.prose h2 {
  font-size: var(--fs-lg);
  margin-top: var(--s-3);
}
.prose h3 {
  font-size: var(--fs-md);
  margin-top: var(--s-2);
}
.prose ul,
.prose ol {
  margin: 0;
  padding-left: var(--s-5);
  display: grid;
  gap: var(--s-1);
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--s-2) 0;
}
.quote {
  margin: 0;
  padding: var(--s-2) var(--s-4);
  border-left: 3px solid var(--accent-strong);
  color: var(--text-muted);
}
.table-wrap {
  overflow-x: auto;
  max-width: 100%;
}
.table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--fs-sm);
}
.table th,
.table td {
  text-align: left;
  vertical-align: top;
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--border);
}
.table th {
  color: var(--text-muted);
  font-weight: 700;
}
.chips a.chip {
  text-decoration: none;
  min-height: var(--tap);
  padding: 0 var(--s-3);
}
