/* ═══════════════════════════════════════════
   TANKEN APP — Sahara Warm Minimalism
   Farben: Burnt Sienna + Warm Linen
   Fonts: EB Garamond (Headlines) + Manrope (Body)
═══════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400;500;600&family=Manrope:wght@400;500;600;700&display=swap');

/* ── DESIGN TOKENS ── */
:root {
  --primary:   #c2652a;
  --primary-d: #a0521f;
  --bg:        #faf5ee;
  --card:      #fff8f0;
  --text:      #2d1f0e;
  --sub:       #9c8672;
  --sep:       #ede4d8;
  --sep2:      #d8d0c8;
  --accent:    #8c3c3c;
  --shadow:    rgba(58,48,42,0.06);

  --hero-bg:     #fff3e8;
  --hero-border: #f0c9a0;
  --green-text:  #5a6e2a;
  --green-sub:   #8faa48;

  --font-head: 'EB Garamond', Georgia, serif;
  --font-body: 'Manrope', -apple-system, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* Dark Mode — warme Dunkelheit */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:    #1a1208;
    --card:  #261a0e;
    --text:  #f5ede0;
    --sub:   #9c8672;
    --sep:   #3a2a18;
    --sep2:  #4a3820;
    --shadow: rgba(0,0,0,0.3);
    --hero-bg:     #2a1800;
    --hero-border: #5a3010;
    --green-text:  #a8cc60;
    --green-sub:   #7a9e3a;
  }
}
body.dark {
  --bg:#1a1208!important;--card:#261a0e!important;--text:#f5ede0!important;
  --sub:#9c8672!important;--sep:#3a2a18!important;--sep2:#4a3820!important;
  --shadow:rgba(0,0,0,0.3)!important;
  --hero-bg:#2a1800!important;--hero-border:#5a3010!important;
  --green-text:#a8cc60!important;--green-sub:#7a9e3a!important;
}
body.light {
  --bg:#faf5ee!important;--card:#fff8f0!important;--text:#2d1f0e!important;
  --sub:#9c8672!important;--sep:#ede4d8!important;--sep2:#d8d0c8!important;
  --shadow:rgba(58,48,42,0.06)!important;
  --hero-bg:#fff3e8!important;--hero-border:#f0c9a0!important;
  --green-text:#5a6e2a!important;--green-sub:#8faa48!important;
}

/* ── BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; background: var(--bg); font-family: var(--font-body); color: var(--text); -webkit-font-smoothing: antialiased; }

/* ── HEADER ── */
.hdr {
  background: var(--card);
  position: sticky; top: 0; z-index: 400;
  padding: calc(env(safe-area-inset-top,0px) + 10px) 16px 0;
  border-bottom: 1px solid var(--sep2);
  box-shadow: 0 2px 16px var(--shadow);
}
.logo-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.logo { font-family: var(--font-head); font-size: 26px; font-weight: 600; color: var(--primary); letter-spacing: -0.3px; line-height: 1; }
.logo span { color: var(--text); }
.rbtn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--sep2);
  font-size: 15px; cursor: pointer; color: var(--sub);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s;
}
.rbtn:active { opacity: .5; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .7s linear infinite; }

/* ── SUCHE ── */
.search-wrap { position: relative; margin-bottom: 8px; }
.search-row { display: flex; gap: 8px; }
.search-box {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--bg); border-radius: var(--radius-md);
  padding: 0 12px; border: 1.5px solid var(--sep2);
  transition: border-color .15s; min-width: 0;
}
.search-box:focus-within { border-color: var(--primary); }
.search-input {
  flex: 1; border: none; background: transparent;
  padding: 10px 0; font-size: 15px; font-family: var(--font-body);
  color: var(--text); outline: none; min-width: 0;
}
.search-input::placeholder { color: var(--sub); }
.clr-btn {
  background: none; border: none; cursor: pointer;
  font-size: 15px; color: var(--sub); padding: 4px;
  display: none; flex-shrink: 0;
}
.loc-btn {
  background: var(--primary); border: none; border-radius: var(--radius-sm);
  padding: 0 14px; height: 42px; cursor: pointer; color: #fff;
  font-size: 13px; font-weight: 600; font-family: var(--font-body);
  white-space: nowrap; flex-shrink: 0; transition: background .15s;
}
.loc-btn:active { background: var(--primary-d); }

/* Dropdown */
.sugg {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--card); border-radius: var(--radius-md);
  border: 1px solid var(--sep2);
  box-shadow: 0 8px 24px var(--shadow);
  z-index: 999; max-height: 200px; overflow-y: auto; display: none;
}
.sugg.open { display: block; }
.si {
  padding: 11px 16px; cursor: pointer; font-size: 13px;
  border-bottom: .5px solid var(--sep);
  display: flex; align-items: center; gap: 10px;
}
.si:last-child { border-bottom: none; }
.si:active { background: var(--bg); }
.si-city { font-weight: 600; color: var(--text); }
.si-det { font-size: 11px; color: var(--sub); }

