.camera-preview {
  /* Layout centers the lens even when shared button states change transform. */
  position:absolute; left:0; right:0; margin:0 auto; z-index:3;
  display:block; padding:0; border:0;
  border-radius:50%; overflow:visible;
  background:transparent; color:var(--paper,#F2E8DA); cursor:pointer;
  min-height:44px; touch-action:manipulation;
}
.camera-preview[hidden] { display:none; }
/* In the logging flow the lens sits on the page, over its transparent scrim
   and under no sheet: below the flow's header, above the marker's label. */
/* placed over the marker (left set by camera-dom), not centred on the page */
.camera-preview.camera-preview-log { position:fixed; z-index:42; right:auto; margin:0; }
.camera-preview:focus-visible { outline:2px solid currentColor; outline-offset:4px; }
.camera-video { display:block; width:100%; height:100%; object-fit:contain; background:transparent; transition-property:none; }
.camera-preview .camera-video {
  pointer-events:none; position:absolute;
  width:var(--camera-width,177.778%); height:var(--camera-height,100%);
  left:var(--camera-left,-38.889%); top:var(--camera-top,0%);
  object-fit:fill;
}
.camera-lens {
  position:absolute; inset:0; overflow:hidden; border-radius:inherit; isolation:isolate;
  -webkit-mask-image:radial-gradient(circle closest-side at 50% 50%, #000 77%, rgba(0,0,0,.97) 83%, rgba(0,0,0,.78) 90%, rgba(0,0,0,.35) 96%, transparent 100%);
  mask-image:radial-gradient(circle closest-side at 50% 50%, #000 77%, rgba(0,0,0,.97) 83%, rgba(0,0,0,.78) 90%, rgba(0,0,0,.35) 96%, transparent 100%);
}
.camera-lens::after {
  opacity:var(--camera-reveal-opacity,0);
  content:""; position:absolute; inset:3px; border-radius:inherit; pointer-events:none;
  background:radial-gradient(ellipse at 31% 19%, #dce6ed10, transparent 48%),
    linear-gradient(150deg, #c8dce30b, transparent 38%, #7b6a8a0b);
}
.camera-viewer {
  position:fixed; inset:0; box-sizing:border-box; margin:auto; padding:0;
  width:min(100%,480px); max-width:100%; height:100%; max-height:100%;
  border:0; overflow:hidden; background:var(--bg,#0B0910); color:var(--paper,#F2E8DA);
}
.camera-viewer::backdrop { background:var(--bg,#0B0910); }
.camera-viewer[open] { display:flex; flex-direction:column; align-items:center; }
.camera-viewer-top {
  position:absolute; top:max(16px,env(safe-area-inset-top)); left:20px; right:16px;
  display:flex; align-items:center; justify-content:space-between; gap:16px; z-index:1;
}
.camera-viewer-top h2 { font-family:inherit; font-weight:600; font-size:16px; line-height:1.4; margin:0; }
.camera-control {
  min-width:44px; min-height:44px; padding:10px 16px; border-radius:24px;
  border:1px solid rgba(242,232,218,.2); background:transparent; color:inherit;
  font:inherit; font-size:14px; cursor:pointer; touch-action:manipulation;
}
.camera-control:focus-visible { outline:2px solid currentColor; outline-offset:3px; }
.camera-viewer-centre { width:100%; margin:auto 0; display:flex; flex-direction:column; align-items:center; }
.camera-viewer-surface { width:100%; aspect-ratio:16/9; max-height:calc(100dvh - 300px); }
.camera-viewer-surface .camera-video { width:100%; height:100%; object-fit:contain; }
.camera-viewer-looks { margin-top:20px; display:flex; align-items:center; justify-content:center; gap:8px; }
.camera-viewer-looks [aria-pressed="true"] { background:rgba(242,232,218,.12); border-color:rgba(242,232,218,.45); }
.camera-viewer-controls { margin-top:14px; display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap; }
.camera-viewer-surface { position:relative; isolation:isolate; }
/* The Violet tide's blend layers (camera-tone.js), the video's next siblings:
   the whole lens, or only the picture inside the viewer's letterbox. Their
   host isolates them with the video. */
.camera-tone-layer { position:absolute; inset:0; display:block; pointer-events:none; }
.camera-tone-layer[hidden] { display:none; }
/* A picture from the past (camera-dom.js): the video's previous sibling, the
   same geometry, raised over the playing video and under the tone layers so
   it takes the same Violet tide. */
.camera-still { position:absolute; display:block; pointer-events:none; background:transparent; z-index:1; }
.camera-still[hidden] { display:none; }
.camera-preview .camera-still {
  width:var(--camera-width,177.778%); height:var(--camera-height,100%);
  left:var(--camera-left,-38.889%); top:var(--camera-top,0%); object-fit:fill;
}
.camera-viewer-surface .camera-still { inset:0; width:100%; height:100%; object-fit:contain; }
.camera-still:not([hidden]) ~ .camera-tone-layer { z-index:2; }
.camera-preview-past .camera-lens::after { z-index:3; }
.camera-control:disabled { opacity:.4; cursor:default; }
.camera-focus[aria-pressed="true"] { background:rgba(242,232,218,.12); }
.camera-viewer-surface.camera-setting-focus { cursor:crosshair; outline:1px solid rgba(242,232,218,.35); outline-offset:4px; }
.camera-focus-status { min-height:20px; margin:12px 20px 0; font-size:13px; opacity:.65; }
.camera-bubbles {
  position:absolute; left:50%; top:50%;
  width:calc(320px * var(--camera-scale,1)); height:calc(380px * var(--camera-scale,1));
  transform:translate(-50%,-44.2105263158%); pointer-events:none;
}
.camera-bubbles[hidden] { display:none; }
.camera-sound[hidden] { display:none; }

/* On a rotated phone, give the full frame the left side and keep every
   control reachable on the right instead of subtracting their height. */
@media (max-height:480px) and (orientation:landscape) {
  .camera-viewer { width:min(100%,860px); }
  .camera-viewer-centre {
    box-sizing:border-box; padding:0 16px; margin:76px 0 12px;
    height:calc(100dvh - 88px); min-height:0;
    display:grid; grid-template-columns:minmax(0,1fr) 190px;
    grid-template-rows:auto auto 1fr; gap:10px 16px; align-items:start;
  }
  .camera-viewer-surface { grid-column:1; grid-row:1 / 4; height:100%; max-height:none; }
  .camera-viewer-looks { grid-column:2; grid-row:1; margin:0; gap:6px; }
  .camera-viewer-controls { grid-column:2; grid-row:2; margin:0; gap:6px; }
  .camera-viewer-centre .camera-control { min-height:40px; padding:8px 10px; font-size:12px; }
  .camera-focus-status { grid-column:2; grid-row:3; margin:0; font-size:12px; }
}
