.gallery-hero { position: relative; overflow: hidden; padding: 56px 0 38px; text-align: center; background: color-mix(in srgb, var(--theme-primary) 8%, var(--theme-background)); }
.gallery-hero-content { position: relative; z-index: 2; }
.gallery-hero.has-cover { background: var(--theme-primary-dark); }
.gallery-hero-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .62; image-orientation: from-image; }
.gallery-hero.has-cover::after { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(9,20,17,.16), rgba(9,20,17,.68)); }
.gallery-hero.has-cover h1, .gallery-hero.has-cover p { color: #fff; text-shadow: 0 2px 18px rgba(0,0,0,.42); }
.gallery-hero.has-cover .event-icon { color: #fff; border-color: rgba(255,255,255,.7); background: rgba(15,20,18,.46); }
.gallery-hero .event-icon { color: var(--theme-text); border-color: var(--theme-border); background:var(--theme-surface-paint,var(--theme-surface)); text-shadow: none; }
.gallery-hero h1 { margin: 0; font-family: var(--theme-heading-font); font-size: clamp(2.6rem, 7vw, 5.1rem); line-height: 1; }
.gallery-hero p { margin: 13px 0 0; color: var(--theme-muted); }
.gallery-main { width: min(1280px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 72px; }
.gallery-summary { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; margin-bottom: 28px; color: var(--theme-muted); font-size: .92rem; }
.gallery-summary strong { color: var(--theme-primary); }

.gallery-controls { position: relative; z-index: 20; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 18px; margin-bottom: 14px; padding: 14px 16px; border: 1px solid var(--theme-border); border-radius: 20px; background: var(--theme-surface-paint,var(--theme-surface)); box-shadow: 0 10px 30px rgba(22,44,37,.08); }
.filter-group { display: flex; align-items: center; gap: 6px; }
.filter-button,.tag-filter-button { min-height: 42px; border: 0; padding: 9px 16px; border-radius: 999px; color: var(--theme-muted); background: transparent; font-weight: 800; cursor: pointer; }
.filter-button.active,.tag-filter-button.active { color: #fff; background:var(--theme-primary-paint,var(--theme-primary)); }
.tag-filter-group{flex-wrap:wrap;grid-column:1/-1}
.gallery-control-actions { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; align-items: center; gap: 9px; }
.sort-select { min-height: 44px; padding: 9px 38px 9px 13px; border: 1px solid var(--theme-border); border-radius: 13px; color: var(--theme-control-text, #17211e); background-color: var(--theme-control-background, #fff); font: inherit; }
.sort-select option { color: var(--theme-option-text, #17211e); background: var(--theme-option-background, #fff); }
.gallery-control-actions > .button { min-height: 44px; padding-inline: 19px; color: #fff; background: var(--theme-primary-paint,var(--theme-primary)); border-color: var(--theme-primary); }
.gallery-search { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid var(--theme-border); border-radius: 13px; background: var(--theme-control-background, #fff); }
.gallery-search:focus-within { border-color: var(--theme-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-primary) 13%, transparent); }
.gallery-search span { flex: 0 0 auto; color: var(--theme-muted); font-size: 1.2rem; }
.gallery-search input { min-width: 0; width: 100%; min-height: 42px; border: 0; outline: 0; color: var(--theme-control-text, #17211e); background: transparent; font: inherit; }

.selection-panel { margin: 0 0 16px; padding: 17px 19px; border: 1px solid color-mix(in srgb, var(--theme-primary) 30%, var(--theme-border)); border-radius: 20px; background: color-mix(in srgb, var(--theme-primary) 4%, var(--theme-surface)); box-shadow: 0 10px 28px rgba(22,44,37,.07); }
.selection-panel[hidden] { display: none; }
.selection-panel-top { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 24px; }
.selection-link { border: 0; padding: 4px; color: var(--theme-primary); background: transparent; font: inherit; font-weight: 800; cursor: pointer; }
.selection-downloads { display: grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 13px; }
.selection-downloads .button { min-width: 220px; background:var(--theme-primary-paint,var(--theme-primary)); }
.selection-downloads .button-secondary { color: var(--theme-primary); background: #fff; border-color: var(--theme-border); }
.selection-downloads .button:disabled { opacity: .42; cursor: not-allowed; }
.selection-downloads .cloud-export-button { color:var(--theme-control-on-primary,#fff); background:var(--theme-primary-paint,var(--theme-primary)); border-color:var(--theme-primary); }
.selection-downloads .cloud-export-button:hover { background:var(--theme-primary-dark,var(--theme-primary)); border-color:var(--theme-primary-dark,var(--theme-primary)); }
.selection-panel p { margin: 12px 0 0; color: var(--theme-muted); font-size: .82rem; line-height: 1.45; }

.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.media-card { position: relative; min-width: 0; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 17px; background: color-mix(in srgb, var(--theme-primary) 8%, #e6ebe8); box-shadow: 0 8px 24px rgba(20,39,33,.09); cursor: zoom-in; }
.media-card[hidden] { display: none; }
.media-card img, .media-card video { width: 100%; height: 100%; display: block; object-fit: cover; image-orientation: from-image; transition: transform .24s ease; }
.media-card:hover img, .media-card:hover video { transform: scale(1.025); }
.media-card-processing{cursor:default}.media-processing-placeholder{position:absolute;inset:0;display:grid;place-content:center;justify-items:center;gap:8px;padding:24px;text-align:center;color:var(--theme-text);background:color-mix(in srgb,var(--theme-primary) 10%,#edf2ef)}.media-processing-placeholder strong{font-size:1.05rem}.media-processing-placeholder>span:last-child{color:var(--theme-muted);font-size:.88rem}.media-processing-placeholder .video-badge{position:static}
.media-overlay { position: absolute; inset: auto 0 0; z-index: 2; padding: 36px 13px 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.76)); opacity: 0; transition: opacity .2s; pointer-events: none; }
.media-card:hover .media-overlay, .media-card:focus-visible .media-overlay { opacity: 1; }
.media-overlay strong, .media-overlay span { display: block; }
.media-overlay span { color: rgba(255,255,255,.82); font-size: .78rem; }
.select-media { position: absolute; z-index: 5; top: 11px; right: 11px; left: auto; width: 30px; height: 30px; display: none; appearance: none; margin: 0; border: 2px solid #fff; border-radius: 50%; background: rgba(28,30,29,.58); box-shadow: 0 2px 9px rgba(0,0,0,.28); cursor: pointer; }
.select-media:checked { background-color: var(--theme-primary); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='m5 12 4 4L19 6'/%3E%3C/svg%3E"); background-size: 19px; background-position: center; background-repeat: no-repeat; }
.selection-mode .select-media { display: block; }
.selection-mode .media-card { cursor: pointer; }
.selection-mode .media-card:hover img, .selection-mode .media-card:hover video { transform: none; }
.selection-mode .media-card.selected::after { content: ''; position: absolute; inset: 0; z-index: 3; border: 4px solid var(--theme-primary); border-radius: inherit; background: color-mix(in srgb, var(--theme-primary) 12%, transparent); pointer-events: none; }
.video-badge, .temporary-badge { position: absolute; z-index: 4; top: 10px; left: 10px; padding: 5px 9px; border-radius: 999px; color: #fff; background: rgba(0,0,0,.68); font-size: .72rem; font-weight: 800; }
.temporary-badge { top: auto; bottom: 10px; background:var(--theme-primary-paint,var(--theme-primary)); }
.empty-gallery { padding: 70px 20px; text-align: center; color: var(--theme-muted); border: 2px dashed var(--theme-border); border-radius: 24px; }
.empty-gallery .button{color:var(--theme-button-text,#fff);background:var(--theme-primary-paint,var(--theme-primary));border-color:var(--theme-primary)}
.demo-gallery-note { margin: 0 0 20px; padding: 13px 16px; text-align: center; border-radius: 14px; color: var(--theme-primary-dark); background: color-mix(in srgb, var(--theme-accent) 15%, white); }
.event-timescales{margin:0 0 22px;border:1px solid var(--theme-border);border-radius:16px;background:color-mix(in srgb,var(--theme-primary) 4%,var(--theme-surface));overflow:hidden}.event-timescales summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 17px;color:var(--theme-primary);font-weight:850;cursor:pointer}.event-timescales summary small{color:var(--theme-muted);font-weight:600}.event-timescale-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:0 17px 17px}.event-timescale-grid div{display:grid;gap:4px;padding:13px 14px;border-radius:13px;background:var(--theme-surface)}.event-timescale-grid span{color:var(--theme-muted);font-size:.85rem;line-height:1.45}
.pin-panel { width: min(500px, calc(100% - 30px)); margin: 70px auto; padding: 34px; text-align: center; border-radius: 25px; background: var(--theme-surface-paint,var(--theme-surface)); box-shadow: 0 18px 50px rgba(20,44,36,.13); }
.pin-panel input { width: 100%; padding: 14px; margin: 18px 0 12px; text-align: center; border: 1px solid var(--theme-border); border-radius: 13px; letter-spacing: .18em; }

.lightbox { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 24px; background: rgba(5,11,9,.93); }
.lightbox.open { display: grid; }
.lightbox-content { max-width: min(1100px, 96vw); max-height: 84vh; }
.lightbox-content img, .lightbox-content video { max-width: 100%; max-height: 84vh; display: block; border-radius: 12px; image-orientation: from-image; }
/* Photos follow the finger while the neighbouring picture moves into view.
   Only enable the larger clipping canvas during an actual horizontal gesture. */
/* Match the existing edge-to-edge viewer dimensions. The extra specificity
   is deliberate: image-interactions.css sets full-viewport lightbox media. */
.lightbox.open .lightbox-content.is-gallery-swipe {
    position: relative;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    overflow: hidden;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}
.lightbox-swipe-stage { position: absolute; inset: 0; overflow: hidden; }
/* Keep exactly the same photo dimensions throughout the drag; no swipe-only padding or scaling. */
.lightbox-swipe-slide { position: absolute; inset: 0; display: grid; place-items: center; padding: 0; box-sizing: border-box; will-change: transform; }
.lightbox.open .lightbox-content.is-gallery-swipe .lightbox-swipe-slide img,
.lightbox.open .lightbox-content.is-gallery-swipe .lightbox-swipe-slide video {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100dvh;
    object-fit: contain;
    border-radius: 0;
    user-select: none;
    -webkit-user-drag: none;
}
.lightbox-swipe-video-placeholder { display: grid; place-items: center; width: min(420px, 80vw); aspect-ratio: 16 / 9; border-radius: 12px; background: #1b2925; color: #fff; font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
    .lightbox-swipe-slide { transition-duration: 0.01ms !important; }
}
.lightbox-close { position: fixed; top: 18px; right: 18px; z-index: 3; width: 44px; height: 44px; border: 0; border-radius: 50%; color: #fff; background: rgba(255,255,255,.14); font-size: 1.45rem; cursor: pointer; }
.lightbox-nav { position: fixed; top: 50%; z-index: 2; width: 52px; height: 52px; display: grid; place-items: center; transform: translateY(-50%); border: 0; border-radius: 50%; color: #fff; background: rgba(255,255,255,.16); font-size: 2.2rem; cursor: pointer; }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }
.lightbox-meta{position:fixed;z-index:3;left:50%;bottom:58px;transform:translateX(-50%);display:grid;gap:3px;width:max-content;max-width:min(760px,calc(100vw - 130px));padding:9px 14px;border:1px solid rgba(255,255,255,.14);border-radius:13px;color:#fff;background:rgba(6,12,10,.68);box-shadow:0 8px 30px rgba(0,0,0,.24);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);text-align:center;pointer-events:none}
.lightbox-meta[hidden]{display:none!important}
.lightbox-meta strong{font-size:.72rem;font-weight:850;letter-spacing:.04em;text-transform:uppercase;color:rgba(255,255,255,.78)}
.lightbox-meta span{font-size:.88rem;font-weight:600;line-height:1.4;color:#fff;text-wrap:balance}
.event-gallery-page.caption-style-fun .lightbox-meta{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"by deco" "caption deco";column-gap:9px;row-gap:1px;bottom:48px;width:max-content;max-width:min(520px,calc(100vw - 28px));padding:7px 12px 8px 15px;border:1px solid color-mix(in srgb,var(--theme-accent,#d7aa62) 42%,#fff);border-radius:18px;color:#17211e;background:rgba(255,255,255,.97);box-shadow:0 7px 22px rgba(0,0,0,.22);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);text-align:left}
.event-gallery-page.caption-style-fun .lightbox-meta::after{content:"";position:absolute;left:18px;bottom:-7px;width:16px;height:10px;background:rgba(255,255,255,.97);clip-path:polygon(0 0,100% 0,18% 100%)}
.event-gallery-page.caption-style-fun .lightbox-meta strong{grid-area:by;color:var(--theme-accent,#d7aa62);font-family:'DM Sans',system-ui,sans-serif;font-size:.66rem;font-weight:850;line-height:1.15;letter-spacing:.005em;text-transform:none}
.event-gallery-page.caption-style-fun .lightbox-meta span{grid-area:caption;color:#17211e;font-family:'DM Sans',system-ui,sans-serif;font-size:.94rem;font-style:italic;font-weight:650;line-height:1.16;letter-spacing:0;text-wrap:pretty;overflow-wrap:anywhere}
.event-gallery-page.caption-style-fun .lightbox-meta .caption-decoration{grid-area:deco;align-self:center;display:block;min-width:20px;color:var(--theme-accent,#d7aa62);font-family:'DM Sans',system-ui,sans-serif;font-size:1rem;font-style:normal;font-weight:900;line-height:1;text-align:center}
.event-gallery-page.caption-style-fun .lightbox-meta .caption-decoration[hidden]{display:none!important}
.event-gallery-page.caption-style-fun .lightbox-meta.caption-long{max-width:min(560px,calc(100vw - 24px))}
.event-gallery-page.caption-style-fun .lightbox-meta.caption-long span,
.event-gallery-page.caption-style-fun .lightbox-meta.caption-very-long span{font-size:.94rem;line-height:1.16}
.event-gallery-page.caption-style-fun .lightbox-meta.caption-variant-dash .caption-decoration{font-size:1.05rem;letter-spacing:-.18em;transform:rotate(-18deg)}
.event-gallery-page.caption-style-fun .lightbox-meta.caption-variant-emoji .caption-decoration{font-size:1.08rem;color:initial}
.event-gallery-page.caption-style-fun .lightbox-meta.caption-variant-heart .caption-decoration{font-size:1.38rem;font-weight:500}
.event-gallery-page.caption-style-fun .lightbox-meta.caption-variant-sparkle .caption-decoration{font-size:1.16rem}
.event-gallery-page.caption-style-fun .lightbox-meta.caption-variant-smile .caption-decoration{font-size:1.24rem;font-weight:650}
.lightbox-count { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); padding: 5px 10px; border-radius: 999px; color: #fff; background: rgba(0,0,0,.42); font-size: .8rem; }
.back-to-top { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 70; width: 50px; height: 50px; display: grid; place-items: center; transform: translateY(18px); border: 2px solid rgba(255,255,255,.8); border-radius: 50%; color: #fff; background: var(--theme-primary-paint,var(--theme-primary)); box-shadow: 0 10px 28px rgba(10,30,24,.32); opacity: 0; pointer-events: none; font-size: 1.35rem; font-weight: 800; cursor: pointer; transition: opacity .2s, transform .2s; }
.back-to-top.visible { transform: translateY(0); opacity: 1; pointer-events: auto; }

@media (min-width: 701px) {
    .event-gallery-page.caption-style-fun .lightbox-meta {
        bottom:16px;
        max-width:min(460px,46vw);
    }
    .event-gallery-page.caption-style-fun .lightbox-meta.caption-long,
    .event-gallery-page.caption-style-fun .lightbox-meta.caption-very-long {
        max-width:min(500px,48vw);
    }
    .event-gallery-page.caption-style-fun .lightbox-meta span,
    .event-gallery-page.caption-style-fun .lightbox-meta.caption-long span,
    .event-gallery-page.caption-style-fun .lightbox-meta.caption-very-long span {
        font-size:.94rem;
        line-height:1.16;
    }
    .event-gallery-page.caption-style-fun .lightbox-count {
        left:18px;
        bottom:16px;
        transform:none;
    }
}

@media (max-width: 980px) {
    .gallery-controls { grid-template-columns: 1fr; gap: 10px; }
    .gallery-control-actions { grid-template-columns: minmax(0, 1fr) auto auto; }
    .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .gallery-hero { padding: 38px 16px 30px; }
    .gallery-hero h1 { font-size: clamp(2.25rem, 13vw, 3.4rem); }
    .gallery-main { width: min(100% - 20px, 1280px); padding-top: 20px; }
    .gallery-summary { flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-bottom: 20px; text-align: center; white-space: nowrap; font-size: .78rem; }
    .gallery-controls { padding: 10px; border-radius: 17px; }
    .filter-group { display: grid; grid-template-columns: repeat(3, 1fr); }
    .filter-button,.tag-filter-button { min-width: 0; padding-inline: 8px; }
    .tag-filter-group{display:flex}
    .gallery-control-actions { grid-template-columns: minmax(0, 1fr) auto; }
    .gallery-search { grid-column: 1 / -1; grid-row: 2; }
    .sort-select { width: 100%; min-width: 0; }
    .gallery-control-actions > .button { min-width: 86px; }
    .selection-panel { padding: 15px; border-radius: 17px; }
    .selection-panel-top { grid-template-columns: 1fr auto auto; gap: 10px; font-size: .88rem; }
    .selection-downloads { display: grid; grid-template-columns: 1fr; gap: 8px; }
    .selection-downloads .button { min-width: 0; padding: 11px 8px; font-size: .78rem; line-height: 1.2; }
    .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .media-card { aspect-ratio: 1 / 1; border-radius: 13px; }
    .media-overlay { opacity: 1; padding: 30px 9px 8px; }
    .media-overlay strong { font-size: .78rem; }
    .media-overlay span { font-size: .68rem; }
    .select-media { top: 8px; right: 8px; width: 29px; height: 29px; }
    .lightbox { padding: 10px; }
    .lightbox-nav { width: 44px; height: 44px; top: auto; bottom: max(14px, env(safe-area-inset-bottom)); transform: none; }
    .lightbox-prev { left: 16px; }
    .lightbox-next { right: 16px; }
    .lightbox-meta { bottom: max(64px, calc(env(safe-area-inset-bottom) + 50px)); max-width:calc(100vw - 24px); padding:8px 12px; border-radius:12px; }
    .lightbox-meta strong{font-size:.66rem}.lightbox-meta span{font-size:.8rem}
    .event-gallery-page.caption-style-fun .lightbox-meta{bottom:max(46px,calc(env(safe-area-inset-bottom) + 38px));max-width:calc(100vw - 20px);padding:6px 10px 7px 13px;border-radius:17px}
    .event-gallery-page.caption-style-fun .lightbox-meta span,
    .event-gallery-page.caption-style-fun .lightbox-meta.caption-long span,
    .event-gallery-page.caption-style-fun .lightbox-meta.caption-very-long span{font-size:.88rem;line-height:1.16}
    .lightbox-count { bottom: max(12px, calc(env(safe-area-inset-bottom) + 4px)); }
    .back-to-top { right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); }
    .event-timescales summary{align-items:flex-start;flex-direction:column;gap:2px}.event-timescale-grid{grid-template-columns:1fr}
}


/* Compact sticky final-gallery controls shared by event, delivery and proofing */
.gallery-controls{position:sticky;top:10px;display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;margin-bottom:12px;padding:10px 12px;border-radius:16px}
.gallery-controls>.gallery-control-actions{display:flex;align-items:center;gap:8px;margin-left:auto;min-width:0}
.gallery-controls>.filter-group,.gallery-controls>.category-filters,.gallery-controls>.selection-filters{display:flex;flex-wrap:wrap;align-items:center;gap:5px}
.gallery-controls .filter-button,.gallery-controls .tag-filter-button,.gallery-controls .category-filter{min-height:38px;padding:7px 13px}
.gallery-controls .sort-select{min-height:40px}
.gallery-controls .gallery-search{min-height:40px}
.gallery-controls .tag-filter-group{grid-column:auto}
.selection-toolbar{position:sticky;top:82px;z-index:19;margin:0 0 12px;padding:9px 12px}
.selection-toolbar .selection-panel-top{display:flex;align-items:center;gap:10px}
.selection-toolbar .selection-panel-top strong{margin-right:auto}
.selection-toolbar .open-export-dialog{min-height:38px;margin-left:4px}
.export-dialog{width:min(480px,calc(100% - 28px));padding:0;border:0;border-radius:22px;color:var(--theme-text,var(--ink));background:transparent;box-shadow:0 24px 70px rgba(8,28,22,.32)}
.export-dialog::backdrop{background:rgba(7,24,20,.62);backdrop-filter:blur(3px)}
.export-dialog-card{position:relative;padding:25px;background:var(--theme-surface,#fff);border:1px solid var(--theme-border,var(--line));border-radius:22px}
.export-dialog-card h2{margin:0 38px 6px 0;font-size:1.35rem}
.export-dialog-card>p{margin:0 0 18px;color:var(--theme-muted,var(--muted))}
.export-dialog-card .field{margin:0 0 14px}
.export-dialog-card .field select{width:100%}
.export-dialog-close{position:absolute;right:14px;top:13px;width:36px;height:36px;border:0;border-radius:50%;color:var(--theme-text,var(--ink));background:color-mix(in srgb,var(--theme-primary,var(--brand)) 10%,#fff);font-size:1.35rem;cursor:pointer}
.export-destinations{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.export-destinations .button{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-width:0;padding-inline:10px}
.export-provider-icon{flex:0 0 auto;width:22px;height:22px;display:inline-grid;place-items:center;border-radius:4px;background:#fff}
.export-provider-icon svg{display:block;width:19px;height:19px}
.export-device-icon{color:var(--theme-primary);background:rgba(255,255,255,.92)}
.export-dialog-card>small{display:block;margin-top:13px;color:var(--theme-muted,var(--muted));line-height:1.45}
.export-selection-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin:0 0 16px}.export-selection-summary div{display:grid;gap:2px;min-width:0;padding:10px 7px;border:1px solid var(--theme-border,var(--line));border-radius:12px;text-align:center;background:color-mix(in srgb,var(--theme-primary,var(--brand)) 6%,var(--theme-surface,#fff))}.export-selection-summary strong{overflow:hidden;color:var(--theme-primary,var(--brand));font-size:.91rem;text-overflow:ellipsis;white-space:nowrap}.export-selection-summary span{color:var(--theme-muted,var(--muted));font-size:.66rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.site-back-to-top{display:none!important}
@media(max-width:700px){
.gallery-controls{top:7px;gap:7px;padding:8px;border-radius:15px}
.gallery-controls>.filter-group:first-child{display:grid;width:100%;grid-template-columns:repeat(3,minmax(0,1fr))}
.gallery-controls>.gallery-control-actions{width:100%;margin-left:0}
.gallery-controls>.gallery-control-actions .sort-select{flex:1;min-width:0}
.gallery-controls>.gallery-control-actions .gallery-search{order:3;width:100%;flex-basis:100%}
.gallery-controls>.category-filters,.gallery-controls>.selection-filters,.gallery-controls>.tag-filter-group{width:100%}
.selection-toolbar{top:72px;padding:8px 10px}
.selection-toolbar .selection-panel-top{display:grid;grid-template-columns:auto 1fr auto auto;gap:7px}
.selection-toolbar .selection-panel-top strong{margin:0;white-space:nowrap}
.selection-toolbar .selection-link{padding:5px 2px;white-space:nowrap}
.selection-toolbar .open-export-dialog{margin:0}
.export-dialog-card{padding:21px 18px}
.export-selection-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
.export-destinations{grid-template-columns:1fr}
}

/* Compact final-gallery controls and tile/list view */
.gallery-view-toggle{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:7px 13px;border:1px solid var(--theme-border);border-radius:12px;color:var(--theme-control-text,#17211e);background:var(--theme-control-background,#fff);font:inherit;font-size:.82rem;font-weight:800;cursor:pointer;white-space:nowrap}
.gallery-view-toggle:hover{border-color:var(--theme-primary);color:var(--theme-primary)}
.gallery-view-toggle .view-toggle-label{font-size:0}
.gallery-view-toggle .view-toggle-label::after{content:'Compact';font-size:.82rem}
.gallery-view-toggle[aria-pressed="true"] .view-toggle-label::after{content:'Tiles'}
.gallery-grid.is-list-view{grid-template-columns:repeat(auto-fit,minmax(148px,1fr));gap:8px}
.gallery-grid.is-list-view .media-card{aspect-ratio:1/1;min-height:0;border-radius:12px}
.gallery-grid.is-list-view .media-overlay{opacity:1;padding:30px 9px 8px}
.gallery-grid.is-list-view .media-overlay strong{font-size:.75rem}
.gallery-grid.is-list-view .media-overlay span{display:none}
.gallery-grid.is-list-view .select-media,.gallery-grid.is-list-view .proof-select,.gallery-grid.is-list-view .download-media{top:6px;right:6px;width:26px;height:26px}
@media(max-width:700px){
    .gallery-controls{padding:7px;gap:6px}
    .gallery-controls .filter-button,.gallery-controls .tag-filter-button,.gallery-controls .category-filter{min-height:34px;padding:6px 10px;font-size:.8rem}
    .gallery-controls .sort-select,.gallery-controls .gallery-search,.gallery-controls .gallery-category-dropdown select,.gallery-view-toggle{min-height:38px;border-radius:11px;font-size:.8rem}
    .gallery-controls>.gallery-control-actions{grid-template-columns:minmax(0,1fr) auto auto;gap:6px}
    .gallery-controls>.gallery-control-actions .sort-select{grid-column:1;order:3}
    .gallery-controls>.gallery-control-actions .gallery-view-toggle{grid-column:2;order:4}
    .gallery-controls>.gallery-control-actions #select-media{grid-column:3;order:5}
    .gallery-grid.is-list-view{grid-template-columns:repeat(auto-fit,minmax(88px,1fr));gap:6px}
    .gallery-grid.is-list-view .media-card{aspect-ratio:1/1;min-height:0;border-radius:10px}
    .gallery-grid.is-list-view .media-overlay{padding:24px 7px 6px}
    .gallery-grid.is-list-view .media-overlay strong{font-size:.67rem}
    .gallery-grid.is-list-view .media-overlay span{display:none}
    .gallery-grid.is-list-view .select-media{top:5px;right:5px;width:24px;height:24px}
}


/* Used-category dropdown for guest galleries */
.gallery-category-dropdown{display:block;min-width:170px;color:var(--theme-muted);font-size:.78rem;font-weight:800}
.gallery-category-dropdown select{width:100%;min-height:40px;padding:8px 36px 8px 12px;border:1px solid var(--theme-border);border-radius:12px;color:var(--theme-control-text,#17211e);background:var(--theme-control-background,#fff);font:inherit}
@media(max-width:700px){
.gallery-category-dropdown{width:100%;min-width:0}
}


/* Desktop guest uploader search width */
@media(min-width:701px){
.gallery-controls>.gallery-control-actions .gallery-search{flex:0 1 360px;width:360px;min-width:320px}
}


/* Unified public-gallery toolbar order and themed export action */
.gallery-controls > .gallery-control-actions{flex:1 1 640px;justify-content:flex-end}
.gallery-controls > .gallery-control-actions .gallery-view-toggle{order:4}
.gallery-controls > .gallery-control-actions #select-media,
.gallery-controls > .gallery-control-actions #demo-download-select{margin-left:0;order:5}
.gallery-controls > .gallery-control-actions .gallery-search{order:1}
.gallery-controls > .gallery-control-actions .gallery-category-dropdown,
.gallery-controls > .gallery-control-actions .category-filters{order:2}
.gallery-controls > .gallery-control-actions .sort-select{order:3;flex:0 0 200px}
.selection-toolbar .open-export-dialog{
    color:var(--theme-control-on-primary,#fff);
    background:var(--theme-primary-paint,var(--theme-primary));
    border-color:var(--theme-primary);
}
.selection-toolbar .open-export-dialog:hover{background:var(--theme-primary-dark,var(--theme-primary));border-color:var(--theme-primary-dark,var(--theme-primary))}
@media(max-width:700px){
    .gallery-controls > .gallery-control-actions{display:grid;grid-template-columns:minmax(0,1fr) auto;width:100%;flex-basis:100%}
    .gallery-controls > .gallery-control-actions .gallery-search{grid-column:1/-1;order:1;width:100%;min-width:0}
    .gallery-controls > .gallery-control-actions .gallery-category-dropdown,
    .gallery-controls > .gallery-control-actions .category-filters{grid-column:1/-1;order:2}
    .gallery-controls > .gallery-control-actions .sort-select{grid-column:1;order:3;width:100%;min-width:0;flex:auto}
    .gallery-controls > .gallery-control-actions #select-media{grid-column:2;order:4}
}

@media(max-width:700px){
    .gallery-controls > .gallery-control-actions{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto auto;gap:6px}
    .gallery-controls > .gallery-control-actions .gallery-category-dropdown,
    .gallery-controls > .gallery-control-actions .category-filters{grid-column:1;order:2}
    .gallery-controls > .gallery-control-actions .sort-select{grid-column:1;order:3}
    .gallery-controls > .gallery-control-actions .gallery-category-dropdown~.sort-select{grid-column:2}
    .gallery-controls > .gallery-control-actions .gallery-view-toggle{grid-column:3;order:4}
    .gallery-controls > .gallery-control-actions #select-media,
    .gallery-controls > .gallery-control-actions #demo-download-select{grid-column:4;order:5}
    .gallery-controls > .gallery-control-actions:not(:has(.gallery-category-dropdown)){grid-template-columns:minmax(0,1fr) auto auto}
    .gallery-controls > .gallery-control-actions:not(:has(.gallery-category-dropdown)) .gallery-view-toggle{grid-column:2}
    .gallery-controls > .gallery-control-actions:not(:has(.gallery-category-dropdown)) #select-media,
    .gallery-controls > .gallery-control-actions:not(:has(.gallery-category-dropdown)) #demo-download-select{grid-column:3}

    /* Keep final-gallery selection actions below the taller mobile filter panel. */
    .selection-toolbar{position:sticky;top:var(--selection-toolbar-top,72px);z-index:19}
    .selection-toolbar .selection-panel-top{grid-template-columns:auto auto auto minmax(64px,1fr)}
    .selection-toolbar .open-export-dialog{justify-self:end;width:100%;min-width:64px}
    .client-delivery-gallery .gallery-category-dropdown,
    .client-delivery-gallery .sort-select{width:100%;min-width:0}
    .client-delivery-gallery .gallery-category-dropdown select,
    .client-delivery-gallery .sort-select{padding-inline:11px 30px}
}

@media(min-width:701px){
    .gallery-controls:not(:has(>.filter-group))>.gallery-control-actions{flex:1 1 100%;margin-left:0}
    .gallery-controls>.gallery-control-actions .gallery-category-dropdown{flex:1 1 180px;max-width:300px}
    .gallery-controls>.gallery-control-actions .sort-select{flex:1 1 180px;max-width:300px}
}


.gallery-hero h1.hero-title-size-medium{font-size:clamp(2.15rem,5.6vw,4rem)}
.gallery-hero .hero-accent-line{margin-top:16px}
.gallery-controls>.gallery-control-actions .gallery-contributor-filter{order:1;flex:1 1 220px;max-width:360px}
@media(max-width:700px){
    .gallery-controls>.gallery-control-actions{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto}
    .gallery-controls>.gallery-control-actions .gallery-category-dropdown{grid-column:1;grid-row:1;order:1;width:100%}
    .gallery-controls>.gallery-control-actions #gallery-sort{grid-column:2;grid-row:1;order:2;width:100%}
    .gallery-controls>.gallery-control-actions .gallery-view-toggle{grid-column:3;grid-row:1;order:3}
    .gallery-controls>.gallery-control-actions .gallery-contributor-filter{grid-column:1/3;grid-row:2;order:4;width:100%;max-width:none}
    .gallery-controls>.gallery-control-actions #select-media,
    .gallery-controls>.gallery-control-actions #demo-download-select{grid-column:3;grid-row:2;order:5}
    .gallery-controls>.gallery-control-actions:not(:has(.gallery-category-dropdown)) #gallery-sort{grid-column:1/3}
}
.gallery-hero.hero-no-icon{padding-top:38px;padding-bottom:30px}
@media(max-width:700px){.gallery-hero h1.hero-title-size-medium{font-size:clamp(1.95rem,10vw,2.85rem)}.gallery-hero.hero-no-icon{padding-top:28px;padding-bottom:24px}}


/* Clear visual difference between final-gallery title sizes */
.gallery-hero h1.hero-title-size-large{font-size:clamp(3.2rem,7.2vw,5.4rem)}
.gallery-hero h1.hero-title-size-medium{font-size:clamp(2.15rem,4.8vw,3.65rem);line-height:1.05}
@media(max-width:700px){.gallery-hero h1.hero-title-size-large{font-size:clamp(2.8rem,12.5vw,3.7rem)}.gallery-hero h1.hero-title-size-medium{font-size:clamp(1.95rem,8.8vw,2.6rem);line-height:1.08}}


/* Gallery-specific mobile toolbars — real-gallery control repair */
.event-timescales summary{position:relative;padding-right:46px}
.event-timescales summary::after{content:'+';position:absolute;right:18px;top:50%;transform:translateY(-50%);color:var(--theme-primary,#1d6150);font-size:1.35rem;font-weight:850}
.event-timescales[open] summary::after{content:'−'}
.gallery-hero h1.hero-title-size-small{font-size:clamp(1.65rem,3.7vw,2.7rem);line-height:1.1}
.gallery-selection-dropdown{display:block;min-width:0}
.gallery-selection-filter{width:100%}
@media(max-width:700px){
  .gallery-controls{top:7px!important;gap:7px!important;padding:9px!important;border-radius:15px!important}
  .gallery-controls select,
  .gallery-controls button{min-width:0!important;max-width:100%;font-size:.8rem!important;white-space:nowrap}
  .gallery-controls .gallery-category-dropdown,
  .gallery-controls .gallery-category-dropdown select,
  .gallery-controls .gallery-selection-dropdown,
  .gallery-controls .gallery-selection-dropdown select{width:100%!important;min-width:0!important}
  .gallery-controls .gallery-view-toggle,
  .gallery-controls #select-media,
  .gallery-controls #demo-download-select,
  .gallery-controls #jump-finalise{width:100%!important;margin:0!important;padding-inline:8px!important}
  .gallery-controls .sort-select{width:100%!important}
  .selection-toolbar{display:block;position:sticky!important;top:var(--selection-toolbar-top,72px)!important;z-index:19!important;margin:0 0 8px!important;padding:7px 8px!important}
  .selection-toolbar[hidden]{display:none!important}
  .selection-toolbar .selection-panel-top{display:grid!important;grid-template-columns:auto 1fr 1fr minmax(72px,auto)!important;align-items:center!important;gap:5px!important}
  .selection-toolbar .selection-panel-top strong{margin:0!important;white-space:nowrap}
  .selection-toolbar .selection-link{min-width:0;min-height:34px!important;padding:5px 2px!important;white-space:nowrap}
  .selection-toolbar .open-export-dialog{grid-column:auto!important;width:100%!important;min-width:72px!important;min-height:36px!important;margin:0!important;padding-inline:9px!important}

  /* One named grid for each public toolbar. Explicit areas win over the
     older positional rules, including client-gallery.css loaded afterwards. */
  .gallery-controls .gallery-control-actions,
  .gallery-controls .proofing-filter-controls{display:contents!important}
  .gallery-controls .gallery-category-dropdown,
  .gallery-controls .gallery-selection-dropdown{display:block!important;max-width:none!important}
  .gallery-controls :is(select,button){min-height:40px!important;box-sizing:border-box}
  .gallery-controls select{padding:7px 23px 7px 8px!important}
  .gallery-controls .gallery-view-toggle::after,.gallery-controls .gallery-view-toggle .view-toggle-label::after{content:none!important}
  .gallery-controls .gallery-view-toggle .view-toggle-label{font-size:inherit!important}
  .gallery-controls :is(.gallery-category-dropdown){grid-area:category!important}
  .gallery-controls :is(#gallery-sort){grid-area:sort!important}
  .gallery-controls :is(.gallery-view-toggle){grid-area:view!important}
  .gallery-controls :is(#select-media,#demo-select,#demo-download-select){grid-area:select!important}
  .gallery-controls :is(#jump-finalise,#demo-jump-finalise){grid-area:review!important}
  .gallery-controls :is(.gallery-selection-dropdown){grid-area:selection!important}
  .gallery-controls :is(.gallery-contributor-filter){grid-area:contributor!important;max-width:none!important}
  .gallery-controls>.filter-group{grid-area:types!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;width:100%!important;gap:2px!important}
  .gallery-controls>.filter-group .filter-button{width:100%;padding:6px 3px!important}

  /* Proofing: All photos | Filter | Sort; Compact | Review & finalise | Select. */
  .client-proofing-gallery .proofing-gallery-controls{
    display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1.65fr) minmax(0,.95fr)!important;
    grid-template-areas:"selection category sort" "view review select"!important;
  }
  .client-proofing-gallery .proofing-gallery-controls:not(:has(.gallery-category-dropdown)){
    grid-template-areas:"selection selection sort" "view review select"!important;
  }
  .client-proofing-gallery .proofing-gallery-controls:not(:has(.gallery-selection-dropdown)){
    grid-template-areas:"category category sort" "view review select"!important;
  }
  .client-proofing-gallery .proofing-gallery-controls:not(:has(.gallery-selection-dropdown,.gallery-category-dropdown)){
    grid-template-areas:"sort sort sort" "view review select"!important;
  }

  /* Delivery: media types above the compact actions, only when present. */
  .client-delivery-gallery .gallery-controls{
    display:grid!important;grid-template-columns:minmax(0,.95fr) minmax(0,.95fr) minmax(0,1.1fr) minmax(0,1.2fr)!important;
    grid-template-areas:"category sort view select"!important;
  }
  .client-delivery-gallery .gallery-controls:has(>.filter-group){
    grid-template-areas:"types types types types" "category sort view select"!important;
  }
  .client-delivery-gallery .gallery-controls:not(:has(.gallery-category-dropdown)){
    grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-template-areas:"sort view select"!important;
  }
  .client-delivery-gallery .gallery-controls:has(>.filter-group):not(:has(.gallery-category-dropdown)){
    grid-template-areas:"types types types" "sort view select"!important;
  }

  /* Guest categories may be moved inside gallery-control-actions by gallery.js. */
  .event-gallery-page .gallery-controls{
    display:grid!important;grid-template-columns:minmax(0,.95fr) minmax(0,.95fr) minmax(0,1.1fr) minmax(0,1.2fr)!important;
    grid-template-areas:"category sort view select" "types types contributor contributor"!important;
  }
  .event-gallery-page .gallery-controls:not(:has(.gallery-category-dropdown)){
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    grid-template-areas:"sort sort view view select select" "types types types contributor contributor contributor"!important;
  }
  .event-gallery-page .gallery-controls:not(:has(>.filter-group)){
    grid-template-areas:"category sort view select" "contributor contributor contributor contributor"!important;
  }
  .event-gallery-page .gallery-controls:not(:has(>.filter-group,.gallery-category-dropdown)){
    grid-template-areas:"sort sort view view select select" "contributor contributor contributor contributor contributor contributor"!important;
  }
  .event-gallery-page .gallery-controls:not(:has(.gallery-contributor-filter)){
    grid-template-areas:"category sort view select" "types types types types"!important;
  }
  .event-gallery-page .gallery-controls:not(:has(.gallery-contributor-filter,.gallery-category-dropdown)){
    grid-template-areas:"sort sort view view select select" "types types types types types types"!important;
  }
  .event-gallery-page .gallery-controls:not(:has(.gallery-contributor-filter,>.filter-group)){
    grid-template-areas:"category sort view select"!important;
  }
  .event-gallery-page .gallery-controls:not(:has(.gallery-contributor-filter,>.filter-group,.gallery-category-dropdown)){
    grid-template-areas:"sort sort view view select select"!important;
  }

  .gallery-hero h1.hero-title-size-small{font-size:clamp(1.55rem,7.2vw,2.1rem)}
  .gallery-hero h1.hero-title-size-medium{font-size:clamp(1.85rem,8.5vw,2.55rem)}
  .gallery-hero h1.hero-title-size-large{font-size:clamp(2.25rem,10.5vw,3.25rem);overflow-wrap:anywhere}
}

/* Guest Gallery covers use the same neutral treatment as the matching upload page. */
.event-gallery-page .gallery-hero-cover,
.client-delivery-gallery.business-guest-gallery .gallery-hero-cover{
  opacity:.62;
  image-orientation:from-image;
}
.event-gallery-page .gallery-hero.has-cover::after,
.client-delivery-gallery.business-guest-gallery .gallery-hero.has-cover::after{
  background:linear-gradient(180deg,rgba(9,20,17,.16),rgba(9,20,17,.68));
}


/* Shared client-gallery subtitle and date sizing. */
.gallery-hero.hero-subtitle-size-small .gallery-hero-subtitle{font-size:.78rem}
.gallery-hero.hero-subtitle-size-medium .gallery-hero-subtitle{font-size:.94rem}
.gallery-hero.hero-subtitle-size-large .gallery-hero-subtitle{font-size:1.08rem}
.gallery-hero .gallery-hero-date{display:flex;align-items:center;justify-content:center;gap:7px;letter-spacing:.01em!important;text-transform:none!important;font-size:.76rem;font-weight:600}
.gallery-hero .gallery-hero-date .gallery-ui-icon{width:15px;height:15px;flex:0 0 15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:700px){
  .gallery-hero.hero-subtitle-size-small .gallery-hero-subtitle{font-size:.72rem}
  .gallery-hero.hero-subtitle-size-medium .gallery-hero-subtitle{font-size:.82rem}
  .gallery-hero.hero-subtitle-size-large .gallery-hero-subtitle{font-size:.94rem}
  .gallery-hero .gallery-hero-date{font-size:.69rem}
}

.export-device-status{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;margin-top:13px;padding:11px 12px;border:1px solid var(--theme-border,var(--line));border-radius:14px;color:var(--theme-text,var(--ink));background:color-mix(in srgb,var(--theme-primary,var(--brand)) 5%,var(--theme-surface,#fff))}
.export-device-status[hidden]{display:none!important}
.export-device-status-icon{width:30px;height:30px;display:grid;place-items:center;border-radius:50%;color:var(--theme-control-on-primary,#fff);background:var(--theme-primary-paint,var(--theme-primary,var(--brand)));font-weight:900}
.export-device-status>div{display:grid;gap:2px;min-width:0}.export-device-status strong{font-size:.84rem}.export-device-status span:not(.export-device-status-icon){color:var(--theme-muted,var(--muted));font-size:.72rem;line-height:1.4}.export-device-status .button{min-height:36px;padding:7px 11px;font-size:.74rem}.export-device-status [data-device-download-done]{color:var(--theme-control-on-primary,#fff)!important;background:var(--theme-primary-paint,var(--theme-primary,var(--brand)))!important;border-color:var(--theme-primary,var(--brand))!important}.export-device-status.is-success{border-color:color-mix(in srgb,var(--theme-primary,var(--brand)) 40%,var(--theme-border,var(--line)))}.export-device-status.is-warning .export-device-status-icon{background:#9a6b15}
@media(max-width:700px){.export-device-status{grid-template-columns:auto minmax(0,1fr)}.export-device-status .button{grid-column:1/-1;width:100%}}
