.h48ci-upload { margin: 20px 0; padding: 16px; border: 1px solid rgba(128,148,174,.4); border-radius: 8px; }
.h48ci-upload label { display: block; font-weight: 600; margin-bottom: 8px; }
.h48ci-help { font-size: .875em; margin: 0 0 12px; }
.h48ci-upload input[type=file] { display: block; width: 100%; max-width: 100%; color: inherit; }
.h48ci-error { color: #ee7474; margin-top: 8px; }
.h48ci-error:empty { display: none; }
.h48ci-previews, .h48ci-gallery { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.h48ci-previews:empty { display: none; }
.h48ci-preview { width: 130px; max-width: 100%; }
.h48ci-preview img { width: 130px; height: 100px; object-fit: contain; display: block; border-radius: 5px; background: rgba(128,148,174,.1); }
.h48ci-preview button { margin-top: 6px; padding: 5px 10px; font-size: .8rem; }
.h48ci-gallery a { display: block; width: min(180px, 100%); }
.h48ci-gallery img { display: block; width: 100%; height: 140px; object-fit: contain; border-radius: 6px; background: rgba(128,148,174,.1); }
@media (max-width: 480px) { .h48ci-gallery a { width: calc(50% - 6px); } .h48ci-upload { padding: 12px; } }

/* Full-screen native modal. Does not affect upload previews. */
.h48ci-lightbox[open] {
    position: fixed; inset: 0; margin: 0; padding: 0;
    width: 100vw; height: 100vh; height: 100dvh;
    max-width: none; max-height: none; border: 0;
    box-sizing: border-box; background: rgba(5,14,25,.96); color: #fff;
    display: grid; grid-template-rows: auto minmax(0,1fr) auto;
    overflow: hidden;
}
.h48ci-lightbox::backdrop { background: rgba(0,0,0,.8); }
.h48ci-lightbox-toolbar { display: flex; align-items: center; justify-content: space-between; padding: max(12px,env(safe-area-inset-top)) 16px 8px; }
.h48ci-lightbox-counter { font: 16px/1.4 sans-serif; padding: 0 8px; }
.h48ci-lightbox button {
    display: flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; min-width: 48px; padding: 0; margin: 0;
    border: 1px solid rgba(255,255,255,.45); border-radius: 50%;
    background: #172d46; color: #fff; box-shadow: none;
    font: 36px/1 sans-serif; cursor: pointer;
}
.h48ci-lightbox button:hover { background: #254b76; color: #fff; }
.h48ci-lightbox button:focus-visible, .h48ci-lightbox a:focus-visible { outline: 3px solid #9acbff; outline-offset: 3px; }
.h48ci-lightbox button[hidden], .h48ci-lightbox-image[hidden] { display: none !important; }
.h48ci-lightbox-stage { min-height: 0; min-width: 0; padding: 8px 76px; display: flex; align-items: center; justify-content: center; touch-action: pan-y pinch-zoom; }
.h48ci-lightbox-image { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; margin: 0; border: 0; border-radius: 3px; box-shadow: none; user-select: none; }
.h48ci-lightbox .h48ci-lightbox-prev, .h48ci-lightbox .h48ci-lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; }
.h48ci-lightbox-prev { left: 12px; }
.h48ci-lightbox-next { right: 12px; }
.h48ci-lightbox-footer { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 10px 16px max(14px,env(safe-area-inset-bottom)); font: 14px/1.4 sans-serif; }
.h48ci-lightbox-status:empty { display: none; }
.h48ci-lightbox .h48ci-lightbox-original { color: #bddcff; text-decoration: underline; }
/* Override the optional enlargement rule supplied before the gallery update. */
.h48ci-gallery a:hover img { transform: none !important; box-shadow: none !important; }
@media (max-width: 600px) {
    .h48ci-lightbox-stage { padding: 6px; }
    .h48ci-lightbox .h48ci-lightbox-prev, .h48ci-lightbox .h48ci-lightbox-next { top: auto; bottom: max(68px,calc(env(safe-area-inset-bottom) + 54px)); transform: none; }
}
.h48ci-upload .h48ci-clear[hidden] { display: none; }
.h48ci-status { margin: 8px 0; font-size: .9em; }
.h48ci-status:empty { display: none; }
.h48ci-clear { margin: 8px 0; font-size: .85em; }
.h48ci-preview small { display: block; margin-top: 5px; }
