/* ===== KaSakay theme =====
   Soft slate base (easy on the eyes) with the logo's Filipino flag colors as accents:
   blue = main actions, sun gold = highlights, red = warnings/SOS. */

:root {
  --bg: #151B26;
  --bg-glow-1: rgba(127, 166, 232, 0.08);
  --bg-glow-2: rgba(242, 203, 90, 0.05);
  --surface: #1C2331;
  --surface-2: #232B3B;
  --surface-3: #2B3446;
  --border: #313B4F;
  --text: #DCE3EE;
  --muted: #97A3B6;
  --primary: #7FA6E8;
  --primary-2: #93B6EE;
  --primary-ink: #0E1A33;
  --accent: #F2CB5A;
  --accent-fill: #F2CB5A;
  --accent-ink: #2B2105;
  --online: #7FCF9F;
  --verified: #6FD6A3;
  --danger: #EE8A8A;
  --offer: #7FA6E8;
  --request: #A9A2DB;
  /* Exact logo colors, for stripes and small brand touches */
  --flag-blue: #0B3C9E;
  --flag-yellow: #FCD116;
  --flag-red: #D42A2F;
  --logo-plate: #F3F1EC;
  --shadow: 0 8px 24px -14px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --radius-sm: 10px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #EEF2F7;
  --bg-glow-1: rgba(31, 79, 163, 0.06);
  --bg-glow-2: rgba(252, 209, 22, 0.08);
  --surface: #F9FAFC;
  --surface-2: #F0F3F8;
  --surface-3: #E3E8F0;
  --border: #D6DDE8;
  --text: #1F2A3F;
  --muted: #56637B;
  --primary: #1F4FA3;
  --primary-2: #2A5DB8;
  --primary-ink: #FFFFFF;
  --accent: #7F5E00;
  --accent-fill: #F5C518;
  --accent-ink: #2B2105;
  --online: #276D48;
  --verified: #17663D;
  --danger: #B3302C;
  --offer: #1F4FA3;
  --request: #6358A0;
  --flag-blue: #0B3C9E;
  --flag-yellow: #FCD116;
  --flag-red: #D42A2F;
  --logo-plate: transparent;
  --shadow: 0 8px 24px -16px rgba(30, 45, 70, 0.18);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 500px at 10% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(700px 400px at 100% 0%, var(--bg-glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, .brand, .stat b { font-family: "Bricolage Grotesque", "Onest", system-ui, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ===== Top bar ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 24px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.brand b { color: var(--primary); font-weight: 800; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  font-size: 1.1rem;
}
.nav { display: flex; gap: 4px; margin-left: 24px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 0.95rem;
  transition: background .15s, color .15s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--primary-ink); background: var(--primary); }
.nav .ico { display: inline-flex; }
.nav .ico svg, .icon-btn svg { width: 19px; height: 19px; display: block; }
.icon-btn { display: inline-grid; place-items: center; color: var(--muted); }
.icon-btn:hover { color: var(--text); }
.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--accent-fill); color: var(--accent-ink);
  font-size: 0.7rem; font-style: normal; font-weight: 800; display: grid; place-items: center;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: 1rem;
}
.icon-btn:hover { background: var(--surface-2); }

/* Driver active switch */
.drive-toggle {
  display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none;
  padding: 6px 14px 6px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
}
.drive-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.track {
  position: relative; width: 44px; height: 24px; border-radius: 999px;
  background: var(--surface-3); transition: background .2s;
}
.thumb {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); transition: transform .2s;
}
.drive-toggle input:checked + .track { background: var(--online); }
.drive-toggle input:checked + .track .thumb { transform: translateX(20px); }
.drive-toggle input:focus-visible + .track { outline: 2px solid var(--primary); outline-offset: 2px; }
.drive-label { font-weight: 700; font-size: 0.85rem; color: var(--muted); }
.drive-toggle.on { border-color: color-mix(in srgb, var(--online) 60%, transparent); }
.drive-toggle.on .drive-label { color: var(--online); }

