/* Page header and section index. */
.gallery-main { width: min(1120px, calc(100% - 48px)); margin: auto; padding: 48px 0; }
.gallery-header { display: flex; justify-content: space-between; align-items: end; gap: 32px; }
.gallery-header h1 { margin: 8px 0 16px; }
.gallery-header .field { min-width: 140px; }
.gallery-index { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 32px 0; }
@media (max-width: 640px) {
  .gallery-main { width: calc(100% - 32px); padding: 24px 0; }
  .gallery-header { align-items: start; flex-direction: column; gap: 24px; }
}
/* Labeled specimens keep controls and usage notes together. */
.gallery-section { border-top: 1px solid var(--line); padding: 32px 0; scroll-margin-top: 24px; }
.gallery-section > header { margin-bottom: 24px; }
.gallery-section > header p { margin-top: 8px; max-width: 72ch; color: var(--text-medium); font-size: var(--text-sm); }
.gallery-samples { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.gallery-examples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.gallery-example { margin: 0; min-width: 0; }
.gallery-demo { display: flex; align-items: center; justify-content: center; min-height: 88px; margin-bottom: 16px; }
.gallery-demo > .menu { display: grid; justify-items: center; width: min(19rem, 100%); }
.gallery-example figcaption { border-top: 1px solid var(--line); padding-top: 12px; }
.gallery-example figcaption p { margin-top: 8px; color: var(--text-medium); font-size: var(--text-sm); }
@media (max-width: 800px) { .gallery-examples { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .gallery-examples { grid-template-columns: 1fr; gap: 24px; } }
/* Segmented navigation. */
.gallery-navigation { width: fit-content; max-width: 100%; }
.gallery-response { margin-top: 16px; color: var(--text-medium); }
/* Checkboxes, radios and poll choices. */
.gallery-selection { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.gallery-selection fieldset { display: grid; gap: 12px; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.gallery-selection legend { padding: 0 8px; font-weight: var(--weight-strong); }
.gallery-selection label { display: flex; align-items: center; gap: 8px; }
@media (max-width: 640px) { .gallery-selection { grid-template-columns: 1fr; } }
/* Form fields and local validation feedback. */
.gallery-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.gallery-message, .gallery-form-result { grid-column: 1 / -1; }
.gallery-form-result { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
@media (max-width: 640px) { .gallery-fields { grid-template-columns: 1fr; } }
/* Cards and expandable content. */
.gallery-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 24px; }
.gallery-card-variants { margin-top: 24px; }
.gallery-cards .panel { display: grid; align-content: start; gap: 16px; }
.gallery-disclosure { margin-top: 24px; max-width: 560px; }
.gallery-disclosure[open] > p { margin-top: 16px; }
/* Loading and empty states follow the notice triggers. */
#feedback .gallery-cards { margin-top: 24px; }
/* Return link below the popup examples. */
.gallery-footer { border-top: 1px solid var(--line); padding-top: 24px; color: var(--text-medium); font-size: var(--text-xs); }
