/* Easy Ride design system. Mobile first. */

:root {
  --ink: #131C20;
  --ink-2: #1E2A2F;
  --ink-3: #2C3A40;
  --brand: #0E7A65;
  --brand-dark: #0A5F4F;
  --teal: #16A286;
  --teal-bright: #5FD4B6;
  --teal-tint: #E3F4EF;
  --teal-tint-2: #F1F9F7;
  --coral: #E8804A;
  --coral-dark: #B24F1C;
  --coral-tint: #FDF1EA;
  --plate: #111111;
  --plate-ink: #F5C400;
  --paper: #FFFFFF;
  --paper-2: #F6F8F8;
  --line: #DFE6E7;
  --control-line: #7A888E;
  --line-2: #EDF1F2;
  --muted: #56666D;
  --danger: #B3261E;
  --danger-tint: #FDF1F0;
  --warn: #8A5300;
  --warn-tint: #FDF5E6;
  --watch: #6B6B1F;
  --watch-tint: #FAFAE8;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --shadow: 0 1px 2px rgba(19,28,32,.05), 0 6px 20px -10px rgba(19,28,32,.12);
  --shadow-lg: 0 2px 4px rgba(19,28,32,.08), 0 24px 60px -28px rgba(19,28,32,.30);
  --tap: 44px;
  --header-h: 56px;

  --sans: "Karla", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@font-face { font-family: "Karla"; src: url("../fonts/Karla.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("../fonts/PlusJakartaSans.woff2") format("woff2"); font-weight: 500 800; font-display: swap; }

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

/* A focused control must never end up underneath a fixed bar. */
html { scroll-padding-top: calc(var(--header-h) + 12px); scroll-padding-bottom: 84px; }

/* class rules with a display value would otherwise beat the user agent's [hidden] */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper-2);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 700; line-height: 1.2; letter-spacing: -0.015em; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; }
p { margin: 0 0 .75rem; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 200;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: var(--r);
  transition: top .15s;
}
.skip-link:focus { top: 8px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

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

.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 60;
  background: var(--ink);
  color: #fff;
  height: var(--header-h);
  display: flex; align-items: center; gap: .75rem;
  padding: 0 .75rem;
  border-bottom: 3px solid var(--teal);
}

.brand { display: flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; flex-shrink: 0; }
.brand img { height: 34px; width: auto; display: block; background: #fff; padding: 4px 10px; border-radius: 10px; }
.brand-text { font-weight: 700; letter-spacing: .02em; font-size: .9rem; white-space: nowrap; }
.brand-text span { color: var(--teal-bright); }

.topbar-spacer { flex: 1; }

.icon-btn {
  appearance: none; background: transparent; border: 1px solid transparent;
  color: #fff; min-width: var(--tap); min-height: var(--tap);
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r); cursor: pointer; padding: 0 .6rem; font: inherit;
}
.icon-btn:hover { background: rgba(255,255,255,.10); }
.icon-btn[aria-expanded="true"] { background: rgba(255,255,255,.16); }

/* primary navigation: bottom bar on mobile, inline on desktop */
.mainnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
  display: flex; background: var(--paper); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.mainnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 56px; text-decoration: none; color: var(--muted);
  font-size: .68rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
  border-top: 3px solid transparent;
}
.mainnav a svg { width: 20px; height: 20px; }
.mainnav a[aria-current="page"] { color: var(--brand); border-top-color: var(--brand); background: var(--teal-tint-2); }

main { flex: 1; padding: 1rem .75rem calc(72px + env(safe-area-inset-bottom)); }
.wrap { max-width: 1400px; margin: 0 auto; }

/* ---------- search ---------- */

.search { position: relative; flex: 1; max-width: 520px; }
.search-toggle { display: none; }

@media (max-width: 1023px) {
  .search-toggle { display: inline-flex; }
  .search {
    position: absolute; left: .5rem; right: .5rem; top: 50%; transform: translateY(-50%);
    max-width: none; z-index: 8;
  }
  .search[data-open="false"], .search:not([data-open]) {
    opacity: 0; pointer-events: none; visibility: hidden;
  }
  .search[data-open="true"] { opacity: 1; pointer-events: auto; }
  .search[data-open="true"] ~ .search-toggle { background: rgba(255,255,255,.16); }
}
.topbar .search input {
  width: 100%; height: 38px; min-height: 38px; border-radius: var(--r);
  border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.10);
  color: #fff; padding: 0 .75rem 0 2.1rem; font: inherit;
}
.topbar .search input::placeholder { color: rgba(255,255,255,.62); }
.topbar .search input:focus { background: rgba(255,255,255,.18); border-color: var(--teal-bright); outline: none; }
.search svg { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: rgba(255,255,255,.7); pointer-events: none; }

