:root {
  --bg: #111418; --panel: #1b1f26; --line: #2c323c; --text: #f2f4f7; --muted: #9aa3af;
  --accent: #f5a623; --good: #3ecf8e; --bad: #ef4444; --blue: #3b82f6;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; } .err { color: var(--bad); min-height: 1.4em; }
button { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; cursor: pointer; }
button.primary { background: var(--accent); color: #111; border: 0; font-weight: 700; }
button.wide { width: 100%; margin-top: 10px; }
input { font: inherit; color: var(--text); background: #0d1014; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; width: 100%; }

.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; }
.card { width: 100%; max-width: 380px; background: var(--panel); border-radius: 18px; padding: 24px; }
.card h1 { margin: 0 0 4px; color: var(--accent); }
.card form { display: grid; gap: 10px; }
.tabs { display: flex; gap: 6px; margin: 16px 0; }
.tabs button { flex: 1; padding: 10px; }
.tabs button.on { border-color: var(--accent); color: var(--accent); }

#map { position: fixed; inset: 0; }
.leaflet-container { background: #1d232b; }
#topbar { position: fixed; top: calc(env(safe-area-inset-top) + 10px); left: 10px; right: 10px;
  display: flex; gap: 8px; z-index: 1000; }
#searchWrap { flex: 1; position: relative; }
#search { padding: 14px; border-radius: 14px; background: var(--panel); box-shadow: 0 4px 16px #0008; }
#results { position: absolute; top: 54px; left: 0; right: 0; background: var(--panel); border-radius: 12px;
  overflow: hidden; box-shadow: 0 6px 20px #000a; }
#results div { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.round { width: 50px; height: 50px; border-radius: 50%; padding: 0; font-size: 22px; box-shadow: 0 4px 16px #0008; }
#recenter { position: fixed; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 110px); z-index: 1000; }
#reportBtn { position: fixed; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 24px); z-index: 1000;
  width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: #111; border: 0;
  font-size: 34px; font-weight: 900; box-shadow: 0 6px 20px #000a; }

#navBanner { position: fixed; top: calc(env(safe-area-inset-top) + 72px); left: 10px; right: 10px; z-index: 1000;
  background: #0f5132; border-radius: 14px; padding: 14px; display: flex; gap: 14px; align-items: center;
  box-shadow: 0 6px 20px #000a; }
#navArrow { font-size: 40px; width: 48px; text-align: center; }
#navDist { font-size: 26px; font-weight: 800; }
#navText { font-size: 16px; }

#sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001; background: var(--panel);
  border-radius: 18px 18px 0 0; padding: 16px 16px calc(env(safe-area-inset-bottom) + 16px);
  box-shadow: 0 -6px 24px #000a; max-height: 55vh; overflow: auto; }
#sheet h2 { margin: 0 0 4px; font-size: 22px; }
#sheet .row, #prompt .row { display: flex; gap: 8px; margin-top: 12px; }
#sheet .row button, #prompt .row button { flex: 1; }
.states { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.states span { background: #0d1014; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 13px; }

#prompt { position: fixed; left: 10px; right: 10px; bottom: calc(env(safe-area-inset-bottom) + 110px); z-index: 1002;
  background: var(--panel); border: 2px solid var(--accent); border-radius: 16px; padding: 16px; font-size: 18px; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 110px);
  z-index: 1003; background: #000d; padding: 10px 16px; border-radius: 10px; max-width: 90vw; }

.overlay { position: fixed; inset: 0; z-index: 2000; background: #000a; display: flex; align-items: flex-end; }
.panel { width: 100%; background: var(--panel); border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(env(safe-area-inset-bottom) + 16px); }
.panel.scroll { max-height: 90vh; overflow: auto; }
.panel h2 { margin: 0 0 12px; } .panel h3 { margin: 20px 0 8px; color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid button { padding: 14px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; min-height: 92px; }
.grid .ico { font-size: 30px; }
.truck { display: grid; gap: 10px; }
.truck label { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.truck label span { display: flex; align-items: center; gap: 6px; }
.truck input[type=number] { width: 90px; padding: 8px; }
.truck .check { justify-content: flex-start; }
.truck .check input { width: 22px; height: 22px; }
table.ifta { width: 100%; border-collapse: collapse; font-size: 14px; }
table.ifta td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.ifta td:last-child { text-align: right; }
.invite { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.invite b { font-family: ui-monospace, Consolas, monospace; letter-spacing: 1px; }

.pin { font-size: 22px; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; background: var(--panel); border: 2px solid var(--accent); box-shadow: 0 2px 8px #000a; }
.pin.unconfirmed { border-style: dashed; opacity: .85; }
.me-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--blue); border: 4px solid #fff; box-shadow: 0 0 0 6px #3b82f655; }
