@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap');

:root{
  color-scheme: dark;
  --bg: #111111;
  --panel: #111111;
  --panel2: #383838;
  --text: rgba(255,255,255,0.98);
  --muted: rgba(255,255,255,0.75);
  --muted2: rgba(255,255,255,0.60);
  --shadow: 0 20px 60px rgba(0,0,0,0.45);
  --radius: 24px;
  --button-radius: 16px;
  --accent: #f64749;
  --accent-press: #d13234;
  --line: rgba(255,255,255,0.12);
}

*{ box-sizing: border-box; }

.is-hidden{ display: none !important; }

html, body{
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji";
}

body{
  position: fixed;
  inset: 0;
  height: var(--vvh, 100dvh);
  overflow: hidden;
  /* Prevent double-tap zoom on most browsers; map overrides below. */
  touch-action: manipulation;
  overscroll-behavior: none;
}

.page{
  min-height: var(--vvh, 100dvh);
  display: flex;
  flex-direction: column;
}

.mapShell{
  position: fixed;
  top: var(--vvo, 0px);
  left: 0;
  right: 0;
  height: var(--vvh, 100dvh);
}

.map{
  height: 100%;
  min-height: 100%;
  border-radius: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: none;
  position: relative;
  z-index: 1;
  /* Allow map gestures (pan + pinch zoom) even if the page itself is non-zoomable. */
  touch-action: pan-x pan-y pinch-zoom;
}

.userDotBuzz{
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #0b0b0b;
  border: 2px solid #f64749;
  box-shadow: 0 0 0 6px rgba(246,71,73,0.14), 0 12px 30px rgba(0,0,0,0.26);
}
.userPulseBuzz{ position: relative; }
.userPulseBuzz::after{
  content:"";
  position:absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  transform: translate(-50%,-50%);
  border-radius: 999px;
  background: rgba(246,71,73,0.12);
}

.searchDock{
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  transform: none;
  width: auto;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
  z-index: 2600;
  pointer-events: auto;
}

.searchBar{
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  touch-action: manipulation;
}

.searchPill{
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 6px 0 16px;
  border-radius: 999px;
  background: rgba(17,17,17,0.92);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(18px);
}

.searchPill input{
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 16px;
  padding: 0;
  height: 56px;
  outline: none;
  flex: 1 1 auto;
  min-width: 0;
}

.searchBtn{
  border: none;
  border-radius: 999px;
  height: 44px;
  padding: 0 14px; /* less vertical padding */
  margin: 6px 0;   /* same feel as right inset */
  font-weight: 600;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  flex: 0 0 auto;
}

.searchBtn:active{ background: var(--accent-press); }

.locateBtn{
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.82);
  color: rgba(255,255,255,0.95);
  border-radius: 999px;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  flex: 0 0 auto;
  box-shadow: 0 18px 45px rgba(0,0,0,0.22);
}
.locateBtn:active{ transform: translateY(1px); }

.searchMsg{
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted2);
}

.authOverlay{
  position: fixed;
  inset: 0;
  display: block;
  z-index: 3000;
}

.authOverlay.is-hidden{ display: none; }

.authBackdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.22);
}

.authSheet{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  min-height: 0;
  background: #0f0f0f;
  border-radius: 24px 24px 0 0;
  border: none;
  box-shadow: 0 -20px 60px rgba(0,0,0,0.55);
  transform: translate3d(0, 0, 0);
  max-height: 85svh;
  overflow: hidden;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
}

.authForm{
  grid-template-rows: auto;
}

.authSheetBody{
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
}

.authForm{
  flex: 1 1 auto;
}

.authActions{
  margin-top: 6px;
  display: grid;
  gap: 12px;
}

.authSheet .profileSheetHandle{
  touch-action: none;
}

.authSheet.anim{
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.authSheet.is-closed{
  transform: translate3d(0, 110%, 0);
}

.authSheetBody{
  padding: 12px 22px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: auto;
  scroll-padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px) + var(--keyboard-offset, 0px));
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px) + var(--keyboard-offset, 0px));
  overscroll-behavior: contain;
  overscroll-behavior-y: none;
}

.authHeader{
  display: grid;
  gap: 6px;
  place-items: center;
  margin-bottom: 12px;
}

