:root {
  color-scheme: light;
  --accent: #173b66;
  --accent-dark: #102c4d;
  --accent-foreground: #173b66;
  --accent-light: #c9d8e9;
  --accent-soft: #eaf0f6;
  --bg: #f4f6f8;
  --card: #fff;
  --text: #17212b;
  --muted: #667382;
  --line: #dfe5eb;
  --ok: #16794b;
  --danger: #b83232;
  --radius: 14px;
  --radius-sm: 9px;
  --gradient: linear-gradient(135deg, #173b66, #102c4d);
  --shadow: 0 2px 10px rgba(25, 39, 54, .055);
  --shadow-lg: 0 16px 38px rgba(15, 30, 55, .18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, select { font: inherit; }
a { color: inherit; }
.bar {
  min-height: 68px;
  width: min(calc(100% - 24px), 1120px);
  margin: 10px auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -.8px;
  white-space: nowrap;
}
.brand > span:last-child { color: var(--muted); }
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: var(--accent);
  color: #fff !important;
  font-size: 19px;
  font-weight: 900;
}
nav { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
nav button {
  border: 0;
  border-radius: 999px;
  padding: 8px 13px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background .16s ease, color .16s ease;
}
nav button:hover, nav button.on { background: var(--accent); color: #fff; }
.wrap { width: min(100% - 32px, 720px); margin: 30px auto 80px; }
.card {
  padding: clamp(20px, 4vw, 28px);
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.card:hover { border-color: #ccd6e0; box-shadow: 0 5px 18px rgba(15, 30, 55, .08); }
h1, h2, h3, p { margin-top: 0; }
h2 { margin-bottom: 18px; font-size: clamp(25px, 5vw, 34px); letter-spacing: -1.1px; line-height: 1.1; }
h3 { margin-bottom: 12px; font-size: 18px; letter-spacing: -.35px; }
label { display: block; margin: 13px 0 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
input, select {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--input-bg, #f8fafc);
  color: var(--text);
  font-size: 15px;
  transition: border .15s ease, box-shadow .15s ease;
}
input:focus, select:focus { border-color: #52749b; background: var(--card); box-shadow: 0 0 0 3px rgba(30, 58, 95, .12); }
.btn, button.primary {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(15, 30, 55, .2);
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.btn:hover, button.primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 9px 20px rgba(15, 30, 55, .25); }
.btn.ghost, button.ghost { border: 1px solid var(--line); border-radius: 10px; background: var(--accent-soft); color: var(--accent-foreground); box-shadow: none; }
button.danger { border: 1px solid #efc7c7; border-radius: 10px; padding: 11px 16px; background: #fff1f1; color: var(--danger); font-weight: 700; cursor: pointer; box-shadow: none; }
button:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.row > * { flex: 1 1 150px; }
.muted { color: var(--muted); font-size: 13px; }
.err { margin-top: 4px; color: var(--danger); font-size: 12px; }
.pill { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px; background: #edf1f5; color: #455362; font-size: 11px; font-weight: 800; }
.pill.completed { background: #e6f6ec; color: var(--ok); }
.pill.cancelled { background: #fff0ee; color: var(--danger); }
.pill.in_progress, .pill.accepted { background: var(--accent-soft); color: var(--accent); }
.pill.offered { background: #fff1d7; color: #805100; }
#map { height: 310px; margin: 14px 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); }
.moto-pin { font-size: 26px; line-height: 36px; text-align: center; background: #fff; border: 2px solid #1e3a5f; border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.big { margin: 12px 0; font-size: clamp(25px, 6vw, 34px); font-weight: 850; letter-spacing: -1px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 14px 0; }
.stat { padding: 12px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-muted, #f8fafc); text-align: center; }
.stat b { display: block; font-size: clamp(14px, 3vw, 19px); overflow-wrap: anywhere; }
.stat small { color: var(--muted); font-size: 11px; font-weight: 650; }
.driver-identity { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: #eff0f7; }
.avatar-preview { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; background: #eff0f7; }
.motorcycle-photo { width: min(100%, 340px); max-height: 210px; display: block; margin: 10px 0; border-radius: 20px; object-fit: cover; }
.motorcycle-preview { width: 100%; height: 130px; border-radius: 16px; object-fit: cover; background: #eff0f7; }
.file-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.upload-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-muted, #f8fafc); }
.upload-card h4 { margin: 0 0 10px; font-size: 14px; }
.upload-card input[type=file] { display: none; }
.file-pick { display: flex; align-items: center; gap: 10px; margin: 10px 0; padding: 8px; border: 1px dashed #b4c4da; border-radius: 10px; background: var(--input-bg, #f8fafc); cursor: pointer; font-weight: 600; transition: background .15s ease, border-color .15s ease; }
.file-pick:hover { background: var(--accent-soft); border-color: var(--accent); }
.pick-btn { flex: none; padding: 8px 12px; border-radius: 12px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; }
.pick-name { min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head h3, .profile-head p { margin: 0; }
.notice { margin: 10px 0; padding: 12px 14px; border-radius: 14px; font-size: 14px; font-weight: 650; }
.notice.ok { background: #e6f6ec; color: var(--ok); }
.notice.wait { background: #fff1d7; color: #805100; }
.card.blocked { border-color: #e7b6b2; background: #fff7f6; }
.meter { height: 12px; margin: 8px 0 12px; overflow: hidden; border-radius: 999px; background: #eceee8; }
.meter span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3d6296, #b7791f, #b3322c); }
h4 { margin: 18px 0 4px; font-size: 15px; }
.upload-card button { width: 100%; }
.file-link { display: inline-flex; min-height: 48px; align-items: center; color: var(--accent); font-weight: 750; }
.doc-links { display: flex; justify-content: flex-end; gap: 5px; flex-wrap: wrap; text-align: right; }
.doc-links a { color: var(--accent); font-weight: 750; }
.pill.pending { background: #edf0f8; color: #536176; }
.pill.due { background: #fee2e2; color: #a32925; }
.pill.partial { background: #fff1d7; color: #805100; }
.pill.paid { background: #e6f6ec; color: var(--ok); }
#toast {
  position: fixed;
  z-index: 2100;
  left: 50%;
  bottom: 22px;
  max-width: 90vw;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #151714;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: .2s ease;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.hero {
  position: relative;
  overflow: hidden;
  width: calc(100% - 20px);
  margin: 10px auto 0;
  padding: clamp(55px, 10vw, 110px) 20px 76px;
  border-radius: 18px;
  background: linear-gradient(135deg, #0f1f35, #1e3a5f);
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.hero::after {
  position: absolute;
  right: -110px;
  bottom: -260px;
  width: 460px;
  height: 460px;
  border: 1px solid rgba(169, 191, 220, .22);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(169, 191, 220, .04), 0 0 0 90px rgba(169, 191, 220, .025);
  content: "";
  pointer-events: none;
}
.hero img { position: relative; z-index: 1; width: 72px; height: 72px; border-radius: 20px; }
.hero h1 { position: relative; z-index: 1; margin: 14px 0 10px; font-size: clamp(48px, 10vw, 76px); letter-spacing: -4px; line-height: 1; }
.hero h1 span { color: var(--accent-light); }
.hero p { position: relative; z-index: 1; max-width: 500px; margin: 0 auto 26px; color: #b9c4d4; font-size: 17px; }
.cta { position: relative; z-index: 1; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.hero .btn { background: #fff; color: #0f1f35; box-shadow: none; }
.hero .btn:hover { background: #e8eef6; }
.hero .btn.ghost { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .3); }
.hero .btn.ghost:hover { background: rgba(255, 255, 255, .2); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; width: min(100% - 32px, 1000px); margin: -24px auto 30px; position: relative; z-index: 2; }
.features article { min-height: 145px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); transition: border-color .16s ease, box-shadow .16s ease; }
.features article:hover { border-color: #ccd6e0; box-shadow: 0 5px 18px rgba(15, 30, 55, .08); }
.features h3 { margin: 0 0 8px; }
.features p { margin: 0; color: var(--muted); font-size: 14px; }
footer { padding: 28px 16px; color: var(--muted); text-align: center; font-size: 12px; }
.consent-backdrop { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 18px; background: rgba(15, 17, 15, .56); }
.consent-card { width: min(100%, 510px); padding: 26px; border-radius: 22px; background: #fff; box-shadow: 0 25px 80px rgba(0,0,0,.23); }
.consent-card h2 { margin-bottom: 12px; }
.consent-card p:not(.eyebrow) { color: #5f665d; font-size: 14px; }
.eyebrow { margin-bottom: 8px; color: #5b6f8d; font-size: 11px; font-weight: 850; letter-spacing: 1.5px; }
.privacy-button { position: fixed; z-index: 900; right: 14px; bottom: 14px; padding: 8px 12px; border: 1px solid #dfe2dc; border-radius: 999px; background: rgba(255,255,255,.92); color: #444a42; font-size: 11px; font-weight: 700; cursor: pointer; box-shadow: 0 3px 12px rgba(0,0,0,.07); }
@media (max-width: 600px) {
  .bar { width: calc(100% - 16px); min-height: 60px; padding: 8px 12px; gap: 8px; }
  .brand { font-size: 17px; }
  .brand-mark { width: 29px; height: 29px; }
  nav { gap: 1px; }
  nav button { padding: 7px 8px; font-size: 11px; }
  .wrap { width: min(100% - 20px, 720px); margin: 16px auto 80px; }
  .card { border-radius: 20px; }
  #map { height: 260px; }
  .features { width: min(100% - 24px, 1000px); grid-template-columns: 1fr 1fr; }
  .features article { min-height: 0; padding: 15px; }
  .features h3 { font-size: 15px; }
  .features p { font-size: 12px; }
  .file-grid { grid-template-columns: 1fr; }
  .stats { gap: 5px; }
  .stat { padding: 9px 5px; border-radius: 13px; }
  .stat small { font-size: 10px; }
}
@media (max-width: 390px) {
  .features { grid-template-columns: 1fr; }
  .brand { gap: 5px; font-size: 15px; }
  nav button { padding: 6px; font-size: 10px; }
}

.chat-log { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 6px 0; }
.bubble { max-width: 80%; padding: 8px 10px; border-radius: 12px; word-wrap: break-word; font-size: .92rem; }
.bubble small { display: block; opacity: .6; font-size: .7rem; text-align: right; }
.bubble.mine { align-self: flex-end; background: #1e3a5f; color: #fff; }
.bubble.theirs { align-self: flex-start; background: #e5eaf1; color: #1b2a3f; }
.chat-form { display: flex; gap: 8px; margin-top: 8px; }
.chat-form input { flex: 1; }
.qr-box { display: flex; justify-content: center; margin: 8px 0; } .qr-img { max-width: 100%; height: auto; border: 1px solid #d9e0ea; border-radius: 8px; }

.stars{display:flex;gap:6px;margin:8px 0}.stars button{background:none;border:0;font-size:2rem;color:#e0a800;cursor:pointer;padding:0 4px}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:1000;display:flex;align-items:center;justify-content:center;padding:12px}
.modal-box{background:#fff;border-radius:12px;padding:12px;width:100%;max-width:560px}
#tripmap{height:340px!important;min-height:0!important;border-radius:8px;margin:8px 0}
.sugwrap{position:relative}
.sug{position:absolute;z-index:1200;left:0;right:0;top:100%;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 28px rgba(15,30,55,.18);max-height:280px;overflow:auto}
.sug button{display:block;width:100%;text-align:left;background:none;border:0;border-bottom:1px solid var(--line);padding:10px 12px;border-radius:0;color:var(--ink,#1b2433);cursor:pointer;box-shadow:none}
.sug button:hover{background:var(--accent-soft)}
.sug-empty{padding:10px 12px}
.info-hero{background:linear-gradient(135deg,#1e3a5f,#2c5282);color:#fff;border-radius:18px;padding:22px;margin-bottom:16px}
.info-hero h1{margin:0 0 6px;font-size:26px}.info-hero p{margin:4px 0;opacity:.92}
.info-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;margin:14px 0}
.info-grid .card{margin:0}.info-grid h4{margin:0 0 4px}
.steps{padding-left:20px}.steps li{margin:6px 0}
#map{height:min(62vh,520px)!important;min-height:360px}
@media(max-width:600px){#map{height:60vh!important;min-height:340px}}
.depform input[type=file]{width:100%;margin:6px 0}

.theme-toggle {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: none;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.theme-toggle:hover { border-color: #91a6bb; background: var(--accent-soft); }
.theme-toggle-float { position: fixed; z-index: 2500; top: 14px; right: 14px; box-shadow: var(--shadow); }
.hero .theme-toggle { position: absolute; z-index: 3; top: 16px; right: 18px; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.1); color: #fff; }
.hero .theme-toggle:hover { background: rgba(255,255,255,.2); }

:root[data-theme="dark"] {
  color-scheme: dark;
  --accent: #31577f;
  --accent-dark: #3e6a98;
  --accent-foreground: #b5d1ef;
  --accent-light: #c9d8e9;
  --accent-soft: #26384d;
  --bg: #111820;
  --card: #1a242e;
  --text: #e6edf4;
  --muted: #a5b2bf;
  --line: #344250;
  --ok: #67c393;
  --danger: #ff8b86;
  --gradient: linear-gradient(135deg, #173b66, #102c4d);
  --shadow: 0 3px 14px rgba(0, 0, 0, .2);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, .38);
  --input-bg: #151e27;
  --surface-muted: #202c37;
}
:root[data-theme="dark"] body { background: var(--bg); color: var(--text); }
:root[data-theme="dark"] .bar { background: var(--card); border-color: var(--line); }
:root[data-theme="dark"] .brand, :root[data-theme="dark"] nav button { color: var(--text); }
:root[data-theme="dark"] .brand > span:last-child { color: var(--muted); }
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .features article,
:root[data-theme="dark"] .consent-card,
:root[data-theme="dark"] .modal-box,
:root[data-theme="dark"] details.faq { background: var(--card); border-color: var(--line); color: var(--text); }
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea { background: var(--input-bg); border-color: var(--line); color: var(--text); }
:root[data-theme="dark"] input:focus,
:root[data-theme="dark"] select:focus,
:root[data-theme="dark"] textarea:focus { background: var(--card); }
:root[data-theme="dark"] label,
:root[data-theme="dark"] .consent-card p:not(.eyebrow) { color: var(--muted); }
:root[data-theme="dark"] .pill { background: #2b3743; color: #d6e0e9; }
:root[data-theme="dark"] .pill.completed,
:root[data-theme="dark"] .pill.paid,
:root[data-theme="dark"] .notice.ok { background: #1f3a30; color: #8cddb2; }
:root[data-theme="dark"] .pill.cancelled,
:root[data-theme="dark"] .pill.due,
:root[data-theme="dark"] .notice.wait,
:root[data-theme="dark"] button.danger { background: #422827; color: #ff9a94; border-color: #68403e; }
:root[data-theme="dark"] .pill.offered,
:root[data-theme="dark"] .pill.partial { background: #493a22; color: #f2c979; }
:root[data-theme="dark"] .pill.in_progress,
:root[data-theme="dark"] .pill.accepted { background: #26384d; color: #b9d5f3; }
:root[data-theme="dark"] .card.blocked { background: #352423; border-color: #68403e; }
:root[data-theme="dark"] .upload-card,
:root[data-theme="dark"] .stat,
:root[data-theme="dark"] .file-pick,
:root[data-theme="dark"] .sug { background: var(--surface-muted); border-color: var(--line); }
:root[data-theme="dark"] .sug button { color: var(--text); }
:root[data-theme="dark"] .sug button:hover { background: var(--accent-soft); }
:root[data-theme="dark"] .file-link,
:root[data-theme="dark"] .doc-links a { color: #a8c9ef; }
:root[data-theme="dark"] .btn.ghost,
:root[data-theme="dark"] button.ghost { color: var(--accent-foreground); }
:root[data-theme="dark"] .privacy-button { background: rgba(26,36,46,.95); color: var(--text); border-color: var(--line); }
:root[data-theme="dark"] .modal { background: rgba(0,0,0,.72); }
:root[data-theme="dark"] .bubble.theirs { background: #2b3743; color: var(--text); }
:root[data-theme="dark"] .rt-card,
:root[data-theme="dark"] .rt-kpi { background: var(--card); border-color: var(--line); color: var(--text); }
:root[data-theme="dark"] .rt-top h1,
:root[data-theme="dark"] .rt-kpi b { color: #b5d1ef; }
:root[data-theme="dark"] .rt-kpi span { color: var(--muted); }
:root[data-theme="dark"] .rt-tabs button,
:root[data-theme="dark"] .rt-btn { background: var(--card); color: #b5d1ef; border-color: #52749b; }
:root[data-theme="dark"] .rt-tabs button.on,
:root[data-theme="dark"] .rt-btn.pri { background: #284c73; color: #fff; }
:root[data-theme="dark"] .rt-row input,
:root[data-theme="dark"] .rt-row select,
:root[data-theme="dark"] .rt-login input { background: var(--input-bg); border-color: var(--line); color: var(--text); }
:root[data-theme="dark"] .rt-table th,
:root[data-theme="dark"] .rt-table td { border-color: var(--line); }
:root[data-theme="dark"] .rt-tag { background: #2b3743; color: var(--text); }
:root[data-theme="dark"] .rt-tag.bad { background: #422827; color: #ffaaa4; }
:root[data-theme="dark"] .rt-tag.ok { background: #1f3a30; color: #8cddb2; }
:root[data-theme="dark"] .rt-tag.warn { background: #493a22; color: #f2c979; }
:root[data-theme="dark"] .rt-btn.bad { color: #ff9a94; border-color: #68403e; }
:root[data-theme="dark"] .rt-btn.ok { color: #8cddb2; border-color: #31694e; }

@media (max-width: 600px) {
  .theme-toggle { min-height: 34px; padding: 7px 9px; font-size: 11px; }
  .bar .theme-toggle { margin-left: auto; }
}
