.gallery-trigger {
  position: absolute;
  left: 1.5%;
  top: 15.6%;
  width: 20.5%;
  height: 31.5%;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 8%;
  padding: 0;
  cursor: pointer;
  background: transparent;
  touch-action: manipulation;
}
.gallery-trigger:hover { background: #fff6e814; }
.gallery-trigger:focus-visible { outline: 3px dashed #fff8eb; box-shadow: 0 0 0 5px #732156; }
#gallery-camera, #gallery-print {
  max-height: calc(100dvh - 12px);
  max-width: none;
  margin: auto;
  padding: 0;
  overscroll-behavior: contain;
}
#gallery-camera {
  width: min(820px, calc(100vw - 10px));
  border: 0;
  border-radius: 20px;
  background: transparent;
  overflow: hidden auto;
}
#gallery-camera::backdrop { background: #39143088; }
#gallery-print::backdrop { background: #271223b3; }
.cam-stage {
  width: min(100%, 810px);
  margin: 0 auto;
  padding: 8px 0 12px;
  color: #35272e;
  container: cam-view / inline-size;
  font: 600 14px/1.25 "Trebuchet MS", Arial, sans-serif;
}
.cam-stage, .cam-stage * { box-sizing: border-box; }
.cam-unit { position: relative; margin: 7px 4.5% 8px 2%; }
.cam-strap {
  position: absolute;
  top: 21%;
  right: -5.4%;
  width: 7.6%;
  height: 67%;
  transform: rotate(-6deg);
  border: 7px solid #9c689a;
  border-left-width: 4px;
  border-radius: 60% 80% 70% 90%;
  background: transparent;
  box-shadow: inset 1px 1px 0 #502646, 1px 0 0 1px #4c284a, 3px 5px 6px #4d163c3b;
}
.cam-eyelet {
  position: absolute;
  z-index: 1;
  right: -1.9%;
  top: 21%;
  width: 3.3%;
  height: 10%;
  border: 4px solid #dbbfcd;
  border-radius: 5px 10px 9px 4px;
  box-shadow: 1px 1px 1px #553f52, inset 1px 1px 2px #593d5b;
}
.cam-case {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template: "brand grip" 30px "lcd rail" minmax(0, 1fr) / minmax(0, 1fr) 19%;
  gap: 4px 13px;
  padding: 10px 16px 16px 19px;
  aspect-ratio: 1.72;
  border: 2px solid #634664;
  border-radius: 29px 32px 33px 26px / 23px 29px 30px 25px;
  background:
    repeating-linear-gradient(0deg, #fff1fb14 0 .6px, transparent .6px 2px),
    radial-gradient(80% 100% at 12% 0%, #fff2fc 0, #efd0e1 44%, transparent 76%),
    linear-gradient(130deg, #c897b8, #f1d8e8 47%, #d4a9c7 73%, #b182aa);
  box-shadow: inset 0 3px 0 #fff3ff, inset 3px 0 1px #f8d6ef, inset -5px -6px 0 #a780a0,
    inset 0 -8px 0 #f2cce4, 1px 3px 0 #704c69, 1px 9px 13px #3b163344;
}
.cam-case::before, .cam-case::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  bottom: 6px;
  border: 1px solid #91768a;
  border-radius: 50%;
  background: linear-gradient(132deg, #ebd5e6 40%, #846d82 44% 55%, #f6ddec 60%);
  pointer-events: none;
}
.cam-case::before { left: 14px; }
.cam-case::after { right: 14px; }
.cam-brand {
  grid-area: brand;
  margin: 0;
  align-self: center;
  padding-left: 6px;
  color: #694861;
  text-shadow: 0 1px #fffafa;
  font: bold italic clamp(17px, 3.2cqi, 25px)/1 "Baskerville", Georgia, serif;
  letter-spacing: -.055em;
}
.cam-close {
  grid-area: grip;
  place-self: center end;
  display: grid;
  place-items: center;
  width: 34px;
  height: 28px;
  padding: 0 0 2px;
  border: 1px solid #926c86;
  border-radius: 15px;
  background: linear-gradient(#ffeffa, #ead1df 60%, #d7aec8);
  color: #5f3c57;
  box-shadow: inset 0 1px #fff6fb, 0 1px 1px #a48097;
  font: 21px/1 Arial, sans-serif;
  cursor: pointer;
}
.cam-close:hover, .print-nav button:hover { filter: brightness(1.07); }
.cam-bezel {
  grid-area: lcd;
  min-width: 0;
  min-height: 0;
  padding: 7px 8px 9px;
  border: 1px solid #7b5d77;
  border-radius: 13px;
  background: linear-gradient(135deg, #655666, #27252f 19%, #342734 66%, #7c667f);
  box-shadow: 0 1px 0 1px #fce5f2, 0 -1px 2px #846881, inset 1px 2px #928093;
}
.cam-lcd {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template: 22px minmax(0, 1fr) auto 47px / minmax(0, 1fr);
  border: 1px solid #332c37;
  border-radius: 4px;
  color: #fff1f6;
  background: #332834;
  overflow: hidden;
}
.cam-lcd-top {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: linear-gradient(#443844, #342c37);
  color: #fff1fa;
  font: bold 10px/1 "Courier New", monospace;
  letter-spacing: .07em;
}
.cam-playmode { display: flex; align-items: center; gap: 6px; margin-right: auto; }
.cam-playmode i { width: 0; height: 0; border: 4px solid transparent; border-left: 6px solid #f9c3e1; border-right: 0; }
.cam-battery { position: relative; width: 17px; height: 8px; border: 1px solid #e5d1e4; border-radius: 1px; background: repeating-linear-gradient(90deg, #d8e5aa 0 3px, transparent 3px 4px) 1px center/12px 4px no-repeat; }
.cam-battery::after { content:""; position:absolute; right:-3px; top:1px; width:2px; height:4px; background:#ddcddb; }
.cam-stage button { appearance: none; font-family: inherit; cursor: pointer; }
.cam-stage button:focus-visible { outline: 3px solid #ffed7c; outline-offset: 1px; z-index: 2; }
.cam-stage .cam-photo {
  position: relative;
  display: block;
  min-height: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: radial-gradient(ellipse, #463a40, #28242a);
  overflow: hidden;
  cursor: zoom-in;
}
.cam-photo .cam-hero { display:block; width:100%; height:100%; object-fit:contain; }
.cam-caption {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 6px 10px 5px;
  color: #fff6fc;
  background: #392d3b;
}
.cam-title { font: 700 13px/1.14 "Trebuchet MS", Arial, sans-serif; }
.cam-line {
  color: #eedce6;
  font: 12px/1.3 "Trebuchet MS", Arial, sans-serif;
  overflow-wrap: anywhere;
}
.cam-strip {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #a7849d #302632;
  padding: 3px 8px 5px;
  background: #302632;
}
.cam-thumb {
  position: relative;
  flex: 0 0 57px;
  min-width: 0;
  height: 100%;
  padding: 2px;
  border: 1px solid #8e7389;
  border-radius: 3px;
  background: #504253;
}
.cam-thumb img { display:block; width:100%; height:100%; object-fit:cover; object-position:50% 36%; border-radius:1px; }
.cam-thumb[aria-pressed="true"] { background:#f8bdd8; border-color:#fff1f7; box-shadow:0 0 0 1px #ed9bc1; }
.cam-rail { grid-area:rail; min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:space-around; gap:5px; }
.cam-optic {
  display: grid; place-items:center; width:61%; height:16%; max-height:38px;
  border:1px solid #8a6f85; border-radius:10px;
  background:linear-gradient(145deg,#a889a2,#e4cadd 66%,#fae3f0);
  box-shadow:inset 1px 2px 1px #b194aa,0 1px #ffe1f0;
}
.cam-optic i { display:block; width:64%; height:51%; border:2px solid #524656; border-radius:4px; background:linear-gradient(140deg,#9db1b9,#3d505f 38%,#5a4961 55%,#9c92a8); box-shadow:inset 1px 1px 2px #453943; }
.cam-dial {
  position:relative;
  width:100%; max-width:118px; aspect-ratio:1;
  display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) minmax(0,1fr); align-items:center;
  padding:4px; border:1px solid #95718e; border-radius:50%;
  background:conic-gradient(from 32deg,#c2aabf,#f5e1ee 14%,#d4bccf 30%,#a288a1 48%,#f1dfeb 63%,#d4bbd2 80%,#c2aabf);
  box-shadow:0 2px 1px #785b78,0 0 0 4px #c6abc0,0 0 0 5px #eed7e7,inset 0 1px 1px #fff1fc;
}
.cam-prev,.cam-next { display:grid; place-items:center; padding:0; height:68%; width:100%; color:#71496a; border:0; border-radius:36%; background:transparent; }
.cam-prev i, .cam-next i { display:block; width:0; height:0; border:5px solid transparent; filter:drop-shadow(0 1px #fdebfa); }
.cam-prev i {border-right:7px solid currentColor; border-left:0;}
.cam-next i {border-left:7px solid currentColor; border-right:0;}
.cam-zoom {
  aspect-ratio:1; min-width:0; padding:0; border:1px solid #8d6c88; border-radius:50%;
  color:#654662; background:radial-gradient(at 35% 15%,#fff1fc,#dfc2d8 66%,#b595b0);
  box-shadow:0 1px 1px #a88da1,inset 0 1px #fff1fa;
  font-weight:bold; font-size:clamp(9px,1.7cqi,13px);
}
.cam-zoom:active,.cam-next:active,.cam-prev:active {background:#c8a4be;}
.cam-grille {width:41%; height:16px; border-radius:5px; background:radial-gradient(ellipse,#785d75 26%,#e0c5d7 32%,transparent 43%) 0 0/5px 5px;}
@container cam-view (max-width: 515px) {
  .cam-unit { margin-inline: 1.5% 5%; }
  .cam-strap { right: -3.4%; width: 6.2%; top: 25%; height: 48%; transform: rotate(-3deg); border-width: 4px; }
  .cam-case { aspect-ratio:auto; grid-template:"brand grip" 30px "lcd lcd" auto "rail rail" 48px / 1fr 65px; gap:7px; padding:10px 12px 11px; border-radius:21px 23px 22px 21px; }
  .cam-bezel { height:clamp(268px,88cqi,370px); padding:5px; border-radius:9px; }
  .cam-lcd { grid-template-rows:20px minmax(0,1fr) auto 43px; }
  .cam-thumb { flex-basis: 48px; }
  .cam-rail { flex-direction:row; justify-content:space-between; padding:0 7px; }
  .cam-optic {width:41px;height:24px;margin-right:8px;}
  .cam-grille {order:1; width:36px; height:12px; margin-right:auto;}
  .cam-dial {order:2; width:137px; max-width:60%; height:39px; aspect-ratio:auto; padding:1px 4px; grid-template-columns:1fr 1fr 1fr; border-radius:23px; box-shadow:0 1px 1px #785b78,0 0 0 2px #c6abc0,0 0 0 3px #eed7e7;}
  .cam-prev, .cam-next {height:100%;}
  .cam-zoom {height:31px; min-width:35px; aspect-ratio:auto; border-radius:14px; font-size:11px;}
  .cam-caption { padding: 5px 8px; }
  .cam-brand {font-size:20px;}
}

#gallery-print {
  width: min(575px, calc(100vw - 20px));
  overflow: auto;
  border: 1px solid #805367;
  border-radius: 13px;
  background: #fff8f3;
  color: #492c40;
  box-shadow: 0 8px 42px #2c122a70;
}
.print-heading, .print-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
}
.print-heading { background: linear-gradient(#fff2fa, #eed4e4); }
.print-heading h2 { margin: 0; font: bold italic clamp(18px, 3.2vw, 24px)/1.15 Georgia, serif; }
.print-heading .cam-close { flex: none; }
.print-image { width: 100%; height: min(57dvh, 490px); display: block; object-fit: contain; background: #342a34; }
.print-footer p { margin: 0; font-size: 14px; line-height: 1.35; }
.print-source { display: inline-block; margin-top: 5px; color: #7d315f; font-size: 12px; font-weight: bold; text-underline-offset: 3px; }
.print-source[hidden] { display: none; }
.print-nav { display: flex; flex: none; gap: 4px; }
.print-nav button {
  width: 32px; min-height: 34px; padding: 0 0 2px; border: 1px solid #b78ca6; border-radius: 12px;
  background: #fae9f1; color: #714564; font: bold 23px/1 Georgia, serif; cursor: pointer;
}
@media (max-height: 490px) and (min-width: 570px) {
  #gallery-camera { width: min(85vw, 715px); }
  .cam-case { aspect-ratio: 2.12; }
}
