/* ══════════════════════════════════════════════════════════════════
   Route Web App — style.css  (full viewport, Apple drawer)
   ══════════════════════════════════════════════════════════════════ */

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; } /* ASLA kaymaz */

/* ── System font (SF Pro on Apple, Segoe on Windows) ───────────── */
:root {
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI',
          'Helvetica Neue', Arial, sans-serif;

  /* palette */
  --bg:       #ffeeee;
  --card:     #ffffff;
  --border:   rgba(10, 95, 82, 0.12);
  --primary:  #0A5F52;
  --primary-ink: #0A5F52; /* yeşil yazı, simge ve çizgi (koyu temada açık ton) */
  --pri-lt:   #0D7A69;
  --pri-dk:   #073D35;
  --dark-bg:  #0B1D1A;
  --accent:   #FFD166;
  --txt-h:    #132E29;
  --txt-s:    #4E665F;
  --txt-m:    #5E7770;
  --d-orange: #F5A623;
  --d-blue:   #3978A8;
  --d-red:    #E53E3E;
  --c-sun:    #FFD166;
  --c-rain:   #4F91C5;
  --c-fog:    #9EB3AB;

  /* subtle elevated shadows (slightly increased for crisp depth) */
  --sh-xs: 0 2px 10px rgba(11, 29, 26,  0.08);
  --sh-sm: 0 4px 22px rgba(11, 29, 26,  0.11);
  --sh-md: 0 8px 32px rgba(11, 29, 26,  0.15);

  /* radii */
  --r:  22px;
  --rm: 16px;
  --rs: 12px;

  /* innovative slow-motion theme timing */
  --ease: 240ms cubic-bezier(.4, 0, .2, 1);
  --theme-trans: background 650ms cubic-bezier(0.33, 1, 0.68, 1),
                 color 650ms cubic-bezier(0.33, 1, 0.68, 1),
                 border-color 650ms cubic-bezier(0.33, 1, 0.68, 1),
                 box-shadow 650ms cubic-bezier(0.33, 1, 0.68, 1);
}

/* ── Innovative View Transition Animations ──────────────────────── */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 700ms;
  animation-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
}
::view-transition-old(root) {
  animation: 700ms cubic-bezier(0.33, 1, 0.68, 1) both themeFadeOut;
}
::view-transition-new(root) {
  animation: 700ms cubic-bezier(0.33, 1, 0.68, 1) both themeFadeIn;
}
@keyframes themeFadeOut {
  from { opacity: 1; filter: blur(0px); }
  to   { opacity: 0; filter: blur(2.5px); }
}
@keyframes themeFadeIn {
  from { opacity: 0; filter: blur(2.5px); }
  to   { opacity: 1; filter: blur(0px); }
}

body.dark {
  --bg:     #0B1D1A;
  --card:   #0F2925;     /* sayfa zemininden (#0B1D1A) belirgin açık */
  --border: rgba(255, 238, 238, 0.10);
  --txt-h:  #ffeeee;
  --txt-s:  #C1E6D9;
  --txt-m:  #8FA89F;
  --primary-ink: #84CDB4;
  --sh-xs:  0 3px 14px rgba(0, 0, 0, 0.55);
  --sh-sm:  0 6px 26px rgba(0, 0, 0, 0.65);
  --sh-md:  0 10px 38px rgba(0, 0, 0, 0.75);
}

body.dark .logo-text h1 {
  color: #ffeeee;
}

body.dark .logo-text .logo-tagline {
  color: rgba(255, 238, 238, 0.45);
}

body.dark .chip {
  background: rgba(15, 41, 37,  0.92);
  color: #ffeeee;
  border: 1px solid rgba(255, 238, 238, 0.15);
  box-shadow: var(--sh-sm);
}

/* ── App shell — full viewport, no scroll ──────────────────────── */
body {
  font-family: var(--font);
  font-weight: 400; /* Apple regular */
  background: var(--bg);
  color: var(--txt-h);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--ease), color var(--ease);
}

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;        /* fills exactly the viewport */
  overflow: hidden;      /* absolutely no page scroll */
}

/* ── Header ────────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  flex-shrink: 0;
  background: var(--bg);
  transition: background var(--ease);
}

.logo {
  width: 40px; height: 40px;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  padding: 0;
  border-radius: 50%;
  transition: transform var(--ease);
}
.logo:hover { transform: scale(1.08); }
.logo img { width: 100%; height: 100%; object-fit: contain; }

.logo-img { display: block !important; }

.logo-text {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
}
.logo-text h1 {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--primary-ink);
  line-height: 1;
}
.route-go-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%;
  margin-top: 8px;
  padding: 10px 14px;
  border: none;
  border-radius: var(--rs);
  background: var(--primary);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--ease);
}
.route-go-btn:hover:not(:disabled) { background: var(--pri-lt); transform: translateY(-1px); box-shadow: 0 3px 10px rgba(10, 95, 82, 0.28); }
.route-go-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.route-go-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.route-go-btn.dirty:not(:disabled) { box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.55); } /* değişiklik var, henüz aranmadı */
body.dark .route-go-btn { background: var(--pri-lt); }
.beta-badge {
  align-self: center;
  padding: 3px 7px;
  border-radius: 8px;
  background: var(--accent);
  color: #132E29;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
}
.beta-form { display: flex; flex-direction: column; gap: 6px; }
.beta-note { font-size: 12px; line-height: 1.5; color: var(--txt-s); margin: 0 0 6px; }
.beta-label { font-size: 11px; font-weight: 600; color: var(--txt-s); margin-top: 6px; }
.beta-field {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--rs);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--txt-h);
  font-family: var(--font);
  font-size: 13px;
  resize: vertical;
}
.beta-field:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
body.dark .beta-field { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.14); color: #ffeeee; }
.logo-tagline {
  font-size: 11px;
  font-weight: 400;
  color: rgba(11, 29, 26,  0.42);
  letter-spacing: 0.02em;
}