.results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 90;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-lg); overflow: hidden; max-height: 60vh; overflow-y: auto;
}
.results a {
  display: flex; justify-content: space-between; gap: .75rem; align-items: baseline;
  padding: .6rem .75rem; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line-2);
}
.results a:last-child { border-bottom: 0; }
.results a:hover, .results a:focus { background: var(--teal-tint-2); }
.results .r-name { font-weight: 600; }
.results .r-meta { color: var(--muted); font-size: .8rem; }
.results .empty { padding: .75rem; color: var(--muted); }

/* ---------- cards and sections ---------- */

.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow); margin-bottom: 1rem; overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .85rem 1rem; border-bottom: 1px solid var(--line-2); background: var(--paper);
}
.card-head h2 { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.card-body { padding: 1rem; }
.card-body.flush { padding: 0; }

.count-pill {
  background: var(--teal-tint); color: var(--brand-dark);
  border-radius: 999px; padding: .1rem .5rem; font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.count-pill.zero { background: var(--line-2); color: var(--muted); }
.count-pill.alert { background: var(--danger-tint); color: var(--danger); }

.section-title {
  display: flex; align-items: center; gap: .5rem;
  font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); margin: 1.5rem 0 .6rem;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- KPI strip ---------- */

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-bottom: 1rem; }
.kpi {
  background: var(--ink); color: #fff; border-radius: var(--r);
  padding: .7rem .8rem; display: flex; flex-direction: column; gap: .1rem;
  text-decoration: none; position: relative; overflow: hidden;
}
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--teal-bright); }
.kpi.is-alert::after { background: #F87171; }
.kpi.is-warn::after { background: #FBBF24; }
.kpi-label { font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.66); font-weight: 700; }
.kpi-value { font-family: var(--display); font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi-note { font-size: .7rem; color: rgba(255,255,255,.62); }
a.kpi:hover { background: var(--ink-2); }

/* ---------- money: client billing beside one-off income ---------- */

/* Client billing and other income are deliberately separate figures, so the
   line that adds them up is drawn as an equation rather than another KPI tile. */
.received-line {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  margin-top: .85rem; padding-top: .85rem; border-top: 1px solid var(--line-2);
  font-size: .85rem; color: var(--muted);
}
.received-line b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 700; }
.received-line .plus { color: var(--muted); font-weight: 700; }
.received-line .received-total {
  margin-left: auto; padding: .2rem .6rem; border-radius: var(--r-sm);
  background: var(--teal-tint-2); color: var(--brand-dark); font-weight: 600;
}
.received-line .received-total b { color: var(--brand-dark); }

.head-total { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }

@media (max-width: 560px) {
  .received-line .received-total { margin-left: 0; width: 100%; }
}

/* ---------- tables that become cards ---------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.data { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.data th {
  text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 800; padding: .6rem .75rem;
  background: var(--paper-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data th button {
  appearance: none; background: none; border: 0; padding: 0; font: inherit; color: inherit;
  cursor: pointer; display: inline-flex; align-items: center; gap: .25rem; text-transform: inherit; letter-spacing: inherit;
}
table.data th button:hover { color: var(--brand); }
table.data td { padding: .65rem .75rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--teal-tint-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data th.num { text-align: right; }
.nowrap { white-space: nowrap; }

.empty-state { padding: 2rem 1rem; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); margin-bottom: .25rem; }

@media (max-width: 1199px) {
  table.data td.col-optional, table.data th.col-optional { display: none; }
}

@media (max-width: 767px) {
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.data tr {
    border: 1px solid var(--line); border-radius: var(--r); margin: .5rem; padding: .35rem 0;
    background: var(--paper);
  }
  table.data tbody tr:hover { background: var(--paper); }
  table.data td {
    display: flex; justify-content: space-between; gap: 1rem; align-items: center;
    border-bottom: 1px solid var(--line-2); padding: .5rem .75rem; text-align: right;
  }
  table.data td:last-child { border-bottom: 0; }
  table.data td::before {
    content: attr(data-label); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); font-weight: 800; text-align: left; flex-shrink: 0;
  }
  table.data td[data-label=""]::before { content: none; }
  /* secondary columns live on the detail page; the card stays scannable */
  table.data td.col-optional, table.data th.col-optional { display: none; }
  table.data td.num { text-align: right; }
  .table-scroll { overflow-x: visible; }
}

/* Action cells hold a row of buttons. Left to the table's own width rules they
   were allowed to wrap, so a third button dropped onto a second line. They stay
   on one line and sit at the right edge, with the primary action last. */
@media (min-width: 768px) {
  table.data td.actions { text-align: right; white-space: nowrap; width: 1%; }
  table.data td.actions .btn-row { flex-wrap: nowrap; justify-content: flex-end; }
}

/* Two half-width cards side by side only have room for full-label buttons on a
   very wide screen. Below that they stack, and in the band where they sit side
   by side the secondary buttons keep their icon and drop the word. */