.authLogo{
  height: 100px;
  object-fit: contain;
}

.authTitle{
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ffffff;
}

.authTabs{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.tabBtn{
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--button-radius);
  cursor: pointer;
  font-weight: 600;
}

.tabBtn.is-active{
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.28);
}

.authForm{
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
}

.field{
  display: grid;
  gap: 6px;
}

.fieldLabel{
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted2);
}

.field input{
  border-radius: var(--button-radius);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 12px 14px;
  font-size: 16px; /* iOS: prevent zoom-on-focus */
}

.selectInput{
  border-radius: var(--button-radius);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 12px 14px;
  font-size: 16px; /* iOS: prevent zoom-on-focus */
  appearance: none;
  -webkit-appearance: none;
}

.textArea{
  border-radius: var(--button-radius);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 12px 14px;
  font-size: 16px; /* iOS: prevent zoom-on-focus */
  resize: vertical;
}

.divider{
  height: 1px;
  width: 100%;
  background: rgba(255,255,255,0.10);
  border-radius: 999px;
}

.sectionTitle{
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}

.field.is-hidden{ display: none; }

.formMsg{
  min-height: 18px;
  font-size: 13px;
  color: var(--muted2);
}

.btnPrimary{
  border: none;
  border-radius: var(--button-radius);
  padding: 12px 18px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.btnPrimary:active{ background: var(--accent-press); }

.leaflet-container{
  font-family: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji";
  background: #111111;
}

.leaflet-control-attribution{
  background: transparent !important;
  color: rgba(255,255,255,0.88) !important;
  border: none !important;
  box-shadow: none !important;
  text-shadow: 0 1px 10px rgba(0,0,0,0.40);
}

.leaflet-control-attribution a{ color: rgba(255,255,255,0.92) !important; }

.emojiMarker{
  background: #ffffff;
  color: #0d1418;
  border-radius: 16px;
  padding: 6px 8px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.32);
  border: 1px solid rgba(13,20,24,0.1);
  font-size: 18px;
}

.customLeafletPin{
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  position: relative;
  width: 44px;
  height: 44px;
}