/* ===== Layout ===== */
main { max-width: 1120px; margin: 0 auto; padding: 28px 24px 96px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.75rem; letter-spacing: -0.03em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* ===== Cards ===== */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 12px; font-size: 1rem; }
.sticky { position: sticky; top: 88px; }

/* ===== Buttons & inputs ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid transparent; cursor: pointer;
  font-weight: 700; font-size: 0.95rem; transition: transform .08s, filter .15s, background .15s;
  background: var(--surface-2); color: var(--text); border-color: var(--border);
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--primary-ink); border: none; }
.btn-accent { background: var(--accent-fill); color: var(--accent-ink); border: none; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; border-radius: 10px; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
textarea.input { resize: vertical; min-height: 80px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.error { color: var(--danger); font-size: 0.88rem; min-height: 1.2em; margin: 0; }

/* chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 0.85rem;
  color: var(--muted); transition: all .15s;
}
.chip:hover { color: var(--text); }
.chip.on { background: color-mix(in srgb, var(--primary) 16%, transparent); border-color: var(--primary); color: var(--text); }

/* segmented */
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { border: none; background: transparent; padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 0.88rem; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.2); }

/* ===== Avatars & status ===== */
.avatar {
  position: relative; flex: none; width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center; font-weight: 800; color: #1A2230; font-size: 1rem;
}
.avatar.lg { width: 72px; height: 72px; border-radius: 22px; font-size: 1.6rem; }
.avatar.sm { width: 34px; height: 34px; border-radius: 11px; font-size: 0.85rem; }
.avatar .dot {
  position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--muted); border: 2.5px solid var(--surface);
}
.avatar .dot.on { background: var(--online); }

.status {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
  background: var(--surface-3); color: var(--muted);
}
.status.active { background: color-mix(in srgb, var(--online) 18%, transparent); color: var(--online); }
.status.active::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--online);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--online) 70%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 8px;
  font-size: 0.78rem; font-weight: 700; background: var(--surface-2); color: var(--muted);
}
.tag.offer { background: color-mix(in srgb, var(--offer) 16%, transparent); color: var(--offer); }
.tag.request { background: color-mix(in srgb, var(--request) 18%, transparent); color: var(--request); }

/* ===== Auth / landing ===== */
.auth {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center;
  min-height: calc(100vh - 56px); max-width: 1120px; margin: 0 auto;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: -0.04em; margin: 16px 0; }
.hero h1 .grad { color: var(--primary); }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 34ch; }
.hero-vehicles { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.hero-vehicles span {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; font-size: 1.6rem;
  background: var(--surface); border: 1px solid var(--border);
  animation: bob 3s ease-in-out infinite;
}
.hero-vehicles span:nth-child(2) { animation-delay: .3s; }
.hero-vehicles span:nth-child(3) { animation-delay: .6s; }
.hero-vehicles span:nth-child(4) { animation-delay: .9s; }
.hero-vehicles span:nth-child(5) { animation-delay: 1.2s; }
.hero-vehicles span:nth-child(6) { animation-delay: 1.5s; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.hero-points { display: grid; gap: 10px; margin-top: 28px; }
.hero-points div { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.hero-points b { color: var(--text); }
.auth-card { padding: 28px; }
.auth-card .seg { width: 100%; margin-bottom: 20px; }
.auth-card .seg button { flex: 1; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-pick label {
  display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface-2); transition: all .15s;
}
.role-pick label b { font-size: 1rem; }
.role-pick label span { font-size: 0.8rem; color: var(--muted); }
.role-pick input { display: none; }
.role-pick label:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--surface-2)); }
.demo-hint { margin-top: 16px; padding: 12px; border-radius: 12px; background: var(--surface-2); font-size: 0.82rem; color: var(--muted); }
.demo-hint code { color: var(--text); }

