html,
body,
.app-shell,
#cesiumContainer {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #101820;
  color: #17202a;
  font-family: Arial, Helvetica, sans-serif;
}

.app-shell {
  position: relative;
}

.map-panel,
.tour-drawer,
.legend-panel {
  position: absolute;
  z-index: 5;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.map-panel {
  top: 16px;
  left: 16px;
  bottom: 16px;
  width: min(380px, calc(100vw - 32px));
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header,
.tour-header,
.legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(16, 24, 32, 0.12);
}

.eyebrow {
  margin: 0 0 4px;
  color: #51718d;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.icon-button,
.button {
  border: 0;
  border-radius: 6px;
  background: #113d5c;
  color: #fff;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.icon-button {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 22px;
  line-height: 36px;
}

#homeButton {
  width: auto;
  font-size: 13px;
  font-weight: 700;
}

.button {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
}

.search-field {
  display: grid;
  gap: 6px;
  padding: 14px 16px 10px;
  color: #415466;
  font-size: 13px;
  font-weight: 700;
}

.search-field input,
.search-field select,
.select-control select {
  min-width: 0;
  border: 1px solid rgba(16, 24, 32, 0.18);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

.select-control {
  display: grid;
  gap: 6px;
  padding: 0 10px 10px;
  color: #415466;
  font-size: 13px;
  font-weight: 700;
}

.compact-field {
  padding-top: 0;
}

.filters,
.layer-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.filters {
  padding: 0 16px 12px;
  font-size: 13px;
}

.layer-panel {
  margin: 0 16px 10px;
  border: 1px solid rgba(16, 24, 32, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.62);
}

.layer-panel summary {
  cursor: pointer;
  padding: 8px 10px;
  color: #263849;
  font-size: 13px;
  font-weight: 700;
}

.layer-options {
  max-height: 300px;
  overflow: auto;
  padding: 0 8px 10px;
  font-size: 13px;
}

.layer-options label {
  flex: 1 1 150px;
}

.layer-options label.overlay-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.layer-options label.overlay-option .overlay-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overlay-group {
  flex: 1 1 100%;
  border-top: 1px solid rgba(16, 24, 32, 0.08);
  padding: 5px 0;
}

.overlay-group:first-child {
  border-top: 0;
}

.overlay-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  color: #263849;
  font-weight: 700;
  padding: 5px 2px;
}

.overlay-group-list {
  display: grid;
  gap: 6px;
  padding: 4px 0 8px;
}

.overlay-control {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(16, 24, 32, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.5);
  padding: 7px 8px;
}

.overlay-control.is-active {
  border-color: rgba(31, 120, 180, 0.45);
  background: rgba(232, 244, 252, 0.78);
}

.overlay-actions {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
}

.layer-opacity-control {
  display: none;
  gap: 3px;
  padding-left: 25px;
  color: #607181;
  font-size: 11px;
}

.overlay-control.is-active .layer-opacity-control {
  display: grid;
}

.layer-opacity-control span {
  display: flex;
  justify-content: space-between;
}

.layer-opacity-control input {
  width: 100%;
}

.mini-button {
  border: 1px solid rgba(17, 61, 92, 0.24);
  border-radius: 6px;
  background: #fff;
  color: #113d5c;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  padding: 3px 8px;
}

.mini-button:hover {
  background: #e9f2f8;
}

.layer-options label.is-disabled {
  color: #8a98a6;
  cursor: not-allowed;
}

.opacity-control {
  display: grid;
  gap: 6px;
  padding: 0 10px 10px;
  color: #415466;
  font-size: 13px;
}

.opacity-control span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.layer-note {
  margin: 0;
  padding: 0 10px 10px;
  color: #607181;
  font-size: 12px;
  line-height: 1.3;
}

.stats {
  padding: 0 16px 10px;
  color: #5f6e7a;
  font-size: 13px;
}

.marker-list {
  flex: 1;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.marker-item {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 0;
  border-top: 1px solid rgba(16, 24, 32, 0.08);
  background: transparent;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
}

.marker-item:hover,
.marker-item:focus {
  background: rgba(17, 61, 92, 0.08);
  outline: none;
}

.marker-name {
  color: #17202a;
  font-size: 15px;
  font-weight: 700;
}

.marker-meta {
  color: #607181;
  font-size: 12px;
}

.tour-drawer {
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: min(780px, calc(100vw - 430px));
  min-width: 420px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tour-drawer[hidden] {
  display: none;
}

.legend-panel {
  right: 16px;
  top: 86px;
  width: min(420px, calc(100vw - 430px));
  max-height: min(680px, calc(100vh - 118px));
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.legend-panel[hidden] {
  display: none;
}

.legend-header {
  padding: 12px 14px;
}

.legend-header h2 {
  font-size: 17px;
}

#geologyLegendFrame {
  width: 100%;
  height: min(590px, calc(100vh - 210px));
  border: 0;
  background: #fff;
}

.startup-error {
  position: absolute;
  inset: 20px;
  z-index: 4;
  display: grid;
  place-content: center;
  gap: 8px;
  border-radius: 8px;
  background: #101820;
  color: #fff;
  text-align: center;
}

.startup-error strong {
  font-size: 22px;
}

.startup-error span {
  color: #c8d2dc;
}

.tour-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#tourFrame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
}

.cesium-viewer-bottom,
.cesium-credit-lightbox-overlay {
  display: none;
}

@media (max-width: 900px) {
  .map-panel {
    right: 16px;
    bottom: auto;
    max-height: 44vh;
  }

  .tour-drawer {
    top: auto;
    left: 16px;
    right: 16px;
    width: auto;
    min-width: 0;
    height: 52vh;
  }
}
