/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Matches the light basemap land; overridden per data-theme below. */
  background: #f4f1ea;
}

/* No-flash backgrounds: applied by the head script before first paint, and
   shown under the map container until tiles render. */
:root[data-theme="dark"] body,
:root[data-theme="dark"] #map {
  background: #16181d;
}

:root[data-theme="light"] body,
:root[data-theme="light"] #map {
  background: #f4f1ea;
}

#map {
  position: absolute;
  inset: 0;
  background: #f4f1ea;
}

.theme-toggle {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 10;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.92);
  color: #f59e0b; /* sun amber */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease;
}

.theme-toggle:hover {
  background: #fff;
}

:root[data-theme="dark"] .theme-toggle {
  background: rgba(40, 42, 48, 0.92);
  color: #e2e8f0; /* moonlight */
}

:root[data-theme="dark"] .theme-toggle:hover {
  background: #2c2e33;
}

/* Animated sun <-> moon (adapted from web.dev's theme-toggle). */
.sun-and-moon > :is(.moon, .sun, .sun-beams) {
  transform-origin: center;
}

.sun-and-moon > .sun {
  transition: transform 0.5s cubic-bezier(0.5, 1.25, 0.75, 1.25);
}

.sun-and-moon > .sun-beams {
  stroke-width: 2px;
  stroke-linecap: round;
  transition: transform 0.5s cubic-bezier(0.5, 1.5, 0.75, 1.25), opacity 0.5s ease;
}

.sun-and-moon .moon > circle {
  transition: transform 0.25s cubic-bezier(0, 0, 0, 1);
}

@supports (cx: 1) {
  .sun-and-moon .moon > circle {
    transition: cx 0.25s cubic-bezier(0, 0, 0, 1);
  }
}

:root[data-theme="dark"] .sun-and-moon > .sun {
  transform: scale(1.75);
  transition-timing-function: cubic-bezier(0.25, 0, 0.3, 1);
  transition-duration: 0.25s;
}

:root[data-theme="dark"] .sun-and-moon > .sun-beams {
  opacity: 0;
  transform: rotateZ(-25deg);
  transition-duration: 0.15s;
}

:root[data-theme="dark"] .sun-and-moon > .moon > circle {
  transform: translateX(-7px);
  transition-delay: 0.25s;
  transition-duration: 0.5s;
}

