:root {
  color-scheme: dark;
  --ink: #f0f6f5;
  --line: #ffffff24;
  --edge: 24px;
  --gallery-width: min(320px, calc(100vw / 3));
  --overlay-bg: #0e191f80;
  --qr-size: 56px;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
body {
  margin: 0;
  background: #0a161b;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  overflow: hidden;
}
.camera-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background: #0a161b;
}
#video {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  cursor: crosshair;
}
#video[aria-disabled="true"] { cursor: default; }
.preview-placeholder { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 80px; }
.overlay-layer { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.overlay-layer .panel { pointer-events: auto; }
.site-header {
  position: absolute;
  z-index: 2;
  inset: var(--edge) calc(var(--gallery-width) + 2 * var(--edge)) auto var(--edge);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 18px;
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }
.brand {
  margin: 0;
  font-size: 20px;
  line-height: 42px;
  font-weight: 750;
  letter-spacing: .06em;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  white-space: nowrap;
  flex: 0 0 auto;
  text-shadow: 0 2px 12px #000b;
}
.qr-toggle { position: relative; z-index: 3; flex: 0 0 auto; width: var(--qr-size); height: var(--qr-size); border: 0; padding: 0; background: #fff; cursor: zoom-in; }
.brand-mark { display: block; width: 100%; height: 100%; background: #fff; transform-origin: top left; }
.qr-toggle[aria-expanded="true"] { cursor: zoom-out; }
.qr-toggle[aria-expanded="true"] .brand-mark { transform: scale(4); box-shadow: 0 2px 8px #0004; }
.qr-toggle:focus-visible { outline: none; }
.qr-toggle:focus-visible .brand-mark { outline: 1px solid #ffd284; outline-offset: 1px; }
.brand-name { display: block; }
.panel {
  position: absolute;
  z-index: 1;
  background: var(--overlay-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 8px 30px #0003;
  backdrop-filter: blur(8px);
  min-width: 0;
}
.camera-status {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(340px, calc(100vw - 2 * var(--edge)));
  max-height: calc(100dvh - 2 * var(--edge));
  text-align: center;
  overflow-y: auto;
  pointer-events: auto;
}
.camera-stage:has(.camera-status:not([hidden])) .preview-placeholder { visibility: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 8px; text-shadow: 0 1px 3px #000c; }
h2 { font-size: 15px; margin: 0; }
.photo-heading-toggle { display: block; border: 0; padding: 0; background: transparent; color: inherit; font: inherit; font-weight: 700; text-align: left; text-shadow: inherit; cursor: pointer; }
.gallery-reveal { position: absolute; z-index: 0; inset: 0 0 0 auto; width: 50%; height: 100%; border: 0; padding: 0; background: transparent; cursor: pointer; pointer-events: auto; }
.gallery-reveal:focus-visible { outline-offset: -3px; }
select {
  min-width: 42px;
  width: 260px;
  flex: 0 1 260px;
  height: 42px;
  border: 1px solid #ffffff32;
  border-radius: 7px;
  background: var(--overlay-bg);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  padding: 0 9px;
  text-shadow: 0 1px 3px #000c;
}
select option { background: #14252c; color: var(--ink); }
.placeholder-icon { font-size: 38px; color: #728f99; line-height: 1.2; }
.button {
  width: 42px;
  height: 42px;
  border: 1px solid #ffffff32;
  border-radius: 7px;
  padding: 9px;
  background: var(--overlay-bg);
  color: var(--ink);
  backdrop-filter: blur(8px);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.button:hover { filter: brightness(1.1); }
.button:disabled { opacity: .4; cursor: not-allowed; filter: none; }
.fullscreen-toggle { flex: 0 0 42px; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.status { font-size: 12px; border-radius: 7px; padding: 10px; margin: 0; background: #aa4226db; color: #ffd8bc; overflow-wrap: anywhere; }
.photo-panel {
  top: var(--edge);
  bottom: var(--edge);
  right: var(--edge);
  width: var(--gallery-width);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #6f8a94 transparent;
  cursor: pointer;
}
.photo-empty { display: grid; place-items: center; aspect-ratio: 4 / 3; background: #ffffff08; border: 1px dashed #ffffff24; border-radius: 9px; }
.photo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.photo-card { position: relative; min-width: 0; }
.photo-image { display: block; width: 100%; height: auto; border-radius: 8px; background: #14252c; cursor: default; }
.photo-actions { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 6px; }
.photo-actions .button { width: 40px; height: 40px; padding: 8px; background: #0e191fb3; backdrop-filter: blur(6px); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #ffd284; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 700px) {
  :root { --edge: 12px; --qr-size: 32px; }
  .site-header { gap: 8px; }
  .brand { font-size: 16px; gap: 6px; }
  .panel { border-radius: 10px; padding: 10px; }
  .panel-heading { gap: 4px; margin-bottom: 10px; }
  h2 { font-size: 12px; }
  select { font-size: 12px; padding: 0 5px; }
}
@media (max-width: 500px) {
  .brand { white-space: normal; line-height: 20px; }
  .brand-name { width: 3.2em; word-break: keep-all; }
}
@media (max-width: 400px) {
  .photo-panel { padding: 6px; }
  .photo-actions { right: 4px; bottom: 4px; gap: 4px; }
  .photo-actions .button { width: clamp(24px, 10vw, 36px); height: clamp(24px, 10vw, 36px); padding: 4px; }
  .photo-actions .icon { width: 100%; height: 100%; }
  .site-header { gap: 2px; }
  .brand { font-size: 12px; letter-spacing: 0; gap: 2px; }
}