.hdr-actions { display: flex; gap: 6px; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: var(--rs);
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--sh-xs);
  color: var(--txt-s);
  transition: var(--theme-trans), transform var(--ease);
}
.icon-btn svg { width: 16px; height: 16px; transition: transform 650ms cubic-bezier(0.33, 1, 0.68, 1); }
.icon-btn:hover { transform: translateY(-1px); box-shadow: var(--sh-sm); }
.icon-btn:active { transform: scale(.92); }
#darkBtn:active svg { transform: rotate(180deg) scale(0.9); }

/* ── Load bar ──────────────────────────────────────────────────── */
.load-bar {
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
  background-size: 200%;
  flex-shrink: 0;
  opacity: 0;
  transform: scaleX(.6);
  transform-origin: left center;
  transition: opacity 260ms ease, transform 420ms cubic-bezier(.22,1,.36,1);
}
.load-bar.on { opacity: 1; transform: scaleX(1); animation: loadAnim 1.6s linear infinite; }
@keyframes loadAnim {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ── Main ──────────────────────────────────────────────────────── */
.main {
  display: flex;
  flex: 1;
  overflow: hidden;   /* children manage their own scroll */
  min-height: 0;
}

/* ── Map column ────────────────────────────────────────────────── */
.map-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 0 14px 14px;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.map-wrap {
  flex: 1;
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-md);
  min-height: 380px;
  height: 100%;
  background: var(--dark-bg);
}

#map {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  z-index: 0;
}

.mapboxgl-ctrl-attrib.mapboxgl-compact { border-radius: 10px; background: rgba(255,255,255,.85); margin: 0 10px 10px 0; }
.maplibregl-ctrl-attrib.maplibregl-compact { border-radius: 10px; background: rgba(255,255,255,.85); margin: 0 10px 10px 0; }
body.dark .mapboxgl-ctrl-attrib.mapboxgl-compact { background: rgba(15, 41, 37, .85); }
body.dark .maplibregl-ctrl-attrib.maplibregl-compact { background: rgba(15, 41, 37, .85); }
body.dark .mapboxgl-ctrl-attrib a { color: #C1E6D9; }
body.dark .maplibregl-ctrl-attrib a { color: #C1E6D9; }
.mapboxgl-ctrl-logo { opacity: .9; }
.maplibregl-ctrl-logo { opacity: .9; }

/* map overlay chips */
.map-chips {
  position: absolute; top: 13px; left: 13px; right: 13px;
  display: flex; justify-content: space-between;
  z-index: 999; pointer-events: none;
}
.map-chips > * { pointer-events: auto; }

.chip {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 12px;
  background: rgba(255,255,255,.93);
  backdrop-filter: blur(10px);
  border-radius: var(--rs);
  font-size: 12px; font-weight: 400;
  font-family: var(--font);
  color: var(--txt-h); border: none; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  transition: transform var(--ease), background var(--ease), color var(--ease);
}
.chip:hover { transform: translateY(-1px); }
.chip.active { background: var(--primary); color: white; }
.chip.active svg { stroke: white; }

/* ── Side panel ────────────────────────────────────────────────── */
.side {
  width: 356px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 14px 14px 14px;
  overflow: hidden;  /* side itself NEVER scrolls */
  min-height: 0;
}

/* ── Fixed top section ─────────────────────────────────────────── */
.side-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--r);
  padding: 18px 20px;
  box-shadow: var(--sh-sm);
  border: 1px solid var(--border);
  transition: var(--theme-trans);
}

.route-card {
  padding: 14px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

/* Apple-style Route Input Group */
.route-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fbf3f3;
  border-radius: 14px;
  padding: 6px 12px;
  border: 1px solid rgba(11, 29, 26,  0.07);
  box-shadow: 0 1px 4px rgba(11, 29, 26,  0.04);
  transition: var(--theme-trans);
}
body.dark .route-input-group {
  background: #081512;
  border-color: rgba(255, 238, 238, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.route-indicators {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 10px;
  flex-shrink: 0;
}

.route-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.route-dot.origin {
  background: #0D7A69;
  box-shadow: 0 0 0 2px rgba(13, 122, 105, 0.2);
}
.route-dot.dest {
  background: #E53E3E;
  box-shadow: 0 0 0 2px rgba(229, 62, 62, 0.2);
}

.route-line {
  width: 1.5px;
  height: 14px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 1px;
}
body.dark .route-line {
  background: rgba(255, 255, 255, 0.2);
}

.route-inputs {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.input-wrap {
  display: flex;
  align-items: center;
}

.route-field {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--txt-h);
  padding: 3px 0;
}
.route-field::placeholder {
  color: var(--txt-m);
  font-weight: 400;
}

.input-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 1px 0;
}
body.dark .input-divider {
  background: rgba(255, 255, 255, 0.06);
}

.route-input-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.route-swap-btn,
.route-add-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  color: var(--txt-s);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: all var(--ease);
  flex-shrink: 0;
}
.route-swap-btn:hover {
  transform: rotate(180deg) scale(1.08);
  color: var(--primary-ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}
.route-add-btn:hover {
  transform: scale(1.08);
  color: var(--primary-ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}
.route-add-btn:active { transform: scale(.92); }
body.dark .route-swap-btn,
body.dark .route-add-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--txt-h);
}