/* ===== Feed ===== */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.stat b { display: block; font-size: 1.6rem; letter-spacing: -0.03em; }
.stat span { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.stat.hot b { color: var(--online); }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search { flex: 1; min-width: 200px; }

.post { display: flex; flex-direction: column; gap: 14px; }
.post-head { display: flex; gap: 12px; align-items: center; }
.post-head .who { flex: 1; min-width: 0; }
.post-head .who a { font-weight: 700; }
.post-head .who a:hover { color: var(--primary); }
.route {
  display: grid; grid-template-columns: 20px 1fr; gap: 2px 12px; padding: 14px 16px;
  border-radius: 14px; background: var(--surface-2);
}
.route .pin { display: flex; flex-direction: column; align-items: center; padding-top: 6px; }
.route .pin i { width: 10px; height: 10px; border-radius: 50%; border: 2.5px solid var(--primary); }
.route .pin.to i { border-color: var(--flag-red); background: var(--flag-red); }
.route .line { width: 2px; flex: 1; min-height: 14px; margin-top: 4px; background: repeating-linear-gradient(var(--border) 0 4px, transparent 4px 8px); }
.route .place { font-weight: 700; }
.route .lbl { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; }
.meta span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 10px; background: var(--surface-2); font-size: 0.85rem; font-weight: 600; }
.meta .fare { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.post-note { margin: 0; color: var(--text); opacity: .9; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; }
.post-actions .btn.on { color: var(--primary); border-color: var(--primary); }
.post.closed { opacity: .6; }
.comments { display: flex; flex-direction: column; gap: 10px; }
.comment { display: flex; gap: 10px; }
.comment .bubble { flex: 1; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); overflow-wrap: anywhere; }
.comment .bubble b { font-size: 0.85rem; }
.comment-form { display: flex; gap: 8px; }

