/* Humboldt Food Trucks. Theme colors come from /theme.css (admin → Design). */
:root {
  --primary: #1f6f5c;
  --accent: #e8833a;
  --bg: #faf8f4;
  --text: #1d2321;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --list-columns: 3;
  --surface: #fff;
  --muted: color-mix(in srgb, var(--text) 60%, var(--bg));
  --border: color-mix(in srgb, var(--text) 14%, transparent);
  --primary-soft: color-mix(in srgb, var(--primary) 10%, var(--surface));
  --accent-soft: color-mix(in srgb, var(--accent) 14%, var(--surface));
  --error: #c92a2a;
  --success: #2b8a3e;
  --warn: #e67700;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(0 0 0 / 4%), 0 2px 8px rgb(0 0 0 / 4%);
  --ring: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

/* The hidden attribute must win over component display rules. */
[hidden] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.45rem, 2.2vw, 1.9rem); letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
main.container { padding-top: 24px; padding-bottom: 48px; }
main.narrow, .narrow { max-width: 560px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-error { color: var(--error); }
.mt { margin-top: 16px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.inline { display: inline; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }

/* Header */
.site-header { background: var(--primary); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand-logo { height: 36px; width: auto; border-radius: 6px; background: #fff; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a, .site-nav .link-button { color: #fff; text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: .95rem; }
.site-nav a[aria-current="page"], .site-nav a:hover, .site-nav .link-button:hover { background: rgb(255 255 255 / 15%); }
.site-nav .nav-cta { background: var(--accent); }
.nav-toggle { display: none; background: transparent; border: 1px solid rgb(255 255 255 / 50%); color: #fff; border-radius: 8px; padding: 6px 10px; font: inherit; }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--primary); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; z-index: 1000; }
  .site-nav.open { display: flex; }
  .site-header { position: relative; }
}
.announcement { background: var(--accent-soft); border-bottom: 1px solid var(--border); padding: 8px 0; font-size: .95rem; }
.site-footer { border-top: 1px solid var(--border); padding: 24px 0; margin-top: 32px; font-size: .95rem; }

/* Buttons & forms */
.button, button.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border); min-height: 40px;
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; line-height: 1.2;
}
.button:hover { border-color: var(--primary); }
.button.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.button.primary:hover { filter: brightness(1.08); }
.button.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.button.ghost { background: transparent; }
.button.danger { background: var(--error); color: #fff; border-color: var(--error); }
.button.small { padding: 6px 12px; font-size: .875rem; min-height: 34px; }
.button.wide { width: 100%; }
.button:disabled { opacity: .6; cursor: not-allowed; }
.link-button { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
label { display: block; font-weight: 600; font-size: .9rem; }
.label { display: block; font-weight: 600; font-size: .9rem; }
/* Consistent vertical rhythm for stacked fields. */
form :where(label:not(.check):not(.chip):not(.sr-only)) { margin-bottom: 14px; }
.inline-form label { margin-bottom: 0; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; font: inherit; }
.icon-button:hover { color: var(--error); border-color: var(--error); }
label.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; margin: 6px 0; }
label.check input { margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], input[type=tel],
input[type=number], input[type=date], input[type=time], select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 12px; font: inherit; font-weight: 400;
  color: var(--text); background: var(--surface); border: 1px solid color-mix(in srgb, var(--text) 20%, transparent); border-radius: 8px;
  min-height: 42px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
input[type=date], input[type=time] { max-width: 16rem; }
input[type=number] { max-width: 10rem; }
input[type=color] { display: block; width: 100%; height: 42px; margin-top: 4px; border: 1px solid var(--border); border-radius: 10px; padding: 2px; background: var(--surface); }
input[type=file] { display: block; margin: 8px 0; font: inherit; }
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.help { font-size: .85rem; color: var(--muted); margin: 4px 0 0; }
.form-error { color: var(--error); font-size: .9rem; margin-top: 8px; }
.code-input { max-width: 13rem; font-size: 1.4rem; letter-spacing: .35em; text-align: center; font-family: ui-monospace, monospace; padding-left: .35em; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.inline-form label { margin: 0; }
.inline-form .grow { flex: 1 1 200px; }
.inline-form input.grow { flex: 1 1 160px; margin: 0; }
.narrow-input { max-width: 110px; }
.inline-form .narrow-input { margin: 0; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 16px 0 8px; }

/* Cards & layout */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card > :last-child { margin-bottom: 0; }
.card.danger { border-color: color-mix(in srgb, var(--error) 40%, transparent); }
.card.empty { text-align: center; padding: 40px 20px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 760px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }
.page-head { margin-bottom: 16px; }
.crumbs { margin: 0 0 4px; font-size: .9rem; }
.tabs, .view-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a, .view-tabs a { padding: 8px 14px; text-decoration: none; color: var(--text); border-bottom: 3px solid transparent; font-weight: 600; }
.tabs a[aria-current="page"], .view-tabs a[aria-current="page"] { border-color: var(--primary); color: var(--primary); }
.auth-card h2 { margin-bottom: .25em; }

/* Flash & badges */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid var(--border); background: var(--surface); }
.flash-success { border-color: color-mix(in srgb, var(--success) 40%, transparent); background: color-mix(in srgb, var(--success) 8%, var(--surface)); }
.flash-error { border-color: color-mix(in srgb, var(--error) 40%, transparent); background: color-mix(in srgb, var(--error) 7%, var(--surface)); }
.flash-info { border-color: color-mix(in srgb, var(--primary) 30%, transparent); background: var(--primary-soft); }
.badges { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.badge a { color: inherit; text-decoration: none; }
.badge.subtle { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.badge.now { background: var(--accent); color: #fff; }
.badge.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: #8a4b00; }
.status { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 6px; background: color-mix(in srgb, var(--text) 8%, transparent); vertical-align: middle; }
.status-published, .status-resolved, .status-sent { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.status-pending, .status-open { background: color-mix(in srgb, var(--warn) 18%, transparent); color: #8a4b00; }
.status-suspended, .status-failed { background: color-mix(in srgb, var(--error) 14%, transparent); color: var(--error); }

/* Home / search */
.hero { background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, var(--accent))); color: #fff; padding: 32px 0 28px; }
.hero h1 { margin-bottom: .25em; }
.hero p { margin: 0; opacity: .92; font-size: 1.05rem; }
.search-layout { display: grid; gap: 20px; padding-top: 20px; padding-bottom: 32px; grid-template-columns: 1fr; }
@media (min-width: 960px) { .search-layout { grid-template-columns: 290px minmax(0, 1fr); align-items: start; } .filters { position: sticky; top: 16px; } }
.filters-title { font-size: 1.05rem; }
.filters label { margin-bottom: 12px; }
.filters label.check { margin: 4px 0; }
.filter-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { margin: 0 !important; font-weight: 500; font-size: .88rem; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; }
.chip input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.results-header { margin-bottom: 12px; }
.results-header .view-tabs { margin-bottom: 8px; }
.card-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (min-width: 960px) { .results .card-grid { grid-template-columns: repeat(var(--list-columns), minmax(0, 1fr)); } }
.truck-card { padding: 0; overflow: hidden; margin: 0; display: flex; }
.truck-card-link { color: inherit; text-decoration: none; display: flex; flex-direction: column; width: 100%; }
.truck-card-link:hover h3 { color: var(--primary); text-decoration: underline; }
.truck-card-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--primary-soft); display: block; }
.truck-card-img.placeholder { display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.truck-card-body { padding: 14px 16px 16px; }
.truck-card h3 { margin-bottom: .2em; }
.tagline { color: var(--muted); margin-bottom: .4em; }
.next-stop { font-size: .9rem; margin: 8px 0 0; }
.empty { color: var(--muted); }

.map { height: 480px; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 12px; z-index: 0; }
.map.small-map { height: 300px; }
.map.picker { height: 260px; cursor: crosshair; }
.popup-sub { font-size: .85rem; color: #555; margin-top: 2px; }
.pin { font-size: 24px; line-height: 1; background: none; border: 0; }

.stop-list { list-style: none; padding: 0; margin: 0 0 16px; }
.stop-list li + li { border-top: 1px solid var(--border); }
.stop { display: grid; grid-template-columns: 170px 1fr auto; gap: 12px; padding: 12px 4px; align-items: start; }
.stop.now { background: var(--accent-soft); border-radius: 8px; }
.stop-actions { text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
@media (max-width: 560px) { .stop { grid-template-columns: 1fr; } .stop-actions { align-items: flex-start; flex-direction: row; } }

.week-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.calendar { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .calendar { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.day { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px; min-height: 120px; }
.day.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.day h3 { font-size: .95rem; }
.cal-stop { display: block; padding: 8px; margin-bottom: 6px; border-radius: 8px; background: var(--primary-soft); color: var(--text); text-decoration: none; font-size: .85rem; }
.cal-stop:hover { outline: 2px solid var(--primary); }
.cal-stop.now { background: var(--accent-soft); }
.cal-time { display: block; font-weight: 600; color: var(--primary); }
.cal-place { display: block; color: var(--muted); }

/* Truck page */
.truck-hero { margin-bottom: 20px; }
.truck-photo { width: 100%; max-height: 380px; object-fit: cover; border-radius: var(--radius); margin-bottom: 16px; }
.truck-title { display: flex; gap: 16px; align-items: center; }
.truck-logo { width: 84px; height: 84px; object-fit: contain; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); padding: 4px; flex-shrink: 0; }
.truck-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.truck-layout { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .truck-layout { grid-template-columns: minmax(0, 1fr) 320px; } }
.details { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; margin: 0; }
.details dt { font-weight: 600; color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.link-list, ul.plain { list-style: none; padding: 0; margin: 0; }
.link-list li, ul.plain li { padding: 6px 0; }
.prose p { max-width: 70ch; }

/* ------------------------------------------------------------------
   Overflow safety: long emails, URLs and IDs wrap instead of spilling.
   ------------------------------------------------------------------ */
body { overflow-wrap: break-word; }
.break { overflow-wrap: anywhere; word-break: break-word; }
.table td, .table th { overflow-wrap: anywhere; }
.card, .stat, .details dd { min-width: 0; }
code { overflow-wrap: anywhere; }

/* ------------------------------------------------------------------
   Search page: toolbar with view tabs + "Filters" pill.
   ------------------------------------------------------------------ */
.results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.results-toolbar .view-tabs { border-bottom: 0; margin: 0; flex-wrap: nowrap; }
.results-toolbar .view-tabs a { padding: 10px 12px; }
.results-summary { margin: 0 0 12px; }
.filters-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600;
  text-decoration: none; white-space: nowrap; box-shadow: var(--shadow); min-height: 40px;
}
.filters-pill.active { border-color: var(--primary); color: var(--primary); }
.pill-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: .8rem; }
.filters-head { display: flex; justify-content: space-between; align-items: center; }
.close-filters { display: none; }
body.filters-open { overflow: hidden; }
.cf-turnstile { margin: 8px 0 12px; }

@media (min-width: 960px) {
  .filters-pill { display: none; }
}

@media (max-width: 959px) {
  .hero { padding: 16px 0 14px; }
  .hero h1 { font-size: 1.35rem; margin-bottom: .15em; }
  .hero p { font-size: .95rem; }
  .search-layout { padding-top: 0; gap: 0; }

  /* The toolbar sticks to the top while scrolling a long list. */
  .results-toolbar { position: sticky; top: 0; z-index: 900; background: var(--bg); margin: 0 -16px 6px; padding: 6px 16px; }

  /* Filters become a full-screen sheet (works without JS via :target). */
  .filters-panel { display: none; }
  .filters-panel:target, body.filters-open .filters-panel {
    display: block; position: fixed; inset: 0; z-index: 2000; background: var(--bg); overflow-y: auto; overscroll-behavior: contain;
  }
  .filters-panel .filters { border: 0; border-radius: 0; box-shadow: none; margin: 0; min-height: 100%; padding: 12px 16px 104px; }
  .filters-panel .filters-head { position: sticky; top: 0; background: var(--surface); padding: 4px 0 8px; z-index: 1; }
  .close-filters { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 999px; font-size: 1.2rem; text-decoration: none; color: var(--text); border: 1px solid var(--border); }
  .filters-panel .filter-actions { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); z-index: 2; }
  .filters-panel .filter-actions .button { flex: 1; min-height: 48px; }

  /* Compact horizontal cards instead of tall image cards. */
  .card-grid { grid-template-columns: 1fr; gap: 10px; }
  .truck-card-link { flex-direction: row; align-items: stretch; }
  .truck-card-img { width: 104px; min-width: 104px; aspect-ratio: auto; height: auto; min-height: 104px; object-fit: cover; }
  .truck-card-img.placeholder { font-size: 2rem; }
  .truck-card-body { padding: 10px 12px; min-width: 0; }
  .truck-card h3 { font-size: 1rem; }
  .truck-card .tagline { font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 2px; }
  .truck-card .badges { margin: 4px 0; }
  .next-stop { margin-top: 4px; font-size: .85rem; }

  .map { height: 60vh; min-height: 320px; }
  .calendar .empty-day { min-height: 0; }
  .calendar .empty-day h3 { margin-bottom: 0; }
  .week-nav { gap: 8px; }
}

/* Phones */
@media (max-width: 760px) {
  .truck-photo { max-height: 220px; border-radius: 10px; }
  .truck-logo { width: 64px; height: 64px; }
  .truck-actions .button { flex: 1 1 auto; }
  h1 { font-size: 1.5rem; }
  main.container { padding-top: 16px; }
  .page-head .tabs, .admin-nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabs a, .admin-nav a { white-space: nowrap; }
  .truncate { max-width: none; white-space: normal; }

  /* Responsive tables: rows become labelled cards. */
  .table.responsive { display: block; overflow: visible; }
  .table.responsive thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; padding: 8px 12px; background: var(--surface); }
  .table.responsive td { border: 0; padding: 4px 0; }
  .table.responsive td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
}

/* Dashboard */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 6px 0; }
.checklist li.done a { color: var(--muted); text-decoration: line-through; }
.checklist li.done span { color: var(--success); }
.sync-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.preview { max-width: 240px; border-radius: 10px; display: block; margin-bottom: 8px; }
.logo-preview { max-width: 120px; background: var(--surface); border: 1px solid var(--border); padding: 4px; }
details summary { cursor: pointer; font-weight: 600; margin: 8px 0; }
.inline-details { display: inline-block; }
.inline-details summary { display: inline; list-style: none; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table.compact td, .table.compact th { padding: 6px; }
@media (max-width: 760px) { .table { display: block; overflow-x: auto; } }

/* Admin */
.admin-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.admin-nav a { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: .9rem; font-weight: 600; }
.admin-nav a[aria-current="page"] { background: var(--primary); color: #fff; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 20px; }
.stat { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--text); }
.stat strong { font-size: 1.6rem; }
.stat span { color: var(--muted); font-size: .9rem; }
.stat.attention { border-color: var(--warn); }
.report header { margin-bottom: 8px; }
.pager { display: flex; gap: 16px; }
.error-page { padding-top: 64px; text-align: center; }

/* "Ways to order" rows on the truck form */
.order-rows { display: grid; gap: 10px; margin-bottom: 12px; }
.order-row { display: grid; gap: 4px 12px; grid-template-columns: 1fr; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: color-mix(in srgb, var(--bg) 60%, var(--surface)); position: relative; }
.order-row label { margin-bottom: 0 !important; }
.order-row .icon-button { position: absolute; top: 8px; right: 8px; }
@media (min-width: 860px) {
  .order-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1fr) auto; align-items: end; padding-right: 12px; }
  .order-row .icon-button { position: static; margin-bottom: 3px; }
}
@media (max-width: 859px) {
  .order-row { padding-right: 52px; }
}

/* Auth pages */
.auth-card form { margin: 0; }
.auth-card .button { margin-top: 2px; }
.code-form { text-align: left; }

/* ------------------------------------------------------------------
   Final overrides — keep at the end of the file.
   ------------------------------------------------------------------ */
.sticky-actions {
  position: sticky; bottom: 12px; z-index: 50; display: flex; justify-content: flex-end; gap: 8px;
  padding: 10px 12px; margin: 16px 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 6px 24px rgb(0 0 0 / 10%);
}
.card-meta { font-size: .85rem; color: var(--primary); margin: 2px 0 0; font-weight: 600; }
.stop-list.compact .stop { grid-template-columns: 150px 1fr auto; }

@media (max-width: 959px) {
  .truck-card-link { align-items: flex-start; }
  .truck-card-img { width: 84px; min-width: 84px; height: 84px; min-height: 84px; margin: 12px 0 12px 12px; border-radius: 10px; }
  .truck-card-img.placeholder { font-size: 1.8rem; }
}

@media (max-width: 760px) {
  .admin-nav, .page-head .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .admin-nav::-webkit-scrollbar, .page-head .tabs::-webkit-scrollbar { display: none; }
  .admin-nav a, .page-head .tabs a { white-space: nowrap; flex: 0 0 auto; }
  /* Stacked table rows: label and value side by side. */
  .table.responsive td[data-label] { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 3px 0; }
  .table.responsive td[data-label]::before { font-size: .7rem; }
  .stop-list.compact .stop { grid-template-columns: 1fr; gap: 4px; }
  .sticky-actions { bottom: 8px; }
  .sticky-actions .button { flex: 1; }
}
@media (max-width: 760px) {
  .table.responsive td[data-label] .badge, .table.responsive td[data-label] .status { justify-self: start; width: max-content; }
}