/* ── Route Point Rows & Drag Handle ────────────────────────────── */
.route-points-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}
.route-point-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  position: relative;
  border-radius: 6px;
  transition: background var(--ease);
}
.route-point-row.dragging {
  opacity: 0.35;
  background: rgba(11, 29, 26,  0.06);
}
.route-point-row.drag-over {
  background: rgba(11, 29, 26,  0.08);
  outline: 1.5px dashed var(--primary-ink);
}
body.dark .route-point-row.drag-over {
  background: rgba(255, 238, 238, 0.1);
  outline-color: #ffeeee;
}
.route-point-row .route-field {
  flex: 1;
  min-width: 0;
}
.wp-del-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(229, 62, 62, 0.25);
  background: rgba(229, 62, 62, 0.08);
  color: var(--d-red);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--ease);
  padding: 0;
}
.wp-del-btn:hover {
  background: var(--d-red);
  color: white;
  transform: scale(1.12);
}
.drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--txt-m);
  cursor: grab;
  flex-shrink: 0;
  border-radius: 4px;
  transition: color var(--ease), background var(--ease);
}
.drag-handle:hover {
  color: var(--txt-h);
  background: rgba(0, 0, 0, 0.05);
}
.drag-handle:active {
  cursor: grabbing;
}
body.dark .drag-handle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.route-dot.wp {
  width: 6px; height: 6px;
  background: #F5A623;
  box-shadow: 0 0 0 2px rgba(245, 166, 35, .22);
}

.route-row {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px;
}
.route-title {
  font-size: 19px; font-weight: 600;
  letter-spacing: -.3px; line-height: 1.2;
  color: var(--txt-h);
}
.route-sub {
  font-size: 12px; font-weight: 300;
  color: var(--txt-s); margin-top: 4px;
}

.badge-row { display: flex; gap: 8px; flex-shrink: 0; }
.w-badge {
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
}
.w-badge-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.w-badge-icon.sun  { background: rgba(255,209,102,.15); }
.w-badge-icon.rain { background: rgba(79,145,197,.15); }
.w-badge-icon.fog  { background: rgba(158,179,171,.15); }
.w-badge-temp { font-size: 10.5px; font-weight: 500; color: var(--txt-h); }

/* ── Tarih + Saat satırı ───────────────────────────────────────── */
.date-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
}

.date-pills {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.date-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid rgba(11, 29, 26,  0.12);
  background: transparent;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  color: var(--txt-s);
  cursor: pointer;
  transition: all var(--ease);
  white-space: nowrap;
}
.date-pill:hover {
  background: rgba(11, 29, 26,  0.05);
  color: var(--txt-h);
}
.date-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary-ink);
}
.date-pill svg { stroke: currentColor; }
body.dark .date-pill {
  border-color: rgba(255, 238, 238, 0.15);
  color: var(--txt-s);
}
body.dark .date-pill.active {
  background: rgba(255, 238, 238, 0.15);
  color: #ffeeee;
  border-color: rgba(255, 238, 238, 0.25);
}
body.dark .date-pill:hover {
  background: rgba(255, 238, 238, 0.08);
}

.tl-time-wrap {
  flex-shrink: 0;
}
.tl-time {
  font-size: 22px; font-weight: 700;
  color: var(--primary-ink); letter-spacing: -.4px;
  line-height: 1;
}
body.dark .tl-time {
  color: #ffeeee;
}

input[type="range"] {
  --pct: 40%;
  --track: rgba(11, 29, 26,  0.14);
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 3px;
  border-radius: 4px; outline: none; cursor: pointer;
  margin: 7px 0 7px;
  background: linear-gradient(to right, var(--accent) var(--pct), var(--track) var(--pct));
}
body.dark input[type="range"] { --track: rgba(255, 255, 255, 0.18); }
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px; border-radius: 4px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--accent); margin-top: -7px;
  box-shadow: 0 0 0 4px rgba(255,209,102,.2), 0 2px 6px rgba(0,0,0,.18);
  transition: box-shadow 200ms var(--ease-out, ease), transform 200ms var(--ease-out, ease); cursor: pointer;
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); box-shadow: 0 0 0 9px rgba(255,209,102,.24), 0 2px 8px rgba(0,0,0,.22); }
input[type="range"]::-webkit-slider-runnable-track { background: transparent; }
input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 7px rgba(255,209,102,.28);
}
input[type="range"]::-moz-range-thumb {
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--accent); border: none;
  box-shadow: 0 0 0 4px rgba(255,209,102,.2);
}
input[type="range"]::-moz-range-progress {
  background: var(--accent); height: 3px; border-radius: 4px;
}

.tl-scale {
  display: flex; justify-content: space-between;
}
.tl-scale span, .tl-tick-btn {
  font-size: 10px;
  color: rgba(0,0,0,.38);
  background: none;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 4px;
  font-family: inherit;
  transition: all var(--ease);
}
.tl-tick-btn:hover, .tl-tick-btn:focus-visible {
  color: var(--primary-ink);
  background: rgba(10, 95, 82, 0.10);
  outline: none;
}
body.dark .tl-scale span, body.dark .tl-tick-btn {
  color: rgba(255,255,255,.38);
}
body.dark .tl-tick-btn:hover, body.dark .tl-tick-btn:focus-visible {
  color: var(--accent);
  background: rgba(255, 209, 102, 0.14);
}

/* ── Mola satırı ───────────────────────────────────────────────── */
.break-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}