@media (min-width: 1440px) {
  .split-wide { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
}
@media (min-width: 1440px) and (max-width: 1699px) {
  table.data.compact-actions .btn-compactable .btn-label { display: none; }
  table.data.compact-actions .btn-compactable { padding: .25rem .5rem; }
}

/* ---------- badges ---------- */

.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  border-radius: 999px; padding: .12rem .5rem;
  font-size: .72rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.badge.u-overdue { background: var(--danger-tint); color: var(--danger); }
.badge.u-critical { background: var(--danger-tint); color: var(--danger); }
.badge.u-soon { background: var(--warn-tint); color: var(--warn); }
.badge.u-watch { background: var(--watch-tint); color: var(--watch); }
.badge.u-ok, .badge.u-none { background: var(--line-2); color: var(--muted); }
.badge.paid { background: var(--teal-tint); color: var(--brand-dark); }
.badge.neutral { background: var(--line-2); color: var(--muted); }
.badge.plan { background: var(--teal-tint-2); color: var(--brand-dark); border: 1px solid var(--teal-tint); }
.badge.hold { background: var(--warn-tint); color: var(--warn); }

.id-chip {
  font-family: var(--mono); font-size: .75rem; font-weight: 700; color: var(--muted);
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .05rem .35rem;
}

/* A gap to fill, not an error, so amber rather than red. Red here would compete
   with the genuinely overdue amounts sitting in the same row. */
.flag-chip {
  display: inline-flex; align-items: center; gap: .2rem; vertical-align: middle;
  background: var(--warn-tint); color: var(--warn); border: 1px solid #EBD9AE;
  border-radius: 999px; padding: .05rem .4rem; margin-left: .35rem;
  font-size: .68rem; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.flag-chip:hover, .flag-chip:focus-visible { background: #FBEFD5; color: var(--warn); border-color: var(--warn); }
.flag-chip svg { width: 11px; height: 11px; flex-shrink: 0; }

/* Still used on tab labels, where a word would not fit. Always paired with an
   aria-label so it is not silent to a screen reader. */
.dot-flag { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); margin-left: .25rem; vertical-align: middle; }

/* ---------- buttons and forms ---------- */

.btn {
  appearance: none; font: inherit; font-family: var(--display); font-size: .92rem; font-weight: 650; cursor: pointer;
  min-height: var(--tap); padding: .5rem .9rem; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--paper-2); border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-danger { color: var(--danger); border-color: #E7C4C1; background: var(--danger-tint); }
.btn-danger:hover { background: #F8DEDC; border-color: var(--danger); }
.btn-sm { min-height: 34px; padding: .25rem .6rem; font-size: .8rem; border-radius: var(--r-sm); }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }

.field { margin-bottom: .9rem; }
.field label { display: block; font-size: .76rem; font-weight: 700; color: var(--muted); margin-bottom: .25rem; text-transform: uppercase; letter-spacing: .04em; }
.field .hint { font-size: .76rem; color: var(--muted); margin-top: .25rem; font-weight: 400; text-transform: none; letter-spacing: 0; }
input[type=text], input[type=password], input[type=email], input[type=url], input[type=date],
input[type=month], input[type=number], input[type=search], input[type=tel], input[type=time], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--control-line); border-radius: var(--r); padding: .55rem .7rem; min-height: var(--tap);
}
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%235A6560'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; background-size: 12px; padding-right: 2rem; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 2px solid var(--teal-tint); outline-offset: 0; }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--brand); cursor: pointer; }
.check { display: flex; align-items: center; gap: .55rem; min-height: var(--tap); cursor: pointer; }
.check label, .check span { margin: 0; text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--ink); font-weight: 500; cursor: pointer; }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: .75rem 1rem; background: var(--paper-2); border-bottom: 1px solid var(--line-2); }
.filters .wide { grid-column: 1 / -1; }

/* ---------- boot skeleton ---------- */
/* Shown by index.html before app.js has fetched the session and built the
   shell. Removed by app.js once the real interface is up. Without this a
   cold load is a blank white screen for the length of that round trip. */

.bootload { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; background: var(--paper); }
.bootload img { height: 40px; width: auto; animation: bootpulse 1.1s ease-in-out infinite; }
@keyframes bootpulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

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

