#reef-viewer-host {
  display: flex;
  position: relative;
  height: 100%;
  min-height: 0;
  gap: 3px;
  background: #24404f;
}
.reef-initial-loading {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: #0d1c27;
  color: #e8f1f5;
  text-align: center;
}
.reef-initial-loading span { color: #b1c5d0; font-size: 13px; }
#reef-viewer-host > arcgis-scene {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  container-type: inline-size;
  container-name: reef-pane;
  --calcite-color-brand: #2ec4b6;
  --calcite-color-brand-hover: #25afa3;
  --calcite-color-brand-press: #1c938a;
}
.reef-card, .reef-measure {
  box-sizing: border-box;
  background: rgba(13, 28, 39, .94);
  border: 1px solid rgba(181, 211, 224, .18);
  border-radius: 14px;
  color: #e8f1f5;
  padding: 16px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .28);
  backdrop-filter: blur(18px);
}
.reef-card {
  width: min(500px, calc(100cqw - 32px));
  display: grid;
  gap: 12px;
  background: rgba(13, 28, 39, .94);
}
.reef-mobile-summary { display: none; }
.reef-collapse { margin-inline-start: -6px; }
.reef-card.reef-card-collapsed { gap: 0; }
.reef-card.reef-card-collapsed > :not(.reef-card-heading):not(.reef-mobile-summary):not(.reef-status[role="alert"]) { display: none; }
.reef-card-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}
.reef-card-label { display: grid; gap: 3px; min-width: 0; }
.reef-card-plot { display: none; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reef-card-collapsed .reef-card-plot { display: block; }
.reef-sst-legend { width: 220px; max-width: calc(100cqw - 32px); max-height: 240px; overflow: auto; border: 1px solid rgba(181, 211, 224, .16); border-radius: 12px; }
.reef-collapsed-date { display: none; align-items: center; gap: 2px; margin-inline: auto; }
.reef-card-collapsed .reef-collapsed-date { display: flex; }
.reef-collapsed-date strong { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; padding-inline: 4px; }
.reef-card-collapsed .reef-position { margin-left: 0; }
.reef-card-collapsed .reef-collapse { margin-inline-start: 0; }
.reef-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #b1c5d0;
}
.reef-position {
  margin-left: auto;
  color: #c1d5dd;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  background: rgba(165, 205, 217, .1);
  border-radius: 999px;
  padding: 3px 8px;
}
.reef-row {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}
.reef-row calcite-select, .reef-row calcite-segmented-control {
  flex: 1;
  min-width: 0;
}
.reef-row calcite-segmented-control { overflow-x: auto; scrollbar-color: #618695 #182e3b; scrollbar-width: thin; }
.reef-row calcite-segmented-control-item { white-space: nowrap; }
.reef-plot-name { flex: 1; min-width: 0; text-align: center; }
.reef-date-select { display: none; }
.reef-icon-button { flex: 0 0 auto; min-width: 36px; }
.reef-text-button { flex: 0 0 auto; }
.reef-card calcite-button { --calcite-button-corner-radius: 8px; }
.reef-footer {
  border-top: 1px solid rgba(181, 211, 224, .12);
  padding-top: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.reef-zoom-controls {
  gap: 0;
  background: rgba(165, 205, 217, .08);
  border: 1px solid rgba(181, 211, 224, .14);
  border-radius: 9px;
}
.reef-source { font-size: 12px; color: #b1c5d0; }
.reef-source a { color: #79e1d5; }
.reef-source a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.reef-playback { flex-wrap: nowrap; }
.reef-linked {
  font-size: 11px;
  color: #5dd6c9;
  margin-left: auto;
  white-space: nowrap;
}
.reef-measure {
  width: max-content;
  max-width: calc(100cqw - 32px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(13, 28, 39, .72);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
}
.reef-measure .reef-measure-types {
  --calcite-segmented-control-border-color: transparent;
  border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .05);
}
.reef-measure calcite-segmented-control-item {
  border-radius: 999px; overflow: hidden;
  --calcite-segmented-control-background-color: transparent;
}
.reef-measure calcite-segmented-control-item[checked] { --calcite-segmented-control-background-color: var(--calcite-color-brand); }
.reef-measure arcgis-direct-line-measurement-3d, .reef-measure arcgis-area-measurement-3d {
  --calcite-color-foreground-1: transparent; --calcite-color-text-1: rgba(225, 240, 246, .72);
  text-align: center; padding: 2px 16px 4px;
}
.reef-measure .reef-measure-types { width: 100%; }
.reef-surface-distance { display: grid; gap: 8px; }
.reef-surface-distance p { margin: 0; font-size: 12px; line-height: 1.4; }
.reef-distance-results { display: grid; gap: 5px; }
.reef-distance-results > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.reef-measure.is-measuring { width: min(340px, calc(100cqw - 32px)); padding: 8px; border-radius: 18px; background: rgba(13, 28, 39, .92); }
/* The SDK component controls drawing; its native chart and controls are replaced here. */
.reef-measure arcgis-elevation-profile {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  visibility: hidden;
}
.reef-profile-note { margin: 0; color: #b1c5d0; font-size: 11px; line-height: 1.5; }
.reef-profile-chart { background: rgba(144, 187, 204, .1); border: 1px solid rgba(181, 211, 224, .12); border-radius: 8px; padding: 8px 10px; color: #e8f1f5; }
.reef-profile-chart svg { display: block; width: 100%; height: auto; }
.reef-profile-chart text { fill: #b1c5d0; font-size: 10px; }
.reef-profile-line { fill: none; stroke: #e079de; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.reef-profile-hit { fill: transparent; cursor: crosshair; touch-action: pan-y; }
.reef-profile-cursor { pointer-events: none; }
.reef-profile-guide { stroke: rgba(232, 241, 245, .55); stroke-width: 1; stroke-dasharray: 3 3; }
.reef-profile-dot { fill: #e079de; stroke: #fff; stroke-width: 1.5; }
.reef-profile-chart .reef-profile-readout { fill: #fff; font-weight: 600; }
.reef-profile-message { margin: 0; font-size: 12px; line-height: 1.5; }
.reef-card strong { font-size: 16px; font-weight: 600; }
.reef-text-button.is-active {
  --calcite-button-border-color: #2ec4b6;
  --calcite-button-text-color: #5dd6c9;
}
.reef-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.reef-status[role="alert"]:not(.reef-sr-only) { font-size: 13px; color: #ffb7ad; }
@container reef-pane (max-width: 580px) {
  .reef-card { width: calc(100cqw - 24px); padding: 12px; gap: 10px; }
  .reef-measure { max-width: calc(100cqw - 24px); }
  .reef-measure.is-measuring {
    width: min(380px, calc(100cqw - 24px));
    max-height: min(28dvh, 200px);
    overflow-y: auto;
  }
  @container reef-pane (max-width: 450px) {
    .reef-reset-label { display: none; }
  }
}
@container reef-pane (max-width: 420px) {
  .reef-card-collapsed .reef-card-heading { gap: 4px; }
  .reef-card-collapsed .reef-position { display: none; }
  .reef-card-collapsed .reef-eyebrow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@container reef-pane (max-width: 360px) {
  .reef-card-collapsed .reef-card-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .reef-card-collapsed .reef-card-label { grid-column: 1; grid-row: 1; }
  .reef-card-collapsed .reef-collapsed-date { grid-column: 1; grid-row: 2; margin: 0; }
  .reef-card-collapsed .reef-card-heading > calcite-loader { grid-column: 2; grid-row: 1; justify-self: end; }
  .reef-card-collapsed .reef-collapse { grid-column: 2; grid-row: 2; }
}
@media (max-width: 600px), (max-height: 500px) {
  .reef-measure.is-measuring { width: min(256px, calc(100cqw - 24px)); padding: 6px; gap: 4px; }
  .reef-measure arcgis-direct-line-measurement-3d, .reef-measure arcgis-area-measurement-3d { width: 100%; max-width: 100%; min-width: 0; padding: 0; }
  .reef-surface-distance { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; }
  .reef-surface-distance [role="alert"] { grid-column: 1 / -1; }
  .reef-distance-results { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .reef-distance-results > div { flex-direction: column; gap: 1px; font-size: 10px; white-space: nowrap; }
  .reef-distance-results strong { font-size: 13px; font-variant-numeric: tabular-nums; }
  .reef-distance-new { grid-column: 2; width: 30px; justify-self: end; }
  .reef-distance-new-label { display: none; }
  .reef-card { padding: 8px; gap: 5px; max-height: calc(100dvh - 160px); overflow-y: auto; }
  .reef-card-heading { gap: 6px; }
  .reef-footer { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px; padding-top: 6px; }
  .reef-zoom-controls { grid-column: 1; grid-row: 1; }
  .reef-zoom-controls .reef-text-button { width: 36px; min-width: 36px; }
  .reef-reset-label { display: none; }
  .reef-playback { grid-column: 2; grid-row: 1; gap: 5px; flex-wrap: wrap; }
}
@media (max-width: 700px) {
  .reef-row .reef-dates-control { display: none; }
  .reef-row .reef-date-select { display: block; }
  #reef-viewer-host:has(#reef-compare:not([hidden])) { flex-direction: column; overflow: hidden; }
  #reef-viewer-host:has(#reef-compare:not([hidden])) > arcgis-scene { flex: 1 1 0; min-height: 0; height: auto; }
  #reef-viewer-host:has(#reef-compare:not([hidden])) .reef-card {
    max-height: min(24dvh, 200px);
    overflow-y: auto;
    padding: 8px;
    gap: 8px;
  }
  #reef-viewer-host:has(#reef-compare:not([hidden])) .reef-mobile-summary {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
  }
  .reef-mobile-label { display: grid; flex: 1; min-width: 0; gap: 2px; }
  .reef-mobile-label span { color: #b1c5d0; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .reef-mobile-label strong { font-size: 13px; white-space: nowrap; }
  #reef-viewer-host:has(#reef-compare:not([hidden])) arcgis-scene:not(.reef-controls-expanded) .reef-card > :not(.reef-mobile-summary):not(.reef-status[role="alert"]),
  #reef-viewer-host:has(#reef-compare:not([hidden])) arcgis-scene:has(.reef-measure.is-measuring) .reef-card > :not(.reef-mobile-summary):not(.reef-status[role="alert"]) { display: none; }
  #reef-viewer-host:has(#reef-compare:not([hidden])) .reef-measure.is-measuring { max-height: min(20dvh, 125px); }
  #reef-viewer-host:has(#reef-compare:not([hidden])) arcgis-scene:not(.reef-controls-expanded) .reef-measure:not(.is-measuring),
  #reef-viewer-host:has(#reef-compare:not([hidden])) arcgis-scene:not(.reef-controls-expanded) > arcgis-zoom,
  #reef-viewer-host:has(#reef-compare:not([hidden])) arcgis-scene:not(.reef-controls-expanded) > arcgis-navigation-toggle,
  #reef-viewer-host:has(#reef-compare:not([hidden])) arcgis-scene:not(.reef-controls-expanded) > arcgis-compass { display: none; }
}

