/* ===================================================================
   Questigo — Koyu motor teması
   Tüm renkler CSS değişkeni; tema tek yerden değişir.
   =================================================================== */
:root {
  /* Yüzeyler */
  --bg:            #0d0f12;
  --surface:       #16191f;
  --surface-2:     #1e222b;
  --surface-glass: rgba(20, 23, 29, 0.72);
  --border:        rgba(255, 255, 255, 0.08);

  /* Metin */
  --text:          #f2f4f7;
  --text-dim:      #9aa2ad;
  --text-faint:    #626a76;

  /* Vurgu (racing amber) */
  --accent:        #ff6b2c;
  --accent-soft:   rgba(255, 107, 44, 0.16);
  --accent-2:      #2dd4bf;   /* viraj/telemetri ikincil */
  --danger:        #ff3b46;

  /* Ölçü sistemi — kompakt */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);

  /* Güvenli alanlar (çentik / gesture bar) */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 60px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", system-ui, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

#app { position: fixed; inset: 0; }

/* ===================== EKRANLAR ===================== */
.screen { position: absolute; inset: 0; display: none; }
.screen.is-active { display: block; }

.screen--map { inset: 0; }
.screen--list {
  padding: calc(var(--safe-top) + 16px) 16px calc(var(--nav-h) + var(--safe-bottom) + 16px);
  overflow-y: auto;
  background: var(--bg);
}

/* ===================== HARİTA ===================== */
#map { position: absolute; inset: 0; }
.maplibregl-ctrl-bottom-right { margin-bottom: calc(var(--nav-h) + var(--safe-bottom) + 8px); }
.maplibregl-ctrl-attrib { font-size: 10px; background: var(--surface-glass) !important; }
.maplibregl-ctrl-attrib a { color: var(--text-faint); }

/* ===================== ÜST BAR ===================== */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-top) + 10px) 14px 10px;
  pointer-events: none;
}
.topbar__brand {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-glass);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border);
  pointer-events: auto;
}
.topbar__logo { color: var(--accent); font-size: 15px; }
.topbar__title { font-weight: 700; font-size: 14px; letter-spacing: 0.3px; }
.topbar__chip {
  pointer-events: auto;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--surface-glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border); color: var(--text);
  font-size: 18px; cursor: pointer;
  display: grid; place-items: center;
}
.topbar__chip:active { background: var(--accent-soft); }