.active-list { display: flex; flex-direction: column; gap: 10px; }
.active-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; transition: background .15s; }
.active-item:hover { background: var(--surface-2); }
.active-item .info { flex: 1; min-width: 0; }
.active-item .info b { display: block; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .big { font-size: 2.4rem; }

/* ===== Drivers ===== */
.drivers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.driver-card { display: flex; flex-direction: column; gap: 14px; transition: transform .15s, border-color .15s; }
.driver-card:hover { transform: translateY(-2px); }
.driver-card.is-active { border-color: color-mix(in srgb, var(--online) 45%, var(--border)); }
.driver-card .top { display: flex; gap: 12px; align-items: center; }
.driver-card .top .who { flex: 1; min-width: 0; }
.driver-card .top b { display: block; }
.vehicle-box { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.vehicle-box .v-ico { font-size: 1.8rem; }
.vehicle-box .plate { font-family: ui-monospace, monospace; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: var(--surface-3); font-size: 0.8rem; }

/* ===== Messages ===== */
.chat-layout {
  display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 150px); min-height: 440px;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface);
}
.convo-list { border-right: 1px solid var(--border); overflow-y: auto; }
.convo-list h3 { margin: 0; padding: 16px 18px; font-size: 1rem; border-bottom: 1px solid var(--border); }
.convo { display: flex; gap: 12px; align-items: center; padding: 12px 16px; cursor: pointer; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
.convo:hover { background: var(--surface-2); }
.convo.on { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
.convo .info { flex: 1; min-width: 0; }
.convo .info b { display: block; }
.convo .info span { display: block; font-size: 0.85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo.unread .info span { color: var(--text); font-weight: 600; }
.thread { display: flex; flex-direction: column; min-width: 0; }
.thread-head { display: flex; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.thread-head .who { flex: 1; min-width: 0; }
.thread-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 70%; padding: 9px 14px; border-radius: 16px; background: var(--surface-2); align-self: flex-start; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.mine { align-self: flex-end; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--primary-ink); border-bottom-right-radius: 5px; }
.msg:not(.mine) { border-bottom-left-radius: 5px; }
.msg time { display: block; font-size: 0.7rem; opacity: .65; margin-top: 2px; }
.typing { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--muted); padding: 0 20px 8px; }
.typing-dots { display: inline-flex; gap: 3px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typing-wave 1.2s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes typing-wave { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing-dots i { animation: none; } }
.thread-form { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--border); }
.back-btn { display: none; }

/* ===== Profile ===== */
.profile-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.profile-hero .who { flex: 1; min-width: 200px; }
.profile-hero h1 { margin: 0; font-size: 1.6rem; letter-spacing: -0.03em; }
.go-active {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 20px; border-radius: var(--radius); border: 1.5px dashed var(--border); background: var(--surface-2);
}
.go-active.on { border-style: solid; border-color: var(--online); background: color-mix(in srgb, var(--online) 10%, var(--surface)); }
.go-active h3 { margin: 0; }
.big-switch .track { width: 64px; height: 34px; }
.big-switch .thumb { width: 28px; height: 28px; }
.big-switch input:checked + .track { background: var(--online); }
.big-switch input:checked + .track .thumb { transform: translateX(30px); }
.big-switch input:focus-visible + .track { outline: 2px solid var(--primary); outline-offset: 2px; }
.big-switch { display: flex; align-items: center; cursor: pointer; }
.big-switch input { position: absolute; opacity: 0; }

/* ===== Dialog ===== */
.dialog {
  width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
}
.dialog::backdrop { background: rgba(15, 20, 30, 0.45); backdrop-filter: blur(4px); }
.dialog form { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.dialog h2 { margin: 0; letter-spacing: -0.02em; }

/* ===== Toasts ===== */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 14px; max-width: 340px;
  background: var(--surface-3); border: 1px solid var(--border); box-shadow: var(--shadow); cursor: pointer;
  animation: slide-in .25s ease-out;
}
@keyframes slide-in { from { transform: translateY(12px); opacity: 0; } }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .auth { grid-template-columns: 1fr; gap: 24px; padding-top: 12px; min-height: 0; }
  .hero p { max-width: none; }
}

@media (max-width: 820px) {
  /* backdrop-filter would make the topbar the containing block for the fixed bottom nav */
  .topbar { padding: 10px 16px; gap: 10px; backdrop-filter: none; background: var(--bg); }
  .topbar .logo { height: 24px; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; margin: 0; z-index: 30;
    justify-content: space-around; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--border);
  }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 10px; font-size: 0.72rem; border-radius: 12px; }
  .nav a .ico svg { width: 22px; height: 22px; }
  .nav a .badge { position: absolute; top: 0; right: 4px; }
  main { padding: 20px 16px 110px; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 12px; }
  .stat b { font-size: 1.3rem; }
  .form-grid { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; height: calc(100vh - 190px); }
  .chat-layout.has-thread .convo-list { display: none; }
  .chat-layout:not(.has-thread) .thread { display: none; }
  .back-btn { display: inline-flex; }
  .msg { max-width: 85%; }
  .toasts { left: 16px; right: 16px; bottom: 90px; }
  .toast { max-width: none; }
}