.msg { padding: .7rem .9rem; border-radius: var(--r); margin-bottom: 1rem; font-size: .875rem; border: 1px solid; display: flex; gap: .5rem; align-items: flex-start; }
.msg-error { background: var(--danger-tint); border-color: #E7C4C1; color: var(--danger); }
.msg-ok { background: var(--teal-tint); border-color: #C9E3B8; color: var(--brand-dark); }
.msg-warn { background: var(--warn-tint); border-color: #EBD9AE; color: var(--warn); }
.msg-info { background: var(--paper-2); border-color: var(--line); color: var(--muted); }
.msg strong { display: block; }

.toast-stack { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 300; display: flex; flex-direction: column; gap: .5rem; width: calc(100% - 1.5rem); max-width: 420px; }
.toast { background: var(--ink); color: #fff; padding: .7rem .9rem; border-radius: var(--r); box-shadow: var(--shadow-lg); font-size: .875rem; animation: rise .18s ease-out; }
.toast.is-error { background: var(--danger); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

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

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(19,28,32,.55); z-index: 200;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
.modal {
  background: var(--paper); width: 100%; max-height: 92vh; overflow-y: auto;
  border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow-lg);
  animation: sheet .2s ease-out;
}
@keyframes sheet { from { transform: translateY(16px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; gap: .75rem; padding: 1rem; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: var(--paper); z-index: 2; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 1rem; }
.modal-foot { display: flex; gap: .5rem; justify-content: flex-end; padding: 1rem; border-top: 1px solid var(--line-2); position: sticky; bottom: 0; background: var(--paper); }
.modal-foot .btn { flex: 1; }

/* ---------- detail view ---------- */

.detail-head { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 1rem; margin-bottom: 1rem; }
.detail-head h1 { font-size: 1.3rem; margin-bottom: .2rem; }
.detail-head .sub { color: rgba(255,255,255,.72); font-size: .85rem; word-break: break-all; }
.detail-head .sub a { color: var(--teal-bright); }
.detail-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .85rem; }

.tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 1rem; -webkit-overflow-scrolling: touch; }
.tabs button {
  appearance: none; background: none; border: 0; border-bottom: 3px solid transparent;
  font: inherit; font-weight: 650; color: var(--muted); padding: .6rem .8rem; cursor: pointer;
  white-space: nowrap; min-height: var(--tap);
}
.tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tabs button:hover { color: var(--ink); }

dl.facts { margin: 0; display: grid; grid-template-columns: 1fr; gap: 0; }
dl.facts > div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line-2); align-items: baseline; }
dl.facts > div:last-child { border-bottom: 0; }
dl.facts dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; flex-shrink: 0; }
dl.facts dd { margin: 0; text-align: right; word-break: break-word; }
dl.facts dd.blank { color: var(--muted); font-style: italic; }

.vault-row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .75rem; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: .5rem; background: var(--paper); }
.vault-row .grow { flex: 1; min-width: 140px; }
.secret { font-family: var(--mono); background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .3rem .5rem; font-size: .85rem; word-break: break-all; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 .9rem 1.1rem; border-left: 2px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: .35rem; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.timeline .t-when { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.progress { height: 6px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

.gap-list { list-style: none; margin: 0; padding: 0; }
.gap-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line-2); align-items: center; }
.gap-list li:last-child { border-bottom: 0; }

.bar-row { display: grid; grid-template-columns: minmax(70px, 1fr) 2fr auto; gap: .6rem; align-items: center; padding: .4rem 0; font-size: .85rem; }
.bar { height: 18px; background: var(--line-2); border-radius: var(--r-sm); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; background: var(--brand); }
.bar i.pending { background: var(--line); }

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

@media (min-width: 560px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .modal-backdrop { align-items: center; padding: 1.5rem; }
  .modal { max-width: 620px; border-radius: var(--r-lg); }
  .modal-foot .btn { flex: 0 0 auto; }
  .filters { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
  body { font-size: 15px; }
  main { padding: 1.25rem 1.25rem 2rem; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  dl.facts { grid-template-columns: 1fr 1fr; column-gap: 2rem; }
  .filters { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

@media (min-width: 1024px) {
  :root { --header-h: 60px; }
  .topbar { padding: 0 1.25rem; gap: 1rem; }
  .mainnav {
    position: static; border-top: 0; background: transparent; padding: 0;
    width: auto; flex: 0 0 auto; order: 2;
  }
  .mainnav a {
    flex: 0 0 auto; flex-direction: row; gap: .4rem; min-height: 38px; padding: 0 .75rem;
    border-top: 0; border-radius: var(--r); font-size: .8rem; text-transform: none; letter-spacing: 0;
    color: rgba(255,255,255,.78);
  }
  .mainnav a:hover { background: rgba(255,255,255,.10); color: #fff; }
  .mainnav a[aria-current="page"] { background: var(--brand); color: #fff; border-top-color: transparent; }
  .mainnav a svg { width: 16px; height: 16px; }
  main { padding-bottom: 2rem; }
  .toast-stack { bottom: 1.5rem; right: 1.5rem; left: auto; transform: none; }
  .kpis { grid-template-columns: repeat(7, 1fr); }
  .split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1rem; align-items: start; }
  .split-even { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
}

@media (min-width: 1536px) {
  main { padding: 1.5rem 2rem 2.5rem; }
  .wrap { max-width: 1560px; }
}

@media print {
  .topbar, .mainnav, .btn, .tabs, .toast-stack { display: none !important; }
  body { background: #fff; }
  .card { break-inside: avoid; box-shadow: none; }
  .kpi, .detail-head { background: #fff !important; color: var(--ink) !important; border: 1px solid var(--line); }
  .kpi *, .detail-head * { color: var(--ink) !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- sign in ---------- */

.login-page { background: var(--ink); display: flex; align-items: center; min-height: 100vh; }
.login-page main { width: 100%; padding: 1.5rem 1rem; }
.login-shell { max-width: 400px; margin: 0 auto; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-bottom: 1.25rem; color: #fff; }
.login-brand img { height: 64px; width: auto; background: #fff; padding: 8px 16px; border-radius: 14px; }
.login-brand > span { font-weight: 700; letter-spacing: .04em; }
.login-brand > span span { color: var(--teal-bright); }
.login-page .card { margin: 0; }
.login-page h1 { margin-bottom: .25rem; }
.login-foot { text-align: center; color: rgba(255,255,255,.5); font-size: .78rem; margin-top: 1.25rem; }

/* ---------- utilities ---------- */

.lede { color: var(--muted); font-size: .9rem; }
.btn-block { width: 100%; }
.noscript-note { padding: 2rem; max-width: 40rem; margin: 0 auto; }

/* icons carry no intrinsic size, so every context that holds one sets it */
.card-head > svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted); }
.msg > svg { width: 18px; height: 18px; flex-shrink: 0; }
.detail-head svg { width: 16px; height: 16px; }
svg { max-width: 100%; }


/* ---------- Easy Ride components ---------- */

.plate {
  display: inline-flex; align-items: center; font-family: var(--display); font-weight: 800;
  font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  background: var(--plate); color: var(--plate-ink); border-radius: 5px; padding: .12rem .45rem;
  box-shadow: inset 0 0 0 1.5px #3a3a3a; font-variant-numeric: tabular-nums;
}
a .plate, a.plate { text-decoration: none; }
.plate.lg { font-size: .9rem; padding: .2rem .6rem; }

.btn-accent { background: linear-gradient(180deg, #EC8A53, #DD6B35); border-color: #C95A26; color: #1B0E06; }
.btn-accent:hover { background: #DD6B35; border-color: #B24F1C; color: #1B0E06; }
.btn-primary { background: var(--brand); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--brand); padding-left: .4rem; padding-right: .4rem; }
.btn-quiet:hover { background: var(--teal-tint-2); border-color: transparent; }
.btn-wa { background: #E7F7EE; border-color: #BFE6CF; color: #0B6B3A; }
.btn-wa:hover { background: #D5F0E1; border-color: #0B6B3A; }

.new-booking-top { display: none; }
.fab {
  position: fixed; right: 1rem; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 80;
  width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #EC8A53, #DD6B35); color: #1B0E06; box-shadow: 0 10px 26px -10px rgba(221,107,53,.8), 0 2px 6px rgba(19,28,32,.2);
}
.fab svg { width: 26px; height: 26px; stroke-width: 2.5; }
@media (min-width: 1024px) {
  .fab { display: none; }
  .new-booking-top { display: inline-flex; order: 5; min-height: 38px; }
}

.badge.st-enquiry { background: var(--line-2); color: var(--muted); }
.badge.st-confirmed { background: var(--teal-tint); color: var(--brand-dark); }
.badge.st-out { background: var(--coral-tint); color: var(--coral-dark); }
.badge.st-returned { background: var(--warn-tint); color: var(--warn); }
.badge.st-closed { background: var(--line-2); color: var(--muted); }
.badge.st-cancelled { background: var(--danger-tint); color: var(--danger); text-decoration: line-through; }
.badge.owe { background: var(--coral-tint); color: var(--coral-dark); }
.badge.good { background: var(--teal-tint); color: var(--brand-dark); }
.badge.watch { background: var(--warn-tint); color: var(--warn); }
.badge.blacklisted { background: var(--danger); color: #fff; }
.badge.commission { background: #EEF0FB; color: #3B4396; }

.page-head { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { flex: 1 1 auto; font-size: 1.5rem; }
.page-head .sub { color: var(--muted); font-size: .9rem; width: 100%; margin-top: -.5rem; }

/* the headline sentence at the top of Home */
.hello { margin: .25rem 0 1rem; }
.hello h1 { font-size: 1.55rem; }
.hello p { color: var(--muted); margin: .2rem 0 0; }

/* fleet: one card per car, what it is doing right now */
.fleet { display: grid; grid-template-columns: 1fr; gap: .6rem; margin-bottom: 1rem; }
.bay {
  display: grid; grid-template-columns: auto 1fr; gap: .15rem .75rem; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: .75rem .85rem;
  position: relative; text-decoration: none; color: var(--ink); overflow: hidden;
}
.bay::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--teal); }
.bay.is-out::before { background: var(--coral); }
.bay.is-blocked::before { background: var(--control-line); }
.bay.is-overdue::before { background: var(--danger); }
.bay .bay-ico { grid-row: span 2; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--teal-tint-2); color: var(--brand); }
.bay.is-out .bay-ico { background: var(--coral-tint); color: var(--coral-dark); }
.bay .bay-ico svg { width: 22px; height: 22px; }
.bay .bay-name { font-family: var(--display); font-weight: 700; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.bay .bay-state { font-size: .88rem; color: var(--muted); }
.bay .bay-state b { color: var(--ink); font-weight: 600; }
.bay .bay-next { grid-column: 2; font-size: .8rem; color: var(--muted); }
@media (min-width: 640px) { .fleet { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .fleet { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1500px) { .fleet { grid-template-columns: repeat(5, 1fr); } }

/* work lists: pickups, returns, things to close */
.work-list { list-style: none; margin: 0; padding: 0; }
.work-list li { border-bottom: 1px solid var(--line-2); }
.work-list li:last-child { border-bottom: 0; }
.work-list a.row {
  display: grid; grid-template-columns: 1fr auto; gap: .15rem .75rem; padding: .7rem 1rem; text-decoration: none; color: var(--ink);
}
.work-list a.row:hover { background: var(--teal-tint-2); }
.work-list .w-title { font-weight: 600; display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.work-list .w-meta { font-size: .82rem; color: var(--muted); }
.work-list .w-side { grid-row: span 2; align-self: center; text-align: right; font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }
.work-list .w-side small { display: block; font-family: var(--sans); font-weight: 500; font-size: .74rem; color: var(--muted); }

/* the money headline tiles on Home */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: 1rem; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: .8rem .9rem; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: .15rem; }
a.tile:hover { border-color: var(--teal); }
.tile .t-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--muted); }
.tile .t-value { font-family: var(--display); font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile .t-note { font-size: .8rem; color: var(--muted); }
.tile.is-good { background: var(--teal-tint-2); border-color: var(--teal-tint); }
.tile.is-bad { background: var(--danger-tint); border-color: #EFC9C6; }
.tile.is-bad .t-value { color: var(--danger); }
.tile.is-warm { background: var(--coral-tint); border-color: #F5D6C3; }
.tile.wide { grid-column: 1 / -1; }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(4, 1fr); } .tile.wide { grid-column: auto; } }

.delta { font-size: .78rem; font-weight: 700; }
.delta.up { color: var(--brand); }
.delta.down { color: var(--coral-dark); }

.alerts { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .4rem; }
.alerts a {
  display: flex; gap: .6rem; align-items: flex-start; padding: .6rem .8rem; border-radius: var(--r);
  text-decoration: none; font-size: .9rem; border: 1px solid; line-height: 1.35;
}
.alerts a svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alerts .a-danger { background: var(--danger-tint); border-color: #EFC9C6; color: var(--danger); }
.alerts .a-warn { background: var(--warn-tint); border-color: #EBD9AE; color: var(--warn); }
.alerts .a-info { background: var(--paper); border-color: var(--line); color: var(--ink-3); }

.settle-line {
  display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; border-radius: var(--r);
  background: var(--ink); color: #fff; margin-bottom: 1rem; text-decoration: none;
}
.settle-line svg { width: 22px; height: 22px; color: var(--teal-bright); flex-shrink: 0; }
.settle-line b { font-family: var(--display); }
.settle-line span { color: rgba(255,255,255,.75); font-size: .85rem; display: block; }

/* bookings: availability and the calendar grid */
.segments { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .25rem; margin-bottom: .75rem; -webkit-overflow-scrolling: touch; }
.segments a, .segments button {
  flex: 0 0 auto; display: inline-flex; gap: .35rem; align-items: center; min-height: 38px; padding: 0 .8rem;
  border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-3);
  font: inherit; font-weight: 600; font-size: .88rem; text-decoration: none; cursor: pointer;
}
.segments [aria-current="true"], .segments [aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.segments .count-pill { background: var(--line-2); color: var(--muted); }
.segments [aria-current="true"] .count-pill { background: rgba(255,255,255,.18); color: #fff; }

.grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.cal { border-collapse: separate; border-spacing: 0; font-size: .78rem; min-width: 100%; }
table.cal th, table.cal td { padding: 0; border-bottom: 1px solid var(--line-2); }
table.cal thead th { font-weight: 700; color: var(--muted); text-align: center; padding: .35rem 0; min-width: 44px; background: var(--paper); position: sticky; top: 0; }
table.cal thead th.is-today { color: var(--brand); }
table.cal thead th small { display: block; font-weight: 500; font-size: .66rem; }
table.cal th.car { position: sticky; left: 0; background: var(--paper); z-index: 2; text-align: left; padding: .5rem .6rem; min-width: 118px; max-width: 150px; font-family: var(--display); font-size: .8rem; border-right: 1px solid var(--line); }
table.cal td.cell { height: 44px; position: relative; }
table.cal td.cell > * { position: absolute; inset: 5px 0; display: flex; align-items: center; padding: 0 .35rem; overflow: hidden; white-space: nowrap; font-weight: 600; font-size: .72rem; text-decoration: none; }
table.cal td.cell.is-today { background: var(--teal-tint-2); }
table.cal .c-confirmed { background: var(--teal-tint); color: var(--brand-dark); }
table.cal .c-out { background: #F9D9C6; color: #7A3410; }
table.cal .c-returned, table.cal .c-closed { background: #E8ECED; color: var(--muted); }
table.cal .c-enquiry { background: repeating-linear-gradient(135deg, #fff, #fff 4px, #EEF2F3 4px, #EEF2F3 8px); color: var(--muted); border: 1px dashed var(--control-line); }
table.cal .c-block { background: repeating-linear-gradient(135deg, #E3E7E8, #E3E7E8 4px, #F2F4F5 4px, #F2F4F5 8px); color: var(--ink-3); }
table.cal .c-start { border-top-left-radius: 7px; border-bottom-left-radius: 7px; margin-left: 3px; }
table.cal .c-end { border-top-right-radius: 7px; border-bottom-right-radius: 7px; margin-right: 3px; }
table.cal a.c-free { color: transparent; }
table.cal a.c-free:hover, table.cal a.c-free:focus-visible { background: var(--teal-tint-2); color: var(--brand); outline: none; box-shadow: inset 0 0 0 2px var(--teal); border-radius: 7px; }
.cal-legend { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); padding: .6rem 1rem; }
.cal-legend span { display: inline-flex; gap: .35rem; align-items: center; }
.cal-legend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }

.avail { list-style: none; margin: 0; padding: 0; }
.avail li { display: flex; gap: .75rem; align-items: center; padding: .6rem 1rem; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.avail li:last-child { border-bottom: 0; }
.avail .a-name { font-weight: 700; font-family: var(--display); flex: 1 1 auto; }
.avail .free { color: var(--brand); font-weight: 700; }
.avail .busy { color: var(--coral-dark); font-weight: 600; font-size: .88rem; }

/* choice chips for small fixed sets: fuel level, whose phone */
.choices { display: flex; flex-wrap: wrap; gap: .35rem; }
.choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choices label {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); min-width: 52px; padding: 0 .85rem;
  border: 1px solid var(--control-line); border-radius: var(--r); cursor: pointer; font-weight: 600; background: var(--paper);
  text-transform: none; letter-spacing: 0; font-size: .95rem; color: var(--ink); margin: 0;
}
.choices input:checked + label { background: var(--brand); border-color: var(--brand); color: #fff; }
.choices input:focus-visible + label { outline: 3px solid var(--brand); outline-offset: 2px; }

/* the new booking form: steps stacked, each in its own panel */
.step { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1rem; margin-bottom: .85rem; }
.step > h2 { font-size: 1rem; display: flex; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.step > h2 .n { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .78rem; display: inline-flex; align-items: center; justify-content: center; }
.match { padding: .7rem .8rem; border-radius: var(--r); background: var(--teal-tint-2); border: 1px solid var(--teal-tint); margin-bottom: .75rem; font-size: .9rem; }
.match.is-flag { background: var(--danger-tint); border-color: #EFC9C6; color: var(--danger); }
.car-pick { display: grid; grid-template-columns: 1fr; gap: .4rem; }
.car-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.car-pick label {
  display: flex; gap: .6rem; align-items: center; padding: .65rem .8rem; border: 1px solid var(--control-line); border-radius: var(--r);
  cursor: pointer; background: var(--paper); text-transform: none; letter-spacing: 0; color: var(--ink); font-size: .95rem; font-weight: 600; margin: 0;
}
.car-pick label small { margin-left: auto; font-weight: 600; font-size: .8rem; }
.car-pick label small.free { color: var(--brand); }
.car-pick label small.busy { color: var(--coral-dark); }
.car-pick input:checked + label { border-color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); background: var(--teal-tint-2); }
.car-pick input:focus-visible + label { outline: 3px solid var(--brand); outline-offset: 2px; }
@media (min-width: 640px) { .car-pick { grid-template-columns: 1fr 1fr; } }
.summary-bar {
  position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 50; background: var(--ink); color: #fff; border-radius: var(--r-lg);
  padding: .75rem .9rem; display: flex; gap: .75rem; align-items: center; box-shadow: var(--shadow-lg); margin-top: .5rem;
}
.summary-bar .sb-total { font-family: var(--display); font-size: 1.25rem; font-weight: 800; }
.summary-bar .sb-note { font-size: .78rem; color: rgba(255,255,255,.72); }
.summary-bar .grow { flex: 1; min-width: 0; }
@media (min-width: 1024px) { .summary-bar { bottom: 1rem; } }

/* booking detail */
.bk-head { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 1rem; margin-bottom: 1rem; }
.bk-head .top { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .45rem; }
.bk-head h1 { font-size: 1.35rem; }
.bk-head h1 a { color: #fff; text-decoration: none; }
.bk-head h1 a:hover { text-decoration: underline; }
.bk-head .meta { color: rgba(255,255,255,.78); font-size: .9rem; display: flex; flex-wrap: wrap; gap: .2rem .9rem; }
.bk-head .meta b { color: #fff; font-weight: 600; }
.bk-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .85rem; }
.bk-head .badge { box-shadow: 0 0 0 1px rgba(255,255,255,.15); }
.stages { display: flex; gap: 0; margin: .9rem 0 0; list-style: none; padding: 0; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.stages li { flex: 1; padding-top: .45rem; border-top: 3px solid rgba(255,255,255,.18); color: rgba(255,255,255,.5); }
.stages li.done { border-top-color: var(--teal-bright); color: rgba(255,255,255,.85); }
.stages li.now { border-top-color: var(--coral); color: #fff; }

.bill { width: 100%; border-collapse: collapse; font-size: .92rem; }
.bill td { padding: .45rem 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
.bill td.amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 1rem; }
.bill tr.total td { border-bottom: 0; border-top: 2px solid var(--ink); font-weight: 700; font-family: var(--display); padding-top: .6rem; }
.bill tr.bal td { border-bottom: 0; font-weight: 800; font-family: var(--display); font-size: 1.05rem; }
.bill tr.bal.owe td { color: var(--coral-dark); }
.bill tr.bal.clear td { color: var(--brand); }
.bill .x { appearance: none; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-sm); }
.bill .x:hover { color: var(--danger); }
.bill .x svg { width: 14px; height: 14px; }

.handover { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.handover h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .4rem; }
.handover dl { margin: 0; font-size: .9rem; }
.handover dl div { display: flex; justify-content: space-between; gap: .5rem; padding: .25rem 0; border-bottom: 1px solid var(--line-2); }
.handover dt { color: var(--muted); }
.handover dd { margin: 0; text-align: right; font-weight: 600; }

.suggest { border: 1px dashed var(--coral); background: var(--coral-tint); border-radius: var(--r); padding: .6rem .8rem; margin-bottom: .75rem; }
.suggest .check { min-height: 36px; }

.money-row { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 1rem; border-bottom: 1px solid var(--line-2); align-items: baseline; text-decoration: none; color: var(--ink); }
.money-row:last-child { border-bottom: 0; }
.money-row .m-main { min-width: 0; }
.money-row .m-title { font-weight: 600; }
.money-row .m-meta { font-size: .8rem; color: var(--muted); }
.money-row .m-amt { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.money-row .m-amt.in { color: var(--brand); }
.money-row .m-amt.out { color: var(--ink); }
.money-row.is-void { opacity: .55; }
.money-row.is-void .m-amt { text-decoration: line-through; }

.equation { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; font-size: .92rem; }
.equation .e-amt { text-align: right; font-variant-numeric: tabular-nums; }
.equation .e-sub { color: var(--muted); padding-left: .8rem; }
.equation .e-total { font-weight: 800; font-family: var(--display); border-top: 2px solid var(--ink); padding-top: .4rem; }

.split-cards { display: grid; gap: .75rem; }
@media (min-width: 900px) { .split-cards { grid-template-columns: 1fr 1fr; } }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.gap-top { margin-top: 1rem; }
.stack > * + * { margin-top: .75rem; }
.inline-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.legacy { font-size: .8rem; color: var(--muted); background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .5rem .7rem; }
.legacy dt { font-weight: 700; }
.legacy dl { display: grid; grid-template-columns: auto 1fr; gap: .15rem .75rem; margin: .35rem 0 0; }
.legacy dd { margin: 0; }
details.more > summary { cursor: pointer; color: var(--brand); font-weight: 600; min-height: 36px; display: flex; align-items: center; }
.bk-head .meta svg { width: 15px; height: 15px; vertical-align: -2px; }
.bk-head .btn-dark { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.22); }
.bk-head .btn-dark:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.4); }
.stages li { padding-right: .35rem; line-height: 1.25; }

/* Icons carry no size of their own. This default has no specificity, so every
   context that sizes an icon on purpose still wins. */
:where(svg[aria-hidden="true"]) { width: 18px; height: 18px; flex-shrink: 0; }
.car-pick label svg { width: 20px; height: 20px; color: var(--muted); }

.badge.st-passed { background: #EEF0FB; color: #3B4396; }
.pass-panel { border: 1px solid #D6DAF5; background: #F5F6FD; border-radius: var(--r); padding: .75rem .85rem; margin-top: .75rem; }
.pass-panel p { margin: 0 0 .5rem; font-size: .92rem; }
.one-car { display: flex; align-items: center; gap: .6rem; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: var(--r); font-weight: 600; }
.one-car small { margin-left: auto; font-weight: 700; text-align: right; }
.one-car small.free { color: var(--brand); }
.one-car small.busy { color: var(--coral-dark); }
.sharing { list-style: none; margin: 0; padding: 0; }
.sharing li { display: flex; gap: .75rem; justify-content: space-between; align-items: baseline; padding: .6rem 1rem; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.sharing li:last-child { border-bottom: 0; }
.sharing b { font-family: var(--display); }