/* Status-Zeile */
.filter-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sub); flex-shrink: 0; }
.status-dot.g { background: #7aaa30; }
.status-dot.b { background: var(--primary); }
.status-dot.o { background: #c2852a; }
.status-txt { font-size: 12px; color: var(--sub); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-txt { font-size: 11px; color: var(--sub); flex-shrink: 0; }

/* Segment-Buttons (Fuel, Radius) */
.seg, .rad-row {
  display: flex; background: var(--bg); border-radius: var(--radius-sm);
  padding: 2px; gap: 1px; margin-bottom: 6px;
  border: 1px solid var(--sep);
}
.ft, .rb {
  flex: 1; padding: 7px 2px; border: none; border-radius: 6px;
  font-size: 11px; cursor: pointer; background: transparent;
  color: var(--sub); font-family: var(--font-body);
  transition: all .15s; white-space: nowrap;
}
.ft.on, .rb.on {
  background: var(--card); color: var(--primary);
  font-weight: 700; box-shadow: 0 1px 4px var(--shadow);
}
.hdr-pad { height: 8px; }

/* ── STRIP ── */
.strip {
  background: var(--card); padding: 8px 16px;
  border-bottom: 1px solid var(--sep); display: flex; align-items: center; gap: 8px;
}
.avg-n { font-family: var(--font-head); font-size: 20px; font-weight: 500; color: var(--text); }
.avg-u { font-size: 11px; color: var(--sub); }
.sdiv { width: 1px; height: 18px; background: var(--sep2); margin: 0 4px; }
.sinfo { font-size: 11px; color: var(--sub); margin-left: auto; }
.pbar { height: 2px; background: var(--sep); }
.pbar-i { height: 100%; background: var(--primary); width: 0%; transition: width .35s; }

/* ── HERO ── */
.hero {
  background: var(--hero-bg); border-radius: var(--radius-lg);
  padding: 14px 16px; margin: 12px;
  border: 1px solid var(--hero-border);
  box-shadow: 0 2px 12px var(--shadow);
}
.hero-lbl {
  font-size: 10px; color: var(--green-text); font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px; margin-bottom: 6px;
  font-family: var(--font-body);
}
.hero-row { display: flex; align-items: flex-end; gap: 12px; }
.hero-price {
  font-family: var(--font-head); font-size: 46px; font-weight: 400;
  color: var(--green-text); letter-spacing: -2px; line-height: 1;
}
.hero-price sup { font-size: 22px; font-weight: 600; vertical-align: super; }
.hero-inf { padding-bottom: 6px; }
.hero-brand { font-size: 13px; font-weight: 700; color: var(--green-text); }
.hero-addr { font-size: 11px; color: var(--green-sub); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── KARTE ── */
.map-full {
  height: calc(100vh - 280px); min-height: 380px;
  margin: 12px; border-radius: var(--radius-lg);
  overflow: hidden; border: 1px solid var(--sep2);
  box-shadow: 0 2px 16px var(--shadow); position: relative;
}
#map { width: 100%; height: 100%; }
.map-my-loc {
  position: absolute; bottom: 14px; right: 14px; z-index: 1000;
  background: var(--card); border: 1px solid var(--sep2);
  border-radius: var(--radius-md); padding: 10px 14px;
  cursor: pointer; box-shadow: 0 2px 10px var(--shadow);
  font-size: 13px; font-weight: 600; color: var(--primary);
  font-family: var(--font-body);
}
.map-my-loc:active { opacity: .7; }

/* ── LISTE ── */
.card-wrap {
  background: var(--card); margin: 12px;
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--sep2); box-shadow: 0 2px 12px var(--shadow);
}
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: .5px solid var(--sep);
  cursor: pointer; transition: background .1s;
}
.row:last-child { border-bottom: none; }
.row:active { background: var(--bg); }
.bico {
  width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900; color: #fff;
}
.inf { flex: 1; min-width: 0; }
.bn { font-size: 14px; font-weight: 700; color: var(--text); }
.ba { font-size: 11px; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.bc { font-size: 10px; color: var(--sub); }
.badge { display: inline-block; font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 99px; margin-top: 3px; }
.pcol { flex-shrink: 0; min-width: 68px; text-align: right; }
.pbig { font-family: var(--font-head); font-size: 28px; font-weight: 400; letter-spacing: -1px; line-height: 1; color: var(--text); }
.pbig sup { font-size: 14px; font-weight: 600; vertical-align: super; }
.punit { font-size: 9px; color: var(--sub); margin-top: 1px; font-family: var(--font-body); }
.fav-btn {
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: none; font-size: 18px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: .3; transition: opacity .2s;
}
.fav-btn.on { opacity: 1; }
.nav {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none; flex-shrink: 0;
  transition: background .15s;
}
.nav:active { background: var(--primary-d); }
.sec {
  background: var(--bg); padding: 7px 16px; font-size: 10px;
  font-weight: 700; color: var(--sub); text-transform: uppercase;
  letter-spacing: .6px; border-bottom: .5px solid var(--sep2);
  border-top: .5px solid var(--sep2); margin-top: 4px;
}

/* ── FAVORITEN ORTE ── */
.fav-loc-card {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; margin: 0 12px 10px;
  background: var(--card); border-radius: var(--radius-lg);
  border: 1px solid var(--sep2); cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow); transition: opacity .1s;
}
.fav-loc-card:active { opacity: .8; }
.fav-loc-ico {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--primary); display: flex; align-items: center;
  justify-content: center; font-size: 20px; flex-shrink: 0;
}
.fav-loc-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.fav-loc-sub { font-size: 11px; color: var(--sub); }
.fav-loc-del {
  background: var(--bg); border: 1px solid var(--sep2);
  border-radius: var(--radius-sm); padding: 6px 10px;
  cursor: pointer; color: var(--sub); font-size: 12px;
  font-weight: 600; font-family: var(--font-body); flex-shrink: 0;
}

/* ── ADD LOC BOX ── */
.add-loc-box {
  display: none; margin: 0 12px 12px;
  background: var(--card); border-radius: var(--radius-lg);
  border: 1px solid var(--sep2); padding: 16px;
  box-shadow: 0 2px 16px var(--shadow);
}
.add-search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border-radius: var(--radius-md);
  padding: 0 12px; border: 1.5px solid var(--sep2); margin-bottom: 8px;
}
.add-search-box:focus-within { border-color: var(--primary); }
.add-search-input {
  flex: 1; border: none; background: transparent;
  padding: 10px 0; font-size: 15px; font-family: var(--font-body);
  color: var(--text); outline: none;
}
.add-search-input::placeholder { color: var(--sub); }
.add-sugg {
  display: none; background: var(--card); border-radius: var(--radius-md);
  border: 1px solid var(--sep2); box-shadow: 0 4px 16px var(--shadow);
  max-height: 180px; overflow-y: auto; margin-bottom: 8px;
}