.break-add-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px dashed rgba(11, 29, 26,  0.20);
  background: transparent;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  color: var(--txt-m);
  cursor: pointer;
  transition: all var(--ease);
}
.break-add-btn:hover {
  border-color: rgba(11, 29, 26,  0.40);
  color: var(--txt-s);
  background: rgba(11, 29, 26,  0.04);
}
body.dark .break-add-btn {
  border-color: rgba(255, 238, 238, 0.18);
  color: var(--txt-m);
}
body.dark .break-add-btn:hover {
  border-color: rgba(255, 238, 238, 0.35);
  background: rgba(255, 238, 238, 0.05);
}

.break-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.break-pill {
  padding: 4px 9px;
  border-radius: 20px;
  border: 1px solid rgba(11, 29, 26,  0.12);
  background: transparent;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  color: var(--txt-s);
  cursor: pointer;
  transition: all var(--ease);
}
.break-pill:hover { background: rgba(11, 29, 26,  0.05); color: var(--txt-h); }
.break-pill.active {
  background: rgba(10, 95, 82, 0.1);
  color: var(--primary-ink);
  border-color: rgba(10, 95, 82, 0.25);
  font-weight: 600;
}
.break-pill.remove-break {
  color: var(--txt-m);
  border-color: transparent;
  font-size: 10px;
}
.break-pill.remove-break:hover {
  color: var(--d-red);
  background: rgba(229, 62, 62, .1);
}
body.dark .break-pill {
  border-color: rgba(255, 238, 238, 0.12);
  color: var(--txt-s);
}
body.dark .break-pill.active {
  background: rgba(13, 122, 105, 0.15);
  color: #7EC8BD;
  border-color: rgba(13, 122, 105, 0.30);
}

/* ── Profile toggle (6 Vehicle Segmented Grid) ─────────────────── */
.profile-wrap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--card);
  border-radius: var(--r);
  padding: 6px;
  gap: 5px;
  border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
  transition: var(--theme-trans);
}

.prof-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: transparent;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  color: var(--txt-m);
  transition: all var(--ease);
  line-height: 1.1;
  text-align: center;
}
.prof-btn svg { stroke: var(--txt-m); flex-shrink: 0; transition: stroke var(--ease); width: 16px; height: 16px; }
.prof-btn span { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.prof-btn:hover { color: var(--txt-h); }
.prof-btn:hover svg { stroke: var(--txt-h); }
.prof-btn.active {
  background: transparent;
  color: var(--primary-ink);
  font-weight: 600;
}
.prof-btn.active svg { stroke: var(--primary-ink); }
body.dark .prof-btn.active {
  background: transparent;
  color: #ffeeee;
}
body.dark .prof-btn.active svg { stroke: #ffeeee; }

/* ── Profil açıklama satırı ─────────────────────────────────────── */
.profile-hint {
  font-size: 11px;
  color: var(--txt-m);
  text-align: center;
  padding: 0 4px;
  min-height: 14px;
  line-height: 1.4;
  transition: opacity var(--ease), color var(--ease);
}
.profile-hint:empty { display: none; }
.profile-hint strong {
  font-weight: 600;
  color: var(--txt-s);
}

/* ── Route divider (separates route summary from departure time) ─ */
.route-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 0;
}
body.dark .route-divider { background: rgba(255, 255, 255, 0.07); }

/* ══════════════════════════════════════════════════════════════════
   APPLE-STYLE DRAWER
   ══════════════════════════════════════════════════════════════════ */
.drawer {
  flex: 1;                      /* takes remaining side height */
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--theme-trans);
}

.drawer-handle-wrap {
  display: flex; justify-content: center;
  padding: 10px 0 6px;
  flex-shrink: 0;
  cursor: default;
}
.drawer-handle {
  width: 36px; height: 4px;
  border-radius: 3px;
  background: rgba(0,0,0,.12);
  transition: background var(--ease);
}
body.dark .drawer-handle { background: rgba(255,255,255,.14); }

/* The scrollable area — momentum scroll */
.drawer-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;   /* prevent page bounce */
  -webkit-overflow-scrolling: touch; /* iOS momentum */
  padding: 6px 18px 20px;
  scrollbar-width: none;          /* Firefox */
}
.drawer-scroll::-webkit-scrollbar { display: none; }

/* ── Karar Özet Banner ─────────────────────────────────────────── */
.decision-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--rm);
  margin-bottom: 12px;
  border: 1px solid transparent;
  transition: var(--theme-trans);
}
@keyframes bannerIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.decision-banner.safe {
  background: rgba(13, 122, 105, 0.08);
  border-color: rgba(13, 122, 105, 0.20);
}
.decision-banner.caution {
  background: rgba(245, 166, 35, 0.08);
  border-color: rgba(245, 166, 35, 0.25);
}
.decision-banner.danger {
  background: rgba(229, 62, 62, 0.08);
  border-color: rgba(229, 62, 62, 0.25);
}
body.dark .decision-banner.safe   { background: rgba(13, 122, 105, 0.12); border-color: rgba(13, 122, 105, 0.25); }
body.dark .decision-banner.caution { background: rgba(245, 166, 35, 0.12); border-color: rgba(245, 166, 35, 0.28); }
body.dark .decision-banner.danger  { background: rgba(229, 62, 62, 0.12); border-color: rgba(229, 62, 62, 0.28); }