@supports (cx: 1) {
  :root[data-theme="dark"] .sun-and-moon > .moon > circle {
    cx: 17;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sun-and-moon > :is(.moon, .sun, .sun-beams),
  .sun-and-moon .moon > circle {
    transition: none;
  }
}

.app-badge {
  position: absolute;
  margin: 0;
  top: 12px;
  left: 12px;
  z-index: 10;
  background: #0f766e;
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ---- Этап 1: filter chip + station panel ---- */

.filter-chip {
  position: absolute;
  top: 56px;
  left: 12px;
  z-index: 10;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.92);
  color: #1c1c1e;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}

.filter-chip--on {
  background: #16a34a;
  color: #fff;
}

:root[data-theme="dark"] .filter-chip {
  background: rgba(40, 42, 48, 0.92);
  color: #e2e8f0;
}

:root[data-theme="dark"] .filter-chip--on {
  background: #16a34a;
  color: #fff;
}

.panel {
  position: absolute;
  z-index: 20;
  left: 12px;
  right: 12px;
  bottom: 12px;
  max-width: 420px;
  margin-inline: auto;
  background: #fff;
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  max-height: 82vh;
  overflow: hidden;
  animation: panel-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Enabled after first measure: animates the sheet between station heights. */
.panel--anim-h {
  transition: height 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel-scroll {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

@keyframes panel-in {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.panel--closing {
  animation: panel-out 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes panel-out {
  to {
    transform: translateY(24px);
    opacity: 0;
  }
}

:root[data-theme="dark"] .panel {
  background: #1f2126;
  color: #e8eaed;
}

.panel-body {
  padding: 16px 18px 18px;
  animation: content-in 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Station switch slides the new content in from the right (clipped by the
   panel's overflow-x: hidden). */
@keyframes content-in {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.panel-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  cursor: pointer;
  color: #374151;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

:root[data-theme="dark"] .panel-close {
  background: rgba(20, 22, 26, 0.7);
  color: #e2e8f0;
}

@media (prefers-reduced-motion: reduce) {
  .panel,
  .panel-body {
    animation: none;
  }
  .panel--anim-h {
    transition: none;
  }
}

.panel-title {
  margin: 0 28px 4px 0;
  font-size: 19px;
}

.panel-muted {
  color: #6b7280;
  font-size: 13px;
  margin: 2px 0;
}

:root[data-theme="dark"] .panel-muted {
  color: #9aa3af;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 8px;
}

.status-badge {
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 8px;
}

.confidence {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.confidence-bar {
  flex: 1 1;
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  overflow: hidden;
}

:root[data-theme="dark"] .confidence-bar {
  background: #34373d;
}

.confidence-fill {
  height: 100%;
}

.report-buttons {
  display: flex;
  gap: 8px;
  margin: 6px 0 10px;
}

.report-btn {
  flex: 1 1;
  padding: 12px 8px;
  border: 2px solid;
  border-radius: 12px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: inherit;
}

.report-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.route-btn {
  display: block;
  text-align: center;
  padding: 11px;
  border-radius: 12px;
  background: #0f766e;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.panel-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: #b45309;
}

.feed {
  margin-top: 16px;
  border-top: 1px solid #eee;
  padding-top: 12px;
}

:root[data-theme="dark"] .feed {
  border-top-color: #34373d;
}

.feed-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px;
  color: #6b7280;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 4px 0;
}

.feed-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.feed-item .panel-muted {
  margin-left: auto;
}

/* ---- Этап 2: confirm/deny, unverified tag, add-station, contribution ---- */

.panel-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-right: 28px;
}

.panel-title-row .panel-title {
  margin: 0 0 4px 0;
}

/* Brand logo chip — white background so transparent logos read on both themes. */
.brand-logo {
  width: 40px;
  height: 40px;
  flex: none;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Generic fuel-pump chip for unbranded "АЗС" stations. */
.brand-logo--generic {
  display: grid;
  place-items: center;
  padding: 7px;
  color: #0f766e;
  background: #e9f3f1;
}

:root[data-theme="dark"] .brand-logo--generic {
  color: #5ec8b8;
  background: #1a2a28;
}

.unverified-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
  white-space: nowrap;
}

:root[data-theme="dark"] .unverified-tag {
  background: #3a2f17;
  color: #f0c674;
}

.confirm-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0 12px;
}

.confirm-buttons {
  display: flex;
  gap: 8px;
}

.confirm-btn {
  flex: 1 1;
  padding: 9px 8px;
  border: 1px solid;
  border-radius: 10px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: inherit;
}

.confirm-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.confirm-btn--yes {
  border-color: #16a34a;
  color: #16a34a;
}

.confirm-btn--no {
  border-color: #dc2626;
  color: #dc2626;
}

:root[data-theme="dark"] .confirm-btn--yes {
  color: #4ade80;
}

:root[data-theme="dark"] .confirm-btn--no {
  color: #f87171;
}

.contrib-chip {
  margin: 14px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #0f766e;
}

:root[data-theme="dark"] .contrib-chip {
  color: #5eead4;
}

/* Floating "add station" button. */
.add-fab {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 15;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  background: #0f766e;
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease, transform 0.15s ease;
}

.add-fab:hover {
  background: #115e57;
}

.add-fab--on {
  background: #dc2626;
  font-size: 20px;
}

.add-fab--on:hover {
  background: #b91c1c;
}

.add-hint {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  background: #0f766e;
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

/* Add-station form reuses .panel; these style the inputs/actions. */
.add-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  margin: 10px 0 4px;
}

:root[data-theme="dark"] .add-label {
  color: #9aa3af;
}

.add-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  color: #1c1c1e;
}

.add-input:focus {
  outline: none;
  border-color: #0f766e;
}

:root[data-theme="dark"] .add-input {
  background: #16181d;
  border-color: #3a3e45;
  color: #e8eaed;
}

.add-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.add-btn {
  flex: 1 1;
  padding: 12px 8px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.add-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.add-btn--cancel {
  background: #e5e7eb;
  color: #374151;
}

:root[data-theme="dark"] .add-btn--cancel {
  background: #34373d;
  color: #e2e8f0;
}

.add-btn--submit {
  background: #0f766e;
  color: #fff;
}

/* ---- Geolocation onboarding sheet ---- */

.geo-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.35);
  animation: geo-fade 0.2s ease;
}

@keyframes geo-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.geo-sheet {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 22px 20px 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  animation: panel-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="dark"] .geo-sheet {
  background: #1f2126;
  color: #e8eaed;
}

.geo-title {
  margin: 0 0 8px;
  font-size: 22px;
}

.geo-text {
  margin: 0 0 16px;
  color: #4b5563;
  font-size: 15px;
  line-height: 1.4;
}

:root[data-theme="dark"] .geo-text {
  color: #9aa3af;
}

.geo-note {
  margin: -6px 0 14px;
  font-size: 13px;
  color: #b45309;
}

.geo-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.geo-primary {
  border: none;
  border-radius: 12px;
  padding: 14px;
  background: #0f766e;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.geo-primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.geo-skip {
  border: none;
  background: transparent;
  padding: 10px;
  color: #6b7280;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

:root[data-theme="dark"] .geo-skip {
  color: #9aa3af;
}

@media (prefers-reduced-motion: reduce) {
  .geo-overlay,
  .geo-sheet {
    animation: none;
  }
}

/* ---- MapLibre controls restyled to the app look ---- */

.maplibregl-ctrl-top-right {
  top: 8px;
  right: 8px;
}

.maplibregl-ctrl.maplibregl-ctrl-group {
  border: none;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}

.maplibregl-ctrl.maplibregl-ctrl-group button {
  width: 40px;
  height: 40px;
  background-color: transparent;
}

.maplibregl-ctrl.maplibregl-ctrl-group button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.maplibregl-ctrl.maplibregl-ctrl-group button + button {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

:root[data-theme="dark"] .maplibregl-ctrl.maplibregl-ctrl-group {
  background: rgba(40, 42, 48, 0.92);
}

:root[data-theme="dark"] .maplibregl-ctrl.maplibregl-ctrl-group button + button {
  border-top-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .maplibregl-ctrl.maplibregl-ctrl-group button:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

/* Default control icons are dark; invert them for the dark theme (the active /
   waiting geolocate icon keeps its blue accent). */
:root[data-theme="dark"]
  .maplibregl-ctrl-group
  button:not(.maplibregl-ctrl-geolocate-active):not(.maplibregl-ctrl-geolocate-waiting)
  .maplibregl-ctrl-icon {
  filter: invert(1);
}

