@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@300;400;600;700&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --ink: #1f2428;
  --paper: #f7f4ef;
  --line: rgba(255, 255, 255, 0.24);
  --bronze: #b87e58;
  --bronze-soft: rgba(184, 126, 88, 0.22);
  --panel: rgba(31, 36, 40, 0.82);
  --panel-strong: rgba(31, 36, 40, 0.94);
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  --font: 'Assistant', Arial, sans-serif;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  min-height: 100%;
  overflow: hidden;
  direction: rtl;
  font-family: var(--font);
  color: var(--paper);
  background: #121619;
}

button,
input {
  font: inherit;
}

.app-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 5;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  background: linear-gradient(180deg, rgba(15, 18, 20, 0.88), rgba(15, 18, 20, 0.52) 72%, rgba(15, 18, 20, 0));
  pointer-events: none;
}

.brand,
.header-actions {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.header-actions a,
.header-link {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 15px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 23, 25, 0.42);
  backdrop-filter: blur(10px);
}

.header-link {
  cursor: pointer;
}

.header-actions a:hover,
.header-link:hover {
  background: rgba(184, 126, 88, 0.76);
}

.viewer-shell,
#map {
  position: fixed;
  inset: 0;
}

#map {
  background: #121619;
}

.control-strip {
  position: fixed;
  right: 18px;
  left: 18px;
  bottom: 18px;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  pointer-events: none;
}

.search-box,
.toggle-group,
.status-line {
  pointer-events: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(130%);
}

.search-box {
  width: min(420px, 58vw);
  height: 48px;
  display: grid;
  grid-template-columns: 1fr 62px;
  overflow: hidden;
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  padding: 0 16px;
  font-size: 16px;
}

.search-box input::placeholder {
  color: rgba(255, 255, 255, 0.64);
}

.search-box button,
.toggle {
  border: 0;
  color: #fff;
  background: transparent;
  cursor: pointer;
}

.search-box button {
  border-right: 1px solid var(--line);
  font-size: 15px;
  font-weight: 700;
}

.toggle-group {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(62px, auto);
  height: 48px;
  overflow: hidden;
}

.toggle {
  height: 48px;
  min-width: 62px;
  padding: 0 12px;
  border-left: 1px solid var(--line);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.toggle:first-child {
  border-left: 0;
}

.toggle:hover,
.search-box button:hover,
.toggle.is-on {
  background: rgba(184, 126, 88, 0.88);
}

.toggle[data-layer-toggle='labels'] {
  font-weight: 700;
}

.status-line {
  position: fixed;
  right: 18px;
  bottom: 78px;
  z-index: 4;
  min-height: 34px;
  max-width: min(420px, calc(100vw - 36px));
  display: flex;
  align-items: center;
  padding: 6px 12px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.status-line.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.maplibregl-ctrl-top-left,
.maplibregl-ctrl-top-right {
  top: 78px;
}

.maplibregl-ctrl-group {
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 26px rgba(15, 18, 20, 0.18);
}

.maplibregl-ctrl button {
  width: 34px;
  height: 34px;
}

.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right {
  bottom: 18px;
}

.maplibregl-ctrl-bottom-left {
  left: 18px;
}

.maplibregl-ctrl-bottom-right {
  right: 18px;
}

.maplibregl-ctrl-attrib {
  direction: ltr;
  margin: 0 0 10px 0;
  max-width: min(360px, calc(100vw - 36px));
  padding: 8px 10px;
  border-radius: 14px;
  color: rgba(31, 36, 40, 0.92);
  background: rgba(247, 244, 239, 0.94);
  border: 1px solid rgba(31, 36, 40, 0.1);
  box-shadow: 0 16px 30px rgba(15, 18, 20, 0.16);
  backdrop-filter: blur(10px);
  font-size: 12px;
  line-height: 1.45;
}

.about-modal[aria-hidden='true'] {
  display: none;
}

.about-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--ink);
}

.about-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 15, 17, 0.56);
  backdrop-filter: blur(4px);
}

.about-modal__panel {
  position: relative;
  width: min(520px, calc(100vw - 36px));
  max-height: calc(100vh - 72px);
  overflow: auto;
  padding: 24px 24px 22px;
  background: rgba(247, 244, 239, 0.98);
  border: 1px solid rgba(31, 36, 40, 0.14);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  outline: 0;
}

.about-modal__close {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(31, 36, 40, 0.14);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.56);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.about-modal__close:hover {
  background: var(--bronze-soft);
}

.about-modal h1 {
  margin: 0 0 12px;
  padding-left: 38px;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0;
}

.about-modal h2 {
  margin: 18px 0 10px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

.about-modal p {
  margin: 0 0 10px;
  color: rgba(31, 36, 40, 0.86);
  font-size: 16px;
  line-height: 1.62;
}

.about-modal p:last-child {
  margin-bottom: 0;
}

.about-faq {
  margin: 0;
}

.about-faq dt {
  margin: 12px 0 4px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.about-faq dd {
  margin: 0;
  color: rgba(31, 36, 40, 0.78);
  font-size: 15px;
  line-height: 1.5;
}

.about-modal__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.about-modal__links a {
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 12px;
  background: rgba(184, 126, 88, 0.92);
}

.about-modal__links a:hover {
  background: rgba(142, 92, 51, 0.96);
}

.maplibregl-ctrl-attrib a {
  color: #8e5c33;
}

.maplibregl-ctrl-attrib summary {
  cursor: pointer;
}

.maplibregl-ctrl-scale {
  margin: 0 0 10px 0;
  padding: 4px 8px;
  color: rgba(31, 36, 40, 0.92);
  background: rgba(247, 244, 239, 0.94);
  border: 1px solid rgba(31, 36, 40, 0.14);
  box-shadow: 0 12px 22px rgba(15, 18, 20, 0.14);
}

.maplibregl-ctrl-logo {
  opacity: 0.88;
}

.maplibregl-ctrl-attrib.maplibregl-compact {
  padding-inline-end: 30px;
}

@media (max-width: 720px) {
  .app-header {
    height: 58px;
    padding: 0 14px;
  }

  .brand span {
    font-size: 18px;
  }

  .brand img {
    width: 36px;
    height: 36px;
  }

  .header-actions a {
    font-size: 14px;
    padding: 7px 8px;
  }

  .control-strip {
    right: 10px;
    left: 10px;
    bottom: 10px;
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .search-box {
    width: 100%;
  }

  .toggle-group {
    justify-self: end;
    grid-auto-columns: minmax(58px, auto);
    max-width: 100%;
  }

  .toggle {
    min-width: 58px;
    padding: 0 9px;
    font-size: 14px;
  }

  .status-line {
    right: 10px;
    bottom: 116px;
  }

  .maplibregl-ctrl-bottom-left,
  .maplibregl-ctrl-bottom-right {
    bottom: 126px;
  }

  .maplibregl-ctrl-bottom-left {
    left: 10px;
  }

  .maplibregl-ctrl-bottom-right {
    right: 10px;
  }

  .maplibregl-ctrl-attrib {
    max-width: min(300px, calc(100vw - 20px));
    font-size: 11px;
  }

}