/* ===== Trust & safety ===== */
.tag.verified { background: color-mix(in srgb, var(--verified) 16%, transparent); color: var(--verified); }
.rating { display: inline-flex; align-items: center; gap: 3px; font-size: 0.8rem; font-weight: 700; color: var(--accent); }
.post-head .who .tag, .post-head .who .rating, .thread-head .who .tag, .thread-head .who .rating { margin-left: 6px; vertical-align: middle; }
.stars { color: var(--accent); letter-spacing: 1px; }
.stars .off { color: var(--surface-3); }
.btn-sos { background: color-mix(in srgb, var(--danger) 9%, var(--surface)); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-sos.big { padding: 14px; font-size: 1.05rem; }
.btn-danger-solid { background: var(--danger); color: #fff; border: none; }
:root:not([data-theme="light"]) .btn-danger-solid { color: #2A1414; }

.sheet-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.sheet-body h2 { margin: 0; font-size: 1.25rem; }
.safety-peer { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.tips summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.tips ul { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 0.9rem; display: grid; gap: 4px; }
.radio { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 0.92rem; color: var(--text); cursor: pointer; }
.radio input { accent-color: var(--primary); width: 17px; height: 17px; }
.star-pick { display: flex; gap: 6px; justify-content: center; }
.star-pick button { font-size: 2.2rem; line-height: 1; border: none; background: none; cursor: pointer; color: var(--surface-3); transition: color .15s, transform .1s; }
.star-pick button.on { color: var(--accent); }
.star-pick button:hover { transform: scale(1.1); }
.review { padding: 14px; }
.thread-blocked { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }
.form-section { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; border-top: 1px solid var(--border); }

.verify-card { display: flex; flex-direction: column; gap: 14px; border-style: dashed; }
.verify-card.approved { border-style: solid; border-color: color-mix(in srgb, var(--verified) 45%, var(--border)); }
.verify-card.rejected { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.verify-card h3 { margin: 0 0 4px; }
.verify-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.file-pick { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--border); background: var(--surface-2); font-size: 0.85rem; font-weight: 600; cursor: pointer; flex: 1 1 200px; }
.file-pick input { font-size: 0.8rem; color: var(--muted); max-width: 100%; }
.verify-form .muted, .verify-form .error { flex-basis: 100%; }

.stat.warn b { color: var(--danger); }
.report { display: flex; flex-direction: column; gap: 12px; }
.report.resolved { opacity: .65; }
.report-people { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.report-people .lbl, .lbl-top { display: block; font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-bottom: 4px; }
.doc-preview { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; background: var(--surface-2); }
hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; width: 100%; }

/* Public "shared trip" page */
.share-page { max-width: 560px; display: flex; flex-direction: column; gap: 18px; }
.share-page > .brand { margin-bottom: 4px; }
.share-page h1 { font-size: 1.5rem; letter-spacing: -0.02em; }
.big-plate { display: inline-block; margin-top: 4px; font-size: 1.2rem; letter-spacing: .08em; }

@media (max-width: 820px) {
  .report-people { grid-template-columns: 1fr; }
  .nav a { padding: 6px 6px; }
}

/* ===== Brand: logo + flag colors ===== */
.logo { display: block; height: 30px; width: auto; }
.logo-wrap { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 10px; background: var(--logo-plate); }
.hero .logo-wrap { padding: 10px 16px; border-radius: 14px; }
.hero .logo { height: 54px; }
.share-page .logo { height: 36px; }
/* Thin blue / yellow / red stripe, like the flag in the logo */
.flag-stripe { height: 4px; background: linear-gradient(90deg, var(--flag-blue) 0 33.3%, var(--flag-yellow) 33.3% 66.6%, var(--flag-red) 66.6% 100%); }
.topbar { border-bottom: none; }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px; background: linear-gradient(90deg, var(--flag-blue) 0 33.3%, var(--flag-yellow) 33.3% 66.6%, var(--flag-red) 66.6% 100%); }
/* Short flag divider under the logo on the login and share pages */
.flag-stripe { width: 72px; height: 4px; border-radius: 2px; margin-top: 12px; }
/* Stat boxes: a faint wash of one flag color each */
.stat { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.stat:nth-child(2) { background: color-mix(in srgb, var(--flag-yellow) 9%, var(--surface)); }
.stat:nth-child(3) { background: color-mix(in srgb, var(--flag-red) 7%, var(--surface)); }
.stat b { color: var(--primary); }
.stat:nth-child(2) b { color: var(--accent); }
.stat:nth-child(3) b { color: var(--danger); }
.stat.hot b { color: var(--online); }
.hero-points div:nth-child(1) b { color: var(--primary); }
.hero-points div:nth-child(2) b { color: var(--accent); }
.hero-points div:nth-child(3) b { color: var(--danger); }
.go-active:not(.on) .btn-accent { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-fill) 40%, transparent); }

/* ===== Bookings, Plus, boosts ===== */
.tag.boosted { background: color-mix(in srgb, var(--accent-fill) 22%, transparent); color: var(--accent); }
.tag.plus { background: color-mix(in srgb, var(--accent-fill) 20%, transparent); color: var(--accent); }
.meta .seats-none { color: var(--danger); }
.btn.booked { color: var(--verified); border-color: color-mix(in srgb, var(--verified) 45%, var(--border)); }
.btn.pending { color: var(--accent); }
.small-route { padding: 10px 14px; }
.mask-note { padding: 8px 18px; font-size: 0.8rem; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.mask-note a { color: var(--primary); font-weight: 700; }
.consent { font-size: 0.82rem; color: var(--muted); align-items: flex-start; }
.consent a { color: var(--primary); font-weight: 600; }

.trip { display: flex; flex-direction: column; gap: 10px; }
.trip.bad { opacity: .7; }
.trip-route { font-size: 0.95rem; }
.bstatus { font-size: 0.75rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent-fill) 18%, transparent); color: var(--accent); white-space: nowrap; }
.bstatus.ok { background: color-mix(in srgb, var(--verified) 16%, transparent); color: var(--verified); }
.bstatus.done { background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary); }
.bstatus.bad { background: var(--surface-3); color: var(--muted); }
.trips-grid { grid-template-columns: 1fr 1fr; }

