/* Shared scene surfaces. Product-specific content lives in advanced disclosures. */
.scene-layer-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
  background: #191f26;
}
.scene-layer-toolbar input {
  width: 100%;
  min-width: 0;
}
.scene-layer-toolbar select {
  flex: 1;
  min-width: 0;
}
.scene-layer-toolbar :is(input, select, button),
.scene-category-actions button {
  min-height: 36px;
  font: inherit;
}
.scene-category {
  border-top: 1px solid #435160;
}
.scene-category > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  cursor: pointer;
  font-weight: 600;
}
.scene-category > summary input {
  width: 20px;
  height: 20px;
  margin: 4px;
}
.scene-category-count {
  margin-left: auto;
  max-width: 45%;
  font-size: 12px;
  color: #d0dae5;
  text-align: right;
}
.scene-category-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0;
}
.scene-source-row {
  border-top: 1px solid #35414b;
  padding: 4px 0;
}
.scene-source-row > summary {
  min-height: 40px;
  cursor: pointer;
}
.scene-source-row > summary label {
  margin: 0;
}
.scene-source-row :is(.overlay-help, .suite-info) {
  font-size: 13px;
  line-height: 1.5;
}
.scene-display-settings,
.scene-radar-controls {
  padding: 12px 0;
  border-top: 1px solid #435160;
}
.scene-sheet-sizes {
  display: none;
}
.scene-dock {
  position: absolute;
  bottom: 24px;
  left: 12px;
  z-index: 640;
  background: #172029f5;
  border: 1px solid #687785;
  color: #e0e8f2;
  border-radius: 4px;
  max-width: min(380px, calc(100% - 88px));
  font-size: 13px;
}
.scene-dock > summary {
  cursor: pointer;
  min-height: 36px;
  padding: 8px;
}
.scene-dock-body {
  max-height: min(42vh, 320px);
  overflow: auto;
  padding: 8px;
}
.scene-dock-body
  > :is(
    #temperature-summary,
    #forecast-summary,
    #suite-summary,
    #suite-map-legend,
    #weather-legend,
    .legend
  ) {
  position: static !important;
  width: auto;
  max-width: none;
  margin: 0 0 8px;
  font-size: 12px;
  white-space: pre-line;
}
.scene-dock-body .legend {
  visibility: visible;
}
.analysis-mode .scene-dock-body .legend {
  display: none;
}
.scene-dock-body .suite-map-legend {
  font-size: 12px;
}
.scene-source-row[hidden],
.scene-category[hidden],
.scene-imagery-slot[hidden],
label[hidden] {
  display: none !important;
}
.scene-category-actions button[aria-pressed="true"] {
  border-color: #a8d5ff;
  background: #334a60;
}
@media (min-width: 1100px) {
  .map-region:has(#layers-panel:not([hidden])) {
    padding-right: 370px;
  }
  #layers-panel {
    width: 350px;
    max-height: calc(100% - 24px);
  }
}
@media (max-width: 680px) {
  #layers-panel {
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-width: none;
    border-radius: 12px 12px 0 0;
  }
  #layers-panel[data-sheet="half"] {
    height: min(46%, 390px);
    max-height: 46%;
  }
  #layers-panel[data-sheet="full"] {
    height: calc(100% - 48px);
    max-height: calc(100% - 48px);
  }
  #layers-panel[data-sheet="collapsed"] {
    height: 146px;
    max-height: 146px;
  }
  .scene-sheet-sizes {
    display: flex;
    gap: 6px;
    width: 100%;
  }
  .scene-sheet-sizes button {
    flex: 1;
  }
  .scene-layer-toolbar :is(input, select, button) {
    min-height: 40px;
  }
  .history-active .playback-row {
    display: flex;
    flex-wrap: wrap;
    height: auto;
    min-height: 88px;
    padding-right: 0;
  }
  .history-active #timeline-options,
  .history-active #go-live {
    position: relative;
    right: auto;
    bottom: auto;
    order: 1;
  }
  #timeline-options > summary {
    font-size: 0;
  }
  #timeline-options > summary::after {
    content: "Options";
    font-size: 12px;
  }
  .history-active .timeline {
    order: 3;
    flex: 1 0 100%;
    padding: 0 4px;
  }
  .history-active .timeline input {
    width: 100%;
  }
  .history-active .transport {
    flex: 1;
  }
  .scene-dock {
    max-width: calc(100% - 150px);
    bottom: 24px;
  }
}
@media (max-height: 500px) {
  .scene-dock {
    left: 8px;
    bottom: 22px;
    max-width: 270px;
    font-size: 12px;
  }
  .scene-dock-body {
    max-height: 130px;
  }
  .scene-dock > summary {
    min-height: 28px;
    padding: 5px;
  }
  #layers-panel {
    top: 0;
    bottom: 0;
    right: 0;
    left: auto;
    height: 100%;
    max-height: 100%;
    width: min(350px, 48vw);
  }
  .leaflet-control-zoom {
    display: flex;
  }
  .leaflet-control-zoom a {
    width: 44px !important;
    height: 44px !important;
    line-height: 44px !important;
  }
  #recenter,
  #fullscreen {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }
  #recenter {
    top: 50px;
    right: 58px;
  }
  #fullscreen {
    top: 50px;
    right: 8px;
  }
  .history-active .playback-row {
    min-height: 44px;
    flex-wrap: nowrap;
  }
  .history-active .timeline {
    flex: 1;
    order: 0;
  }
  #controls .scan-row {
    min-height: 28px;
  }
  #timeline-options > summary {
    font-size: 0;
  }
  #timeline-options > summary::after {
    content: "Options";
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .weather-callout,
  .workspace-panel {
    transition: none !important;
  }
}

