.project-gallery{min-width:0}
.project-card .project-gallery .gallery-frame,.project-gallery .gallery-frame{width:100%;margin:0;padding:0;aspect-ratio:auto;position:relative;border:1px solid #d4d2c5;border-radius:7px;overflow:hidden;background:var(--paper)}
.gallery-track{display:flex;width:100%;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:none;overscroll-behavior-x:contain;touch-action:pan-x pan-y pinch-zoom;-webkit-overflow-scrolling:touch}
.gallery-track::-webkit-scrollbar{display:none}
.gallery-track:focus-visible{outline:2px solid var(--accent-ink);outline-offset:-3px}
.gallery-slide{position:relative;flex:0 0 100%;min-width:0;aspect-ratio:8/5;scroll-snap-align:start;scroll-snap-stop:always;display:grid;place-items:center;background:var(--paper)}
.gallery-image-button{display:block;position:relative;width:100%;height:100%;padding:0;border:0;background:transparent;cursor:zoom-in;touch-action:pan-x pan-y pinch-zoom}
.gallery-image-button:focus-visible{outline:2px solid var(--accent-ink);outline-offset:-3px}
.project-gallery .gallery-image{display:block;width:100%;height:100%;max-width:100%;max-height:none;object-fit:contain;object-position:center;transform:none;translate:none;scale:none;filter:none;transition:none;user-select:none;-webkit-user-drag:none}
.gallery-indicator{position:absolute;left:10px;top:9px;pointer-events:none;border:1px solid #dfdece;border-radius:4px;padding:4px 7px;background:#faf7f0eb;color:var(--muted);font-size:9px;line-height:1.5;letter-spacing:.1px}
.gallery-toolbar{padding:11px 0 0}
.gallery-info{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:11px;line-height:1.6;color:var(--muted);min-height:20px}
.gallery-label{min-width:0;overflow-wrap:anywhere}
.gallery-count{flex:none;font:10px/1.5 Consolas,monospace;letter-spacing:1px;color:var(--accent-ink);font-variant-numeric:tabular-nums}
.gallery-original{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:44px;flex:none;padding:6px 0 6px 6px;color:var(--accent-ink);font-size:11px;white-space:nowrap;text-decoration:underline;text-underline-offset:4px;text-decoration-color:#ab573d55}
.gallery-controls{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:5px}
.gallery-arrow{display:grid;place-items:center;width:44px;height:44px;flex:0 0 44px;padding:0;border:1px solid #c9ccbd;border-radius:50%;background:#f3eee57a;color:var(--ink);transition:background .2s,border-color .2s}
.gallery-arrow svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.gallery-arrow:hover:not(:disabled){border-color:#84957e;background:#e4e7dc}
.gallery-arrow:disabled{opacity:.35;cursor:default}
.gallery-dots{display:flex;align-items:center;justify-content:flex-start;gap:4px;min-width:0;overflow-x:auto;scrollbar-width:none}
.gallery-dot{display:grid;place-items:center;flex:0 0 32px;min-width:32px;height:44px;padding:0 6px;border:0;background:none}
.gallery-dot>span{display:block;width:7px;height:7px;border-radius:20px;background:#adb4a5;transition:width .2s,background .2s}
.gallery-dot[aria-pressed=true]>span{width:22px;background:var(--accent)}
.gallery-dot:focus-visible{outline-offset:-3px;border-radius:5px}
.gallery-empty,.gallery-failure{padding:25px 18px;text-align:center;color:var(--muted);font-size:12px;line-height:1.9;background:#ede9df;border-radius:6px}
.gallery-empty{min-height:150px;display:grid;place-items:center}
.gallery-failure{display:flex;align-items:center;justify-content:center;flex-direction:column;width:100%;height:100%;gap:7px;min-width:0}
.gallery-failure strong{font-size:13px;font-weight:500;color:var(--ink)}
.gallery-failure span{max-width:25em;font-size:11px}
.gallery-retry{min-height:44px;margin-top:2px;padding:7px 12px;border-bottom:1px solid var(--accent-ink);color:var(--accent-ink);font-size:12px}
.project-card .project-open{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:46px;width:100%;margin:16px 0 0;padding:10px 0;border-top:1px solid var(--line);font-size:12px;line-height:1.7;text-align:left;color:var(--ink);border-radius:0}
.project-open>span{display:grid;place-items:center;width:27px;height:27px;background:#e4e7dc;border-radius:50%;font-size:15px}
#project-dialog[data-kind=project] #dialog-media{overflow:visible;background:none}
#dialog-media .project-gallery .gallery-image{max-height:none;object-fit:contain}
#dialog-media .gallery-slide{aspect-ratio:8/5;max-height:440px}
#dialog-media .gallery-indicator{font-size:10px}
#dialog-media .gallery-toolbar{padding:12px 1px 0}
#dialog-media .gallery-info{font-size:12px}
#dialog-media .gallery-controls{justify-content:center;gap:23px}
@media(max-width:640px){
  .project-card>.project-gallery{margin:0 16px}
  .gallery-toolbar{padding-top:10px}
  .gallery-info{font-size:10px;gap:8px}
  .gallery-indicator{font-size:8px;left:7px;top:7px;padding:3px 5px}
  .gallery-controls{margin-top:3px}
  .project-card .project-caption{padding-top:13px}
  .project-card .project-open{width:calc(100% - 36px);margin:17px 18px 10px}
  #dialog-media .gallery-indicator{font-size:8px}
  #dialog-media .gallery-controls{gap:18px}
  #dialog-media .gallery-info{font-size:11px}
}
@media(prefers-reduced-motion:reduce){.project-gallery *{scroll-behavior:auto!important;transition:none!important}}
html[data-motion=off] .project-gallery *{scroll-behavior:auto!important;transition:none!important}
