/* Screen-reader and pointer targets track their exact Canvas symbols. Focus stays visible. */
.named-pins > button[class] {
  position: absolute;
  color: transparent;
  background: transparent;
  border: 0;
  padding: 0;
  text-shadow: none;
  box-shadow: none;
  cursor: pointer;
  touch-action: none;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
.named-pins > button[class]:focus-visible {
  outline: 2px solid #a44724;
  outline-offset: 2px;
}
.named-pins > .chart-name::before {
  display: none;
}
.named-pins > .group-token {
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 2;
}
.named-pins > .chart-dot {
  margin: 0;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}
.named-pins > .chart-dot.pick {
  z-index: 3;
  width: 21px;
  height: 21px;
}
.named-pins > .chart-name {
  z-index: 1;
  overflow: hidden;
}
.depth-key {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 500 10px/1.2 var(--mono);
  color: #495e56;
  white-space: nowrap;
}
.depth-key i {
  display: inline-block;
  width: 34px;
  height: 6px;
  border-radius: 3px;
  border: 1px solid #50777555;
  background: linear-gradient(90deg, #cde6d7, #71bfb8, #35879c, #254d67);
}
.legend .charted-site {
  background: #954731;
  border-color: #fff5d1;
}
@media (max-width: 970px) {
  .depth-key {
    display: none;
  }
}
.site-spotlight {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border: 2px solid #fff1a9;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6d5 0 2px, #eab158 2.5px 4px, transparent 5px);
  box-shadow:
    0 0 0 1px #634d2c,
    0 0 0 5px #f6ba5550,
    inset 0 0 0 1px #51432383;
}
.site-spotlight:not([hidden])::before,
.site-spotlight:not([hidden])::after {
  content: '';
  position: absolute;
  background: #fff1ae;
  width: 5px;
  height: 2px;
  top: 12px;
}
.site-spotlight::before {
  left: -6px;
}
.site-spotlight::after {
  right: -6px;
}
.dir-row:hover,
.dir-row:focus-within {
  background: #eee5c8;
}
.card-host {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
.card-host[hidden],
.site-spotlight[hidden],
.terrain-tools[hidden],
.terrain-settings[hidden],
.terrain-source[hidden] {
  display: none !important;
}
.popup-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.popup-line path {
  fill: none;
  stroke: #fbdd94;
  stroke-width: 2;
  filter: drop-shadow(0 1px 1px #173d3e);
}
.chart-popup {
  position: absolute;
  pointer-events: auto;
  width: min(291px, calc(100% - 16px));
  border: 1px solid #947e51;
  border-radius: 6px;
  background: #fff6df;
  color: #253c38;
  overflow: hidden;
  box-shadow:
    0 5px 19px #061c2863,
    0 0 0 1px #ffebb470;
  font-family: var(--sans);
  text-align: left;
  max-height: calc(100% - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.bubble-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 33px 0 13px;
}
.bubble-photo {
  width: 49px;
  height: 45px;
  flex: 0 0 49px;
  position: relative;
  border-radius: 3px;
  overflow: hidden;
  background: #254d51;
}
.bubble-photo img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}
.bubble-photo .photo-scope {
  font-size: 7px;
}
.bubble-heading {
  min-width: 0;
}
.bubble-region {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #6a674b;
  text-transform: uppercase;
  font: 600 10px/1.4 var(--mono);
  letter-spacing: 0.7px;
}
.bubble-region .icon {
  width: 12px;
  height: 12px;
  color: #a47728;
  fill: #dcc28a;
}
.bubble-heading h3,
.bubble-group-heading h3 {
  font: 400 21px/1.12 var(--serif);
  letter-spacing: -0.55px;
  margin: 3px 0 0;
  color: #213830;
}
.bubble-close {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #555b4b;
  border-radius: 50%;
}
.bubble-close:hover,
.bubble-close:focus-visible {
  background: #dfd6b9;
}
.bubble-close .icon {
  width: 16px;
  height: 16px;
}
.bubble-description {
  font-size: 13px;
  line-height: 1.45;
  margin: 9px 13px 5px;
  max-height: min(14em, 26vh);
  overflow-y: auto;
}
.bubble-data {
  font: 500 11px/1.5 var(--sans);
  color: #5d674f;
  margin: 0 13px 8px;
}
.bubble-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 8px 3px 11px;
  border-top: 1px solid #d7cbaa;
  background: #f3e8ca;
}
.bubble-read,
.cluster-zoom {
  font: 650 12px/1.25 var(--sans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 31px;
  color: #244b44;
  text-align: left;
}
.bubble-read .icon,
.cluster-zoom .icon {
  height: 14px;
  width: 14px;
}
.bubble-actions .mark-btn {
  position: static;
  margin: 0;
  width: 33px;
  height: 30px;
}
.chart-popup[data-popup-kind='group'] {
  width: min(252px, calc(100% - 16px));
}
.bubble-group-heading {
  position: relative;
  display: flex;
  align-items: center;
  padding: 12px 35px 10px 13px;
  background: #efe2c2;
  border-bottom: 1px solid #cebc92;
}
.bubble-group-heading h3 {
  font-size: 20px;
  margin: 0;
}
.cluster-members {
  max-height: min(177px, 27svh);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 3px 7px;
}
.cluster-members button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 6px;
  padding: 7px 4px;
  min-height: 33px;
  text-align: left;
  line-height: 1.2;
  font-size: 13px;
  border-bottom: 1px dotted #d8cdaf;
}
.cluster-members button:hover,
.cluster-members button:focus-visible {
  background: #e6e6cc;
  color: #193a33;
}
.member-symbol {
  width: 15px;
  color: #38756d;
  text-align: center;
}
.member-symbol.favorite {
  color: #9c6f25;
}
.cluster-zoom {
  border-top: 1px solid #d7cbaa;
  background: #f4ebd4;
  padding: 5px 12px;
  width: 100%;
}
.terrain-tools {
  position: absolute;
  left: 13px;
  top: 58px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  max-width: calc(100% - 72px);
}
.terrain-toggle,
.terrain-settings {
  background: #f7eed8f5;
  box-shadow: 0 2px 8px #12383b36;
  border: 1px solid #91835f;
  border-radius: 4px;
  color: #294940;
}
.terrain-toggle {
  display: flex;
  align-items: center;
  min-height: 32px;
  gap: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 650;
}
.terrain-toggle .icon {
  width: 14px;
  height: 14px;
}
.terrain-toggle .icon:last-child {
  width: 12px;
  transition: transform 0.15s;
}
.terrain-toggle[aria-expanded='true'] .icon:last-child {
  transform: rotate(180deg);
}
.terrain-settings {
  width: 204px;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px;
}
.terrain-settings label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  grid-column: 1/-1;
  font-size: 12px;
  font-weight: 600;
}
.terrain-settings output {
  font: 11px var(--mono);
  color: #5a644e;
}
.terrain-settings input {
  grid-column: 1/-1;
  width: 100%;
  min-height: 22px;
  accent-color: #305e59;
}
.terrain-settings label[for='terrain-height'] {
  grid-column: 1;
}
.terrain-settings select {
  grid-column: 2;
  border: 1px solid #b8a47d;
  border-radius: 3px;
  background: #fbf1d7;
  color: #294840;
  padding: 4px 2px;
  font-size: 11px;
  max-width: 88px;
}
.terrain-settings button {
  grid-column: 1/-1;
  color: #3b6355;
  font-weight: 600;
  font-size: 12px;
  text-align: left;
  border-top: 1px solid #cabd9b;
  margin-top: 4px;
  padding: 5px 0 0;
}
.imagery-settings {
  display: flex;
  flex-direction: column;
  width: min(236px, 100%);
  gap: 7px;
}
.imagery-tools {
  width: max-content;
}
.imagery-tools:has(section:not([hidden])) {
  width: 236px;
}
.imagery-settings select {
  width: 100%;
  max-width: none;
  min-height: 32px;
  font-size: 12px;
}
.imagery-settings .enhance-choice {
  justify-content: flex-start;
  gap: 7px;
  min-height: 30px;
}
.imagery-settings .enhance-choice input {
  width: 16px;
  height: 16px;
  margin: 0;
}
.imagery-settings p {
  margin: -2px 0 2px;
  color: #4d6057;
  font-size: 11px;
  line-height: 1.35;
}
.terrain-source {
  position: absolute;
  left: 10px;
  bottom: 9px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  min-height: 24px;
  background: #102f39e8;
  border: 1px solid #929d83;
  border-radius: 3px;
  font: 500 10px/1.2 var(--mono);
  color: #f0e6c4;
  max-width: calc(100% - 18px);
  text-align: left;
}
.terrain-source .icon {
  width: 13px;
  height: 13px;
  flex: none;
}
.turning-terrain,
.turning-terrain * {
  cursor: grabbing !important;
}
.ocean-hero h1 em {
  color: #f3c8af;
  text-shadow:
    0 1px 0 #482d41,
    1px 2px 0 #613951,
    0 0 22px #fb587426;
}
@media (max-width: 680px) {
  .mobile-switch {
    scroll-margin-top: 6px;
  }
  .workspace .map-panel {
    height: clamp(425px, 70svh, 760px);
  }
  .map-right {
    gap: 5px;
  }
  .map-right .map-icon,
  .map-right .zoom-stack button {
    width: 37px;
    height: 37px;
  }
  .terrain-tools {
    left: 8px;
    top: 47px;
  }
  .terrain-toggle {
    min-height: 34px;
  }
  .terrain-settings {
    width: 181px;
  }
  .chart-popup {
    width: min(271px, calc(100% - 18px));
  }
  .bubble-description {
    max-height: 9em;
    font-size: 13px;
    line-height: 1.43;
  }
  .bubble-actions {
    padding-block: 2px;
  }
  .bubble-read,
  .cluster-zoom {
    min-height: 37px;
  }
  .bubble-actions .mark-btn,
  .bubble-close {
    width: 38px;
    height: 36px;
  }
  .bubble-head {
    padding-right: 40px;
  }
  .cluster-members button {
    min-height: 41px;
  }
  .group-token::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
  }
  .map-panel.expanded {
    inset: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0)
      env(safe-area-inset-left, 0) !important;
    border-radius: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .terrain-toggle .icon:last-child {
    transition: none;
  }
}
.bubble-actions .relief-dive {
  color: #4a645b;
}
@media (max-width: 680px) {
  .bubble-actions .bubble-read {
    font-size: 11.5px;
  }
}
.depth-key[hidden] { display: none; }
[data-map-mode="satellite"] .chart-surface { background: #0b313e; }
[data-map-mode="satellite"] .map-scale { color: #fff8dc; text-shadow: 0 1px 3px #09343b; }
[data-map-mode="satellite"] .map-scale i { border-color: #fff8dc; box-shadow: 0 1px 2px #09343b; }
[data-map-mode="satellite"] .map-rose span { color: #fff4cc; text-shadow: 0 1px 3px #102f39; }
.site-spotlight.offscreen {
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%) rotate(var(--direction));
  background: #153a40;
  box-shadow: 0 1px 5px #102c38a6;
}
.site-spotlight.offscreen:not([hidden])::before {
  left: 6px; top: 5px; width: 8px; height: 8px;
  border-top: 2px solid #ffe29a; border-right: 2px solid #ffe29a;
  background: transparent; transform: rotate(45deg);
}
.site-spotlight.offscreen::after { display: none; }
dialog[data-kind="detail"]:has(#site-gallery) { width: min(790px, calc(100% - 18px)); max-height: 92svh; }
.notes-heading { position: relative; padding: 17px 58px 14px 22px; background: #f8efd9; }
.notes-heading .kicker { font-size: 10px; }
.notes-heading h2 { margin: 4px 0 0; color: #203e39; font: 500 clamp(25px,3.4vw,37px)/1.08 var(--serif); }
.gallery-top .detail-cover { height: clamp(220px, 48svh, 448px); background: #102d31; }
.gallery-strip { padding: 8px 14px; gap: 7px; }
.gallery-strip button { flex-basis: 70px; height: 48px; }
.photo-expand {
  position: absolute; top: 10px; right: 10px; width: 38px; height: 38px;
  display: grid; place-items: center; border-radius: 4px; color: #fff4d5;
  background: #12363be6; border: 1px solid #c3b385;
}
.photo-expand .icon { width: 18px; height: 18px; }
dialog[data-photo-expanded="true"]:has(#site-gallery) { width: min(1170px, calc(100% - 12px)); }
dialog[data-photo-expanded="true"] .gallery-top .detail-cover { height: 72svh; }
@media (max-width: 680px) {
  .notes-heading { padding: 12px 49px 12px 15px; }
  .gallery-top .detail-cover { height: clamp(215px, 39svh, 390px); }
  .mode-btn { padding-inline: 7px; gap: 4px; }
  .gallery-strip button { flex-basis: 62px; height: 44px; }
}
@media (max-width: 355px) { .mode-btn .icon { display: none; } }
@media (max-height: 480px) { .gallery-top .detail-cover { min-height: 138px; } }

.terrain-settings .survey-label { grid-column: 1 / -1; margin-top: 5px; }
.terrain-settings #terrain-survey { grid-column: 1 / -1; width: 100%; max-width: none; }
#reader .detail-actions { flex-wrap: wrap; }
.map-empty-favorites { display: none; }
@media (max-width: 680px) {
  .map-empty-favorites {
    display: block; position: absolute; z-index: 5; left: 50%; top: 51%;
    transform: translate(-50%, -50%); width: min(290px,88%); background: #f8eed7f5;
    border: 1px solid #927947; border-radius: 6px; box-shadow: 0 4px 20px #0c2a2f60;
  }
  .map-empty-favorites .empty { min-height: 0; padding: 17px 14px; }
}
