:root {
  --bg: #F7F2E8;
  --ink: #1E1B16;
  --muted: #6F685C;
  --line: #1E1B16;
  --accent: #D9381E;
  --accent-ink: #FFFFFF;
  --soft: #E9E2D3;
  --body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --head: "Fraunces", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.4; }
body { height: 100svh; overflow: hidden; }
#map { position: fixed; inset: 0; height: 100svh; background: var(--soft); }
#brand {
  position: fixed; z-index: 1100; top: max(10px, env(safe-area-inset-top)); left: 10px;
  background: var(--bg); border: 2px solid var(--line); padding: 6px 12px;
  font-family: var(--head); font-weight: 800; font-size: 20px; letter-spacing: -0.01em;
}
#panel {
  position: fixed; z-index: 1000; left: 0; right: 0; bottom: 0;
  max-height: 58svh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg); border-top: 3px solid var(--line);
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
}
@media (min-width: 800px) {
  #panel { top: 0; right: auto; width: 400px; max-height: none; border-top: 0; border-right: 3px solid var(--line); padding-top: 70px; }
}
h1, h2 { font-family: var(--head); margin: 0 0 8px; line-height: 1.1; }
h2 { font-size: 26px; font-weight: 800; }
.label { font-size: 13px; font-weight: 700; margin: 12px 0 6px; color: var(--muted); }
.label:first-child { margin-top: 0; }
.small { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.facts { font-size: 17px; margin: 4px 0 14px; }
.facts b { font-weight: 800; }
button, input { font: inherit; color: inherit; border-radius: 2px; }
button { cursor: pointer; }
.btn {
  display: block; width: 100%; min-height: 54px; padding: 10px 14px; margin-top: 10px;
  border: 2px solid var(--line); background: transparent; font-weight: 800; font-size: 17px; text-align: center;
}
.btn.main { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-size: 19px; min-height: 60px; }
.btn.main:active { background: #b52d17; }
.btn:active { background: var(--soft); }
.btn[disabled] { opacity: .5; cursor: default; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 .btn { margin-top: 10px; }
.place { display: grid; grid-template-columns: 1fr auto; border: 2px solid var(--line); margin-bottom: -2px; background: var(--bg); }
.place.sel { background: var(--soft); box-shadow: inset 8px 0 0 var(--accent); }
.place button { border: 0; background: transparent; min-height: 50px; padding: 8px 12px; text-align: left; font-weight: 700; }
.place.sel button.pick { padding-left: 22px; }
.place button.del { color: var(--muted); font-size: 13px; font-weight: 600; text-align: center; padding: 8px 14px; }
.linkbtn { border: 0; background: transparent; padding: 10px 0; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }
.startrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.startrow span { font-weight: 600; }
.slider { width: 100%; accent-color: var(--accent); height: 36px; margin: 0; }
.budget { display: flex; justify-content: space-between; align-items: baseline; }
.budget strong { font-family: var(--head); font-size: 24px; }
.field { display: flex; gap: 8px; }
.field input { flex: 1; min-width: 0; min-height: 50px; padding: 8px 10px; border: 2px solid var(--line); background: #fff; }
.field .btn { width: auto; margin: 0; padding: 0 16px; }
.result-item { display: block; width: 100%; text-align: left; border: 2px solid var(--line); margin-bottom: -2px; padding: 10px 12px; background: var(--bg); min-height: 50px; font-weight: 600; }
.result-item:active { background: var(--soft); }
.skel { height: 16px; background: linear-gradient(90deg, var(--soft) 25%, #f1ebde 50%, var(--soft) 75%); background-size: 200% 100%; animation: sh 1.2s linear infinite; margin: 10px 0; }
.skel.w1 { width: 90%; } .skel.w2 { width: 70%; } .skel.w3 { width: 80%; }
@keyframes sh { to { background-position: -200% 0; } }
.bar { height: 10px; border: 2px solid var(--line); margin-top: 12px; }
.bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .25s; }
.msg { border-left: 6px solid var(--accent); padding: 4px 0 4px 12px; margin: 8px 0 12px; font-size: 17px; }
.hint { background: var(--ink); color: var(--bg); padding: 10px 12px; font-weight: 700; margin-bottom: 12px; }
#fatal { position: fixed; z-index: 3000; top: 0; left: 0; right: 0; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--accent); color: #fff; font-weight: 700; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
#fatal[hidden] { display: none; }
#fatal button { border: 2px solid #fff; background: transparent; color: #fff; min-height: 44px; padding: 0 14px; font-weight: 800; }
.mk { width: 18px; height: 18px; border: 3px solid var(--ink); background: var(--bg); }
.mk.dest { background: var(--accent); border-color: var(--ink); }
.mk.pend { background: var(--ink); }
.leaflet-container { font-family: var(--body); }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 12px; }
.seg button { min-height: 48px; border: 2px solid var(--line); margin-left: -2px; background: transparent; font-weight: 800; font-size: 16px; }
.seg button:first-child { margin-left: 0; }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--bg); }
.mk.sun { background: #F2B01E; width: 22px; height: 22px; margin: -2px 0 0 -2px; }
.awtip { background: var(--bg); border: 2px solid var(--line); border-radius: 0; box-shadow: none; color: var(--ink); font-weight: 800; padding: 4px 8px; }
.awtip.leaflet-tooltip-top:before { border-top-color: var(--line); }