@media (min-width: 1100px) {
  .map-region:has(#layers-panel:not([hidden])) #map {
    width: calc(100% - 370px);
  }
  .map-region:has(#layers-panel:not([hidden])) :is(#recenter, #fullscreen) {
    right: 382px;
  }
}

.scene-results {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 670;
  width: min(360px, calc(100% - 24px));
  background: #191f26;
  color: #e5edf5;
  border: 1px solid #718192;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.scene-results[hidden] {
  display: none;
}
.scene-results .panel-heading {
  flex-shrink: 0;
}
.scene-results :is(input, select, button) {
  min-height: 36px;
  min-width: 0;
  font: inherit;
}
.scene-result-list {
  overflow: auto;
  flex: 1;
  min-height: 70px;
  outline-offset: 2px;
}
.scene-result-option {
  padding: 8px;
  border-bottom: 1px solid #435160;
  cursor: pointer;
}
.scene-result-option strong,
.scene-result-option span {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.scene-result-option span {
  color: #bfcddd;
}
.scene-result-option[aria-selected="true"] {
  background: #2d4963;
  outline: 2px solid #b6dfff;
  outline-offset: -2px;
}
@media (max-width: 680px) {
  .scene-results {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 48%;
    border-radius: 12px 12px 0 0;
  }
  .scene-results :is(input, select, button) {
    min-height: 40px;
  }
}
@media (max-height: 500px) {
  .scene-results {
    top: 0;
    bottom: 0;
    right: 0;
    left: auto;
    max-height: 100%;
    width: min(350px, 48vw);
  }
}

/* Long details remain non-modal; the selected map feature stays visible. */
.map-region > .scene-details-drawer {
  left: auto !important;
  right: 8px !important;
  top: 8px !important;
  bottom: auto !important;
  transform: none !important;
  margin: 0 !important;
  max-width: calc(100% - 16px);
  pointer-events: none;
}
.scene-details-drawer .leaflet-popup-content-wrapper,
.scene-details-drawer .leaflet-popup-close-button {
  pointer-events: auto;
}
.weather-callout .point-chooser select,
.weather-callout .point-full-details,
.weather-callout .inspect-all-here {
  min-height: 32px;
}
.weather-callout .point-chooser {
  margin-bottom: 4px;
}
@media (max-width: 600px) {
  .map-region > .scene-details-drawer {
    top: auto !important;
    bottom: 8px !important;
    left: 8px !important;
    right: 8px !important;
  }
  .scene-mobile-callout .weather-popup > p:nth-of-type(n + 2) {
    display: none;
  }
  .scene-mobile-callout .point-extra {
    display: none;
  }
  .scene-mobile-callout .point-full-details,
  .scene-mobile-callout .inspect-all-here {
    font-size: 12px;
    min-height: 36px;
  }
}

#settings[open] {
  position: fixed;
  inset: 64px 8px auto auto;
  margin: 0;
  width: min(350px, calc(100vw - 16px));
  max-height: calc(100dvh - 80px);
  overflow: auto;
  z-index: 1200;
}
@media (max-width: 600px) {
  #settings[open] {
    top: auto;
    bottom: 8px;
    max-height: 60dvh;
  }
}