/* ── STATES ── */
.state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 52px 24px; text-align: center;
}
.s-ico { font-size: 44px; margin-bottom: 14px; }
.s-msg { font-size: 14px; color: var(--sub); line-height: 1.7; margin-bottom: 20px; white-space: pre-line; }
.s-btn {
  width: 100%; padding: 13px; background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius-md); font-size: 15px;
  font-weight: 600; cursor: pointer; font-family: var(--font-body);
  transition: background .15s;
}
.s-btn:active { background: var(--primary-d); }

/* ── EINSTELLUNGEN ── */
.settings-card {
  background: var(--card); border-radius: var(--radius-lg);
  padding: 14px 16px; margin-bottom: 12px;
  border: 1px solid var(--sep2); box-shadow: 0 2px 12px var(--shadow);
}
.settings-lbl {
  font-size: 10px; font-weight: 700; color: var(--sub);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px;
}
.toggle-row {
  display: flex; background: var(--bg); border-radius: var(--radius-sm);
  padding: 2px; gap: 1px; border: 1px solid var(--sep);
}
.tog-btn {
  flex: 1; border: none; border-radius: 6px; padding: 8px 4px;
  font-size: 12px; cursor: pointer; font-family: var(--font-body);
  background: transparent; color: var(--sub); transition: all .15s;
}
.tog-btn.on {
  background: var(--card); color: var(--primary);
  font-weight: 700; box-shadow: 0 1px 4px var(--shadow);
}
.std-loc-display {
  font-size: 13px; color: var(--sub); margin-bottom: 10px;
  font-style: italic; line-height: 1.5;
}
.std-loc-display.set { font-style: normal; color: var(--text); }
.btn-primary {
  padding: 11px 16px; background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius-md); font-size: 13px;
  font-weight: 600; cursor: pointer; font-family: var(--font-body);
  transition: background .15s;
}
.btn-primary:active { background: var(--primary-d); }
.btn-secondary {
  padding: 11px 14px; background: var(--bg); color: var(--sub);
  border: 1px solid var(--sep2); border-radius: var(--radius-md);
  font-size: 13px; cursor: pointer; font-family: var(--font-body);
}

/* ── TAB BAR ── */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 350;
  background: rgba(250,245,238,0.96); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--sep2); display: flex;
  padding: 8px 0 calc(env(safe-area-inset-bottom,0px) + 4px);
}
body.dark .tabbar { background: rgba(26,18,8,0.96); }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 3px; cursor: pointer; border: none; background: none;
  padding: 0; font-family: var(--font-body);
}
.tab svg { width: 22px; height: 22px; stroke: var(--sub); stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tab span { font-size: 10px; color: var(--sub); }
.tab.on svg { stroke: var(--primary); }
.tab.on span { color: var(--primary); font-weight: 700; }

/* ── CONTENT ── */
.content { padding-bottom: calc(env(safe-area-inset-bottom,0px) + 72px); }

/* ── ANIMATIONS ── */
@keyframes up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.row { animation: up .2s ease both; }

/* ── LEAFLET OVERRIDES ── */
.leaflet-popup-content-wrapper { border-radius: 16px !important; box-shadow: 0 4px 20px rgba(58,48,42,.15) !important; }
.leaflet-popup-content { margin: 14px 16px !important; }
.leaflet-control-attribution { display: none; }
.my-location-marker {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary); border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(194,101,42,.25), 0 2px 8px rgba(0,0,0,.2);
}
