/* Local history and gallery controls; the established diary design stays in styles.css. */
.history-month-control {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.history-month-control > label {
  color: var(--muted);
  font-size: .9375rem;
}
.history-month-control > input {
  min-width: 160px;
  min-height: 44px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 15px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
}
.ledger-month-toolbar { margin-bottom: 18px; }
.weight-range-control {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 21px;
}
.weight-range-control > .field {
  flex: 1 1 160px;
  min-width: 0;
  margin: 0;
}
.weight-range-control > .field:first-child { flex-grow: 1.15; }
.weight-range-control input, .weight-range-control select { min-width: 0; width: 100%; }
.weight-history-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin-top: 20px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}
.weight-history-heading h3 { font-size: 1rem; }
.weight-history-heading > span { color: var(--muted); font-size: .875rem; }
.weight-history-toggle { width: 100%; margin-top: 14px; }
.gallery-member-filter { margin: 0 0 18px; }
.gallery-card-actions.gallery-detail-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: column;
  gap: 4px;
}
.gallery-detail-actions .gallery-source,
.gallery-detail-actions .gallery-pets {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: .8125rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.gallery-detail-actions .gallery-edit-tools { display: flex; flex-wrap: wrap; gap: 0 12px; }
.gallery-edit-tools .text-button { min-height: 44px; padding: 5px 0; font-size: .875rem; }
.gallery-caption-preview {
  display: block;
  width: 100%;
  max-height: 230px;
  margin: 0 auto 20px;
  border-radius: 17px;
  object-fit: contain;
  background: var(--card);
}
.gallery-source-record .moment-card { margin-bottom: 18px; }
.lightbox #full-photo { max-height: 57dvh; touch-action: pan-y pinch-zoom; }
.lightbox #full-caption { white-space: pre-wrap; overflow-wrap: anywhere; }
.lightbox .lightbox-actions { flex-direction: column; align-items: stretch; gap: 12px; }
.lightbox-navigation {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.lightbox-navigation > .button:first-child { justify-self: start; }
.lightbox-navigation > .button:last-child { justify-self: end; }
.lightbox-navigation > .button:disabled { opacity: .4; cursor: default; }
.lightbox-position { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.lightbox-photo-tools { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 16px; }
@media (max-width: 600px) {
  .history-month-control { gap: 9px; }
  .history-month-control > label { width: 100%; font-size: .875rem; }
  .history-month-control > input { flex: 1; }
  .weight-range-control { gap: 12px; }
  .weight-range-control > .field { flex-basis: calc(50% - 6px); }
  .weight-range-control > .field:first-child { flex-basis: 100%; }
  .gallery-detail-actions .gallery-edit-tools { gap: 0 10px; }
  .gallery-detail-actions .gallery-source { font-size: .75rem; }
  .gallery-caption-preview { max-height: 190px; }
  .lightbox #full-photo { max-height: 50dvh; }
  .lightbox-navigation { gap: 8px; }
  .lightbox-navigation > .button { padding-inline: 11px; font-size: .875rem; }
}