.scene-navigation {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font:
    12px/1.5 Arial,
    sans-serif;
  z-index: 800;
}
.scene-navigation .leaflet-control {
  pointer-events: auto;
}
.scene-navigation .leaflet-control-attribution {
  background: rgba(20, 28, 35, 0.9);
  color: #ccd6de;
}
.scene-navigation .leaflet-control-attribution a {
  color: #d7e5ee;
}
.scene-navigation .leaflet-control-scale-line {
  color: #e5edf4;
  background: #192129;
  border-color: #d7e5ee;
  text-shadow: none;
}

.scene-sheet-handle {
  display: none;
}
.scene-details-drawer .leaflet-popup-content-wrapper {
  resize: both;
  overflow: auto;
  min-width: 240px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 130px);
}
.scene-pinned {
  position: absolute;
  left: 8px;
  bottom: 64px;
  z-index: 1001;
  width: min(350px, calc(100% - 16px));
  border: 1px solid #718497;
  border-radius: 6px;
  background: #192129;
  color: #edf3fa;
  box-shadow: 0 2px 8px #0008;
}
.scene-pinned > summary {
  padding: 10px;
  cursor: pointer;
  font-size: 13px;
}
.scene-pinned-body {
  padding: 10px;
  max-height: 32dvh;
  overflow: auto;
  font-size: 13px;
}
.scene-pinned button {
  min-height: 32px;
  margin: 4px;
}
@media (max-width: 680px) {
  .scene-sheet-handle {
    display: block;
    width: 100%;
    min-height: 28px;
    touch-action: none;
    font-size: 11px;
    padding: 2px;
  }
}
/* Navigation stays over the map; inspection surfaces stay above navigation. */
.scene-results,
#layers-panel {
  z-index: 1002;
}
@media (min-width: 1100px) {
  #layers-panel {
    left: auto;
    right: 8px;
  }
  .map-region:has(#layers-panel:not([hidden])) .scene-navigation {
    right: 370px;
  }
}

#layers-panel > .panel-heading {
  top: -12px;
  z-index: 4;
  min-height: 48px;
}
.scene-layer-toolbar {
  top: 36px;
  z-index: 3;
}

/* Short screens scroll the whole inspector when its controls exceed the map. */
.scene-results {
  overflow: auto;
  overscroll-behavior: contain;
}
.scene-results > :not(.scene-result-list) {
  flex-shrink: 0;
}
/* Grid tracks and sheet controls must shrink at 320px / enlarged text. */
.app-shell {
  grid-template-columns: minmax(0, 1fr);
}
.app-shell > * {
  min-width: 0;
}
.scene-sheet-sizes button,
.scene-layer-toolbar > *,
.panel-heading h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}
.scene-category > summary {
  flex-wrap: wrap;
}
@media (max-width: 680px) {
  #layers-panel {
    width: calc(100% - 16px);
    max-width: calc(100% - 16px);
  }
  .history-active .scan-row {
    height: auto;
    min-height: 32px;
    flex-wrap: wrap;
  }
  .feed-status,
  .scan-time {
    min-width: 0;
  }
}
@media (max-width: 680px) {
  .feed-status {
    flex: 1 0 50%;
    max-width: none;
  }
  .scan-time {
    flex: 1 1 auto;
    max-width: 100%;
  }
  /* The close heading stays pinned; oversized text must not pin a whole toolbar. */
  .scene-layer-toolbar {
    position: relative;
    top: auto;
  }
}

.scene-navigation .leaflet-control-scale {
  margin-bottom: 36px;
}