.decision-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
}
.decision-body { flex: 1; min-width: 0; }
.decision-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt-h);
  line-height: 1.3;
}
.decision-detail {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--txt-s);
  margin-top: 3px;
  line-height: 1.45;
}
.decision-tip {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--primary-ink);
  display: flex;
  align-items: center;
  gap: 4px;
}
body.dark .decision-tip { color: #7EC8BD; }
.decision-tip.orange { color: var(--d-orange); }
body.dark .decision-tip.orange { color: #FFBA5A; }

/* ── Alerts (inside drawer) ────────────────────────────────────── */
.alerts-section { margin-bottom: 16px; }
.alerts-hdr {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 500;
  color: var(--txt-h); margin-bottom: 9px;
}
.alerts-count {
  background: var(--d-red); color: white;
  font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 6px;
}

.alert-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--rm);
  border: 1px solid transparent;
  margin-bottom: 7px;
  transition: var(--theme-trans), transform var(--ease);
  position: sticky;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(11, 29, 26,  0.08);
}
.alert-card:last-child { margin-bottom: 0; }
.alert-card.orange {
  background: #fffdf9;
  border-color: rgba(245, 166, 35, 0.35);
  box-shadow: 0 4px 14px rgba(245, 166, 35, 0.12);
}
.alert-card.blue {
  background: #f8fbfe;
  border-color: rgba(57, 120, 168, 0.35);
  box-shadow: 0 4px 14px rgba(57, 120, 168, 0.12);
}
body.dark .alert-card {
  background: #081512;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
}
body.dark .alert-card.orange {
  background: #262A1A;
  border-color: rgba(245, 166, 35, 0.38);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.60);
}
body.dark .alert-card.blue {
  background: #091624;
  border-color: rgba(57, 120, 168, 0.38);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.60);
}
.alert-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.alert-card.orange .alert-icon { background: rgba(245,166,35,.18); }
.alert-card.blue   .alert-icon { background: rgba(57,120,168,.18); }
.alert-body { flex: 1; min-width: 0; }
.alert-title  { font-size: 12.5px; font-weight: 600; color: var(--txt-h); line-height: 1.25; }
.alert-detail { font-size: 11px;   font-weight: 400; color: var(--txt-s); margin-top: 3px; line-height: 1.35; }
.alert-badge {
  width: 22px; height: 22px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 12px; font-weight: 700; flex-shrink: 0;
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease);
}
.alert-badge:hover {
  transform: scale(1.18);
  box-shadow: 0 0 0 4px rgba(229, 62, 62, 0.25);
}
.alert-card.orange .alert-badge { background: var(--d-orange); }
.alert-card.blue   .alert-badge { background: var(--d-blue); }

/* ── Segments (inside drawer) ──────────────────────────────────── */
.seg-section {
  position: relative;
}
.seg-heading {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  font-size: 13.5px; font-weight: 600;
  color: var(--txt-h); margin-bottom: 11px;
  padding: 4px 0;
}

