@font-face {
  font-family: "Helvetica Local";
  src: url("/static/fonts/helvetica_regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Helvetica Local";
  src: url("/static/fonts/helvetica_bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: "Helvetica Local", Helvetica, Arial, sans-serif;
  color: #222;
  background: #fff;
  --at-stop: #d6372d;
  --boarded: #dc8100;
  --line-control: #8854bf;
  --clear: #22884d;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { font-size: 16px; line-height: 1.4; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, summary:focus-visible, select:focus-visible { outline: 2px solid #333; outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }

.map-viewport {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  cursor: grab;
  outline: none;
  background: #fff;
}
.map-viewport.dragging { cursor: grabbing; }
.map-viewport:focus-visible { box-shadow: inset 0 0 0 2px #888; }
.map-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 1723.3px;
  height: 891.9px;
}
.network-image, .marker-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.network-image { display: block; pointer-events: none; }
.network-image text { font-family: "Helvetica Local", Helvetica, Arial, sans-serif; }
.map-stage.ready .network-image circle.st0 { visibility: hidden; }

.stop-marker {
  --marker-color: #777772;
  position: absolute;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%);
}
.stop-marker::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 2px solid var(--marker-color);
  border-radius: 50%;
}
.stop-marker:not(.idle)::before { width: 12px; height: 12px; background: var(--marker-color); border-color: #fff; box-shadow: 0 0 0 1px var(--marker-color); }
.stop-marker:hover::before, .stop-marker:focus-visible::before { box-shadow: 0 0 0 5px #0002; }
.stop-marker:focus-visible { outline: 0; }
.stop-marker.at_stop { --marker-color: var(--at-stop); }
.stop-marker.boarded { --marker-color: var(--boarded); }
.stop-marker.line_control { --marker-color: var(--line-control); }
.stop-marker.clear { --marker-color: var(--clear); }

.map-control { position: fixed; z-index: 2; border: 1px solid #d4d4d4; border-radius: 5px; background: #fff; box-shadow: 0 1px 5px #0002; }
.map-report-button { top: max(16px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); min-height: 44px; padding: 10px 15px; font-size: 15px; }
.map-report-button:hover, .map-controls button:hover { background: #f4f4f4; }
.map-controls { right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; overflow: hidden; }
.map-controls button { width: 44px; height: 44px; padding: 0; border: 0; border-bottom: 1px solid #ddd; background: transparent; font-size: 24px; }
.map-controls button:last-child { border-bottom: 0; font-size: 21px; }

.legend { left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); max-width: calc(100vw - 88px); font-size: 14px; }
.legend summary { padding: 11px 13px; cursor: pointer; }
.legend-items { display: grid; gap: 9px; padding: 0 13px 13px; }
.legend-items span { display: flex; align-items: center; gap: 9px; }
.legend-dot { display: inline-block; flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; }
.legend-dot.at_stop { background: var(--at-stop); }
.legend-dot.boarded { background: var(--boarded); }
.legend-dot.line_control { background: var(--line-control); }
.legend-dot.clear { background: var(--clear); }
.legend-dot.idle { border: 2px solid #777772; }
.sync-state { position: fixed; z-index: 2; top: max(18px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); margin: 0; padding: 8px 10px; max-width: calc(100% - 175px); background: #fff; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; color: #666; }
.sync-state.error { color: #a52219; }

@keyframes sheetSlideUp {
  0% {
    transform: translateY(100%);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes sheetSlideDown {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(100%);
  }
}

@keyframes backdropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes backdropFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.report-dialog {
  width: min(480px, 100%);
  max-height: 85dvh;
  margin: auto auto 0 auto;
  padding: 0;
  border: 1px solid #dcdcdc;
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  color: #222;
  background: #fff;
  box-shadow: 0 -6px 32px rgba(0, 0, 0, 0.14);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.report-dialog[open] {
  animation: sheetSlideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.report-dialog[open]::backdrop {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  animation: backdropFadeIn 0.25s ease forwards;
}

.report-dialog.closing {
  animation: sheetSlideDown 0.22s cubic-bezier(0.4, 0, 0.7, 0.2) forwards;
}

.report-dialog.closing::backdrop {
  animation: backdropFadeOut 0.22s ease forwards;
}

.dialog-shell {
  padding: 10px 20px max(24px, env(safe-area-inset-bottom));
}

.dialog-handle {
  width: 36px;
  height: 4px;
  background: #d4d4d4;
  border-radius: 2px;
  margin: 4px auto 14px auto;
}

.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dialog-head h2 { margin: 2px 0 0; font-size: 20px; line-height: 1.3; font-weight: 700; }
.close-button { flex: 0 0 auto; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 3px; background: transparent; font-size: 27px; line-height: 1; }
.close-button:hover { background: #f3f3f3; }
.stop-status { margin: 7px 0 0; color: #666; font-size: 14px; }
.report-types { display: grid; gap: 2px; margin: 18px 0; padding: 0; border: 0; min-width: 0; }
.report-type { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px; border-radius: 4px; cursor: pointer; font-size: 15px; }
.report-type:hover { background: #f7f7f7; }
.report-type:has(input:checked) { background: #f0f0f0; }
.report-type input { width: 17px; height: 17px; margin: 0; flex: 0 0 auto; accent-color: #333; }
.field-group { margin-top: 16px; }
.field-group label { display: block; margin-bottom: 6px; font-size: 14px; }
.field-group select { width: 100%; min-width: 0; min-height: 44px; padding: 8px; border: 1px solid #aaa; border-radius: 4px; color: #222; background: #fff; font-size: 16px; }
.field-help { margin: 8px 0 0; color: #666; font-size: 14px; }
.dialog-footer { margin-top: 20px; }
.dialog-footer p { margin: 0 0 12px; color: #666; font-size: 13px; }
.submit-report { width: 100%; min-height: 44px; padding: 10px 16px; border: 1px solid #222; border-radius: 4px; color: white; background: #333; }
.submit-report:hover { background: #222; }
.form-error { margin: 12px 0 0; color: #b0271c; font-size: 14px; }
.toast { position: fixed; z-index: 4; top: max(76px, calc(env(safe-area-inset-top) + 60px)); left: 50%; max-width: calc(100% - 32px); transform: translateX(-50%); padding: 10px 14px; border: 1px solid #ccc; border-radius: 4px; color: #222; background: #fff; font-size: 14px; box-shadow: 0 2px 8px #0002; opacity: 0; pointer-events: none; }
.toast.visible { opacity: 1; }
.toast.error { color: #b0271c; }

/* Фиксированный белый фон для карты и элементов интерфейса */
html, body, .map-viewport {
  background: #ffffff !important;
  color: #222222;
}


