.ae-gallery { color: #262626; font-size: 13px; line-height: 1.5; text-align: left; }
.ae-gallery *, .ae-overlay * { box-sizing: border-box; }
.ae-gallery button, .ae-gallery select { font: inherit; cursor: pointer; }
.ae-gallery button:focus-visible, .ae-gallery select:focus-visible, .ae-dialog a:focus-visible { outline: 2px solid #168aba; outline-offset: 3px; }
.ae-gallery button:disabled { opacity: .4; cursor: default; }
.ae-button, .ae-select, .ae-reset { border: 1px solid transparent; border-radius: 4px; background: #f4f6f7; color: #333; padding: 4px 8px; }
.ae-gallery .is-active { color: white; background: #489bbb; border-color: #489bbb; }
.ae-filters { padding: 12px 12px 6px; }
.ae-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.ae-filter-label { font-weight: 600; color: #666; min-width: 55px; }
.ae-select-label { position: relative; display: inline-block; }
.ae-select-label::after { content: ''; position: absolute; right: 11px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.ae-gallery select.ae-select { max-width: 180px; min-width: 100px; padding-right: 30px; appearance: none; -webkit-appearance: none; background-image: none; }
.ae-gallery .ae-select-label.is-active { border-radius: 4px; }
.ae-gallery select.ae-select.is-active { background-color: #489bbb; color: #fff; border-color: #3588a9; }
.ae-gallery .ae-select option { background: #fff; color: #333; }
.ae-reset { background: transparent; color: #3588a9; }
.ae-hero-layout { display: flex; align-items: stretch; gap: 12px; }
.ae-rail { width: 58px; flex: 0 0 58px; display: flex; flex-direction: column; gap: 6px; }
.ae-rail > .ae-button { padding: 0; line-height: 18px; }
.ae-thumb { display: block; width: 58px; height: 54px; border: 1px solid #e0e4e7; padding: 3px; background: white; }
.ae-thumb img { width: 100%; height: 100%; object-fit: contain; }
.ae-view-all { white-space: pre-line; border: 0; color: white; background: #77828b; padding: 6px 2px; line-height: 1.4; }
.ae-hero-main { min-width: 0; flex: 1; border: 1px solid #d8dde1; }
.ae-hero-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 12px; }
.ae-card { display: block; min-width: 0; width: 100%; padding: 0; border: 0; background: white; text-align: left; color: inherit; }
.ae-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; min-height: 18px; font-size: 11px; }
.ae-tags span { color: #438eab; background: #eff8fb; padding: 1px 4px; border-radius: 2px; overflow-wrap: anywhere; }
.ae-image { display: flex; align-items: center; justify-content: center; height: 180px; padding: 8px; background: #fafafa; border: 1px solid #e1e5e7; }
.ae-image img { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; }
.ae-card:hover .ae-image { border-color: #489bbb; }
.ae-caption { display: block; font-size: 12px; line-height: 1.5; height: auto; margin: 12px 0 2px; overflow-wrap: anywhere; white-space: normal; }
.ae-hero-grid { align-items: start; }
.ae-hero-compact { align-items: stretch; gap: 10px; }
.ae-hero-compact .ae-rail { gap: 4px; justify-content: space-between; }
.ae-hero-compact .ae-rail > * { flex-shrink: 0; }
.ae-hero-compact .ae-hero-grid { padding: 8px; gap: 10px; }
.ae-hero-compact .ae-image { height: clamp(150px, 16vw, 180px); padding: 5px; }
.ae-hero-compact .ae-caption { margin: 6px 0 0; }
.ae-hero-compact .ae-view-all { padding: 4px 2px; }
.ae-result-count { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.ae-review-section { display: flex; align-items: stretch; gap: 8px; margin: 0 0 12px; padding-right: 44px; position: relative; }
.ae-review-section .ae-review-grid { flex: 1; min-width: 0; gap: 10px; overflow-x: auto; }
.ae-review-section .ae-image { height: 150px; padding: 5px; }
.ae-review-section .ae-tags { margin-bottom: 4px; }
#review-group.ae-gallery .ae-filters { padding: 0 0 4px; }
.ae-review-grid, .ae-modal-thumbs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.ae-pagination { display: flex; justify-content: center; align-items: center; gap: 12px; color: #74818b; }
.ae-pagination .ae-button { font-size: 16px; }
.ae-review-section .ae-review-pagination { position: absolute; right: 0; top: 22px; bottom: 0; width: 36px; flex-direction: column; gap: 5px; font-size: 10px; white-space: nowrap; }
.ae-review-pagination .ae-button { width: 30px; padding: 0; line-height: 28px; font-size: 22px; }
.ae-empty { padding: 35px 20px; color: #78848c; text-align: center; }
.ae-image-error { color: #999; font-size: 12px; }
.ae-overlay { position: fixed; inset: 0; z-index: 10050; overflow-y: auto; background: rgba(0,0,0,.42); display: flex; align-items: flex-start; justify-content: center; padding: 36px 20px; }
.ae-dialog { position: relative; width: 1050px; max-width: 100%; background: white; padding: 26px 40px; box-shadow: 0 4px 22px rgba(0,0,0,.25); outline: none; }
.ae-close { position: absolute; top: 7px; right: 12px; border: 0; background: transparent; font-size: 32px !important; color: #333; line-height: 1; }
.ae-modal-body { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; margin: 20px 0 14px; }
.ae-modal-figure .ae-image { height: 360px; background: white; }
.ae-details { font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.ae-details p { margin: 0 0 8px; }
.ae-details h4 { margin: 20px 0 8px; }
.ae-details a { color: #168aba; }
.ae-source { color: #438eab; font-weight: 600; }
.ae-modal-thumbs { margin-top: 20px; }
.ae-modal-thumbs .ae-image { height: 110px; background: white; }
.ae-modal-thumbs .is-active { background: white; }
.ae-modal-thumbs .is-active .ae-image { border: 2px solid #43bea3; }
#heroImage.ae-hero { width: 72%; box-sizing: border-box; }
#heroImage.ae-hero + #selectTotal { width: 28%; box-sizing: border-box; }
#legacy-review-group[hidden], #application_list[hidden] { display: none !important; }
@media (max-width: 1100px) {
    .ae-hero-grid { gap: 8px; }
    .ae-hero-grid .ae-image { height: 150px; }
    .ae-review-grid { grid-template-columns: repeat(6, minmax(120px, 1fr)); }
}
@media (max-width: 760px) {
    #heroImage.ae-hero, #heroImage.ae-hero + #selectTotal { width: 100%; float: none; padding-left: 0; }
    .ae-overlay { padding: 12px 8px; }
    .ae-dialog { padding: 30px 14px 18px; }
    .ae-modal-body { grid-template-columns: 1fr; gap: 16px; }
    .ae-modal-figure .ae-image { height: 280px; }
    .ae-modal-thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ae-hero-layout { gap: 6px; }
    .ae-hero-grid { grid-template-columns: 1fr; }
    .ae-hero-grid .ae-image { height: 200px; }
    .ae-review-grid { grid-template-columns: repeat(6, minmax(130px, 1fr)); }
}
