/* Parcours vélo – style « carnet de route » : papier crème, terre cuite, ocre et vert olive. */
:root {
  --bg: #efe6d8;
  --panel: #fbf6ee;
  --surface: #f4ecdf;
  --surface-hover: #ede2d1;
  --border: #e3d6c3;
  --border-strong: #cdbba2;
  --text: #2f251c;
  --muted: #7b6a58;
  --accent: #b5532c;
  --accent-strong: #933f1d;
  --accent-soft: #f6e2d4;
  --ochre: #c48a1a;
  --ochre-soft: #f7ead0;
  --olive: #66743a;
  --danger: #a3311f;
  --danger-soft: #f9e1da;
  --warn-soft: #f8ecd0;
  --warn: #7c5410;
  --shadow: 0 1px 0 rgba(90, 60, 30, .06), 0 3px 10px rgba(90, 60, 30, .08);
  --radius: 8px;
  --chart-grid: #e8dccb;
  --chart-text: #85735f;
  --c-road: #8a7a68;
  --c-cycle: #66743a;
  --c-unpaved: #c48a1a;
  --via: #c48a1a;
  --font: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-title: "Bitter", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17120e;
    --panel: #211a15;
    --surface: #2a221b;
    --surface-hover: #332920;
    --border: #3a2f26;
    --border-strong: #4d3f33;
    --text: #f1e7da;
    --muted: #b3a18c;
    --accent: #db7a4c;
    --accent-strong: #eb9266;
    --accent-soft: #3c2519;
    --ochre: #deaa45;
    --ochre-soft: #3a2d14;
    --olive: #a5b36b;
    --danger: #f0907b;
    --danger-soft: #3d1f18;
    --warn-soft: #3a2d14;
    --warn: #eac07a;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 3px 10px rgba(0, 0, 0, .35);
    --chart-grid: #3a2f26;
    --chart-text: #b3a18c;
    --c-road: #a8977f;
    --c-cycle: #a5b36b;
    --c-unpaved: #deaa45;
    --via: #deaa45;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--accent); }
code { font-size: .92em; background: var(--surface); padding: 0 4px; border-radius: 3px; }

/* ---------- Mise en page ---------- */
.app {
  display: grid;
  grid-template-columns: 400px 1fr;
  height: 100vh;
  height: 100dvh;
}
.panel {
  background: var(--panel);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 20px 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 2;
}
.map-area { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: #e8e0d2; }

/* ---------- En-tête ---------- */
.brand { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px dashed var(--border-strong); }
.logo { width: 42px; height: 42px; color: var(--accent); flex: none; }
.brand h1 { font-family: var(--font-title); font-weight: 700; font-size: 21px; margin: 0; line-height: 1.15; }
.brand p { margin: 1px 0 0; color: var(--muted); font-size: 14px; font-style: italic; }

/* ---------- Onglets ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-top: -4px; }
.tabs button {
  border: 0;
  background: none;
  padding: 8px 12px 9px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 15px;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--accent-strong); border-bottom-color: var(--accent); }
.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }

/* ---------- Formulaire ---------- */
form#route-form { display: flex; flex-direction: column; gap: 16px; }
.group {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.group legend {
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent-strong);
  padding: 0;
  margin-bottom: 8px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  background: var(--panel);
  padding: 8px 10px;
  font-weight: 600;
  color: var(--muted);
}
.segmented button + button { border-left: 1px solid var(--border-strong); }
.segmented button svg { width: 16px; height: 16px; }
.segmented button:hover { background: var(--surface-hover); color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--accent); color: #fff8f0; }

.place label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 5px;
}
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot-start { background: var(--olive); }
.dot-end { background: var(--danger); }

.place-row { display: flex; gap: 6px; }
.combo { position: relative; flex: 1; min-width: 0; }
input[type="text"], .num, textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 8px 11px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:focus, .num:focus-within, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input.is-set { border-color: var(--olive); background: var(--surface); }

.icon-btn {
  flex: none;
  width: 40px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.icon-btn svg { width: 18px; height: 18px; }

/* Étapes */
.vias { display: flex; flex-direction: column; gap: 6px; }
.vias:empty { display: none; }
.via-row { display: flex; align-items: stretch; gap: 6px; }
.via-num {
  flex: none;
  align-self: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--via);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}
.via-row input[type="text"] { padding: 7px 10px; }
.via-row .icon-btn { width: 36px; }
.via-order { display: flex; flex-direction: column; gap: 2px; flex: none; }
.via-order button {
  flex: 1;
  width: 22px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  border-radius: 4px;
  color: var(--muted);
  padding: 0;
  display: grid;
  place-items: center;
}
.via-order button:hover:not(:disabled) { color: var(--text); background: var(--surface-hover); }
.via-order button:disabled { opacity: .35; cursor: default; }
.via-order svg { width: 10px; height: 10px; }
.icon-btn.remove:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }

.add-via {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  border-radius: 6px;
  padding: 5px 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}
.add-via:hover { color: var(--accent-strong); border-color: var(--accent); background: var(--accent-soft); }
.add-via svg { width: 15px; height: 15px; }
.hint { margin: -2px 0 0; font-size: 13px; color: var(--muted); font-style: italic; }

.suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 1000;
  list-style: none;
  margin: 0;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: var(--shadow);
  max-height: 280px;
  overflow-y: auto;
}
.suggest li {
  padding: 6px 9px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.suggest li small { color: var(--muted); font-size: 13px; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--surface-hover); }
.suggest .empty { color: var(--muted); cursor: default; }

.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--accent); min-width: 0; }
.num {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100px;
  padding: 6px 10px;
}
.num.wide { width: 100%; }
.num input {
  border: 0;
  outline: none;
  background: transparent;
  width: 100%;
  min-width: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.num span { color: var(--muted); white-space: nowrap; font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  border: 1px solid var(--border-strong);
  background: var(--panel);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 14px;
  color: var(--muted);
}
.chips button:hover { color: var(--text); background: var(--surface-hover); }
.chips button.active, .chips button[aria-pressed="true"] {
  border-color: var(--olive);
  background: var(--olive);
  color: #fbf6ee;
  font-weight: 600;
}

.road-types { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.road-card { position: relative; display: block; cursor: pointer; }
.road-card input { position: absolute; opacity: 0; pointer-events: none; }
.road-card .rc-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  height: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--panel);
  transition: border-color .15s, background .15s;
}
.road-card:hover .rc-body { background: var(--surface-hover); }
.road-card .rc-title { font-weight: 700; }
.road-card .rc-desc { font-size: 13px; color: var(--muted); line-height: 1.3; }
.road-card input:checked + .rc-body {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.road-card input:focus-visible + .rc-body { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn-primary {
  border: 0;
  border-bottom: 3px solid var(--accent-strong);
  background: var(--accent);
  color: #fff8f0;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 16px;
  padding: 11px 16px 10px;
  border-radius: 6px;
  transition: background .15s;
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-primary:active { transform: translateY(1px); border-bottom-width: 2px; }
.btn-primary:disabled { opacity: .6; cursor: progress; }

.link-btn {
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 600;
  padding: 2px 0;
}
.link-btn:hover { text-decoration: underline; }
.link-btn:disabled { color: var(--muted); cursor: default; text-decoration: none; }

/* ---------- Assistant ---------- */
.planner { display: flex; flex-direction: column; gap: 12px; }
.planner-intro { margin: 0; color: var(--muted); }
.quota-line { display: block; margin-top: 4px; font-size: 13px; font-style: italic; }
.ai-off {
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: 6px;
  padding: 11px 13px;
  font-size: 14px;
}
.ai-off p { margin: 4px 0 0; }

.chat { display: flex; flex-direction: column; gap: 8px; }
.chat-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
  padding: 2px;
}
.chat-compact .chat-log { max-height: 260px; }
.chat-log:empty { display: none; }
.chat-msg { max-width: 92%; border-radius: 8px; padding: 7px 11px; font-size: 14.5px; }
.chat-msg p { margin: 0; white-space: pre-wrap; }
.chat-user { align-self: flex-end; background: var(--accent-soft); border: 1px solid var(--border); border-bottom-right-radius: 2px; }
.chat-assistant { align-self: flex-start; background: var(--surface); border-left: 3px solid var(--ochre); border-bottom-left-radius: 2px; }
.chat-who { display: block; font-family: var(--font-title); font-size: 12px; font-weight: 600; color: var(--ochre); margin-bottom: 1px; }
.chat-info { align-self: stretch; max-width: none; background: none; color: var(--muted); font-size: 13.5px; font-style: italic; padding: 2px 4px; border-left: 2px solid var(--border-strong); border-radius: 0; }
.chat-error { align-self: stretch; max-width: none; background: var(--danger-soft); color: var(--danger); font-size: 14px; }
.chat-typing { align-self: flex-start; color: var(--muted); font-style: italic; font-size: 14px; padding: 2px 4px; }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-suggestions button {
  border: 1px dashed var(--border-strong);
  background: transparent;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13.5px;
  color: var(--muted);
  text-align: left;
}
.chat-suggestions button:hover:not(:disabled) { color: var(--accent-strong); border-color: var(--accent); background: var(--accent-soft); }
.chat-input { display: flex; gap: 6px; align-items: stretch; }
.chat-input textarea { resize: none; min-height: 44px; padding: 7px 10px; font-size: 14.5px; }
.chat-send {
  flex: none;
  border: 0;
  border-bottom: 2px solid var(--accent-strong);
  background: var(--accent);
  color: #fff8f0;
  font-weight: 600;
  border-radius: 6px;
  padding: 0 14px;
}
.chat-send:hover:not(:disabled) { background: var(--accent-strong); }
.chat-send:disabled, .chat-input textarea:disabled { opacity: .55; cursor: default; }

/* ---------- Progression / alertes ---------- */
.progress {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
}
.progress-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 14px; }
.bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }

.alert {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 600;
}
.note {
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  margin-bottom: 10px;
}

/* ---------- Résultats ---------- */
.results-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.results-head h2 { font-family: var(--font-title); font-size: 17px; margin: 0; }
.route-list { display: flex; flex-direction: column; gap: 12px; }

.route-card {
  --route: #b23a1e;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px 12px 16px;
  background: var(--panel);
  cursor: pointer;
  position: relative;
  transition: border-color .15s, box-shadow .15s, background .15s;
  outline: none;
}
.route-card::before {
  content: "";
  position: absolute;
  left: -1px; top: -1px; bottom: -1px;
  width: 5px;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--route);
  opacity: .35;
}
.route-card:hover { border-color: var(--border-strong); }
.route-card:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.route-card.selected { border-color: var(--route); background: var(--surface); box-shadow: var(--shadow); }
.route-card.selected::before { opacity: 1; }
.route-card header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; background: var(--route); flex: none; }
.route-card h3 { font-family: var(--font-title); font-size: 16px; font-weight: 600; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match {
  font-size: 13px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--surface-hover);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.match.good { background: var(--olive); color: #fbf6ee; }
.modified-tag { font-size: 12px; font-style: italic; color: var(--ochre); white-space: nowrap; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.stats div { display: flex; flex-direction: column; min-width: 0; }
.stats .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stats .v { font-family: var(--font-title); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats .delta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stats .delta.off { color: var(--warn); font-weight: 600; }

.surface-bar {
  display: flex;
  height: 7px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--border);
  gap: 2px;
}
.surface-bar span { display: block; height: 100%; }
.surface-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}
.surface-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
.s-road { background: var(--c-road); }
.s-cycle { background: var(--c-cycle); }
.s-unpaved { background: var(--c-unpaved); }
.env-line { margin-top: 4px; font-size: 13px; color: var(--olive); font-weight: 600; }
.types-ok { margin-top: 6px; font-size: 13px; color: var(--olive); }
.types-off {
  margin-top: 8px;
  border: 1px solid #e8c46a;
  background: var(--ochre-soft);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13.5px;
  color: var(--warn);
}
.types-off summary { cursor: pointer; list-style-position: outside; }
.types-off summary strong { font-weight: 700; }
.types-off summary span { display: block; font-size: 13px; }
.types-hint { margin: 6px 0 4px; font-size: 12.5px; font-style: italic; }
.types-off ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 180px; overflow-y: auto; }
.types-off li button {
  border: 0;
  background: none;
  padding: 2px 4px;
  border-radius: 4px;
  text-align: left;
  font-size: 13px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.types-off li button:hover { background: rgba(240, 180, 41, .25); }
.reuse-warn { margin-top: 8px; padding: 6px 10px; border-radius: 6px; background: var(--danger-soft); color: var(--danger); font-size: 13.5px; font-weight: 600; }
.reuse-note { margin-top: 6px; font-size: 13px; color: var(--warn); font-style: italic; }

.card-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btn-gpx, .btn-adapt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  border-radius: 6px;
  padding: 7px 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-gpx svg, .btn-adapt svg { width: 17px; height: 17px; }
.btn-gpx:hover, .btn-adapt:hover { background: var(--surface-hover); }
.btn-adapt[aria-expanded="true"] { border-color: var(--ochre); background: var(--ochre-soft); }
.btn-adapt:disabled { opacity: .5; cursor: not-allowed; }
.route-card.selected .btn-gpx { background: var(--accent); border-color: var(--accent-strong); color: #fff8f0; }
.route-card.selected .btn-gpx:hover { background: var(--accent-strong); }
.btn-gpx.small { flex: none; width: auto; margin: 0; padding: 4px 10px; background: var(--accent); border-color: var(--accent-strong); color: #fff8f0; }
.btn-gpx.small:hover { background: var(--accent-strong); }

.card-chat {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-strong);
  cursor: auto;
}
.card-chat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.card-chat-head strong { font-family: var(--font-title); font-size: 14px; font-weight: 600; color: var(--ochre); }

.credits { margin-top: auto; font-size: 12.5px; color: var(--muted); padding-top: 8px; }

/* ---------- Superpositions sur la carte ---------- */
.pick-hint {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #3a2c20;
  color: #fbf5ea;
  padding: 7px 8px 7px 14px;
  border-radius: 6px;
  box-shadow: var(--shadow);
  font-weight: 600;
  white-space: nowrap;
}
.pick-hint button {
  border: 0;
  background: rgba(255, 255, 255, .15);
  color: #fbf5ea;
  border-radius: 4px;
  padding: 3px 12px;
}
.map-area.picking .leaflet-container { cursor: crosshair; }

.profile {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 24px;
  z-index: 1000;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 9px 12px 5px;
}
.profile-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.profile-head strong { font-family: var(--font-title); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-head .btn-gpx { margin-left: auto; flex: none; }
.profile-stats { color: var(--muted); font-size: 14px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
#profile-canvas { display: block; width: 100%; height: 130px; touch-action: none; }

/* Marqueurs */
.pin { background: none; border: 0; }
.pin span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font: 700 13px/1 var(--font);
  border: 3px solid #fbf6ee;
  box-shadow: 0 1px 4px rgba(60, 35, 15, .45);
}
.pin-start span, .pin-loop span { background: #66743a; }
.pin-end span { background: #a3311f; }
.pin-via span { background: #c48a1a; width: 26px; height: 26px; font-size: 12px; }
.km-label { background: none; border: 0; }
.km-label span {
  display: inline-block;
  transform: translate(-50%, -50%);
  background: #fbf6ee;
  color: #2f251c;
  border: 2px solid var(--route, #b23a1e);
  border-radius: 4px;
  padding: 0 4px;
  font: 700 11px/15px var(--font);
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(60, 35, 15, .3);
}

/* Menu contextuel de la carte */
.map-menu { display: flex; flex-direction: column; gap: 2px; min-width: 200px; }
.map-menu button {
  border: 0;
  background: none;
  text-align: left;
  padding: 7px 10px;
  border-radius: 4px;
  font: 600 14px var(--font);
  color: #2f251c;
  display: flex;
  align-items: center;
  gap: 8px;
}
.map-menu button:hover { background: #f1e6d6; }
.map-menu .dot { width: 9px; height: 9px; }
.map-menu .dot-via { background: #c48a1a; }
.map-menu .dot-start { background: #66743a; }
.map-menu .dot-end { background: #a3311f; }
.leaflet-popup.menu-popup .leaflet-popup-content { margin: 6px; }
.leaflet-popup.menu-popup .leaflet-popup-content-wrapper { border-radius: 8px; background: #fbf6ee; }
.leaflet-popup.menu-popup .leaflet-popup-tip { background: #fbf6ee; }

.leaflet-container { font-family: var(--font); }
.leaflet-bar a, .leaflet-control-layers { border-radius: 6px !important; }

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .app { display: flex; flex-direction: column; height: auto; min-height: 100vh; }
  .map-area { order: -1; height: 58vh; min-height: 340px; flex: none; }
  .panel { border-right: 0; border-top: 1px solid var(--border); overflow: visible; padding: 16px; }
  .profile { left: 8px; right: 8px; bottom: 20px; padding: 8px 10px 4px; }
  #profile-canvas { height: 100px; }
  .profile-stats { display: none; }
  .chat-log { max-height: none; }
}