.leadEmojiPin{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  display: grid;
  place-items: center;
  box-shadow: 0 14px 30px rgba(0,0,0,0.24);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
}
.leadEmojiPinInner{
  font-size: 20px;
  line-height: 1;
  transform: translateY(-0.5px);
  user-select: none;
  -webkit-user-select: none;
}
.leadEmojiPin--zusage{ background: #22c55e; }
.leadEmojiPin--absage{ background: #f64749; }
.leadEmojiPin--interesse{ background: #f59e0b; }
.leadEmojiPin--angelegt{ background: #8b8b8b; }

.topCards{
  position: fixed;
  left: 50%;
  top: calc(12px + env(safe-area-inset-top, 0px));
  transform: translateX(-50%);
  z-index: 2600;
  width: min(380px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
}

.salesCard{
  width: 100%;
  border-radius: 18px;
  padding: 12px 14px 12px;
  background: rgba(17,17,17,0.92);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 45px rgba(0,0,0,0.30);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.salesCard:active{ transform: none; }

.salesKicker{
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: rgba(255,255,255,0.72);
  font-weight: 700;
}

.salesMetricRow{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.salesMetric{
  min-width: 0;
}
.salesMetricRight{
  text-align: right;
}

.salesMetricLabel{
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: rgba(255,255,255,0.72);
  font-weight: 800;
}

.salesMetricValue{
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: rgba(255,255,255,0.98);
  text-shadow:
    0 0 18px rgba(246,71,73,0.30),
    0 0 42px rgba(246,71,73,0.22);
}
.salesMetricRight .salesMetricValue{
  text-shadow: 0 0 18px rgba(255,255,255,0.10);
}

.salesRow{
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.10);
}

.salesLabel{
  color: rgba(255,255,255,0.70);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.salesValue{
  color: rgba(255,255,255,0.96);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.scheduleCard{
  width: 100%;
  border-radius: 18px;
  padding: 12px 14px 12px;
  background: rgba(17,17,17,0.92);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 45px rgba(0,0,0,0.30);
  display: grid;
  gap: 6px;
}

.scheduleHeadline{
  font-weight: 900;
  letter-spacing: -0.01em;
  color: rgba(255,255,255,0.96);
  font-size: 14px;
}

.scheduleNext{
  color: rgba(255,255,255,0.78);
  font-weight: 700;
  font-size: 12px;
}
.scheduleNext:empty{ display: none; }

.scheduleWeek{
  color: rgba(255,255,255,0.64);
  font-weight: 700;
  font-size: 12px;
}
.scheduleWeek:empty{ display: none; }

.profileSheet{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--panel);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -20px 60px rgba(0,0,0,0.45);
  border: none;
  transform: translate3d(0, 110%, 0);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2700;
  max-height: min(calc(100svh - 8px), calc(100dvh - 8px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  touch-action: pan-y;
}

.profileSheet.is-open{
  transform: translate3d(0, 0, 0);
}

.profileSheetHandle{
  width: 48px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.45);
  margin: 10px auto 6px;
  touch-action: none;
}

.profileSheetBody{
  padding: 16px 22px 28px;
  display: grid;
  gap: 18px;
  overflow-y: auto;
  scroll-padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px) + var(--keyboard-offset, 0px));
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px) + var(--keyboard-offset, 0px));
  -webkit-overflow-scrolling: auto;
  overscroll-behavior: contain;
  overscroll-behavior-y: none;
  max-height: 100%;
}

.profileSheetBody input,
.profileSheetBody select,
.profileSheetBody textarea{
  scroll-margin-bottom: calc(40px + env(safe-area-inset-bottom, 0px) + var(--keyboard-offset, 0px));
}

.profileHeader{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profileHeaderMain{
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.profileEmoji{
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  display: grid;
  place-items: center;
  font-size: 26px;
}

.distanceBtn{
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.96);
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  flex: 0 0 auto;
  white-space: nowrap;
}
.distanceBtn:disabled{
  opacity: 0.45;
  cursor: default;
}
.distanceBtn:active{ transform: translateY(1px); }

.profileName{
  font-weight: 700;
  font-size: 18px;
}

.profileSub{
  color: var(--muted2);
  font-size: 13px;
}

.profileGrid{
  display: grid;
  gap: 12px;
}

.leadDateRow{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Restaurant/Sales-contact sheet should open to 80% height */
#restaurantSheet{
  height: 80svh;
  max-height: 80svh;
}

/* (legacy) leadPin removed in favor of leadEmojiPin */

.profileActions{
  display: grid;
  gap: 10px;
}

.ghostBtn{
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: var(--button-radius);
  padding: 12px 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.ghostBtn.danger{
  border-color: rgba(246,71,73,0.45);
  color: #f64749;
}

.scheduleList{
  display: grid;
  gap: 10px;
}

.scheduleGroupTitle{
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.68);
  margin-top: 4px;
}

.scheduleItem{
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  border-radius: 16px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.scheduleItem:active{ transform: translateY(1px); }

.scheduleItemTop{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.scheduleItemName{
  font-weight: 900;
  color: rgba(255,255,255,0.96);
}

.scheduleItemMeta{
  font-weight: 800;
  color: rgba(255,255,255,0.70);
  font-size: 12px;
  white-space: nowrap;
}

.scheduleCalBtn{
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.40);
  color: rgba(255,255,255,0.92);
  border-radius: 999px;
  padding: 8px 10px;
  font-weight: 900;
  font-size: 12px;
  cursor: pointer;
}
.scheduleCalBtn:active{ transform: translateY(1px); }

.scheduleItemSub{
  color: rgba(255,255,255,0.64);
  font-weight: 700;
  font-size: 12px;
}

.sheetBackdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 2650;
}

.sheetBackdrop.is-open{
  opacity: 1;
  pointer-events: auto;
}

#scheduleCard{ cursor: pointer; -webkit-tap-highlight-color: transparent; }

.scheduleCard.is-compact{
  padding: 12px 14px;
}
.scheduleCard.is-compact .scheduleNext,
.scheduleCard.is-compact .scheduleWeek{
  display: none;
}

.profileSheet,
.authSheet{
  transition: transform 0.22s ease-out;
}
.profileSheet.is-dragging,
.authSheet.is-dragging{
  transition: none !important;
}

@media (max-width: 720px){
  .searchDock{ bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .topCards{ width: min(360px, calc(100vw - 24px)); }
}