.seg-item {
  display: flex; align-items: stretch; gap: 12px;
  padding: 11px 12px;
  background: #ffffff;
  border-radius: var(--rm);
  border: 1px solid rgba(11, 29, 26,  0.08);
  box-shadow: 0 3px 10px rgba(11, 29, 26,  0.05);
  margin-bottom: 7px;
  position: sticky;
  transition: var(--theme-trans), transform var(--ease);
}
.seg-item:last-child { margin-bottom: 0; }
.seg-item.danger { border-color: rgba(245,166,35,.50); }
.seg-item:hover  { transform: translateX(2px); }
body.dark .seg-item {
  background: #081512;
  border-color: rgba(255, 238, 238, 0.09);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.seg-line {
  display: flex; flex-direction: column; align-items: center;
  width: 14px; flex-shrink: 0;
}
.seg-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--card); flex-shrink: 0;
}
.seg-dot.green { background: #0D7A69; box-shadow: 0 0 0 3px rgba(13,122,105,.18); }
.seg-dot.blue  { background: #4F91C5; box-shadow: 0 0 0 3px rgba(79,145,197,.18); }
.seg-dot.gray  { background: #9EB3AB; box-shadow: 0 0 0 3px rgba(158,179,171,.18); }
.seg-dot.amber { background: #F5A623; box-shadow: 0 0 0 3px rgba(245,166,35,.18); }
.seg-connector {
  width: 2px; flex: 1; min-height: 18px;
  margin-top: 3px; border-radius: 2px;
}
.seg-connector.green { background: rgba(13,122,105,.2); }
.seg-connector.blue  { background: rgba(79,145,197,.2); }
.seg-connector.gray  { background: rgba(158,179,171,.2); }
.seg-connector.amber { background: rgba(245,166,35,.2); }
.seg-connector.none  { display: none; }

.seg-body { flex: 1; min-width: 0; }
.seg-name-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 6px; margin-bottom: 4px;
}
.seg-name { font-size: 13px; font-weight: 500; color: var(--txt-h); }
.seg-stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg-stat  { font-size: 11px; font-weight: 300; color: var(--txt-s); }
/* Tahmini geçiş saati etiketi */
.seg-eta-tag {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  color: var(--primary-ink);
  background: rgba(10, 95, 82, 0.08);
  padding: 1px 6px;
  border-radius: 6px;
}
body.dark .seg-eta-tag {
  color: #7EC8BD;
  background: rgba(13, 122, 105, 0.15);
}

.wchip {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 7px; border-radius: 8px;
  font-size: 11px; font-weight: 500; flex-shrink: 0;
}
.wchip.sun  { background: rgba(255,209,102,.15); color: #A87800; }
.wchip.rain { background: rgba(79,145,197,.15);  color: #1E5F9A; }
.wchip.fog  { background: rgba(158,179,171,.15); color: #4A7068; }
body.dark .wchip.sun  { color: #FFD166; }
body.dark .wchip.rain { color: #72B3DC; }
body.dark .wchip.fog  { color: #9EB3AB; }

/* ── Veri kaynağı footer ───────────────────────────────────────── */
.data-source-footer {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 18px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
}
body.dark .data-source-footer {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}
.data-source-footer svg { stroke: var(--txt-m); flex-shrink: 0; }
.data-source-footer span {
  font-size: 10px;
  color: var(--txt-m);
  font-weight: 400;
  line-height: 1.3;
}

/* ── Toast ─────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translate(-50%, 24px) scale(.96);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(92vw, 520px);
  padding: 10px 18px;
  background: #132E29;
  color: #fff;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: 0 10px 30px rgba(0,0,0,0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease, transform 380ms var(--ease-spring, cubic-bezier(.34,1.56,.64,1));
  z-index: 20000;
}
.toast svg { flex-shrink: 0; }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast.error { background: #7f1d1d; }
.toast.info { background: #1e3a5f; }
body.dark .toast { background: rgba(13, 122, 105, 0.95); }
body.dark .toast.error { background: #b42318; }
body.dark .toast.info { background: #2b5f96; }

/* ── Mobil: tam ekran harita + alt çekmece (bottom sheet) ─────────
   Harita artık kaydırılan bir kabın içinde değil → parmak haritada haritayı oynatır, sayfa kaymaz.
   Çekmece konumları (peek/half/full) js/sheet.js tarafından yönetilir; burada yalnızca görünüm var. */
.rc-pill { display: none; }

@media (max-width: 760px) {
  .app { --sheet-hh: 600px; --sheet-vis: 150px; --search-h: 0px; --sheet-ease: 320ms cubic-bezier(.22, 1, .36, 1); }

  /* başlık: simgeler dar ekrana sığsın */
  .header { padding: 8px 10px; gap: 8px; }
  .logo { width: 34px; height: 34px; }
  .logo-text { min-width: 0; }
  .logo-text h1 { font-size: 22px; }
  .logo-tagline { display: none; }
  .hdr-actions { gap: 4px; flex-shrink: 0; }
  .icon-btn { width: 36px; height: 36px; border-radius: 11px; }
  .icon-btn svg { width: 15px; height: 15px; }
  .beta-badge { padding: 2px 5px; font-size: 9px; }

  /* harita tüm alanı kaplar */
  .main { position: relative; display: block; overflow: hidden; }
  .map-col { position: absolute; inset: 0; padding: 0; height: auto; min-height: 0; }
  .map-wrap { border-radius: 0; box-shadow: none; min-height: 0; height: 100%; }

  /* rota kutusu haritanın üstünde yüzer (js/sheet.js #rcSearch'i buraya taşır); rota bulununca tek satıra daralır */
  .rc-search { position: absolute; z-index: 1000; top: 10px; left: 10px; right: 10px; padding: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--sh-md); }
  .rc-search .route-go-btn { margin-top: 8px; }
  .rc-search.collapsed { padding: 3px 6px; }
  .rc-search.collapsed .rc-fields { display: none; }
  .rc-search.collapsed .rc-pill { display: flex; }
  .rc-pill { align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 6px 8px; background: none; border: 0; color: var(--txt-h); font: 700 14px/1.2 var(--font); text-align: left; cursor: pointer; }
  .rc-pill span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rc-pill svg { flex-shrink: 0; color: var(--primary-ink); }

  /* harita üstü düğmeler ve bildirimler çekmecenin üstünde kalır */
  .map-chips { top: calc(var(--search-h) + 22px); flex-wrap: wrap; gap: 6px; transition: top var(--sheet-ease); }
  .radar-bar { bottom: calc(var(--sheet-vis) + 14px); transition: opacity 240ms ease, transform 420ms var(--ease-spring), visibility 0s linear 420ms, bottom var(--sheet-ease); }
  .map-notice { bottom: calc(var(--sheet-vis) + 14px); }
  .radar-bar.show ~ .map-notice { bottom: calc(var(--sheet-vis) + 76px); }
  .toast { bottom: calc(var(--sheet-vis) + 16px); }
  .map-wrap [class*="ctrl-bottom-right"] { bottom: var(--sheet-vis); transition: bottom var(--sheet-ease); } /* harita atfı çekmecenin altında kalmasın */
  .map-wrap [class*="ctrl-bottom-left"] { display: none; } /* yakınlaştırma düğmeleri yerine parmakla sıkıştırma */

  /* çekmece */
  .side {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
    width: auto; height: var(--sheet-hh);
    display: flex; flex-direction: column; gap: 10px;
    padding: 0 14px calc(28px + env(safe-area-inset-bottom));
    overflow: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    background: var(--card); border-radius: 22px 22px 0 0; box-shadow: 0 -8px 32px rgba(11, 29, 26, .22);
    transform: translate3d(0, calc(var(--sheet-hh) - var(--sheet-vis)), 0);
    transition: transform var(--sheet-ease);
  }
  .app[data-sheet="full"] .side { overflow-y: auto; }
  .app[data-sheet="full"] .map-chips { opacity: 0; pointer-events: none; } /* tam açıkken harita kapalı: düğmeler çekmecenin üstünde durmasın */
  .app.sheet-dragging .side, .app.sheet-dragging .map-chips, .app.sheet-dragging .radar-bar, .app.sheet-dragging .map-notice,
  .app.sheet-dragging .map-wrap [class*="ctrl-bottom-right"] { transition: none; }

  /* bölümleri tek sütunda diz; sıra: özet → risk → yol boyunca hava → kalkış zamanı → araç → diğerleri */
  .side-top, .route-card, .drawer, .drawer-scroll { display: contents; }
  .side > *, .drawer-scroll > * { flex-shrink: 0; }
  .drawer-handle-wrap { order: 0; position: sticky; top: 0; z-index: 6; height: 26px; margin: 0 -14px; padding: 0; background: var(--card); align-items: center; cursor: pointer; touch-action: none; }
  .rc-summary { order: 1; position: sticky; top: 26px; z-index: 5; display: none; margin: 0 -14px; padding: 2px 14px 8px; background: var(--card); touch-action: none; }
  .app.has-route .rc-summary { display: block; }
  #decisionBanner { order: 2; }
  #watchWrap { order: 3; }
  #alertsWrap { order: 4; }
  .seg-section { order: 5; }
  .rc-time { order: 6; }
  .route-divider { display: none; }
  .profile-wrap { order: 7; }
  .profile-hint { order: 8; }
  #windowsWrap { order: 9; }
  #altWrap { order: 10; }
  .data-source-footer { order: 11; }
  .official-note { order: 12; }
  .app-legal-footer { order: 13; }
  #altWrap:empty, #windowsWrap:empty, #watchWrap:empty, #alertsWrap:empty { display: none; }
  .seg-heading, .alerts-hdr { position: static !important; }
  .date-time-row { flex-wrap: wrap; gap: 6px; }
}
@media (max-width: 400px) { /* 360 px'lik telefonlarda başlık sığsın: yükle düğmesi gizlenir (tarayıcı menüsünden de yüklenir) */
  #installBtn { display: none; }
  .icon-btn { width: 34px; height: 34px; }
  .hdr-actions { gap: 3px; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .side, .map-chips, .radar-bar, .map-wrap [class*="ctrl-bottom-right"] { transition: none; }
}

/* ── Mapbox zoom kontrolü ─────────────────────────────────────── */
.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-group {
  margin: 0 0 16px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--sh-md);
  background: var(--card);
}
.maplibregl-ctrl-bottom-left .maplibregl-ctrl-group {
  margin: 0 0 16px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--sh-md);
  background: var(--card);
}
.mapboxgl-ctrl-group button { width: 32px; height: 32px; background-color: transparent; transition: background-color var(--ease); }
.maplibregl-ctrl-group button { width: 32px; height: 32px; background-color: transparent; transition: background-color var(--ease); }
.mapboxgl-ctrl-group button + button { border-top: 1px solid var(--border); }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--border); }
.mapboxgl-ctrl-group button:hover { background-color: rgba(11, 29, 26,  0.08); }
.maplibregl-ctrl-group button:hover { background-color: rgba(11, 29, 26,  0.08); }
body.dark .mapboxgl-ctrl-group button .mapboxgl-ctrl-icon { filter: invert(1); }
body.dark .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
body.dark .mapboxgl-ctrl-group button:hover { background-color: rgba(255, 238, 238, 0.12); }
body.dark .maplibregl-ctrl-group button:hover { background-color: rgba(255, 238, 238, 0.12); }

.share-hdr-btn {
  margin-right: 2px;
}

/* ══════════════════════════════════════════════════════════════════
   MODAL POP-UPS (Tutorial & Alert Detail)
   ══════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: modalFadeIn 220ms ease-out both;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: min(520px, 100%);
  max-height: min(88vh, 640px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: modalScaleIn 260ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-icon {
  font-size: 24px;
  line-height: 1;
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--txt-h);
  line-height: 1.2;
}
.modal-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--txt-s);
  margin-top: 2px;
}
.modal-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: var(--txt-s);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all var(--ease);
}
.modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--txt-h);
  transform: scale(1.08);
}
body.dark .modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
}
body.dark .modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tutorial-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(11, 29, 26,  0.025);
  border: 1px solid rgba(11, 29, 26,  0.06);
}
body.dark .tutorial-item {
  background: rgba(255, 238, 238, 0.035);
  border-color: rgba(255, 238, 238, 0.07);
}
.tutorial-icon-box {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  padding-top: 2px;
}
.tutorial-content h4 {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--txt-h);
  margin-bottom: 3px;
}
.tutorial-content p {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--txt-s);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--card);
}
.modal-primary-btn {
  padding: 8px 18px;
  border-radius: 20px;
  border: none;
  background: var(--primary);
  color: white;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease);
}
.modal-primary-btn:hover {
  background: var(--pri-lt);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(11, 29, 26,  0.25);
}
body.dark .modal-primary-btn {
  background: #FFD166;
  color: #132E29;
}
body.dark .modal-primary-btn:hover {
  background: #FFE08A;
  box-shadow: 0 3px 12px rgba(255, 209, 102, 0.30);
}

/* Alert Detail Specific */
.alert-detail-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.alert-risk-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.alert-risk-banner.orange {
  background: rgba(245, 166, 35, 0.12);
  color: var(--d-orange);
  border: 1px solid rgba(245, 166, 35, 0.3);
}
.alert-risk-banner.blue {
  background: rgba(57, 120, 168, 0.12);
  color: #2b78b5;
  border: 1px solid rgba(57, 120, 168, 0.3);
}
body.dark .alert-risk-banner.blue {
  color: #72b3dc;
}
.alert-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.alert-info-card {
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid rgba(0, 0, 0, 0.05);
}
body.dark .alert-info-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}
.alert-info-card .label {
  font-size: 10.5px;
  color: var(--txt-m);
  font-weight: 400;
}
.alert-info-card .val {
  font-size: 12px;
  font-weight: 600;
  color: var(--txt-h);
  margin-top: 2px;
}
.alert-advice-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(13, 122, 105, 0.06);
  border: 1px solid rgba(13, 122, 105, 0.18);
}
body.dark .alert-advice-card {
  background: rgba(13, 122, 105, 0.12);
  border-color: rgba(13, 122, 105, 0.25);
}
.alert-advice-card h5 {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary-ink);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
}
body.dark .alert-advice-card h5 {
  color: #7EC8BD;
}
.alert-advice-card p {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--txt-s);
}

/* ── Loading, Skeletons & Spinners ─────────────────────────────── */
@keyframes shimmerAnim {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, rgba(11, 29, 26,  0.04) 25%, rgba(11, 29, 26,  0.09) 50%, rgba(11, 29, 26,  0.04) 75%);
  background-size: 200% 100%;
  animation: shimmerAnim 1.6s infinite cubic-bezier(0.4, 0, 0.6, 1);
  border-radius: 6px;
  pointer-events: none;
}

