:root {
  color-scheme: dark;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #080d16;
  color: #e8edf5;
}

* {
  box-sizing: border-box;
}

body.legal-page {
  min-height: 100vh;
  margin: 0;
  background: #080d16;
  color: #d8e0eb;
  line-height: 1.65;
}

.legal-header,
.legal-main,
.legal-footer {
  width: min(820px, calc(100% - 40px));
  margin: 0 auto;
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  border-bottom: 1px solid #243044;
}

.legal-brand {
  color: #f5f8fc;
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
}

.legal-nav a,
.legal-footer a,
.legal-main a,
.map-legal-links a,
.map-legal-links button {
  color: #7dd3fc;
}

.legal-nav a,
.legal-footer a {
  font-size: 14px;
  text-decoration: none;
}

.legal-main {
  padding: 64px 0 72px;
}

.legal-main h1 {
  max-width: 720px;
  margin: 0 0 10px;
  color: #f7f9fc;
  font-size: clamp(32px, 6vw, 50px);
  line-height: 1.1;
  letter-spacing: 0;
}

.legal-updated {
  margin: 0 0 42px;
  color: #8290a4;
  font-size: 14px;
}

.legal-lead {
  margin: 0 0 42px;
  color: #b8c4d4;
  font-size: 19px;
}

.legal-main section {
  padding: 26px 0;
  border-top: 1px solid #1d293b;
}

.legal-main h2 {
  margin: 0 0 12px;
  color: #f1f5f9;
  font-size: 20px;
}

.legal-main h3 {
  margin: 20px 0 8px;
  color: #e8edf5;
  font-size: 16px;
}

.legal-main p,
.legal-main ul {
  margin: 0 0 14px;
}

.legal-main ul {
  padding-left: 22px;
}

.legal-table-wrap {
  overflow-x: auto;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.legal-table th,
.legal-table td {
  padding: 13px 12px;
  border-bottom: 1px solid #243044;
  text-align: left;
  vertical-align: top;
}

.legal-table th {
  color: #f1f5f9;
  font-weight: 700;
}

.legal-note {
  padding: 16px 18px;
  border: 1px solid #334155;
  border-radius: 6px;
  background: #0d1523;
  color: #cbd5e1;
}

.legal-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #40506a;
  border-radius: 6px;
  background: #111b2b;
  color: #eef4fb;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.legal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  padding: 24px 0 36px;
  border-top: 1px solid #243044;
  color: #8290a4;
  font-size: 13px;
}

.cookie-consent {
  position: fixed;
  z-index: 100000;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(920px, calc(100% - 36px));
  margin-left: auto;
  padding: 18px 20px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0a1220;
  box-shadow: 0 18px 44px rgb(0 0 0 / 45%);
  color: #dce5ef;
}

.cookie-consent[hidden] {
  display: none;
}

.cookie-consent-copy {
  max-width: 620px;
}

.cookie-consent-copy strong {
  display: block;
  margin-bottom: 4px;
  color: #f8fafc;
  font-size: 16px;
}

.cookie-consent-copy p {
  margin: 0 0 5px;
  font-size: 14px;
  line-height: 1.45;
}

.cookie-consent-copy a {
  color: #7dd3fc;
  font-size: 13px;
}

.cookie-consent-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.cookie-consent-actions button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid #40506a;
  border-radius: 6px;
  background: #111b2b;
  color: #eef4fb;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.cookie-consent-actions button.primary {
  border-color: #38bdf8;
  background: #0c7faa;
  color: #fff;
}

.map-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 6px;
}

body.argus-ui:not(.admin-page) .shell {
  grid-template-columns: minmax(0, 1fr) !important;
}

body.argus-ui:not(.admin-page) .map-wrap {
  grid-column: 1;
  width: 100%;
  min-width: 0;
  height: 100vh;
  min-height: 100vh;
}

body.argus-ui:not(.admin-page) #map {
  height: 100vh;
  min-height: 100vh;
}

body.argus-ui:not(.admin-page) .map-disclaimer {
  z-index: 1200;
  pointer-events: auto;
}

body.argus-ui .map-filters .filter-disclaimer {
  position: static;
  inset: auto;
  display: none;
  width: 100%;
  max-width: none;
  margin: 0 0 4px;
  padding: 10px 11px;
  border-color: #263449;
  background: #111b2a;
  box-shadow: none;
  backdrop-filter: none;
  color: #cbd5e1;
  font-size: 11px;
  line-height: 1.45;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

body.argus-ui:not(.admin-page) .map-legal-links {
  position: relative;
  z-index: 1;
}

.map-legal-links a,
.map-legal-links button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 11px;
  text-decoration: none;
  cursor: pointer;
}

@media (min-width: 861px) {
  body.argus-ui .map-filters:not(.is-collapsed) .filter-disclaimer {
    display: block;
  }
}

@media (max-width: 860px) {
  html.public-map-page,
  html.public-map-page body.public-readonly,
  html.admin-map-page,
  html.admin-map-page body.admin-page.admin-mode {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  html.public-map-page body.public-readonly {
    position: fixed;
    inset: 0;
    min-height: 0;
    height: 100dvh;
    max-height: 100dvh;
  }

  html.admin-map-page body.admin-page.admin-mode {
    position: fixed;
    inset: 0;
    min-height: 0;
    height: 100dvh;
    max-height: 100dvh;
  }

  html.public-map-page body.public-readonly .shell,
  html.public-map-page body.public-readonly .map-wrap,
  html.public-map-page body.public-readonly #map,
  html.admin-map-page body.admin-page.admin-mode .shell,
  html.admin-map-page body.admin-page.admin-mode .map-wrap,
  html.admin-map-page body.admin-page.admin-mode #map {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  body.argus-ui .map-filters.is-open .filter-disclaimer {
    display: block;
  }

  body.argus-ui .telegram-channel-link {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }

  body.argus-ui .leaflet-bottom.leaflet-right {
    bottom: 4px;
  }
}

@media (max-width: 700px) {
  body.argus-ui.heatmap-panel-open .map-disclaimer {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  body.argus-ui:not(.admin-page) .map-wrap,
  body.argus-ui:not(.admin-page) #map {
    height: 100dvh;
    min-height: 100dvh;
  }

  .legal-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 0;
  }

  .legal-nav {
    justify-content: flex-start;
  }

  .legal-main {
    padding: 42px 0 56px;
  }

  .cookie-consent {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    bottom: 10px;
    padding: 16px;
  }

  .cookie-consent-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .map-legal-links {
    margin-top: 4px;
  }
}

@media (max-width: 430px) {
  .cookie-consent-actions {
    grid-template-columns: 1fr;
  }
}
