:root { --brand:#0f766e; --bg:#f5f7f8; --line:#d8dee3; --text:#17212b; --muted:#46525f; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font: 16px/1.4 system-ui, sans-serif; color: var(--text); background: var(--bg); }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; }
input, select, textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
label { display: block; margin: 10px 0; font-size: 14px; color: var(--muted); }
label input, label select, label textarea { margin-top: 4px; color: var(--text); }
button { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
button.primary { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
button.danger { color: #b42318; }
button.ghost { background: transparent; border-color: transparent; color: var(--brand); }
.err { color: #b42318; min-height: 1.4em; margin: 6px 0; font-size: 14px; }

#auth { min-height: 100%; display: grid; place-items: center; padding: 16px; }
#authForm { width: 100%; max-width: 380px; background: #fff; padding: 20px; border-radius: 14px; box-shadow: 0 2px 14px #0002; }
#authForm h1 { margin: 0 0 12px; font-size: 22px; color: var(--brand); }
#authForm .primary { width: 100%; }
.tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.tabs button { flex: 1; }
.tabs button.active { background: var(--brand); color: #fff; border-color: var(--brand); }

#app { height: 100dvh; display: flex; flex-direction: column; position: relative; }
header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); background: #fff; border-bottom: 1px solid var(--line); }
header small { display: block; color: var(--muted); font-size: 12px; }
#map { flex: 1; min-height: 0; z-index: 0; }
nav { display: flex; gap: 8px; padding: 8px 12px; padding-bottom: max(8px, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
nav button { flex: 1; }
#count { background: var(--brand); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 13px; }

.sheet { position: absolute; left: 0; right: 0; bottom: 0; top: 56px; z-index: 1000; background: #fff; overflow-y: auto; padding: 14px 14px 24px; border-radius: 14px 14px 0 0; box-shadow: 0 -4px 20px #0003; }
.sheet h2 { margin: 0 0 8px; font-size: 18px; }
.sheet .row { display: flex; gap: 8px; }
.sheet .row > * { flex: 1; }
.close { float: right; }
.item { padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.item small { color: var(--muted); display: block; }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: #e5e7eb; }
.badge.requested { background: #fef3c7; } .badge.scheduled { background: #dbeafe; } .badge.picked_up { background: #dcfce7; }
.comment { background: var(--bg); padding: 8px 10px; border-radius: 10px; margin: 6px 0; }
.comment small { color: var(--muted); display: block; }
.comment p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.results div { padding: 8px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }
#pickMap { height: 220px; border-radius: 10px; margin: 8px 0; }
.langs { display: flex; justify-content: flex-end; gap: 2px; align-items: center; }
.langs .lang { padding: 4px 8px; font-weight: 600; }
.langs .lang.on { background: var(--brand); color: #fff; }

label.check { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
label.check input { width: auto; margin: 0; }
/* car details */
.card { border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px; margin: 8px 0 14px; }
.kv { display: grid; grid-template-columns: 105px 1fr; gap: 8px; padding: 9px 0; margin: 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.kv:last-child { border-bottom: 0; }
.kv b { color: #2f3a45; font-weight: 600; min-width: 0; }
.kv span, .kv div { overflow-wrap: anywhere; }
.plate { display: inline-block; background: #f7d117; border: 2px solid #1b1b1b; border-radius: 5px; padding: 0 8px; font-weight: 700; letter-spacing: 1px; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.photos .ph { position: relative; }
.photos img { width: 92px; height: 92px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.photos .ph button { position: absolute; top: 2px; right: 2px; padding: 0 7px; line-height: 22px; border-radius: 12px; background: #fffd; }
.hint { color: var(--muted); font-size: 13px; margin: 2px 0 6px; }
.hint.ok { color: #166534; }
.sheet h2 { margin-top: 14px; }
.sheet .close + h2 { margin-top: 0; }
.kv .plate, .kv .badge { justify-self: start; }
/* map text boxes */
.carbox-wrap, .cluster-wrap { background: none; border: 0; }
.carbox { width: 168px; height: 90px; box-sizing: border-box; background: #fff; border: 1px solid #aab4bd; border-left: 5px solid #d99a06; border-radius: 8px; padding: 4px 8px 0; box-shadow: 0 2px 6px #0004; cursor: pointer; position: relative; font-size: 12px; line-height: 1.3; color: var(--text); }
.carbox.scheduled { border-left-color: #2563eb; } .carbox.picked_up { border-left-color: #16a34a; }
.cb-title { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 16px; }
.cb-plate { font-weight: 600; letter-spacing: .5px; }
.cb-status { color: var(--muted); }
.cb-tip { position: absolute; left: 50%; bottom: -7px; width: 10px; height: 10px; background: #fff; border: solid #aab4bd; border-width: 0 1px 1px 0; transform: translateX(-50%) rotate(45deg); }
.cb-dots { position: absolute; left: 0; right: 0; bottom: 2px; display: flex; justify-content: center; gap: 2px; }
.cb-dot { width: 18px; height: 16px; padding: 0; border: 0; background: none; position: relative; cursor: pointer; }
.cb-dot::after { content: ''; position: absolute; left: 5px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: #c3cad1; }
.cb-dot.on::after { background: var(--brand); }
.clusterbox { width: 42px; height: 42px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: 16px; display: grid; place-items: center; border: 3px solid #fff; box-shadow: 0 2px 6px #0005; }
/* address picker + own location */
.pickmap { height: 220px; border-radius: 10px; margin: 8px 0; }
.addrwrap .lbl { font-size: 14px; color: var(--muted); }
.addrwrap .hint { margin: 2px 0 4px; }
.dropbox { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 6px 0 10px; }
.dropline { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dropline span { overflow-wrap: anywhere; font-size: 14px; }
.home-wrap { background: none; border: 0; }
.homepin { position: absolute; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; background: #1f2937; border: 2px solid #fff; display: grid; place-items: center; box-shadow: 0 1px 5px #0006; cursor: pointer; }

.navlink { display: inline-block; margin-top: 4px; padding: 4px 0; font-weight: 600; color: var(--brand); text-decoration: none; }
