
.distance-gallery {
  --dg-green: #1f6546;
  --dg-muted: #607268;
  --dg-line: #cbdcd0;
  margin-block: 36px 42px;
  padding: 28px;
  border: 1px solid var(--dg-line);
  border-radius: 14px;
  background: #fbfdfb;
  color: #203c2e;
  scroll-margin-top: 100px;
}
.distance-gallery [hidden] { display: none !important; }
.distance-gallery button { font: inherit; cursor: pointer; }
.distance-gallery button:focus-visible, .distance-gallery [tabindex="0"]:focus-visible {
  outline: 3px solid #3d9470;
  outline-offset: 4px;
}
.distance-gallery button:disabled { cursor: default; }
.dg-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.dg-heading .dg-eyebrow { margin: 0 0 8px; color: var(--dg-green); font-size: 14px; font-weight: 650; letter-spacing: .65px; text-transform: uppercase; }
.dg-heading h4 { margin: 0; font-size: clamp(26px, 2.5vw, 34px); font-weight: 650; line-height: 1.2; letter-spacing: -.7px; }
.dg-heading > p { flex: 0 0 auto; margin: 0; color: var(--dg-muted); font-size: 17px; line-height: 1.5; }
.dg-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dg-tabs button { min-width: 0; padding: 13px 16px; border: 1px solid var(--dg-line); border-radius: 8px; background: #f0f5f1; color: #365543; text-align: left; transition: background-color .15s, border-color .15s; }
.dg-tabs button > span { display: block; margin-bottom: 5px; font-size: 14px; line-height: 1.3; }
.dg-tabs button strong { display: block; color: inherit; font-size: 21px; font-weight: 650; line-height: 1.3; white-space: nowrap; }
.dg-tabs button small { font-size: 14px; font-weight: 500; }
.dg-tabs button[aria-selected="true"] { color: #fff; border-color: var(--dg-green); background: var(--dg-green); }
.dg-tabs button:hover:not(:disabled):not([aria-selected="true"]) { border-color: #71a78b; background: #e4f0e7; }
.dg-tabs button:disabled { opacity: .65; }
.dg-status { margin: 18px 0 0; color: var(--dg-muted); font-size: 16px; line-height: 1.5; }
.distance-gallery[data-state="error"] .dg-status { color: #8a4936; }
.dg-retry { margin-top: 12px; padding: 9px 15px; border: 1px solid #8ab69c; border-radius: 7px; color: var(--dg-green); background: #fff; }
.dg-panel { margin-top: 18px; }
.dg-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dg-pane { min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--dg-line); border-radius: 10px; background: #eef3ed; }
.dg-pane figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; margin: 0; border: 0; border-bottom: 1px solid #dce6dd; background: #fff; }
.dg-pane-label { display: block; font-size: 17px; font-weight: 650; line-height: 1.35; }
.dg-pane figcaption > div > small { display: block; margin-top: 3px; color: var(--dg-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.dg-distance { flex-shrink: 0; color: var(--dg-green); font-size: 28px; font-weight: 650; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dg-distance small { font-size: 16px; font-weight: 500; }
.dg-image-stage { position: relative; display: grid; place-items: center; height: clamp(300px, 35vw, 440px); background: #eef3ed; }
.dg-image-stage > img { display: block; width: 100%; height: 100%; max-width: none; min-height: 0; object-fit: contain; object-position: center; }
.dg-image-message { max-width: 270px; margin: 0; padding: 24px; text-align: center; color: var(--dg-muted); font-size: 16px; line-height: 1.5; }
.dg-image-stage[data-state="error"] .dg-image-message { color: #8a4936; }
.dg-sample-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 18px 0 12px; }
.dg-sample-toolbar > p { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0; }
.dg-group-name { font-size: 19px; font-weight: 650; }
.dg-sample-position { color: var(--dg-muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.dg-step-controls { display: flex; gap: 7px; }
.dg-step-controls button { display: grid; place-items: center; width: 42px; height: 38px; padding: 0; border: 1px solid #b5ccbc; border-radius: 6px; background: #fff; color: var(--dg-green); font-size: 23px; line-height: 1; }
.dg-step-controls button:hover:not(:disabled) { background: #e8f2ea; }
.dg-step-controls button:disabled { opacity: .35; }
.dg-thumbnails { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; }
.dg-thumbnail { display: block; min-width: 0; padding: 0; overflow: hidden; border: 1px solid #d0dfd4; border-radius: 7px; background: #fff; color: #45624f; transition: border-color .15s, box-shadow .15s; }
.dg-thumbnail[aria-pressed="true"] { border-color: var(--dg-green); box-shadow: 0 0 0 2px var(--dg-green); color: #174b33; }
.dg-thumbnail:hover:not([aria-pressed="true"]) { border-color: #659b7d; }
.dg-thumbnail-image { display: grid; place-items: center; width: 100%; aspect-ratio: 1; background: #eef3ed; }
.dg-thumbnail-image > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.dg-thumbnail-image > span { padding: 5px; font-size: 11px; line-height: 1.25; }
.dg-thumbnail-distance { display: block; padding: 7px 2px; font-size: 14px; font-weight: 600; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dg-footnote { margin: 18px 0 0; color: var(--dg-muted); font-size: 15px; line-height: 1.55; }
.dg-announcement { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 1100px) {
  .distance-gallery { padding: 22px; }
  .dg-heading { align-items: start; }
  .dg-heading > p { max-width: 230px; font-size: 15px; }
  .dg-tabs button { padding: 12px; }
  .dg-tabs button strong { font-size: 18px; }
  .dg-pane figcaption { padding: 12px; }
  .dg-pane-label { font-size: 15px; }
  .dg-distance { font-size: 24px; }
  .dg-thumbnails { gap: 6px; }
  .dg-thumbnail-distance { font-size: 12px; }
}
@media (max-width: 760px) {
  .dg-heading { display: block; margin-bottom: 18px; }
  .dg-heading > p { max-width: none; margin-top: 10px; font-size: 16px; }
  .dg-heading > p br { display: none; }
  .dg-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dg-tabs button strong { font-size: 20px; }
  .dg-comparison { gap: 10px; }
  .dg-pane figcaption { display: block; min-height: 100px; }
  .dg-distance { display: block; margin-top: 8px; font-size: 24px; }
  .dg-image-stage { height: clamp(160px, 31vw, 240px); }
  .dg-thumbnails { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
  .dg-thumbnail-distance { font-size: 14px; }
}
@media (max-width: 440px) {
  .distance-gallery { padding: 16px 12px; margin-block: 28px; }
  .dg-heading h4 { font-size: 26px; }
  .dg-tabs button { padding: 10px; }
  .dg-tabs button > span { font-size: 13px; }
  .dg-tabs button strong { font-size: 17px; }
  .dg-tabs button small { font-size: 12px; }
  .dg-pane figcaption { padding: 10px; min-height: 112px; }
  .dg-pane-label { font-size: 14px; }
  .dg-distance { font-size: 20px; }
  .dg-distance small { font-size: 13px; }
  .dg-image-stage { height: 156px; }
  .dg-group-name { font-size: 17px; }
  .dg-sample-toolbar > p { gap: 2px; flex-direction: column; }
  .dg-thumbnails { gap: 6px; }
  .dg-thumbnail-distance { font-size: 11px; }
  .dg-footnote { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .distance-gallery button { transition: none; }
}
