/* Направление: полевой прибор. Карта — предмет, панель — показания.
   Акцент один: мятный «фикс» — цвет захваченного сигнала. */

:root {
  --ground: #f4f2ed;
  --panel: #fffefb;
  --ink: #14191c;
  --dim: #6d7a80;
  --hair: rgba(20, 25, 28, 0.1);
  --fix: #0f9d76;
  --fix-soft: rgba(15, 157, 118, 0.16);
  --warn: #b7791f;

  --sheet-h: 46svh;
  --radius: 14px;
}

:root[data-scheme="dark"] {
  --ground: #0f1518;
  --panel: #151d21;
  --ink: #e8efec;
  --dim: #7d8f95;
  --hair: rgba(232, 239, 236, 0.12);
  --fix: #3ddc97;
  --fix-soft: rgba(61, 220, 151, 0.18);
  --warn: #e3b341;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ground);
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* --- Карта ---------------------------------------------------------------- */

#map {
  position: absolute;
  inset: 0 0 var(--sheet-h) 0;
  background: var(--ground);
}

.leaflet-control-attribution {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  background: transparent !important;
  color: var(--dim) !important;
}

.leaflet-control-attribution a { color: var(--dim) !important; }

/* Метка последней точки: кольцо захвата сигнала. */
.fix-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--fix);
  box-shadow: 0 0 0 4px var(--fix-soft);
}

.fix-dot--live { animation: ping 2.4s ease-out infinite; }

@keyframes ping {
  0%   { box-shadow: 0 0 0 3px var(--fix-soft); }
  70%  { box-shadow: 0 0 0 16px rgba(61, 220, 151, 0); }
  100% { box-shadow: 0 0 0 3px rgba(61, 220, 151, 0); }
}

.start-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2.5px solid var(--fix);
  background: var(--panel);
}

/* --- Нижняя панель -------------------------------------------------------- */

.sheet {
  position: absolute;
  inset: auto 0 0 0;
  height: var(--sheet-h);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: var(--radius) var(--radius) 0 0;
  border-top: 1px solid var(--hair);
  box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.18);
}

/* Показания прибора */
.readout {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--hair);
}

.readout__figure { display: flex; align-items: baseline; gap: 5px; }

.readout__value {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.readout__unit {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--dim);
}

.readout__meta {
  display: flex;
  gap: 16px;
  margin: 0;
  text-align: right;
}

.readout__meta dt {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.readout__meta dd {
  margin: 2px 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* Лента прогулок */
.feed {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 10px calc(14px + env(safe-area-inset-bottom));
}

.feed__status {
  margin: 28px 20px;
  color: var(--dim);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.feed__status strong { color: var(--ink); font-weight: 500; }

.walk {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 11px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.walk + .walk { box-shadow: inset 0 1px 0 var(--hair); }

.walk[aria-current="true"] { background: var(--fix-soft); box-shadow: none; }
.walk[aria-current="true"] + .walk { box-shadow: none; }

.walk:focus-visible { outline: 2px solid var(--fix); outline-offset: -2px; }

/* Сигнатура: миниатюрный контур самого маршрута */
.walk__glyph { flex: 0 0 auto; width: 46px; height: 30px; }
.walk__glyph path {
  fill: none;
  stroke: var(--fix);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.walk__body { flex: 1; min-width: 0; }

.walk__date { font-size: 15px; font-weight: 500; }

.walk__stats {
  margin-top: 2px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.walk__live {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fix);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .fix-dot--live { animation: none; }
}
