/* =====================================================================
   DankeeGo - Booking page (and estimate page): fit every screen
   Phone: map on top + bottom sheet.  Tablet / laptop / desktop / big monitor: map + side panel.
   Load this file AFTER book.css (and estimate.css).
   ===================================================================== */
:root { --panel-w: 404px; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.book-body { overflow-x: hidden; }
.book-nav { padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
.auth-wrap { min-height: calc(100vh - var(--nav)); min-height: calc(100dvh - var(--nav)); }
.action-bar { padding-bottom: calc(.7rem + env(safe-area-inset-bottom)); }

/* everything that used to assume a 404px panel now follows --panel-w */
.panel { width: var(--panel-w); }
.route-chip { left: calc(50% + var(--panel-w) / 2); max-width: calc(100% - var(--panel-w) - 48px); overflow: hidden; text-overflow: ellipsis; }
.map-hint { left: calc(50% + var(--panel-w) / 2); }
.accept-card { left: calc(50% + var(--panel-w) / 2 + 2px); width: min(420px, calc(100% - var(--panel-w) - 56px)); }

/* ---------- tablet + landscape phone: keep the side panel (no huge stretched bottom sheet) ---------- */
@media (min-width: 700px) and (max-width: 991px), (max-width: 991px) and (orientation: landscape) and (max-height: 520px) {
  :root { --panel-w: 360px; }
  .panel { top: 12px; left: 12px; bottom: 12px; right: auto; max-height: none; border-radius: 18px; }
  .sheet-handle { display: none; }
  .panel.collapsed .tabs { display: grid; }
  .panel.collapsed .panel-body { display: block; }
  .tabs { padding-top: 12px; }
  .route-chip { top: 12px; }
  .map-hint { display: block; }
  .accept-card { top: 12px; min-width: 0; }
}
@media (max-height: 520px) and (orientation: landscape) and (max-width: 699px) {
  :root { --panel-w: 330px; }
}

/* ---------- phones: bottom sheet that never covers the whole map ---------- */
@media (max-width: 699px) and (orientation: portrait), (max-width: 699px) and (min-height: 521px) {
  .panel { width: auto; max-height: min(72%, calc(100dvh - var(--nav) - 70px)); }
  .route-chip { left: 50%; max-width: calc(100% - 24px); }
  .accept-card { left: 50%; width: calc(100% - 24px); }
  .auth-card { padding: 1.4rem 1.2rem; }
}
@media (max-width: 360px) {
  .book-nav { padding-left: 12px; padding-right: 12px; }
  .book-nav .brand img { width: 112px; }
  .action-bar { gap: 6px; padding-left: .6rem; padding-right: .6rem; }
  .action-bar .btn { padding: 0 .7rem; font-size: .8rem; }
  .action-bar .sum strong { font-size: 1.05rem; }
  .otp b i { width: 22px; height: 30px; }
}

/* ---------- laptop / desktop ---------- */
@media (min-width: 1440px) {
  :root { --panel-w: 440px; --nav: 64px; }
  .panel { top: 18px; left: 18px; bottom: 18px; }
  .auth-card { max-width: 440px; }
}

/* ---------- full-HD monitors ---------- */
@media (min-width: 1920px) {
  html { font-size: 17px; }
  :root { --panel-w: 500px; --nav: 72px; }
  .book-nav { padding: 0 32px; }
  .book-nav .brand img { width: 190px; height: 54px; }
  .panel { top: 22px; left: 22px; bottom: 22px; border-radius: 24px; }
  .panel-body { padding: 16px 18px; }
  .tabs { padding: 16px 18px 0; }
  .form-control, .form-select { height: 46px; }
  .btn-send, .btn-ghost, .btn-danger-x { height: 48px; }
  .auth-card { max-width: 480px; padding: 2rem 1.9rem; }
  .modal-c { max-width: 460px; }
  .alert.toast-alert { top: 88px; width: min(440px, calc(100vw - 28px)); }
}

/* ---------- 2K / 4K / ultra-wide ---------- */
@media (min-width: 2560px) {
  html { font-size: 19px; }
  :root { --panel-w: 580px; --nav: 80px; }
  .panel { top: 28px; left: 28px; bottom: 28px; }
  .book-nav .brand img { width: 220px; height: 62px; }
  .auth-card { max-width: 540px; }
  .modal-c { max-width: 520px; }
}

/* ---------- estimate page (step 1 + step 2) ---------- */
@media (min-width: 1500px) {
  .est-card-wrap, .est-points { max-width: 1280px; }
  .fare-card { max-width: 1040px; }
}
@media (min-width: 1920px) {
  .est-hero { padding: 80px 18px 140px; }
  .est-hero-in { max-width: 900px; }
  .est-card-wrap, .est-points { max-width: 1480px; }
  .est-card { padding: 1.9rem 1.9rem 2rem; }
  .est-in, .est-go { height: 52px; }
  .fare-card { max-width: 1240px; }
  .fare-left, .fare-right { padding: 2rem; }
}
@media (min-width: 2560px) {
  .est-card-wrap, .est-points { max-width: 1800px; }
  .fare-card { max-width: 1500px; }
}
@media (min-width: 576px) and (max-width: 991px) {
  .est-points { grid-template-columns: repeat(3, 1fr); }
  .est-points div { grid-template-columns: 1fr; text-align: center; row-gap: 6px; }
  .est-points i { grid-row: auto; margin: 0 auto; }
}