/* ==========================================================================
   TruckBuddies — design system
   ========================================================================== */
:root {
  --bg: #FBF7F1;
  --surface: #FFFFFF;
  --surface-2: #F5EEE4;
  --surface-3: #EFE5D8;
  --ink: #1F1712;
  --ink-2: #54473E;
  --muted: #8A7C71;
  --line: rgba(31, 23, 18, .09);
  --line-2: rgba(31, 23, 18, .16);
  --brand: #FF5A36;
  --brand-2: #E0301A;
  --brand-ink: #C42A13;
  --brand-soft: #FFE8DF;
  --night: #1F1712;
  --night-text: #FBF7F1;
  --mustard: #FFB627;
  --mustard-soft: #FFF1D1;
  --live: #14A862;
  --live-soft: #DCF5E8;
  --danger: #D92D20;
  --shadow-sm: 0 1px 2px rgba(31, 23, 18, .06), 0 1px 1px rgba(31, 23, 18, .04);
  --shadow: 0 6px 24px -8px rgba(31, 23, 18, .18), 0 2px 6px rgba(31, 23, 18, .05);
  --shadow-lg: 0 24px 60px -18px rgba(31, 23, 18, .35), 0 6px 18px rgba(31, 23, 18, .08);
  --radius: 20px;
  --radius-sm: 12px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --topbar-h: 68px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #110D0A; --surface: #1B1511; --surface-2: #241C17; --surface-3: #2E241E;
    --ink: #F8F0E7; --ink-2: #D2C4B7; --muted: #9C8C7F; --line: rgba(255, 240, 225, .09); --line-2: rgba(255, 240, 225, .16);
    --brand-soft: rgba(255, 90, 54, .16); --mustard-soft: rgba(255, 182, 39, .14); --live-soft: rgba(20, 168, 98, .18);
    --brand-ink: #FF8A66;
    --shadow: 0 8px 30px -10px rgba(0, 0, 0, .6); --shadow-lg: 0 28px 70px -18px rgba(0, 0, 0, .75);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #110D0A; --surface: #1B1511; --surface-2: #241C17; --surface-3: #2E241E;
  --ink: #F8F0E7; --ink-2: #D2C4B7; --muted: #9C8C7F; --line: rgba(255, 240, 225, .09); --line-2: rgba(255, 240, 225, .16);
  --brand-soft: rgba(255, 90, 54, .16); --mustard-soft: rgba(255, 182, 39, .14); --live-soft: rgba(20, 168, 98, .18);
  --brand-ink: #FF8A66;
  --shadow: 0 8px 30px -10px rgba(0, 0, 0, .6); --shadow-lg: 0 28px 70px -18px rgba(0, 0, 0, .75);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
p a, .link { color: var(--brand-ink); font-weight: 600; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 .4em; font-weight: 800; }
h1 { font-size: clamp(2.2rem, 5.5vw, 4.2rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.25rem; letter-spacing: -.01em; }
h4 { font-size: 1rem; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--brand); color: #fff; }
.i { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.wrap { width: min(1200px, 100% - 40px); margin-inline: auto; }
.hide { display: none !important; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1000; height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { height: 100%; display: flex; align-items: center; gap: 24px; padding: 0 20px; max-width: 1440px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 9px; }
.wordmark { font-family: var(--font-display); font-weight: 800; font-size: 25px; letter-spacing: -.045em; line-height: 1; }
.wordmark b { color: var(--brand); font-weight: 800; }
.mainnav { display: flex; gap: 4px; margin-left: 8px; }
.mainnav a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; font-weight: 600; color: var(--ink-2); transition: .2s var(--ease); }
.mainnav a .i { width: 17px; height: 17px; opacity: .7; }
.mainnav a:hover { background: var(--surface-2); color: var(--ink); }
.mainnav a.active { background: var(--ink); color: var(--bg); }
.mainnav a.active .i { opacity: 1; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; transition: .2s var(--ease); color: var(--ink-2);
}
.icon-btn:hover { border-color: var(--line-2); color: var(--ink); transform: translateY(-1px); }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; } :root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: block; } :root:not([data-theme="light"]) .i-moon { display: none; } }
.nav-toggle { display: none; }
.usermenu { position: relative; }
.usermenu-btn { display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; }
.usermenu-pop {
  position: absolute; right: 0; top: calc(100% + 10px); width: 270px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-lg); padding: 8px; opacity: 0; transform: translateY(-6px) scale(.98);
  pointer-events: none; transition: .18s var(--ease); transform-origin: top right;
}
.usermenu.open .usermenu-pop { opacity: 1; transform: none; pointer-events: auto; }
.usermenu-head { display: flex; gap: 10px; align-items: center; padding: 10px 10px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.usermenu-head small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.usermenu-pop a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; font-weight: 500; color: var(--ink-2); }
.usermenu-pop a:hover { background: var(--surface-2); color: var(--ink); }
.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--brand-soft); }
.avatar-sm { width: 32px; height: 32px; } .avatar-md { width: 42px; height: 42px; } .avatar-lg { width: 72px; height: 72px; }
.avatar-initials { display: inline-grid; place-items: center; color: var(--brand-ink); font-weight: 700; font-size: 13px; }
.avatar-lg.avatar-initials { font-size: 26px; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-grid; }
  .mainnav {
    position: fixed; left: 12px; right: 12px; top: calc(var(--topbar-h) + 8px); flex-direction: column; padding: 8px; margin: 0;
    background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg);
    opacity: 0; pointer-events: none; transform: translateY(-8px); transition: .2s var(--ease);
  }
  .mainnav.open { opacity: 1; pointer-events: auto; transform: none; }
  .mainnav a { padding: 14px; border-radius: 12px; }
  .hide-sm { display: none; }
  .usermenu-btn { padding: 3px; }
}
@media (max-width: 480px) {
  .topbar-inner { gap: 10px; padding: 0 12px; }
  .brand { gap: 6px; }
  .brand img { width: 28px; height: 28px; }
  .topbar .wordmark { font-size: 20px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .icon-btn { width: 36px; height: 36px; }
  .topbar-actions .btn-sm { padding: 7px 12px; }
}

/* ---------- Buttons ---------- */
.btn {
  --b: var(--surface); --c: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--b); color: var(--c); font-weight: 650; cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s; line-height: 1.2; font-size: 15px;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn-primary { --b: linear-gradient(135deg, #FF7A45, var(--brand) 45%, var(--brand-2)); --c: #fff; border-color: transparent; box-shadow: 0 8px 22px -8px rgba(255, 90, 54, .7); }
.btn-primary { background: var(--b); }
.btn-dark { --b: var(--ink); --c: var(--bg); border-color: transparent; }
.btn-live { --b: var(--live); --c: #fff; border-color: transparent; box-shadow: 0 8px 22px -8px rgba(20, 168, 98, .7); }
.btn-ghost { --b: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn-danger { --c: var(--danger); }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-xs { padding: 5px 10px; font-size: 13px; gap: 6px; }
.btn-xs .i { width: 15px; height: 15px; }
.btn-lg { padding: 16px 28px; font-size: 17px; }
.btn-block { width: 100%; }
.btn.is-on { --b: var(--live-soft); --c: var(--live); border-color: color-mix(in srgb, var(--live) 40%, transparent); }
.btn.is-fav { --b: var(--brand-soft); --c: var(--brand-ink); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.btn.is-fav .i { fill: currentColor; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--c) var(--c) transparent transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Chips, badges ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: .15s var(--ease); user-select: none;
}
.chip:hover { border-color: var(--ink-2); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip input { display: none; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge .i { width: 13px; height: 13px; }
.badge-live { background: var(--live); color: #fff; }
.badge-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.4s infinite; }
.badge-soon { background: var(--mustard-soft); color: #9A6400; }
.badge-brand { background: var(--brand-soft); color: var(--brand-ink); }
.badge-green { background: var(--live-soft); color: var(--live); }
@keyframes blink { 50% { opacity: .35; } }
.diet { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 5px; border-radius: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; }
.diet-vegan { background: #DDF3E3; color: #1C7A3E; } .diet-vegetarian { background: #EAF4D9; color: #4C7A12; }
.diet-gluten_free { background: #FFF0D2; color: #94600A; } .diet-halal { background: #E1EEFB; color: #1F5F9A; }
.diet-spicy { background: #FFE3DC; color: #C42A13; }
:root[data-theme="dark"] .diet { filter: saturate(1.2) brightness(.9); }

/* Stars — CSS-only so they scale */
.stars { --size: 15px; display: inline-block; width: calc(var(--size) * 5); height: var(--size); vertical-align: -2px;
  background: linear-gradient(90deg, var(--mustard) var(--pct), var(--line-2) var(--pct));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01z'/%3E%3C/svg%3E") 0 0 / var(--size) var(--size) repeat-x;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01z'/%3E%3C/svg%3E") 0 0 / var(--size) var(--size) repeat-x; }
.stars.lg { --size: 22px; }
.rating { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.rating small { color: var(--muted); font-weight: 500; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 24px; }
.section { padding: 80px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head p { margin: 0; color: var(--muted); max-width: 520px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-ink); margin-bottom: 14px; }

/* Truck cover placeholder art: cuisine colour + pattern + emoji */
.cover {
  --c: var(--brand);
  position: relative; overflow: hidden; background-color: var(--c);
  background-image:
    radial-gradient(circle at 20% 120%, rgba(255,255,255,.28) 0 30%, transparent 31%),
    radial-gradient(circle at 110% -10%, rgba(0,0,0,.18) 0 35%, transparent 36%),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.07) 0 10px, transparent 10px 22px);
  background-size: cover; background-position: center;
}
.cover > .emoji { position: absolute; inset: 0; display: grid; place-items: center; font-size: 56px; filter: drop-shadow(0 8px 14px rgba(0,0,0,.25)); }
.cover.has-img > .emoji { display: none; }

.truck-card { display: flex; flex-direction: column; overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.truck-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.truck-card .cover { aspect-ratio: 16 / 9; }
.truck-card .logo-float { position: absolute; left: 16px; bottom: -22px; width: 56px; height: 56px; border-radius: 16px; border: 3px solid var(--surface); background: var(--surface); object-fit: cover; box-shadow: var(--shadow); z-index: 2; }
.truck-card .cover-wrap { position: relative; }
.truck-card .body { padding: 30px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.truck-card h3 { margin: 0; font-size: 1.2rem; }
.truck-card .tag { color: var(--muted); font-size: 14px; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.truck-card .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.truck-card .badges-tl { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; z-index: 2; }
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-weight: 650; font-size: 13.5px; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12.5px; }
.input, select.input, textarea.input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface);
  transition: border-color .15s, box-shadow .15s; outline: none; min-height: 46px;
}
textarea.input { min-height: 100px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .row, .row-3 { grid-template-columns: 1fr; } }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 550; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--surface-3); position: relative; cursor: pointer; transition: .2s; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: .2s var(--ease); }
.switch input:checked { background: var(--live); }
.switch input:checked::after { transform: translateX(18px); }
.search-box { position: relative; }
.search-box .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box .input { padding-left: 42px; border-radius: 999px; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.star-input input { display: none; }
.star-input label { cursor: pointer; width: 34px; height: 34px; color: var(--line-2); transition: transform .12s; }
.star-input label svg { width: 100%; height: 100%; fill: currentColor; stroke: none; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: var(--mustard); }
.star-input label:hover { transform: scale(1.12); }

/* ---------- Toasts & modal ---------- */
.toasts { position: fixed; z-index: 3000; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; animation: toastIn .35s var(--ease); pointer-events: auto; max-width: 90vw; }
.toast.err { background: var(--danger); color: #fff; }
.toast.ok .i { color: #5BE39D; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.modal { position: fixed; inset: 0; z-index: 2500; display: grid; place-items: center; padding: 20px; background: rgba(17, 12, 9, .55); backdrop-filter: blur(6px); animation: fade .2s; }
.modal-card { position: relative; width: min(460px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: 24px; padding: 32px; box-shadow: var(--shadow-lg); text-align: center; animation: pop .3s var(--ease); }
.modal-card.wide { width: min(640px, 100%); text-align: left; }
.modal-card > img { margin: 0 auto 14px; }
.modal-close { position: absolute; top: 14px; right: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }

/* ---------- Hero (landing) ---------- */
.hero { position: relative; overflow: hidden; padding: 64px 0 40px; }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: .55;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero h1 { margin-bottom: 20px; }
.hero h1 .hl { background: linear-gradient(120deg, #FF7A45, var(--brand) 50%, var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero h1 .squiggle { position: relative; white-space: nowrap; }
.hero h1 .squiggle::after { content: ''; position: absolute; left: 0; right: 0; bottom: -.08em; height: .22em; background: var(--mustard); border-radius: 99px; z-index: -1; opacity: .85; transform: rotate(-1.5deg); }
.hero .lede { font-size: 1.18rem; color: var(--ink-2); max-width: 520px; margin: 0 0 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art { position: relative; }
.hero-art img { width: 100%; filter: drop-shadow(0 30px 40px rgba(31, 23, 18, .2)); animation: bob 6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.hero-art .float-card { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; font-size: 13.5px; font-weight: 600; animation: bob 7s ease-in-out infinite; }
.hero-art .float-card .emo { font-size: 24px; }
.hero-art .float-card small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.hero-art .fc1 { left: -6%; top: -4%; animation-delay: -2s; }
.hero-art .fc2 { right: -2%; bottom: 8%; animation-delay: -4s; }
.live-counter { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-weight: 600; font-size: 14px; margin-bottom: 22px; }
.live-counter .badge-live { padding: 4px 10px; }
.stat-strip { display: flex; gap: 36px; margin-top: 36px; flex-wrap: wrap; }
.stat-strip div { display: flex; flex-direction: column; }
.stat-strip strong { font-family: var(--font-display); font-size: 2rem; letter-spacing: -.03em; line-height: 1; }
.stat-strip span { color: var(--muted); font-size: 13.5px; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .hero-art { max-width: 520px; margin: 0 auto; } .hero { padding-top: 36px; } }

.map-showcase { position: relative; border-radius: 28px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-lg); height: 520px; background: var(--surface-2); }
.map-showcase .map { position: absolute; inset: 0; }
.map-showcase .overlay { position: absolute; z-index: 500; left: 20px; top: 20px; right: 20px; display: flex; justify-content: space-between; gap: 12px; pointer-events: none; flex-wrap: wrap; }
.map-showcase .overlay > * { pointer-events: auto; }
.glass { background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.glass-pad { padding: 12px 16px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { padding: 28px; position: relative; overflow: hidden; }
.step .num { font-family: var(--font-display); font-weight: 800; font-size: 72px; line-height: 1; position: absolute; right: 18px; top: 6px; color: var(--surface-2); z-index: 0; }
.step > * { position: relative; }
.step .ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 18px; }
.step .ico .i { width: 24px; height: 24px; }
.step p { color: var(--muted); margin: 0; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

.feeder-band { background: var(--night); color: var(--night-text); border: 1px solid var(--line); border-radius: 32px; padding: 56px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; position: relative; overflow: hidden; }
.feeder-band::after { content: ''; position: absolute; right: -120px; top: -120px; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 90, 54, .55), transparent 65%); }
.feeder-band p { color: rgba(251, 247, 241, .72); font-size: 1.08rem; }
.feeder-band ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; position: relative; z-index: 1; }
.feeder-band li { display: flex; gap: 12px; align-items: flex-start; }
.feeder-band li .i { color: var(--mustard); margin-top: 3px; }
@media (max-width: 860px) { .feeder-band { grid-template-columns: 1fr; padding: 32px; } }

/* ---------- Explore (map app) ---------- */
.page-explore { height: 100vh; height: 100dvh; overflow: hidden; }
.page-explore main { display: grid; grid-template-columns: 420px 1fr; min-height: 0; height: calc(100dvh - var(--topbar-h)); }
.explore-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--bg); position: relative; z-index: 2; }
.explore-filters { padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--line); }
.seg { display: flex; padding: 4px; border-radius: 999px; background: var(--surface-2); gap: 2px; overflow-x: auto; scrollbar-width: none; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 10px; border-radius: 999px; font-weight: 650; font-size: 13.5px; cursor: pointer; white-space: nowrap; color: var(--ink-2); transition: .15s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg button[data-when="now"].on { background: var(--live); color: #fff; }
.seg button[data-when="now"] .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); }
.seg button[data-when="now"].on .dot { background: #fff; animation: blink 1.4s infinite; }
.explore-summary { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; font-size: 13.5px; color: var(--muted); }
.explore-summary strong { color: var(--ink); }
.explore-list { flex: 1; overflow-y: auto; padding: 0 12px 24px; display: flex; flex-direction: column; gap: 10px; }
.stop-card { display: grid; grid-template-columns: 76px 1fr; gap: 14px; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: .2s var(--ease); position: relative; }
.stop-card:hover, .stop-card.active { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.stop-card.active { outline: 2px solid var(--brand); outline-offset: -1px; }
.stop-card .thumb { width: 76px; height: 76px; border-radius: 14px; }
.stop-card .thumb .emoji { font-size: 34px; }
.stop-card h4 { font-size: 1.04rem; margin: 0 0 2px; display: flex; gap: 8px; align-items: center; letter-spacing: -.01em; }
.stop-card .loc { font-size: 13px; color: var(--ink-2); display: flex; gap: 5px; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.stop-card .loc .i { width: 14px; height: 14px; color: var(--muted); flex: none; }
.stop-card .when { font-size: 13px; font-weight: 600; margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stop-card .foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.stop-card .foot .going { font-size: 12.5px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.stop-card .foot .going .i { width: 14px; height: 14px; }
.stop-card .foot .btn { margin-left: auto; }
.stop-card.is-live { background: linear-gradient(180deg, var(--live-soft), var(--surface) 70%); }
.explore-map { position: relative; min-height: 0; }
.explore-map .map { position: absolute; inset: 0; }
.map-ctrls { position: absolute; z-index: 600; right: 16px; top: 16px; display: flex; flex-direction: column; gap: 8px; }
.map-ctrls .icon-btn { width: 44px; height: 44px; box-shadow: var(--shadow); }
.map-ctrls .icon-btn.on { background: var(--brand); color: #fff; border-color: transparent; }
.map-top { position: absolute; z-index: 600; left: 16px; top: 16px; right: 80px; display: flex; gap: 8px; pointer-events: none; }
.map-top > * { pointer-events: auto; }
.place-search { width: min(380px, 100%); }
.place-search .input { box-shadow: var(--shadow); border-color: transparent; }
.place-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); overflow: hidden; z-index: 10; }
.place-results button { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 11px 14px; cursor: pointer; font-size: 14px; align-items: flex-start; }
.place-results button:hover { background: var(--surface-2); }
.place-results .i { width: 16px; height: 16px; margin-top: 2px; color: var(--muted); }
.search-area { position: absolute; z-index: 600; left: 50%; bottom: 28px; transform: translateX(-50%); box-shadow: var(--shadow-lg); }
.live-ticker { position: absolute; z-index: 600; left: 16px; bottom: 28px; padding: 10px 14px; display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 13.5px; }
.updated { font-size: 12px; color: var(--muted); font-weight: 500; }
.mobile-switch { display: none; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .emoji-xl { font-size: 46px; margin-bottom: 8px; }
.empty h4 { color: var(--ink); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 18px; height: 104px; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 900px) {
  .page-explore main { grid-template-columns: 1fr; position: relative; }
  .explore-side { position: absolute; inset: 0; z-index: 700; transform: translateY(100%); transition: transform .35s var(--ease); }
  .page-explore.show-list .explore-side { transform: none; }
  .mobile-switch { display: inline-flex; position: fixed; z-index: 800; left: 50%; bottom: 22px; transform: translateX(-50%); box-shadow: var(--shadow-lg); }
  .search-area { bottom: 84px; }
  .live-ticker { display: none; }
  .map-top { right: 72px; }
}

/* ---------- Leaflet skin ---------- */
.leaflet-container { font: inherit; background: var(--surface-2); isolation: isolate; z-index: 0; }
.leaflet-tile-pane { filter: saturate(.72) contrast(.96) brightness(1.03); }
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(185deg) brightness(.92) contrast(.88) saturate(.55); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(185deg) brightness(.92) contrast(.88) saturate(.55); } }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow) !important; border-radius: 14px !important; overflow: hidden; }
.leaflet-control-zoom a { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--line) !important; width: 40px !important; height: 40px !important; line-height: 40px !important; }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 80%, transparent) !important; color: var(--muted) !important; font-size: 10.5px !important; border-radius: 8px 0 0 0; }
.leaflet-control-attribution a { color: var(--ink-2) !important; }
.leaflet-popup-content-wrapper { border-radius: 20px; padding: 0; overflow: hidden; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.leaflet-popup-content { margin: 0; width: 280px !important; font-size: 14px; line-height: 1.45; }
.leaflet-popup-tip { background: var(--surface); }
.leaflet-container a.leaflet-popup-close-button { top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.35); color: #fff; font: 18px/28px var(--font); text-align: center; z-index: 3; }
.leaflet-container .pop a { color: inherit; }
.leaflet-container .pop a.btn-dark { color: var(--bg); }
.pop .cover { height: 110px; }
.pop .cover .emoji { font-size: 44px; }
.pop .pop-body { padding: 14px 16px 16px; }
.pop h4 { font-size: 1.1rem; margin: 0 0 4px; }
.pop .pop-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0 10px; }
.pop .pop-actions { display: flex; gap: 8px; margin-top: 12px; }
.pop .pop-actions .btn { flex: 1; }
.pop .loc { color: var(--ink-2); font-size: 13px; }

/* Map pins */
.fs-pin { position: relative; width: 46px; height: 56px; }
.fs-pin .pin-body {
  position: absolute; left: 3px; top: 0; width: 40px; height: 40px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  background: var(--c, var(--brand)); border: 3px solid #fff; box-shadow: 0 6px 14px rgba(0,0,0,.3); transition: transform .2s var(--ease);
}
.fs-pin .pin-emoji { position: absolute; left: 3px; top: 0; width: 40px; height: 40px; display: grid; place-items: center; font-size: 19px; line-height: 1; }
.fs-pin img.pin-logo { position: absolute; left: 6px; top: 3px; width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.fs-pin.is-live .pin-body { background: var(--live); }
.fs-pin.is-live::before {
  content: ''; position: absolute; left: 23px; top: 48px; width: 16px; height: 16px; margin: -8px; border-radius: 50%;
  background: var(--live); animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite;
}
.fs-pin .live-dot { position: absolute; right: -2px; top: -4px; background: var(--live); color: #fff; font-size: 9px; font-weight: 800; padding: 2px 5px; border-radius: 99px; border: 2px solid #fff; letter-spacing: .04em; }
.fs-pin.active .pin-body, .fs-pin:hover .pin-body { transform: rotate(-45deg) scale(1.15); }
.leaflet-marker-icon.active-z { z-index: 9999 !important; }
@keyframes ping { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(3.2); opacity: 0; } }
.me-dot { width: 20px; height: 20px; border-radius: 50%; background: #2F80ED; border: 3px solid #fff; box-shadow: 0 0 0 8px rgba(47, 128, 237, .22), 0 2px 6px rgba(0,0,0,.3); }
.pick-pin { width: 34px; height: 46px; }
.pick-pin svg { width: 100%; height: 100%; filter: drop-shadow(0 6px 8px rgba(0,0,0,.3)); }
.cluster { display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 800; background: var(--ink); border: 3px solid #fff; box-shadow: var(--shadow); }

/* ---------- Truck page ---------- */
.truck-hero { position: relative; }
.truck-hero .cover { height: clamp(220px, 34vw, 380px); }
.truck-hero .cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, .45)); }
.truck-hero .cover > .emoji { font-size: 120px; }
.truck-head { display: flex; gap: 24px; align-items: flex-start; padding-top: 20px; position: relative; z-index: 2; flex-wrap: wrap; }
.truck-head .truck-logo { margin-top: -84px; }
.truck-head .actions { padding-top: 6px; }
.truck-logo { width: 128px; height: 128px; border-radius: 30px; border: 5px solid var(--bg); background: var(--surface); object-fit: cover; box-shadow: var(--shadow-lg); display: grid; place-items: center; font-size: 60px; flex: none; }
.truck-head .info { flex: 1; min-width: 260px; padding-bottom: 6px; }
.truck-head h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); margin: 0 0 6px; }
.truck-head .tag { font-size: 1.1rem; color: var(--ink-2); margin: 0 0 10px; }
.truck-head .meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.truck-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.truck-layout { display: grid; grid-template-columns: 1fr 380px; gap: 32px; margin: 36px auto 80px; align-items: start; }
.truck-aside { position: sticky; top: calc(var(--topbar-h) + 20px); display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 980px) { .truck-layout { grid-template-columns: minmax(0, 1fr); } .truck-aside { position: static; } }
/* Grid children must be allowed to shrink, or wide content (tab bars, long rows) stretches the page */
.truck-layout > *, .dash > *, .hero-grid > *, .feeder-band > * { min-width: 0; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.tabs button, .tabs a { border: 0; background: none; padding: 12px 16px; font-weight: 650; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.tabs button.on, .tabs a.on { color: var(--ink); border-color: var(--brand); }
.tabs .count { background: var(--surface-2); border-radius: 99px; padding: 1px 8px; font-size: 12px; }
.tab-panel { display: none; animation: fade .25s; }
.tab-panel.on { display: block; }
.menu-section { margin-bottom: 32px; }
.menu-section h3 { display: flex; align-items: center; gap: 12px; font-size: 1.35rem; }
.menu-section h3::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.menu-item { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px dashed var(--line-2); }
.menu-item:last-child { border-bottom: 0; }
.menu-item .mi-main { flex: 1; }
.menu-item h4 { font-family: var(--font); font-weight: 700; font-size: 1rem; letter-spacing: 0; margin: 0 0 3px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.menu-item p { margin: 0; color: var(--muted); font-size: 14px; }
.menu-item .price { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; white-space: nowrap; }
.menu-item.sold-out { opacity: .5; }
.menu-item.sold-out .price { text-decoration: line-through; }
.schedule-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 10px; }
.schedule-item.is-live { border-color: color-mix(in srgb, var(--live) 50%, transparent); background: linear-gradient(90deg, var(--live-soft), var(--surface) 60%); }
.datebox { width: 64px; height: 64px; border-radius: 16px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.datebox small { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--brand-ink); letter-spacing: .06em; }
.datebox strong { font-family: var(--font-display); font-size: 26px; font-weight: 800; }
.schedule-item h4 { margin: 0 0 2px; font-size: 1.05rem; }
.schedule-item .sub { color: var(--muted); font-size: 13.5px; display: flex; gap: 10px; flex-wrap: wrap; }
.schedule-item .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .schedule-item { grid-template-columns: 56px 1fr; } .schedule-item .acts { grid-column: 1 / -1; justify-content: flex-start; } .datebox { width: 56px; height: 56px; } }
.review { display: flex; gap: 14px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.review:last-child { border-bottom: 0; }
.review .rv-main { flex: 1; min-width: 0; }
.review .rv-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.review .rv-head strong { font-weight: 700; }
.review p { margin: 6px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.review .reply { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border-left: 3px solid var(--brand); font-size: 14px; }
.review .reply strong { display: block; font-size: 12.5px; color: var(--brand-ink); margin-bottom: 2px; }
.rating-summary { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; padding: 22px; margin-bottom: 18px; }
.rating-summary .big { font-family: var(--font-display); font-size: 56px; font-weight: 800; line-height: 1; letter-spacing: -.04em; text-align: center; }
.bars { display: grid; gap: 5px; }
.bars div { display: grid; grid-template-columns: 14px 1fr 30px; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.bars .bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bars .bar span { display: block; height: 100%; background: var(--mustard); border-radius: 99px; }
.mini-map { height: 240px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.info-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.info-list li { display: flex; gap: 10px; align-items: center; font-size: 14.5px; overflow-wrap: anywhere; }
.info-list .i { color: var(--muted); }
.live-card { padding: 20px; border-radius: var(--radius); background: var(--live); color: #fff; position: relative; overflow: hidden; }
.live-card::after { content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.12); }
.live-card h3 { margin: 6px 0 4px; }
.live-card .btn { --b: #fff; --c: var(--live); border: 0; margin-top: 12px; }

/* ---------- Page header & dashboard ---------- */
.page-head { padding: 44px 0 28px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 8px; }
.page-head p { color: var(--muted); margin: 0; font-size: 1.05rem; }
.dash { display: grid; grid-template-columns: 260px 1fr; gap: 28px; margin-bottom: 80px; align-items: start; }
.dash-side { position: sticky; top: calc(var(--topbar-h) + 20px); display: flex; flex-direction: column; gap: 6px; }
.dash-side .truck-switch { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; font-weight: 650; border: 1px solid transparent; }
.dash-side .truck-switch:hover { background: var(--surface); }
.dash-side .truck-switch.on { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-sm); }
.dash-side .truck-switch .ava { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex: none; overflow: hidden; }
.dash-side .truck-switch .ava img { width: 100%; height: 100%; object-fit: cover; }
.dash-side .truck-switch small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
@media (max-width: 900px) { .dash { grid-template-columns: minmax(0, 1fr); } .dash-side { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; } .dash-side::-webkit-scrollbar { display: none; } .dash-side .truck-switch { flex: none; } }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.kpi { padding: 18px 20px; }
.kpi span { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi span .i { width: 15px; height: 15px; }
.kpi strong { display: block; font-family: var(--font-display); font-size: 2.1rem; letter-spacing: -.03em; line-height: 1.1; margin-top: 6px; }
@media (max-width: 760px) { .kpis { grid-template-columns: 1fr 1fr; } }
.golive { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 22px 24px; border-radius: var(--radius); background: linear-gradient(120deg, var(--ink), #3A2A21); color: #fff; margin-bottom: 22px; position: relative; overflow: hidden; }
.golive.is-live { background: linear-gradient(120deg, #0E8B50, var(--live)); }
.golive h3 { margin: 0 0 4px; color: #fff; }
.golive p { margin: 0; opacity: .8; font-size: 14px; }
.golive .ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.golive select { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); color: #fff; border-radius: 999px; padding: 10px 14px; }
.golive select option { color: #000; }
@media (max-width: 700px) { .golive { grid-template-columns: 1fr; } .golive .ctl { justify-content: flex-start; } }
.table-list { display: flex; flex-direction: column; }
.table-list .tl-row { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.table-list .tl-row:last-child { border-bottom: 0; }
.table-list .tl-main { flex: 1; min-width: 0; }
.table-list .tl-main strong { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.table-list .tl-main small { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.table-list .tl-main strong { overflow-wrap: anywhere; }
.table-list .tl-price { font-family: var(--font-display); white-space: nowrap; }
.drag { cursor: grab; color: var(--muted); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h3 { margin: 0; }
.picker-map { height: 300px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line-2); margin-bottom: 16px; }
.upload-tile { position: relative; border-radius: 18px; overflow: hidden; border: 2px dashed var(--line-2); cursor: pointer; display: grid; place-items: center; background: var(--surface-2); transition: .2s; }
.upload-tile:hover { border-color: var(--brand); }
.upload-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.upload-tile .ut-label { position: relative; z-index: 1; display: flex; gap: 8px; align-items: center; background: var(--surface); padding: 8px 14px; border-radius: 999px; font-weight: 650; font-size: 13.5px; box-shadow: var(--shadow); }
.upload-tile input { display: none; }
.upload-cover { aspect-ratio: 16 / 7; }
.upload-logo { width: 120px; height: 120px; border-radius: 28px; }
.welcome-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; text-align: left; }
.role-card { position: relative; padding: 18px; border: 2px solid var(--line-2); border-radius: 18px; cursor: pointer; transition: .15s; display: block; }
.role-card:hover { border-color: var(--ink-2); }
.role-card input { position: absolute; opacity: 0; }
.role-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.role-card .emo { font-size: 32px; display: block; margin-bottom: 6px; }
.role-card strong { display: block; font-size: 1.05rem; }
.role-card small { color: var(--muted); }
.role-card .tick { position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; color: transparent; }
.role-card:has(input:checked) .tick { background: var(--brand); border-color: var(--brand); color: #fff; }
.role-card .tick .i { width: 14px; height: 14px; }

/* ---------- Login ---------- */
.auth-wrap { min-height: calc(100vh - var(--topbar-h)); display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { background: var(--night); color: var(--night-text); border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; padding: 60px; position: relative; overflow: hidden; }
.auth-art h2 { font-size: clamp(2rem, 3.5vw, 3rem); color: #fff; }
.auth-art p { color: rgba(255,255,255,.7); max-width: 420px; }
.auth-art img { max-width: 440px; margin-top: 24px; }
.auth-form { display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: min(400px, 100%); text-align: center; }
.auth-card .gbtn { display: flex; justify-content: center; min-height: 44px; margin: 24px 0 14px; }
/* Google's button iframe gets an opaque white backdrop if it inherits a dark color-scheme */
.gbtn iframe { color-scheme: light; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 20px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 48px 0 28px; margin-top: 40px; background: var(--surface); }
.footer-inner { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-brand p { color: var(--muted); max-width: 320px; margin: 12px 0 0; }
.footer-cols { display: flex; gap: 64px; }
.footer-cols div { display: flex; flex-direction: column; gap: 8px; }
.footer-cols h4 { font-family: var(--font); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.footer-cols a { color: var(--ink-2); font-weight: 500; }
.footer-cols a:hover { color: var(--brand); }
.footer-base { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.page-explore .footer { display: none; }

/* Misc */
.notice { padding: 14px 18px; border-radius: 14px; background: var(--mustard-soft); color: var(--ink); display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.notice.green { background: var(--live-soft); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; }
.filter-bar .search-box { flex: 1; min-width: 240px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ==========================================================================
   Phone layout
   ========================================================================== */
@media (max-width: 640px) {
  /* iOS zooms the page when focusing inputs smaller than 16px */
  .input, select.input, textarea.input, .search-box .input { font-size: 16px; }

  .wrap { width: calc(100% - 32px); }
  .card-pad { padding: 18px; }
  .page-head { padding: 28px 0 18px; }
  .section { padding: 56px 0; }

  /* Comfortable tap targets */
  .btn-xs { min-height: 36px; padding: 6px 12px; }
  .btn-sm { min-height: 40px; }

  /* List rows (dashboard schedule & menu): text gets its own line, controls wrap underneath, right-aligned */
  .table-list .tl-row { flex-wrap: wrap; gap: 10px 10px; padding: 14px; }
  .table-list .tl-main { flex: 1 1 calc(100% - 80px); }
  .table-list .tl-main + * { margin-left: auto; }

  /* Tabs scroll sideways: fade the edge so it's obvious there are more */
  .tabs { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 32px; }
  .tabs button, .tabs a { padding: 12px 12px; }

  /* Stop form: date full width, times side by side */
  .row-3.row-times { grid-template-columns: 1fr 1fr; }
  .row-3.row-times > :first-child { grid-column: 1 / -1; }

  /* Home hero */
  .hero-cta .btn { width: 100%; }
  .stat-strip { gap: 18px; justify-content: space-between; }
  .stat-strip strong { font-size: 1.6rem; }
  .stat-strip span { font-size: 12.5px; }
  .hero-art .float-card { display: none; }
  .map-showcase { height: 420px; border-radius: 22px; }
  .map-showcase .overlay { left: 12px; right: 12px; top: 12px; }
  .feeder-band { border-radius: 24px; padding: 26px 22px; }

  /* Dashboard */
  .golive { padding: 18px; }
  .golive .ctl { width: 100%; }
  .golive .ctl .btn, .golive .ctl select { flex: 1; }
  .kpi { padding: 14px 16px; }
  .kpi strong { font-size: 1.7rem; }
  .upload-tile.upload-cover { min-width: 0; width: 100%; flex-basis: 100%; }

  /* Truck page */
  .truck-logo { width: 104px; height: 104px; border-radius: 26px; font-size: 48px; }
  .truck-head .truck-logo { margin-top: -64px; }
  .truck-head .actions { width: 100%; }
  .truck-head .actions .btn { flex: 1; }
  .rating-summary { grid-template-columns: 1fr; gap: 14px; }

  /* Modals become bottom sheets */
  .modal { align-items: end; padding: 0; }
  .modal-card { width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; padding: 26px 20px calc(20px + env(safe-area-inset-bottom)); }

  .footer-cols { gap: 40px; }
}

/* Keep floating controls clear of the iPhone home bar */
.mobile-switch { bottom: calc(22px + env(safe-area-inset-bottom)); }
.toasts { bottom: calc(24px + env(safe-area-inset-bottom)); }

/* ==========================================================================
   Master admin
   ========================================================================== */
.admin-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-kpis .kpi small { display: block; font-size: 12px; margin-top: 2px; }
.admin-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.admin-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.chart-card { padding: 18px 20px; position: relative; }
.chart-card h3 { margin: 0; font-size: 1.05rem; }
.chart-card p { margin: 2px 0 10px; }
.mini-bars { position: relative; }
.mb-total strong { font-family: var(--font-display); font-size: 1.6rem; letter-spacing: -.02em; }
.mb-plot { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 96px; margin-top: 8px; padding-top: 14px; border-bottom: 1px solid var(--line-2); }
.mb-max { position: absolute; top: 0; left: 0; font-size: 11px; color: var(--muted); line-height: 1; }
.mb-plot::before { content: ''; position: absolute; left: 0; right: 0; top: 14px; border-top: 1px dashed var(--line); }
.mb-bar { flex: 1; height: max(var(--h), 2px); background: var(--brand); border-radius: 4px 4px 0 0; opacity: .85; cursor: default; outline: none; position: relative; }
.mb-bar[style*="--h:0%"] { background: var(--line-2); opacity: 1; }
/* Bigger invisible hit area than the bar itself */
.mb-bar::after { content: ''; position: absolute; left: -1px; right: -1px; bottom: 0; height: 96px; }
.mb-bar:hover, .mb-bar:focus-visible { opacity: 1; background: var(--brand-2); }
.mb-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.mb-tip { position: absolute; transform: translate(-50%, -100%); background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 8px; white-space: nowrap; pointer-events: none; z-index: 5; }

.admin-toolbar { gap: 10px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.admin-table td.empty { text-align: center; padding: 40px 14px; }
.admin-table tr.is-banned td { background: color-mix(in srgb, var(--danger) 6%, transparent); }
.admin-table tr.is-past td { opacity: .6; }
.admin-table .input { min-height: 38px; padding: 7px 10px; }
.cell-user { display: flex; gap: 10px; align-items: center; min-width: 200px; }
.cell-user small { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.cell-logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; overflow: hidden; flex: none; }
.cell-logo img { width: 100%; height: 100%; object-fit: cover; }
.cell-actions { white-space: nowrap; text-align: right; }
.cell-actions .btn + .btn { margin-left: 4px; }
.cell-wide { min-width: 260px; max-width: 460px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; padding: 14px; border-top: 1px solid var(--line); }
.pager:empty { display: none; }

@media (max-width: 980px) {
  .admin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-charts, .admin-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  /* Tables become stacked cards on phones */
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .admin-table td { padding: 4px 0; border: 0; }
  .admin-table td.cell-actions { text-align: left; padding-top: 10px; white-space: normal; }
  .cell-user, .cell-wide { min-width: 0; max-width: none; }
}