/* ===================== HUD ===================== */
.hud {
  position: absolute; z-index: 5;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 84px);
  display: flex; align-items: center; gap: 4px;
  background: var(--surface-glass);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 10px 6px; box-shadow: var(--shadow);
}
.hud__metric { display: flex; flex-direction: column; align-items: center; min-width: 74px; }
.hud__value { font-size: 22px; font-weight: 800; line-height: 1; letter-spacing: -0.5px; }
.hud__unit { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.hud__label { font-size: 10px; color: var(--text-faint); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.6px; }
.hud__divider { width: 1px; height: 32px; background: var(--border); }
#hud-lean { color: var(--accent-2); }

/* ===================== KAYIT FAB ===================== */
.fab-record {
  position: absolute; z-index: 5;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  display: flex; align-items: center; gap: 9px;
  padding: 12px 22px; border: none; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #ff8a4c);
  color: #fff; font-weight: 700; font-size: 14px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 107, 44, 0.4);
}
.fab-record__dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.fab-record.is-recording { background: linear-gradient(135deg, var(--danger), #ff5a63); box-shadow: 0 6px 20px rgba(255,59,70,0.4); }
.fab-record.is-recording .fab-record__dot { border-radius: 2px; animation: pulse 1.1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ===================== LİSTE EKRANLARI ===================== */
.page-head { margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.page-head p { color: var(--text-dim); font-size: 14px; margin-top: 4px; }
.placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px; padding: 48px 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--text-dim);
}
.placeholder__icon { font-size: 40px; }
.placeholder b { color: var(--accent); }

/* ===================== ALT NAV ===================== */
.bottomnav {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 6;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex; align-items: stretch;
  background: var(--surface-glass);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
}
.bottomnav__item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: none; cursor: pointer; color: var(--text-faint);
  transition: color 0.15s;
}
.bottomnav__icon { font-size: 19px; filter: grayscale(1) opacity(0.7); transition: filter 0.15s; }
.bottomnav__text { font-size: 10.5px; font-weight: 600; }
.bottomnav__item.is-active { color: var(--accent); }
.bottomnav__item.is-active .bottomnav__icon { filter: none; }

/* ===================== BUTONLAR ===================== */
.btn { border: none; border-radius: 999px; padding: 9px 16px; font-size: 13px; font-weight: 700; cursor: pointer; color: #fff; }
.btn--accent { background: linear-gradient(135deg, var(--accent), #ff8a4c); }
.btn--ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn--danger { background: var(--danger); }
.icon-btn { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 10px; width: 38px; height: 38px; cursor: pointer; font-size: 15px; }

/* ===================== WAYPOINT İŞARETÇİLERİ ===================== */
.wp-marker { width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff;
  border: 2px solid rgba(0,0,0,0.4); box-shadow: 0 3px 8px rgba(0,0,0,0.5); cursor: grab; }
.wp-marker.start { background: #2dd4bf; }
.wp-marker.end   { background: var(--accent); }
.wp-marker.via   { background: #f4c430; color: #1a1a1a; width: 22px; height: 22px; }

/* ===================== ROTA OLUŞTURUCU ===================== */
.rb-overlay { position: absolute; inset: 0; z-index: 20; pointer-events: none; display: none; }
.rb-overlay.is-open { display: block; }
.rb-top { position: absolute; top: calc(var(--safe-top) + 10px); left: 12px; right: 12px;
  display: flex; align-items: flex-start; gap: 8px; pointer-events: auto; }
.rb-icon { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: var(--text); font-size: 17px; cursor: pointer; }
.rb-searchwrap { flex: 1; position: relative; }
.rb-search { width: 100%; height: 42px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: var(--text); padding: 0 14px; font-size: 14px; outline: none; }
.rb-search::placeholder { color: var(--text-faint); }
.rb-results { position: absolute; top: 48px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.rb-results:empty { display: none; }
.rb-result { display: block; width: 100%; text-align: left; padding: 11px 14px; background: none; border: none;
  border-bottom: 1px solid var(--border); color: var(--text); font-size: 13px; cursor: pointer; }
.rb-result:last-child { border-bottom: none; }
.rb-result:active { background: var(--accent-soft); }
.rb-result--err { color: var(--danger); }
.rb-hint { position: absolute; top: calc(var(--safe-top) + 62px); left: 50%; transform: translateX(-50%);
  background: var(--surface-glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; font-size: 12px; color: var(--text-dim);
  white-space: nowrap; pointer-events: none; }

.rb-sheet { position: absolute; left: 0; right: 0; bottom: 0; pointer-events: auto;
  background: var(--surface); border-top: 1px solid var(--border); border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.5); padding: 8px 16px calc(var(--safe-bottom) + 14px);
  transform: translateY(110%); transition: transform 0.25s ease; }
.rb-sheet.is-open { transform: translateY(0); }
.rb-sheet__grip { width: 40px; height: 4px; border-radius: 2px; background: var(--text-faint); margin: 4px auto 12px; cursor: pointer; }
.rb-summary { display: flex; align-items: center; gap: 14px; }
.rb-stat { display: flex; flex-direction: column; }
.rb-stat b { font-size: 18px; font-weight: 800; }
.rb-stat span { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.5px; }
.rb-actions { margin-left: auto; display: flex; gap: 8px; }
.rb-steps { list-style: none; margin: 12px 0 0; max-height: 0; overflow-y: auto; transition: max-height 0.25s ease; }
.rb-sheet.steps-open .rb-steps { max-height: 42vh; }
.rb-steps li { display: flex; gap: 10px; padding: 9px 2px; border-top: 1px solid var(--border); font-size: 13px; }
.step-dist { flex: 0 0 62px; color: var(--accent-2); font-weight: 700; }

/* ===================== NAVİGASYON ===================== */
.nav-overlay { position: absolute; inset: 0; z-index: 25; pointer-events: none; display: none; }
.nav-overlay.is-open { display: block; }
.nav-card { position: absolute; top: calc(var(--safe-top) + 12px); left: 12px; right: 12px; pointer-events: auto;
  display: flex; align-items: center; gap: 14px; background: var(--surface-glass);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.nav-arrow { font-size: 34px; color: var(--accent); line-height: 1; }
.nav-main { display: flex; flex-direction: column; }
.nav-dist { font-size: 22px; font-weight: 800; }
.nav-maneuver { font-size: 14px; color: var(--text-dim); }
.nav-foot { position: absolute; bottom: calc(var(--safe-bottom) + 16px); left: 12px; right: 12px; pointer-events: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface-glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; font-weight: 700; }

/* ===================== ROTA KARTLARI ===================== */
.route-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px; margin-bottom: 10px; }
.route-card__body { flex: 1; min-width: 0; }
.route-card__body h3 { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-card__body p { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.route-card__actions { display: flex; align-items: center; gap: 8px; }

/* ===================== MOD GEÇİŞLERİ ===================== */
body.mode-build .hud, body.mode-build .fab-record, body.mode-build .topbar, body.mode-build .bottomnav,
body.mode-nav .hud, body.mode-nav .fab-record, body.mode-nav .topbar, body.mode-nav .bottomnav,
body.mode-nav .rb-overlay { display: none !important; }

/* ===================== ARAÇ ÇUBUĞU (sağ) ===================== */
.topbar__tools { display: flex; gap: 8px; pointer-events: auto; }

/* ===================== HARİTA STİLİ SEÇİCİ ===================== */
.style-panel { position: absolute; z-index: 7; top: calc(var(--safe-top) + 58px); right: 14px;
  display: none; flex-direction: column; gap: 4px; padding: 6px;
  background: var(--surface-glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.style-panel.is-open { display: flex; }
.style-opt { display: flex; align-items: center; gap: 9px; padding: 9px 14px 9px 10px; min-width: 128px;
  background: none; border: none; border-radius: 10px; color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; text-align: left; }
.style-opt__ico { font-size: 16px; }
.style-opt:active { background: var(--accent-soft); }
.style-opt.is-active { background: var(--accent-soft); color: var(--accent); }

/* ===================== NAV METRİK ÇUBUĞU ===================== */
.nav-foot { flex-direction: column; align-items: stretch; gap: 10px; }
.nav-metrics { display: flex; align-items: center; justify-content: space-between; }
.nav-metric { display: flex; flex-direction: column; align-items: center; flex: 1; }
.nav-metric b { font-size: 17px; font-weight: 800; }
.nav-metric:nth-child(2) b { color: var(--accent-2); }
.nav-metric span { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.4px; }
.nav-foot .btn { width: 100%; }

/* ===================== OLUŞTURUCU TEMİZLE CHIP ===================== */
.rb-hintrow { position: absolute; top: calc(var(--safe-top) + 62px); left: 0; right: 0; z-index: 21;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.rb-hintrow .rb-hint { position: static; transform: none; }
.rb-clearchip { pointer-events: auto; display: none; align-items: center; gap: 6px;
  background: var(--danger); color: #fff; border: none; border-radius: 999px; padding: 7px 14px;
  font-size: 12px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 12px rgba(255,59,70,0.4); }
.rb-clearchip.is-show { display: inline-flex; }

/* ===================== KULLANICI KONUM NOKTASI ===================== */
.user-dot { width: 18px; height: 18px; border-radius: 50%; background: #3b82f6;
  border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(59,130,246,0.25), 0 2px 6px rgba(0,0,0,0.5); }

/* ===================== SÜRÜŞ ÖZETİ (modal) ===================== */
.modal { position: fixed; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center;
  padding: 24px; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal.is-open { display: flex; }
.modal__card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.modal__head { text-align: center; padding: 22px 20px 14px; }
.modal__badge { font-size: 34px; }
.modal__head h2 { font-size: 20px; font-weight: 800; margin-top: 6px; }
.modal__head p { color: var(--text-dim); font-size: 13px; margin-top: 4px; }
.rs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); }
.rs-stat { background: var(--surface); display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 16px 8px; }
.rs-stat b { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.rs-stat span { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.4px; }
.rs-stat.rs-lean b { color: var(--accent-2); }
.modal__actions { display: flex; gap: 10px; padding: 16px 20px calc(var(--safe-bottom) + 16px); }
.modal__actions .btn { flex: 1; }

/* ===================== PROFİL: TOPLAMLAR + SÜRÜŞLER ===================== */
.totals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 22px; }
.tstat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; }
.tstat b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.tstat span { font-size: 12px; color: var(--text-dim); }
.section-title { font-size: 14px; font-weight: 700; color: var(--text-dim); margin-bottom: 12px; }
.ride-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px; margin-bottom: 10px; }
.ride-card__body { flex: 1; min-width: 0; }
.ride-card__body h3 { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ride-card__body p { font-size: 12px; color: var(--text-dim); margin-top: 3px; }

/* ===================== VİRAJ ANALİZİ ===================== */
.wp-marker.corner { background: #ef4444; color: #fff; width: 22px; height: 22px; }
.an-overlay { position: absolute; inset: 0; z-index: 24; pointer-events: none; display: none; }
.an-overlay.is-open { display: block; }
.an-top { position: absolute; top: calc(var(--safe-top) + 10px); left: 12px; right: 12px; pointer-events: auto;
  display: flex; align-items: center; gap: 10px; background: var(--surface-glass);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 12px; }
.an-head h2 { font-size: 15px; font-weight: 800; }
.an-head p { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.an-legend { position: absolute; top: calc(var(--safe-top) + 66px); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; pointer-events: none;
  background: var(--surface-glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; font-size: 11px; color: var(--text-dim); }
.an-legend .lg { width: 12px; height: 4px; border-radius: 2px; display: inline-block; }
.an-legend .lg.ok { background: #22c55e; } .an-legend .lg.warm { background: #f97316; } .an-legend .lg.hot { background: #ef4444; }
.an-sheet { position: absolute; left: 0; right: 0; bottom: 0; pointer-events: auto; max-height: 46vh; overflow-y: auto;
  background: var(--surface); border-top: 1px solid var(--border); border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.5); padding: 8px 14px calc(var(--safe-bottom) + 14px); }
.an-list { list-style: none; }
.an-list li { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-top: 1px solid var(--border); cursor: pointer; }
.an-list li:first-child { border-top: none; }
.an-no { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: 0 0 auto; }
.an-info { flex: 1; display: flex; flex-direction: column; }
.an-info b { font-size: 14px; } .an-info span { font-size: 12px; color: var(--text-dim); }
.an-tag { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.an-tag.ok { background: rgba(34,197,94,0.18); color: #22c55e; }
.an-tag.warm { background: rgba(249,115,22,0.18); color: #f97316; }
.an-tag.hot { background: rgba(239,68,68,0.2); color: #ef4444; }
.an-empty { color: var(--text-dim); font-size: 13px; padding: 12px 4px; }
.ride-card__body { cursor: pointer; }

body.mode-analysis .hud, body.mode-analysis .fab-record, body.mode-analysis .topbar,
body.mode-analysis .bottomnav, body.mode-analysis .style-panel { display: none !important; }

/* ===================== FORMLAR & GRUPLAR ===================== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; margin-bottom: 16px; }
.input { width: 100%; height: 42px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); padding: 0 12px; font-size: 14px; outline: none; margin-bottom: 10px; }
.input:focus { border-color: var(--accent); }
select.input { -webkit-appearance: none; appearance: none; }
.row { display: flex; gap: 8px; align-items: flex-start; }
.row .input { flex: 1; }
.row .btn { height: 42px; flex: 0 0 auto; }
.seg { display: flex; background: var(--surface-2); border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.seg__btn { flex: 1; background: none; border: none; color: var(--text-dim); font-weight: 700; font-size: 13px; padding: 8px; border-radius: 8px; cursor: pointer; }
.seg__btn.is-active { background: var(--accent); color: #fff; }
.form-err { color: var(--danger); font-size: 13px; min-height: 16px; margin-bottom: 8px; }
.adv { margin-top: 12px; } .adv summary { color: var(--text-dim); font-size: 13px; cursor: pointer; }
.adv small { color: var(--text-faint); font-size: 11px; }
.hello { font-size: 15px; margin-bottom: 14px; }
.muted { color: var(--text-dim); font-size: 13px; padding: 8px 2px; }
.grp-card, .grp-route { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px; margin-bottom: 10px; cursor: pointer; }
.grp-card h3, .grp-route h3 { font-size: 15px; font-weight: 700; }
.grp-card p, .grp-route p { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.grp-card > div, .grp-route > div { flex: 1; min-width: 0; }
.chev { color: var(--text-faint); font-size: 20px; }
.link-back { background: none; border: none; color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer; padding: 0 0 10px; }
.grp-title { font-size: 22px; font-weight: 800; }

/* ===================== ÇİZİM: CROSSHAIR + ＋NOKTA ===================== */
.rb-crosshair { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 40px; height: 40px; border: 2px solid rgba(255,255,255,0.9); border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(0,0,0,0.2); pointer-events: none; }
.rb-crosshair span { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(0,0,0,0.4); }
.rb-crosshair::before, .rb-crosshair::after { content: ''; position: absolute; background: rgba(255,255,255,0.9); }
.rb-crosshair::before { top: -10px; left: 50%; width: 2px; height: 8px; transform: translateX(-50%); }
.rb-crosshair::after { bottom: -10px; left: 50%; width: 2px; height: 8px; transform: translateX(-50%); }
.rb-addpin { position: absolute; z-index: 22; top: calc(50% + 34px); left: 50%; transform: translateX(-50%);
  pointer-events: auto; display: inline-flex; align-items: center; gap: 4px;
  padding: 10px 18px; border: none; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #ff8a4c); color: #fff; font-size: 14px; font-weight: 800;
  cursor: pointer; box-shadow: 0 6px 18px rgba(255,107,44,0.45); }
.rb-addpin:active { transform: translateX(-50%) scale(0.96); }

/* ===================== GRUP ÜYELERİ / ÇIKIŞ ===================== */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--text); }
.leave-btn { width: 100%; margin-top: 18px; color: var(--danger); border-color: rgba(255,59,70,0.35); }
.route-card__body { cursor: pointer; }

/* ===================== AKIŞ (FEED) ===================== */
.composer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; margin-bottom: 18px; }
.composer__text { width: 100%; background: none; border: none; color: var(--text); font-size: 15px; resize: none; outline: none; font-family: inherit; }
.composer__text::placeholder { color: var(--text-faint); }
.composer__preview { width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; margin: 8px 0; }
.composer__tools { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.chip-btn, .chip-select { background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 600; cursor: pointer; max-width: 46%; }
.chip-btn.is-on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip-select { -webkit-appearance: none; appearance: none; }
.composer__send { margin-left: auto; }

.post { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; margin-bottom: 12px; }
.post__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #ff8a4c);
  color: #fff; font-weight: 800; display: grid; place-items: center; flex: 0 0 auto; }
.post__head b { font-size: 14px; }
.post__time { font-size: 12px; color: var(--text-faint); margin-left: 6px; }
.post__text { font-size: 15px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.post-photo { width: 100%; max-height: 340px; object-fit: cover; border-radius: 12px; margin-top: 10px; }
.post__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.post-chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 6px 11px; font-size: 12px; color: var(--text-dim); }
.post-chip--route { color: var(--accent-2); cursor: pointer; }
.post__foot { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.post-act { background: none; border: none; color: var(--text-dim); font-size: 14px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; padding: 4px; }
.post-act.is-liked { color: var(--danger); }
.post-act[data-del] { margin-left: auto; }

/* ===================== SESLİ NAV TUŞU ===================== */
.nav-mute { background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  width: 40px; height: 40px; border-radius: 12px; font-size: 18px; cursor: pointer; flex: 0 0 auto; }

/* ===================== KAZA UYARISI ===================== */
.crash-overlay { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center;
  padding: 24px; background: rgba(120, 10, 10, 0.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.crash-overlay.is-open { display: flex; }
.crash-box { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--danger);
  border-radius: var(--r-lg); padding: 24px 20px calc(var(--safe-bottom) + 20px); text-align: center; box-shadow: var(--shadow); }
.crash-ring { width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 50%; border: 5px solid var(--danger);
  display: grid; place-items: center; font-size: 38px; font-weight: 800; color: var(--danger); animation: crashpulse 1s infinite; }
@keyframes crashpulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.crash-box h2 { font-size: 20px; font-weight: 800; }
.crash-box p { color: var(--text-dim); font-size: 14px; margin-top: 4px; }
.crash-ok { width: 100%; margin-top: 16px; background: #16a34a; color: #fff; }
#crash-actions { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.crash-contact { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.crash-btns { display: flex; gap: 6px; flex: 0 0 auto; }
.crash-btns .btn { padding: 7px 12px; }

/* ===================== CANLI SÜRÜŞ BANDI ===================== */
.live-overlay { position: absolute; inset: 0; z-index: 26; pointer-events: none; display: none; }
.live-overlay.is-open { display: block; }
.live-banner { position: absolute; top: calc(var(--safe-top) + 12px); left: 50%; transform: translateX(-50%);
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  background: var(--surface-glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 999px; padding: 8px 8px 8px 16px; box-shadow: var(--shadow); }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; animation: crashpulse 1.2s infinite; }
.live-text { font-size: 13px; font-weight: 600; }
.live-banner .btn { padding: 7px 14px; }
body.mode-live .fab-record, body.mode-live .bottomnav, body.mode-live .hud { display: none !important; }

/* ===================== ARKADAŞ (PEER) İŞARETİ ===================== */
.peer-marker { display: flex; flex-direction: column; align-items: center; }
.peer-name { background: var(--surface-glass); border: 1px solid var(--border); color: var(--text);
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; margin-bottom: 3px; white-space: nowrap;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.peer-dot { width: 16px; height: 16px; border-radius: 50%; background: #a855f7; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.5); }

/* ===================== ACİL DURUM (Profil) ===================== */
.switch-row { display: flex; align-items: center; justify-content: space-between; font-size: 15px; font-weight: 600; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--accent); }
.ec-item { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: 13px; }

/* ===================== GRUP SOHBETİ ===================== */
.chat-overlay { position: fixed; inset: 0; z-index: 45; display: none; flex-direction: column; background: var(--bg); }
.chat-overlay.is-open { display: flex; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-top) + 10px) 14px 10px;
  border-bottom: 1px solid var(--border); background: var(--surface); }
.chat-head h2 { font-size: 16px; font-weight: 700; }
.chat-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 78%; }
.msg--me { align-self: flex-end; align-items: flex-end; }
.msg__who { font-size: 11px; color: var(--text-faint); margin: 0 0 2px 4px; }
.msg__bubble { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 8px 12px; font-size: 14px; line-height: 1.4; word-break: break-word; }
.msg--me .msg__bubble { background: linear-gradient(135deg, var(--accent), #ff8a4c); border: none; color: #fff; }
.chat-input-row { display: flex; gap: 8px; padding: 10px 12px calc(var(--safe-bottom) + 12px); border-top: 1px solid var(--border); background: var(--surface); }
.chat-input-row .input { flex: 1; margin: 0; }
.chat-input-row .btn { flex: 0 0 auto; }
body.mode-chat .bottomnav { display: none !important; }

/* ===================== ROZETLER & SEVİYE ===================== */
.level-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; margin-bottom: 14px; }
.level-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.level-top b { font-size: 16px; font-weight: 800; }
.level-top span { font-size: 12px; color: var(--text-dim); }
.level-bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.level-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ff8a4c); border-radius: 999px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 22px; }
.badge { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; opacity: 0.4; filter: grayscale(1); }
.badge.is-earned { opacity: 1; filter: none; border-color: var(--accent-soft); }
.badge__ic { font-size: 20px; }
.badge__nm { font-size: 12px; font-weight: 600; }

/* ===================== GARAJ ===================== */
.garage-sub { font-size: 13px; font-weight: 700; color: var(--text-dim); margin-bottom: 10px; }
.ec-item.mt-due { border-color: var(--danger); }
.ec-item.mt-due span:first-child { color: var(--danger); font-weight: 600; }

/* ===================== ARAÇ MODU (araba: yatış gizli) ===================== */
body.veh-car .hud__metric--lean { display: none !important; }
body.veh-car .hud .hud__divider { display: none !important; }
body.veh-car .nav-metric:nth-child(2) { display: none !important; }
body.veh-car .rs-lean { display: none !important; }

/* ===================== AYARLAR: RENK SEÇİCİ ===================== */
.sw-row { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; padding: 0; }
.sw.is-on { border-color: var(--text); box-shadow: 0 0 0 2px var(--accent); }

/* ===================== PROFİL KARTI + KIRPMA ===================== */
.profile-card { display: flex; align-items: center; gap: 14px; }
.pf-avatar { width: 56px; height: 56px; border-radius: 50%; flex: 0 0 auto; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), #ff8a4c); color: #fff; font-weight: 800; font-size: 22px;
  display: grid; place-items: center; }
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pf-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pf-info b { font-size: 16px; }
.crop-wrap { display: grid; place-items: center; margin: 10px 0; }
#crop-canvas { width: 240px; height: 240px; border-radius: 50%; touch-action: none; cursor: grab; border: 1px solid var(--border); }

/* ===================== PAYLAŞIM KARTI ===================== */
.share-img { width: 100%; border-radius: 12px; display: block; }

/* ===================== TEHLİKE UYARILARI ===================== */
.hz-marker { font-size: 22px; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.6)); cursor: default; }
.hz-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 23; pointer-events: auto;
  background: var(--surface); border-top: 1px solid var(--border); border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.5); padding: 14px 16px calc(var(--safe-bottom) + 16px);
  transform: translateY(110%); transition: transform 0.25s ease; }
.hz-sheet.is-open { transform: translateY(0); }
.hz-title { font-size: 15px; font-weight: 700; text-align: center; margin-bottom: 12px; }
.hz-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hz-btn { background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 12px; padding: 14px 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.hz-btn:active { background: var(--accent-soft); border-color: var(--accent); }

/* ===================== UYGULAMA İÇİ LOGO ===================== */
.topbar__brand--logo { background: #eef1f4; padding: 5px 10px; }
.topbar__logo-img { height: 26px; width: auto; display: block; }
.auth-logo { display: block; width: 210px; max-width: 70%; margin: 4px auto 18px; }

/* ===================== SPOR DALI SEÇİCİ ===================== */
.sport-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.5);
  display: none; align-items: flex-end; }
.sport-overlay.is-open { display: flex; }
.sport-sheet { width: 100%; max-height: 78vh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 14px 16px calc(14px + var(--safe-bottom)); box-shadow: var(--shadow); }
.sport-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sport-head h2 { font-size: 19px; }
.sport-search { margin: 0 0 6px; }
.sport-list { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sport-cat { color: var(--text); font-weight: 700; font-size: 15px; padding: 16px 2px 8px; }
.sport-opt { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 6px;
  background: none; border: 0; color: var(--text); font-size: 16px; cursor: pointer;
  border-radius: var(--r-sm); text-align: left; }
.sport-opt:active { background: var(--surface-2); }
.sport-opt.is-active { color: var(--accent); font-weight: 700; }
.sport-opt__ic { font-size: 20px; width: 28px; text-align: center; }
.sport-opt__lb { flex: 1; }
.sport-opt__check { color: var(--accent); font-weight: 700; }

/* Rota oluşturucuda spor çipi */
.rb-sportchip { flex-shrink: 0; background: var(--surface-glass); border: 1px solid var(--border);
  color: var(--text); border-radius: 999px; padding: 7px 12px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.rb-sportchip:active { border-color: var(--accent); color: var(--accent); }

/* ===================== İRTİFA GRAFİĞİ ===================== */
/* Yazılar HTML katmanında — SVG esnese de metin boyutu SABİT kalır (boyutlama fix) */
.rb-elev { padding: 4px 16px 8px; max-width: 720px; }
.ev-meta { display: flex; gap: 14px; align-items: baseline; padding: 2px 0 6px;
  color: var(--text-dim); font-size: 12.5px; }
.ev-meta b { color: var(--text); font-size: 13.5px; }
.ev-wrap { position: relative; }
.ev-chart { width: 100%; height: 96px; display: block; border-radius: 6px; }
.ev-lbl { position: absolute; right: 6px; font-size: 11px; color: var(--text-dim);
  background: rgba(13,15,18,0.55); padding: 1px 6px; border-radius: 6px; }
.ev-lbl--max { top: 2px; }
.ev-lbl--min { bottom: 2px; }
.ev-ticks { display: flex; justify-content: space-around; padding-top: 3px;
  color: var(--text-faint); font-size: 10.5px; }

/* Rota listesi profil grup başlıkları — profiller asla karışmaz */
.routes-group { color: var(--text-dim); font-size: 13.5px; font-weight: 700;
  padding: 18px 2px 8px; text-transform: none; }
.routes-group:first-child { padding-top: 4px; }

/* ===================== SAĞLIK EKRANI ===================== */
.hw-chips { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 2px; }
.hw-chip { flex-shrink: 0; background: var(--surface); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 999px; padding: 8px 14px; font-size: 12.5px;
  font-weight: 700; cursor: pointer; }
.hw-chip.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.hw-goal { color: var(--text-dim); font-size: 13px; padding-bottom: 8px; }
.hw-goal b { color: var(--text); font-size: 15px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; justify-items: center; }
.cal-head { color: var(--text-faint); font-size: 11px; font-weight: 700; padding-bottom: 2px; }
.cal-day { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 12.5px; color: var(--text-dim); border: 1px solid transparent; }
.cal-day.is-on { background: var(--accent); color: #fff; font-weight: 700; }
.cal-day.is-today { border-color: var(--text); color: var(--text); }
.cal-day.is-out { visibility: hidden; }

/* ===================== ÇİZGİSEL İKONLAR (emoji yerine) ===================== */
.ic { width: 18px; height: 18px; display: inline-block; vertical-align: -3.5px; flex-shrink: 0; }
.ic--sport { width: 16px; height: 16px; vertical-align: -2.5px; color: var(--accent); }
.ic--xl { width: 34px; height: 34px; }
.ic--fill { fill: currentColor; }
.bottomnav__icon { display: flex; justify-content: center; }
.bottomnav__icon .ic { width: 22px; height: 22px; vertical-align: 0; }
.topbar__chip .ic { width: 18px; height: 18px; vertical-align: -4px; }
.topbar__logo .ic { width: 17px; height: 17px; vertical-align: -3px; }
.sport-opt__ic .ic { width: 22px; height: 22px; }
.hz-btn [data-ic] .ic, .hz-btn .ic { width: 20px; height: 20px; display: block; margin: 0 auto 5px; }
.badge__ic .ic { width: 20px; height: 20px; }
.placeholder__icon .ic { color: var(--text-faint); }
.icon-btn .ic { width: 16px; height: 16px; vertical-align: -3px; }
.post-act.is-liked .ic { color: var(--accent); }
.hw-chip .ic { width: 15px; height: 15px; vertical-align: -2.5px; }
.rb-sportchip .ic { width: 15px; height: 15px; vertical-align: -2.5px; }
.modal__badge .ic { color: var(--accent); }
.nav-mute .ic { width: 20px; height: 20px; }

/* ===================== UYGULAMA MODU (Motorlu / Spor) ===================== */
.mode-gate { position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.mode-gate__box { width: 100%; max-width: 420px; }
.mode-gate__box h1 { font-size: 24px; margin-bottom: 6px; }
.mode-gate__box p { color: var(--text-dim); font-size: 14px; margin-bottom: 22px; }
.mode-card { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px 16px; margin-bottom: 12px; color: var(--text); cursor: pointer; }
.mode-card:active { border-color: var(--accent); background: var(--accent-soft); }
.mode-card__ic { flex-shrink: 0; width: 46px; height: 46px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; }
.mode-card__ic .ic { width: 26px; height: 26px; }
.mode-card__tx b { display: block; font-size: 16.5px; margin-bottom: 3px; }
.mode-card__tx small { color: var(--text-dim); font-size: 12.5px; line-height: 1.4; }

/* ===================== AKILLI ROTA ===================== */
.smart-bar { position: absolute; left: 12px; right: 12px; top: calc(var(--safe-top) + 66px);
  z-index: 30; background: var(--surface-glass); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 10px 12px; display: none; box-shadow: var(--shadow); }
.smart-bar.is-open { display: block; }
.smart-bar__info { font-size: 12.5px; color: var(--text-dim); margin-bottom: 8px; line-height: 1.5; }
.smart-bar__info b { color: var(--text); margin-right: 6px; }
.smart-bar__actions { display: flex; gap: 8px; }
.smart-bar__actions .btn { flex: 1; padding: 9px 8px; }

/* Spor modunda motorlu öğeler gizli (yatış, garaj) */
body.mode-spor .hud__metric--lean { display: none !important; }
body.mode-spor .hud .hud__divider { display: none !important; }
body.mode-spor .nav-metric:nth-child(2) { display: none !important; }
body.mode-spor .rs-lean { display: none !important; }
body.mode-spor #garage, body.mode-spor #garage-title { display: none !important; }