body.dark .skeleton {
  background: linear-gradient(90deg, rgba(255, 238, 238, 0.05) 25%, rgba(255, 238, 238, 0.12) 50%, rgba(255, 238, 238, 0.05) 75%);
  background-size: 200% 100%;
}

.skeleton-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.skeleton-decision-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--rm);
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(11, 29, 26,  0.06);
}
body.dark .skeleton-decision-banner {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 238, 238, 0.06);
}

.skeleton-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skeleton-line {
  border-radius: 4px;
}

.skeleton-line.title {
  width: 65%;
  height: 13px;
}

.skeleton-line.sub {
  width: 90%;
  height: 10px;
}

.skeleton-seg-item {
  position: relative !important;
  top: auto !important;
}

.loading-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(10, 95, 82, 0.25);
  border-top-color: var(--pri-lt);
  border-radius: 50%;
  animation: spinnerRotate 0.7s linear infinite;
  flex-shrink: 0;
}
body.dark .loading-spinner {
  border-color: rgba(255, 238, 238, 0.2);
  border-top-color: var(--accent);
}
@keyframes spinnerRotate {
  to { transform: rotate(360deg); }
}

.inline-loader {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--txt-s);
  font-style: italic;
}

.data-source-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 10.5px;
  color: var(--txt-m);
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: all var(--ease);
}
body.dark .data-source-footer {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.05);
}

