html, body {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  --platform-footer-height: calc(24px + env(safe-area-inset-bottom, 0px));
  background: #f5f7fa;
}

@media (prefers-color-scheme: dark) {
  body {
    background: #171b20;
  }
}

.root {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

@media (max-width: 899.95px) {
  .agromash-map-view .maplibregl-ctrl-top-right .maplibregl-ctrl-group > button,
  .agromash-map-view .maplibregl-ctrl-top-left .maplibregl-ctrl-group > button {
    width: 40px;
    height: 40px;
    box-sizing: border-box;
  }
}

.platform-footer {
  flex: 0 0 var(--platform-footer-height);
  box-sizing: border-box;
  padding: 2px 8px calc(2px + env(safe-area-inset-bottom, 0px));
  font: 11px/20px Arial, sans-serif;
  letter-spacing: 0;
  text-align: center;
  color: #526072;
  background: #f5f7fa;
  border-top: 1px solid #d9e0e8;
}

body:has(.agromash-map-view[data-credits-visible="true"]) {
  --platform-footer-height: 0px;
}

body:has(.agromash-map-view[data-credits-visible="true"]) > .platform-footer {
  display: none;
}

.maplibregl-ctrl.agromash-map-attribution {
  position: relative;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  height: 24px;
  padding-left: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.9);
  gap: 4px;
  max-width: none;
}

.agromash-map-attribution .agromash-developer-credit {
  flex: none;
  height: 24px;
  padding: 0;
  font: 11px/24px Arial, sans-serif;
  letter-spacing: 0;
  white-space: nowrap;
  color: #40454b;
}

.maplibregl-ctrl.agromash-map-attribution .maplibregl-ctrl-attrib {
  box-sizing: border-box;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  position: static;
  border-radius: 0;
  background: transparent;
  float: none;
  clear: none;
  margin: 0;
  min-width: 24px;
  overflow-wrap: anywhere;
}

.agromash-map-attribution .maplibregl-ctrl-attrib .maplibregl-ctrl-attrib-button {
  top: 0;
  right: 0;
  width: 24px;
  height: 24px;
  border-radius: 3px;
  background-color: transparent;
}

.agromash-map-attribution .maplibregl-ctrl-attrib-button:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

.agromash-map-attribution .maplibregl-ctrl-attrib-button:focus-visible {
  outline: 2px solid #1f2a8a;
  outline-offset: 2px;
  box-shadow: none;
}

.agromash-map-attribution .maplibregl-ctrl-attrib-button:hover {
  background-color: rgba(0, 0, 0, 0.06);
}

.agromash-map-attribution .maplibregl-ctrl-attrib-inner {
  position: absolute;
  bottom: 32px;
  right: 0;
  box-sizing: border-box;
  width: max-content;
  max-width: min(360px, calc(100vw - 40px));
  max-height: 40vh;
  overflow: auto;
  padding: 8px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.maplibregl-ctrl-bottom-right:has(.agromash-map-attribution),
.maplibregl-ctrl-bottom-left:has(.agromash-map-attribution) {
  z-index: 9;
}

@media (prefers-color-scheme: dark) {
  .platform-footer { color: #b5c0ce; background: #171b20; border-color: #39434f; }
}

@media print {
  * {
    height: auto !important;
    overflow: visible !important;
  }
}

  html body,
  body:has(.agromash-map-view[data-credits-visible="true"]) {
    --platform-footer-height: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
      env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    background: var(--app-chrome-color, #ffffff);
  }
  body > .platform-footer {
    display: none;
  }
  .agromash-map-attribution .agromash-developer-credit {
    display: none;
  }
  .maplibregl-ctrl.agromash-map-attribution {
    padding-left: 0;
    gap: 0;
  }
body:has([data-main-navigation]) {
  --app-navigation-height: 56px;
}
