/* ═══════════════════════════════════════════════
   TALI · LAYOUT
═══════════════════════════════════════════════ */

/* ── Splash ── */
#splash {
  position: fixed; inset: 0;
  background: #f0f2f5;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity .5s ease;
}
#splash .logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(60px, 18vw, 100px);
  letter-spacing: 14px; color: #111118; line-height: 1;
}
#splash .sub {
  font-size: 11px; color: #666680;
  letter-spacing: 6px; margin-top: 4px; text-transform: uppercase;
}
#splash .loader { margin-top: 48px; display: flex; gap: 6px; }
#splash .loader span {
  width: 6px; height: 6px; background: #22c55e;
  border-radius: 50%; animation: ldot .9s infinite ease-in-out;
}
#splash .loader span:nth-child(2) { animation-delay: .15s; background: #00d4ff; }
#splash .loader span:nth-child(3) { animation-delay: .30s; background: #ff6eb4; }

/* ── App shell ── */
#app {
  display: flex; flex-direction: column;
  height: var(--app-h); overflow: hidden;
  position: relative;
}

/* ── Map pane ── */
#map-wrap {
  position: relative; flex-shrink: 0;
  height: calc(var(--app-h) * 0.42);
  min-height: 200px; max-height: 340px;
  transition: height .35s ease, min-height .35s ease;
}
#map { width: 100%; height: 100%; }

/* ── Side panel ── */
#side {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; border-top: none;
  background: var(--bg);
}

.map-tag {
    display: none;
}

/* ── Header — floats over the map ── */
header {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  z-index: 550;
  display: flex; align-items: center; gap: 0;
  padding: 6px 6px 6px 14px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 40px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.10), 0 0 0 0.5px rgba(0,0,0,0.05);
  white-space: nowrap;
  pointer-events: auto;
  transition: background .3s, box-shadow .3s;
  /* does not participate in flex flow */
  flex-shrink: 0;
}
body.dark header {
  background: rgba(6,6,16,0.82);
  border-color: rgba(255,255,255,0.07);
  box-shadow: 0 2px 24px rgba(0,0,0,0.6), 0 0 0 0.5px rgba(255,255,255,0.04);
}

.hdr-brand   { display: flex; align-items: center; }
.hdr-name    {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 17px; letter-spacing: 6px;
  color: var(--white); line-height: 1;
  padding-right: 11px;
}
.hdr-city    {
  font-size: 8px; color: var(--gray2);
  letter-spacing: 2.5px; text-transform: uppercase;
  border-left: 1px solid var(--border);
  padding: 0 11px; line-height: 1;
}
.hdr-actions { display: flex; gap: 1px; margin-left: 4px; }
.hdr-btn {
  background: transparent; border: none;
  color: var(--gray2);
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 11px; cursor: pointer;
  transition: color .18s, background .18s;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hdr-btn:hover  { color: var(--white); background: rgba(0,0,0,0.06); }
body.dark .hdr-btn:hover { background: rgba(255,255,255,0.09); }
.hdr-btn.active { color: var(--cyan); }
.hdr-btn.day    { color: var(--yellow); }

/* ── Scrollable panel ── */
#panel {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 14px 14px 20px;
  display: flex; flex-direction: column; gap: 12px;
  -webkit-overflow-scrolling: touch; scroll-behavior: smooth;
}
#panel::-webkit-scrollbar       { width: 3px; }
#panel::-webkit-scrollbar-track { background: transparent; }
#panel::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Desktop layout ── */
@media (min-width: 860px) {
  #app { flex-direction: row; }
  #map-wrap { flex: 1; height: var(--app-h); max-height: none !important; }
  #side { width: 380px; flex-shrink: 0; height: var(--app-h); border-top: none; border-left: 1px solid var(--border); }
  #driver-panel { height: var(--app-h); }
  #nav-bar { border-radius: 0; }
  /* Desktop: header floats top-left over map */
  header { left: 16px; transform: none; }
}

/* ── Small phone ── */
@media (max-width: 380px) {
  #map-wrap { height: calc(var(--app-h) * 0.38); }
  header    { padding: 5px 5px 5px 12px; }
  #panel    { padding: 11px 12px 18px; }
}

/* ── Dark overrides ── */
body.dark #map   { filter: brightness(1.02) contrast(.98); }
/* body.dark header — handled inline above */
/* ── Install button in header ── */
.hdr-install-btn {
  color: var(--cyan) !important;
}