.plus-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: color-mix(in srgb, var(--accent-fill) 7%, var(--surface)); }
.plus-card.on { border-color: color-mix(in srgb, var(--accent-fill) 50%, var(--border)); }
.plus-card h3 { margin: 0 0 4px; }
.perks { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 0.92rem; }
.price { margin: 0; font-size: 1.1rem; }
.price b { font-size: 1.6rem; color: var(--accent); font-family: "Bricolage Grotesque", sans-serif; }
.pay-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 0.92rem; }
.gcash { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.notice { padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent-fill) 12%, var(--surface-2)); font-size: 0.88rem; }

.admin-pay { margin-bottom: 20px; }
.money { font-weight: 700; padding: 4px 10px; border-radius: 10px; background: var(--surface-2); }
.pay-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.admin-pay details .pay-row { opacity: .85; }
@media (max-width: 820px) {
  .trips-grid { grid-template-columns: 1fr; }
  .pay-row { grid-template-columns: 1fr 1fr; }
  .nav a { padding: 6px 2px; font-size: 0.72rem; }
}

/* ===== Legal pages ===== */
.legal { max-width: 760px; display: flex; flex-direction: column; gap: 6px; line-height: 1.7; }
.legal h1 { font-size: 2rem; letter-spacing: -0.03em; margin: 20px 0 0; }
.legal h2 { font-size: 1.2rem; margin: 26px 0 4px; scroll-margin-top: 20px; }
.legal p, .legal li { color: var(--text); }
.legal ul { padding-left: 20px; margin: 0; display: grid; gap: 6px; }
.legal a { color: var(--primary); font-weight: 600; }
.legal .toc { margin: 12px 0; }
.legal .toc ol { margin: 6px 0 0; padding-left: 20px; columns: 2; font-size: 0.92rem; }
@media (max-width: 600px) { .legal .toc ol { columns: 1; } }

/* Login / Create account tabs in the logo colors: blue for Log in, gold for Create account */
.auth-card .seg { background: color-mix(in srgb, var(--flag-blue) 10%, var(--surface-2)); border-color: color-mix(in srgb, var(--primary) 25%, var(--border)); }
.auth-card .seg button { transition: background .2s, color .2s; }
.auth-card .seg button:not(.on):hover { color: var(--text); }
.auth-card .seg button[data-mode="login"].on { background: var(--primary); color: var(--primary-ink); }
.auth-card .seg button[data-mode="register"].on { background: var(--accent-fill); color: var(--accent-ink); }
.consent input { flex: none; margin-top: 2px; }
