@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: Bricolage;
  src: url('/fonts/bricolage.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --paper: #f6f7f1;
  --card: #fff;
  --ink: #232830;
  --muted: #565e59;
  --line: #e2e5db;
  --lime: #cfef76;
  --green: #517329;
  --purple: #6f46db;
  font-family: Manrope, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-tap-highlight-color: transparent;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 290px; }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }
[hidden] { display: none !important; }
.symbol-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1520px; margin: auto; min-height: 77px; padding: 0 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; gap: 11px; align-items: center; color: inherit; font: 800 24px/1 Bricolage, system-ui, sans-serif; letter-spacing: -.055em; text-decoration: none; }
.brand-mark { width: 39px; height: 39px; border-radius: 12px; background: var(--lime); display: grid; place-items: center; }
.brand-mark .icon { width: 24px; height: 24px; }
.sync-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 13px; min-height: 44px; border: 1px solid var(--line); border-radius: 11px; background: transparent; font-size: 13px; font-weight: 750; white-space: nowrap; }
.sync-button:hover, .map-button:hover, .icon-button:hover { background: #ecf0e4; }
.sync-button .icon { width: 18px; height: 18px; }

.dashboard { max-width: 1520px; margin: auto; padding: 35px 46px 39px; display: grid; grid-template-columns: minmax(265px, .75fr) minmax(0, 1.85fr); gap: 25px 42px; }
.panel { display: grid; align-content: start; gap: 21px; padding-top: 21px; }
.intro { margin-bottom: 5px; }
.city-label { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 12px; color: #476126; letter-spacing: .075em; text-transform: uppercase; margin: 0 0 13px; }
.city-label .icon { width: 17px; height: 17px; }
h1 { font: 800 clamp(56px, 5.2vw, 88px)/.93 Bricolage, system-ui, sans-serif; letter-spacing: -.083em; margin: 0; max-width: 5.7em; }
h1 span { color: #688333; }
.intro-copy { max-width: 28ch; margin: 17px 0 0; font-size: 15px; font-weight: 650; color: var(--muted); line-height: 1.65; }
.progress-card { border: 1px solid var(--line); background: var(--card); padding: 21px 21px 19px; border-radius: 22px; }
.progress-header, .progress-caption, .map-header, .dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.progress-header h2, .map-header h2 { font-size: 15px; font-weight: 850; margin: 0; }
.progress-header .icon { width: 19px; height: 19px; color: var(--green); }
.progress-number { font: 800 55px/1.05 Bricolage, system-ui, sans-serif; letter-spacing: -.065em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.progress-number span { font-size: .56em; letter-spacing: -.035em; color: var(--green); }
progress { display: block; width: 100%; height: 8px; appearance: none; border: 0; border-radius: 999px; overflow: hidden; color: var(--green); background: #eef0e9; margin: 12px 0 10px; }
progress::-webkit-progress-bar { background: #eef0e9; border-radius: 999px; }
progress::-webkit-progress-value { background: var(--green); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--green); border-radius: 999px; }
.progress-caption { font-size: 11px; font-weight: 750; color: var(--muted); flex-wrap: wrap; }
.progress-caption span:first-child { color: var(--ink); }
.record-button { display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%; border: 1px solid #bad966; min-height: 57px; padding: 11px 16px; border-radius: 15px; background: var(--lime); font-weight: 850; font-size: 15px; }
.record-button:hover { background: #c0e465; }
.record-button[data-active="true"] { background: var(--ink); border-color: var(--ink); color: white; }
.record-button[data-active="true"]:hover { background: #353d49; }
.record-symbol { width: 16px; height: 16px; border: 2px solid currentColor; border-radius: 50%; display: grid; place-items: center; }
.record-symbol::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
[data-active="true"] .record-symbol { color: #ffabae; border-radius: 4px; }
[data-active="true"] .record-symbol::after { border-radius: 1px; }
.record-status { color: var(--muted); font-size: 12px; font-weight: 650; line-height: 1.4; text-align: center; margin: 9px 0 0; }
.walk-stats { display: flex; justify-content: center; gap: 18px; margin-top: 7px; color: var(--ink); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }

.map-card { background: var(--card); border: 1px solid var(--line); border-radius: 25px; padding: 11px; min-width: 0; }
.map-header { padding: 5px 8px 13px; min-height: 40px; }
.legend { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 750; white-space: nowrap; }
.legend-line { background: var(--purple); border-radius: 4px; width: 17px; height: 4px; }
.map-frame { position: relative; overflow: hidden; isolation: isolate; border-radius: 17px; border: 1px solid #e6e8df; }
#map { width: 100%; height: max(540px, calc(100dvh - 211px)); min-height: 310px; max-height: 1100px; background: #e6ece5; }
.leaflet-tile-pane { filter: saturate(.62) contrast(.96); }
.map-actions { position: absolute; z-index: 500; right: 12px; bottom: 31px; display: flex; flex-direction: column; gap: 8px; }
.map-button, .icon-button { border: 1px solid #e2e5db; background: white; border-radius: 10px; width: 42px; height: 42px; display: grid; place-items: center; padding: 0; }
.map-button .icon { width: 20px; height: 20px; }
.zoom-controls { display: grid; border: 1px solid #e2e5db; border-radius: 10px; overflow: clip; background: white; }
.zoom-controls .map-button { border: 0; border-radius: 0; width: 40px; height: 37px; }
.zoom-controls .map-button + .map-button { border-top: 1px solid #eaebe6; }
.zoom-controls .map-button:focus-visible { outline-offset: -3px; }
.map-notice { position: absolute; z-index: 501; inset: 12px 12px auto auto; max-width: calc(100% - 24px); padding: 7px 12px; border-radius: 10px; color: var(--ink); background: white; box-shadow: 0 2px 9px #20252c1a; font-size: 13px; }
.leaflet-container .leaflet-control-attribution { font-family: Manrope, system-ui, sans-serif; color: #30362f; padding: 2px 6px; }
.leaflet-container .leaflet-control-attribution a { color: #274c66; }
.leaflet-control-scale-line { background: #ffffffdc; border-color: #505851; }
.my-position { border: 3px solid white; border-radius: 50%; background: #315eee; box-shadow: 0 0 0 1px #2443a8, 0 2px 6px #272a5277; }

dialog { color: var(--ink); width: min(440px, calc(100% - 28px)); border: 1px solid var(--line); background: white; border-radius: 21px; padding: 21px; }
dialog::backdrop { background: #23283066; }
dialog h2 { margin: 0; font: 800 29px/1.1 Bricolage, system-ui, sans-serif; letter-spacing: -.035em; }
dialog p { font-size: 14px; line-height: 1.55; }
dialog .dialog-hint { color: var(--muted); font-size: 12px; }
dialog input { color: var(--ink); background: var(--paper); border: 1px solid var(--line); width: 100%; min-height: 43px; border-radius: 10px; padding: 8px 10px; margin-bottom: 12px; font-size: 13px; }
dialog .record-button { min-height: 46px; }

@media (max-width: 1000px) and (min-width: 761px) {
  .topbar-inner { padding-inline: 25px; }
  .dashboard { padding-inline: 25px; column-gap: 22px; }
  h1 { font-size: clamp(47px, 5.6vw, 56px); }
}
@media (max-width: 760px) {
  .topbar-inner { min-height: 60px; padding-inline: 14px; }
  .brand { font-size: 21px; gap: 7px; }
  .brand-mark { width: 33px; height: 33px; border-radius: 10px; }
  .brand-mark .icon { width: 21px; height: 21px; }
  .sync-button { font-size: 11px; min-height: 38px; padding: 6px 8px; gap: 4px; }
  .sync-button .icon { width: 16px; height: 16px; }
  .dashboard { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 13px 10px max(12px, env(safe-area-inset-bottom)); }
  .panel { display: contents; }
  .intro { grid-row: 1; margin: 0; padding: 3px 4px 1px; }
  .city-label { font-size: 10px; margin-bottom: 4px; }
  .city-label .icon { width: 14px; height: 14px; }
  h1 { font-size: clamp(29px, 8.5vw, 44px); letter-spacing: -.07em; max-width: none; }
  .intro-copy { font-size: 12px; margin-top: 5px; max-width: none; }
  .map-card { grid-row: 2; border-radius: 17px; padding: 5px; }
  .map-header { min-height: 25px; padding: 1px 5px 5px; }
  .map-header h2 { font-size: 12px; }
  .legend { font-size: 10px; }
  .map-frame { border-radius: 12px; }
  #map { height: calc(100dvh - 350px); min-height: 282px; max-height: 900px; }
  .map-actions { right: 8px; bottom: 25px; gap: 6px; }
  .map-button { width: 42px; height: 42px; }
  .zoom-controls .map-button { height: 40px; }
  .record-card { grid-row: 3; }
  .record-button { min-height: 50px; border-radius: 13px; }
  .record-status { font-size: 11px; margin-top: 5px; }
  .progress-card { grid-row: 4; display: grid; grid-template-columns: 1fr auto; padding: 9px 11px 8px; border-radius: 15px; }
  .progress-header { justify-content: start; align-self: center; }
  .progress-header .icon { display: none; }
  .progress-header h2 { font-size: 12px; }
  .progress-number { align-self: center; margin: 0; font-size: 25px; }
  progress { grid-column: span 2; height: 6px; margin: 4px 0 3px; }
  .progress-caption { grid-column: span 2; font-size: 10px; }
}
@media (max-width: 350px) {
  .sync-button { min-width: 42px; }
  .sync-button span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
