/* Gallery: the existing KAYSTRO palette and component language. */
.gallery{max-width:1200px;margin:0 auto;padding:64px 32px 90px;min-height:70vh;background:radial-gradient(ellipse at 90% 0,#243d7b30,transparent 48%)}
.gallery>a{display:inline-block;color:#a9b4cb;font-size:14px;margin-bottom:30px}.gallery>small{display:block}.gallery h1{font-size:clamp(38px,5.3vw,68px);line-height:1.08;letter-spacing:-.045em;margin:14px 0 22px;max-width:800px}.gallery h1 span{color:#7da6ff}.gallery>p{max-width:730px;color:#b2bed6;font-size:17px}
.gallery label{display:block;margin:18px 0;color:#c0cae0;font-size:14px;font-weight:600}.gallery input,.gallery textarea{display:block;width:100%;padding:12px 14px;margin-top:8px;border:1px solid #ffffff25;border-radius:9px;background:#050b1b;color:#f7f9ff;font:inherit}.gallery textarea{min-height:100px;resize:vertical}.gallery input:focus-visible,.gallery textarea:focus-visible{outline:2px solid #8cb8ff;outline-offset:3px}.gallery input[type=file]{padding:10px}.gallery input::file-selector-button{background:#182b50;color:#e0e9ff;border:0;border-radius:6px;padding:8px 12px;margin-right:12px}
.gallery button{padding:11px 17px;border:1px solid #ffffff25;border-radius:9px;background:#101a32;color:#e0e9ff;font:inherit;font-size:14px;font-weight:600;cursor:pointer;transition:background .2s,border-color .2s}.gallery button:hover{background:#1a2b50;border-color:#7da6ff80}.gallery button:disabled{opacity:.55;cursor:wait}.gallery button:focus-visible{outline:2px solid #8cb8ff;outline-offset:4px}
#gallery-upload{margin:32px 0;padding:28px 32px;border:1px solid #ffffff16;border-radius:18px;background:linear-gradient(145deg,#101a38,#090d1e);max-width:760px}#gallery-upload h2{margin:0;font-size:24px}#gallery-upload p{color:#9da9c1;font-size:13px}#gallery-upload>button,.gallery article form button{background:linear-gradient(135deg,#2677ff,#5158ff);color:white;border-color:transparent;box-shadow:0 10px 35px #1e5cff25}
.gallery nav{display:flex;flex-wrap:wrap;gap:10px;margin:38px 0 26px;padding-bottom:22px;border-bottom:1px solid #ffffff14}.gallery button[aria-pressed=true]{background:#1c3461;border-color:#7da6ff;color:white}
#gallery-photos{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,310px),1fr));gap:24px;align-items:start}.gallery article{min-width:0;padding:22px;border:1px solid #ffffff16;border-radius:18px;background:linear-gradient(145deg,#101a38,#090d1e);box-shadow:0 18px 50px #0003;overflow-wrap:anywhere}.gallery article img{display:block;width:100%;height:260px;object-fit:contain;border-radius:10px;background:#050817}.gallery article h2{font-size:22px;line-height:1.3;margin:20px 0 8px}.gallery article p{color:#a9b4cb;font-size:14px;white-space:pre-wrap}.gallery article button{margin:6px 8px 6px 0}.gallery article form{border-top:1px solid #ffffff14;margin-top:20px;padding-top:4px}#gallery-message:empty{display:none}#gallery-message:not(:empty){padding:14px 18px;border:1px solid #426baa;border-radius:10px;background:#101e38;color:#e0e9ff}#gallery-more{margin-top:26px}.gallery [hidden]{display:none!important}#gallery-photos>p{grid-column:1/-1;padding:48px 24px;text-align:center;color:#9da9c1;border:1px dashed #ffffff25;border-radius:15px;background:#0b1022}
@media(max-width:580px){.gallery{padding:38px 20px 60px}.gallery h1{font-size:42px}#gallery-upload{padding:22px 18px}.gallery nav{gap:8px}.gallery nav button{flex:1 1 auto}.gallery article{padding:18px}.gallery article img{height:230px}}
@media(prefers-reduced-motion:reduce){.gallery button{transition:none}}

.gallery .gallery-photo-open{display:block;width:100%;padding:0;margin:0;border:0;border-radius:10px;cursor:zoom-in}.gallery-viewer{width:min(1280px,96vw);max-width:96vw;max-height:94dvh;padding:20px;border:1px solid #426baa;border-radius:18px;background:#090f23;color:#e0e9ff;overflow:auto}.gallery-viewer::backdrop{background:#020511e8}.viewer-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;position:sticky;top:-20px;background:#090f23;padding:10px 0;z-index:1}.viewer-toolbar span{margin-left:auto}.viewer-stage{height:65dvh;overflow:auto;background:#050817;border-radius:10px;display:grid;place-items:start center}.viewer-stage img{display:block;width:auto;height:auto;max-width:100%;max-height:100%;margin:auto}.viewer-stage:focus-visible{outline:2px solid #8cb8ff;outline-offset:2px}.viewer-details{overflow-wrap:anywhere}.viewer-details p{white-space:pre-wrap;color:#b2bed6}.viewer-details textarea{box-sizing:border-box}.viewer-details form{max-width:760px}@media(max-width:580px){.gallery-viewer{padding:12px;width:94vw;max-height:96dvh;box-sizing:border-box}.viewer-toolbar{top:-12px}.gallery .viewer-toolbar button{padding:11px;min-height:44px}.viewer-stage{height:55dvh}}

.gallery-viewer{--viewer-height:65dvh}.viewer-stage{height:var(--viewer-height)}@media(max-width:580px){.gallery-viewer{--viewer-height:55dvh}}

/* Zoom dimensions always derive from the fitted image, preserving its aspect ratio. */
.viewer-stage{position:relative;display:block;overflow-x:auto;overflow-y:hidden;touch-action:pan-y}
.viewer-fit-bounds{position:absolute;top:0;left:0;width:100%;height:var(--viewer-height);pointer-events:none;visibility:hidden}
.viewer-image-plane{display:flex;align-items:center;justify-content:center;min-width:100%;min-height:100%}
.viewer-stage img{flex:none;max-width:none;max-height:none;object-fit:contain;user-select:none}
.viewer-stage[data-zoomed=true]{cursor:grab}
.viewer-stage[data-dragging=true]{cursor:grabbing}
.viewer-toolbar output{min-width:4ch;text-align:center;font-variant-numeric:tabular-nums;color:#e0e9ff}

.gallery select{padding:12px;border:1px solid #ffffff25;border-radius:9px;background:#050b1b;color:#f7f9ff;font:inherit;margin-left:12px}.gallery #profile-form{max-width:760px;padding:28px;border:1px solid #ffffff25;border-radius:18px;background:#101a38}.gallery input{box-sizing:border-box}.community-personal-links{padding:24px 32px;text-align:center}

.gallery input[type=checkbox]{display:inline-block;width:auto;margin-right:8px}.gallery #public-profile-form{max-width:760px;padding:24px;border:1px solid #ffffff25;border-radius:18px;background:#101a38}.gallery #public-profile-content{max-width:760px;white-space:pre-wrap;overflow-wrap:anywhere}

.gallery .gallery-delete{border:1px solid #b26676;color:#ffb8c4;background:#321825}.gallery-delete:hover{background:#492233}
