#moduleMetrics.module-metrics {
  grid-template-columns: repeat(6, minmax(0, 205px));
  justify-content: center;
  gap: 8px;
}

#moduleMetrics .module-metric {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  padding: 10px 12px;
}

#moduleMetrics .module-metric.tone-neutral {
  background: #f4f8fb;
}

#moduleMetrics .module-metric.tone-danger {
  background: #fff4f3;
}

#moduleMetrics .module-metric.tone-primary {
  background: #f1f8ff;
}

#moduleMetrics .module-metric.tone-success {
  background: #effaf5;
}

#moduleMetrics .module-metric.tone-warning {
  background: #fff9ea;
}

#moduleMetrics .module-metric-copy {
  min-width: 0;
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  text-align: left;
}

#moduleMetrics .module-metric-copy small,
#moduleMetrics .module-metric-copy strong {
  width: 100%;
  display: block;
  max-width: 100%;
  margin: 0;
  line-height: 1.05;
}

#moduleMetrics .module-metric-copy small {
  color: #27445b;
  font-size: .72rem;
  white-space: nowrap;
}

#moduleMetrics .module-metric-copy strong {
  color: var(--ink);
  font-size: clamp(.72rem, .85vw, .88rem);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 960px) {
  #moduleMetrics.module-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.record-fields:has(.stock-photo-gallery) {
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 16px;
}

.stock-card-fields {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.stock-photo-gallery {
  position: sticky;
  top: 0;
  min-width: 0;
  padding: 14px;
  border: 1px solid #bfd7e5;
  border-radius: 12px;
  background: linear-gradient(155deg, #f7fcff 0%, #edf7fb 100%);
  box-shadow: 0 10px 28px rgba(20, 79, 109, .09);
}

.stock-photo-gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}

.stock-photo-gallery-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: .92rem;
}

.stock-photo-gallery-count {
  padding: 5px 8px;
  border-radius: 999px;
  color: #086578;
  background: #dff4f8;
  font-size: .68rem;
  font-weight: 800;
}

.stock-photo-main {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  border: 1px solid #b9d3e2;
  border-radius: 11px;
  background:
    linear-gradient(45deg, #edf4f8 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(-45deg, #edf4f8 25%, transparent 25%) 0 9px / 18px 18px,
    #fff;
  cursor: zoom-in;
}

.stock-photo-main img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.stock-photo-thumbnails {
  display: flex;
  gap: 7px;
  margin-top: 9px;
  padding: 3px 3px 7px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.stock-photo-thumbnail {
  position: relative;
  flex: 0 0 68px;
  width: 68px;
  height: 58px;
  aspect-ratio: 1;
  min-width: 0;
  padding: 3px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}

.stock-photo-thumbnail.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 148, 166, .13);
}

.stock-photo-showcase-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  padding: 2px 4px;
  border-radius: 6px;
  color: #fff;
  background: #a85b17;
  font-size: 8px;
  line-height: 1.2;
  font-weight: 800;
  pointer-events: none;
}

.stock-photo-thumbnail img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 5px;
}

.stock-photo-name {
  margin: 9px 2px 0;
  overflow: hidden;
  color: #587187;
  font-size: .68rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-photo-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px dashed #aec9d8;
  border-radius: 11px;
  color: #6b8294;
  background: rgba(255, 255, 255, .65);
  text-align: center;
}

.stock-photo-empty strong {
  display: block;
  margin-bottom: 5px;
  color: #244b62;
}

.stock-photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 20050;
  display: grid;
  place-items: center;
  padding: 36px;
  background: rgba(5, 25, 42, .86);
  backdrop-filter: blur(7px);
}

.stock-photo-lightbox.hidden {
  display: none;
}

.stock-photo-lightbox-figure {
  position: relative;
  max-width: min(1100px, 92vw);
  max-height: 88vh;
  margin: 0;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
}

.stock-photo-main,
.stock-photo-lightbox-image {
  position: relative;
  color: #38576a;
}

.stock-photo-main img[hidden],
.stock-photo-lightbox-image img[hidden],
.stock-photo-load-status[hidden] {
  display: none !important;
}

.stock-photo-load-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #f2f7fa;
  font-size: .82rem;
  text-align: center;
}

.stock-photo-navigation {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.stock-photo-navigation .stock-photo-name {
  margin: 0;
}

.stock-photo-previous,
.stock-photo-next {
  min-width: 0;
  width: 32px;
  height: 30px;
  padding: 0;
  border: 1px solid #b9d3e2;
  border-radius: 7px;
  color: #0b6479;
  background: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.stock-photo-navigation button:disabled { opacity: .35; cursor: default; }
.stock-photo-thumbnail:focus-visible,
.stock-photo-main:focus-visible,
.stock-photo-navigation button:focus-visible,
.stock-photo-lightbox button:focus-visible {
  outline: 3px solid #087c9b;
  outline-offset: 2px;
}

.stock-photo-lightbox-image {
  display: grid;
  place-items: center;
  width: min(1000px, 82vw);
  height: min(680px, 70vh);
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
}

.stock-photo-lightbox-image img {
  width: 100%;
  height: 100%;
}

.stock-photo-lightbox .stock-photo-navigation figcaption {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-photo-lightbox-figure img {
  max-width: 100%;
  max-height: calc(88vh - 70px);
  display: block;
  object-fit: contain;
}

.stock-photo-lightbox-figure figcaption {
  margin-top: 10px;
  color: #34546a;
  font-size: .78rem;
  text-align: center;
}

.stock-photo-lightbox-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #0b7890;
  font-size: 1.35rem;
  cursor: pointer;
}

@media (max-width: 900px) {
  .record-fields:has(.stock-photo-gallery) {
    grid-template-columns: 1fr;
  }

  .stock-photo-gallery {
    position: static;
  }

  .stock-photo-main {
    max-height: 340px;
  }
}