.empty-route-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 16px;
  color: var(--txt-s);
  gap: 8px;
}

.empty-route-icon {
  font-size: 28px;
  opacity: 0.85;
}

.empty-route-text {
  font-size: 12px;
  max-width: 250px;
  line-height: 1.5;
}

.welcome-banner {
  background: rgba(10, 95, 82, 0.06);
  border-color: rgba(10, 95, 82, 0.16);
}
body.dark .welcome-banner {
  background: rgba(255, 238, 238, 0.06);
  border-color: rgba(255, 238, 238, 0.14);
}

/* ── Dazzle SVG Vector Icons ───────────────────────────────────── */
.d-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke-width: 2;
}

.wx-icon-big .d-icon {
  width: 32px;
  height: 32px;
}

.wchip .d-icon {
  width: 14px;
  height: 14px;
  margin-right: 4px;
}

.w-badge-icon .d-icon {
  width: 14px;
  height: 14px;
}

.decision-icon .d-icon {
  width: 24px;
  height: 24px;
}

.alert-icon .d-icon {
  width: 20px;
  height: 20px;
}

.seg-danger-icon {
  display: inline-flex;
  align-items: center;
  color: var(--d-orange);
  margin-left: 4px;
}

.seg-danger-icon .d-icon {
  width: 13px;
  height: 13px;
}

/* ── Quick Route Chips (Onboarding) ────────────────────────────── */
.quick-routes-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.quick-route-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(10, 95, 82, 0.08);
  border: 1px solid rgba(10, 95, 82, 0.20);
  border-radius: 99px;
  padding: 4px 10px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  color: var(--primary-ink);
  cursor: pointer;
  transition: all var(--ease);
}

.quick-route-chip:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary-ink);
  transform: translateY(-1px);
  box-shadow: var(--sh-xs);
}

body.dark .quick-route-chip {
  background: rgba(255, 209, 102, 0.10);
  border-color: rgba(255, 209, 102, 0.25);
  color: var(--accent);
}

body.dark .quick-route-chip:hover {
  background: var(--accent);
  color: var(--dark-bg);
  border-color: var(--accent);
}

/* ── Accessibility & Focus ─────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--primary-ink);
  outline-offset: 2px;
}
body.dark :focus-visible {
  outline-color: var(--accent);
}
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

/* ── Legal & API Attribution Footer ────────────────────────────── */
.app-legal-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
body.dark .app-legal-footer {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.legal-disclaimer-card {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(10, 95, 82, 0.04);
  border: 1px solid rgba(10, 95, 82, 0.12);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
body.dark .legal-disclaimer-card {
  background: rgba(255, 209, 102, 0.04);
  border-color: rgba(255, 209, 102, 0.12);
}

.legal-disclaimer-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--txt-h);
}
.legal-disclaimer-header svg {
  stroke: var(--primary-ink);
  flex-shrink: 0;
}
body.dark .legal-disclaimer-header svg {
  stroke: var(--accent);
}

.legal-disclaimer-text {
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--txt-s);
  margin: 0;
}

.legal-modal-trigger {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--primary-ink);
  cursor: pointer;
  transition: all var(--ease);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-modal-trigger:hover {
  color: var(--pri-lt);
}
body.dark .legal-modal-trigger {
  color: var(--accent);
}
body.dark .legal-modal-trigger:hover {
  color: #ffffff;
}

/* ── Disclaimer Modal Card ─────────────────────────────────────── */
.disclaimer-modal-card {
  max-width: 620px;
  width: 92vw;
}

.disclaimer-modal-body {
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 4px;
}

.disclaimer-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt-h);
  margin-bottom: 4px;
}

.disclaimer-section p {
  font-size: 12px;
  line-height: 1.55;
  color: var(--txt-s);
  margin: 0;
}

.disclaimer-section a {
  color: var(--primary-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
body.dark .disclaimer-section a {
  color: var(--accent);
}
