/* ============================================================
   Muber — black/white split PWA
   Top: black w/ white text = REQUESTER (child)
   Bottom: white w/ black text = DRIVER (mom)
   iPhone-first, safe-area aware.
   ============================================================ */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { background: #000; }
body {
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: grid;
  grid-template-rows: 1fr 1fr;
  min-height: 100dvh;
}

/* ---------- Panes ---------- */
.pane {
  padding: 28px 20px 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.pane-dark {
  background: #000;
  color: #fff;
  padding-top: max(28px, env(safe-area-inset-top));
}
.pane-light {
  background: #fff;
  color: #000;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
  border-top: 2px solid #000;
}

/* ---------- Brand ---------- */
.brand { margin-bottom: 14px; }
.brand-wordmark {
  font-weight: 800;
  font-size: 38px;
  letter-spacing: -0.02em;
  line-height: 1;
}
.brand-sub {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-top: 6px;
}

/* ---------- Requester card ---------- */
.card { margin-top: 4px; }

.field-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 6px;
}

.autocomplete { position: relative; }

#addr {
  width: 100%;
  background: #fff;
  color: #000;
  border: 0;
  border-radius: 12px;
  padding: 14px 14px;
  font-size: 17px;
  font-family: inherit;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
#addr:focus { box-shadow: 0 0 0 3px rgba(255,255,255,0.25); }

.suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  color: #000;
  border-radius: 12px;
  list-style: none;
  margin: 0;
  padding: 6px 0;
  max-height: 260px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.suggestions li {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 15px;
  border-bottom: 1px solid #eee;
}
.suggestions li:last-child { border-bottom: 0; }
.suggestions li:active,
.suggestions li.active { background: #f4f4f4; }

/* ---------- Cost row ---------- */
.cost-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 18px 0 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.18);
}
.cost-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.65;
}
.cost-value {
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
}

/* ---------- Buttons ---------- */
.primary-btn {
  width: 100%;
  border: 0;
  background: #fff;
  color: #000;
  font-family: inherit;
  font-weight: 700;
  font-size: 17px;
  padding: 16px 18px;
  border-radius: 12px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.05s ease, opacity 0.15s ease;
}
.primary-btn:active { transform: scale(0.985); }
.primary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ghost-btn {
  background: transparent;
  border: 1px solid #000;
  color: #000;
  border-radius: 999px;
  width: 38px;
  height: 38px;
  font-size: 18px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
}
.ghost-btn:active { background: #000; color: #fff; }
.ghost-btn.spinning {
  animation: muberSpin 0.7s linear infinite;
  background: #000;
  color: #fff;
}
@keyframes muberSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ---------- Status line ---------- */
.status {
  font-size: 13px;
  min-height: 18px;
  margin-top: 10px;
  opacity: 0.85;
}

/* ---------- Mini queue (requester side) ---------- */
.queue-mini { margin-top: 18px; }
.queue-mini-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 8px;
}
.queue-mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.queue-mini-list li {
  font-size: 13px;
  opacity: 0.85;
  padding: 6px 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.queue-mini-list li .pos {
  font-weight: 700;
  opacity: 0.75;
}

/* ---------- Driver head ---------- */
.driver-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8px;
  margin-bottom: 14px;
}
.driver-title {
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.02em;
  line-height: 1;
  grid-column: 1;
}
.driver-sub {
  grid-column: 1;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-top: 4px;
}
.driver-head .head-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
}
.head-btn {
  background: #fff;
  color: #000;
  border: 1px solid #000;
  border-radius: 999px;
  padding: 9px 14px;
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.head-btn:active { background: #000; color: #fff; transform: scale(0.98); }

/* ---------- Requests list ---------- */
.requests-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow-y: auto;
}
.requests-list .empty-row {
  font-size: 14px;
  opacity: 0.5;
  padding: 16px 0;
  text-align: center;
}
.req-card {
  border: 1px solid #000;
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.req-card .pos-pill {
  display: inline-block;
  background: #000;
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.req-card .addr-link {
  display: block;
  color: #000;
  text-decoration: underline;
  font-size: 15px;
  font-weight: 600;
  word-break: break-word;
  margin-bottom: 4px;
}
.req-card .meta {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.55;
}
.req-card .close-btn {
  background: #000;
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.req-card .close-btn:active { opacity: 0.7; }

/* ---------- Install hint ---------- */
.install-hint {
  margin-top: 12px;
  font-size: 12px;
  opacity: 0.6;
  text-align: center;
}

/* ---------- Ride log modal ---------- */
.log-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}
.log-modal[hidden] { display: none; }
.log-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: muberFadeIn 0.18s ease;
}
.log-modal-card {
  position: relative;
  background: #fff;
  color: #000;
  border: 2px solid #000;
  border-radius: 18px;
  width: 100%;
  max-width: 460px;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  animation: muberPopIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.log-modal-head {
  position: relative;
  padding: 20px 64px 16px 22px;
  border-bottom: 1px solid #000;
  background: #fff;
}
.log-modal-title {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1;
}
.log-modal-sub {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-top: 8px;
}
.log-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid #000;
  color: #000;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
  padding: 0;
}
.log-close-btn:active { background: #000; color: #fff; }

.log-modal-body {
  padding: 16px 18px 22px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.log-empty {
  font-size: 14px;
  opacity: 0.5;
  padding: 28px 0;
  text-align: center;
  letter-spacing: 0.02em;
}
.log-row {
  position: relative;
  border: 1px solid #000;
  border-radius: 12px;
  padding: 13px 14px;
  background: #fff;
}
.log-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: #000;
  border-radius: 12px 0 0 12px;
}
.log-row .log-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.log-row .log-idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.08em;
  background: #000;
  color: #fff;
  border-radius: 999px;
  padding: 3px 9px;
  flex-shrink: 0;
}
.log-row .log-addr {
  font-weight: 600;
  font-size: 15px;
  word-break: break-word;
  line-height: 1.3;
  flex: 1;
}
.log-row .log-meta {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
  padding-left: 2px;
}

@keyframes muberFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes muberPopIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* Lock body scroll when modal open */
body.log-modal-open { overflow: hidden; }

/* ---------- Tablet/larger: keep split but cap width ---------- */
@media (min-width: 720px) {
  body {
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 0 60px rgba(0,0,0,0.2);
  }
}
