.om-capture-demo,.om-capture-demo * { box-sizing:border-box; }
.om-capture-demo {
  --oc-ink:#173249; --oc-muted:#426074; --oc-accent:#006b58; --oc-border:#c0d4df;
  color:var(--oc-ink); line-height:1.55; container:om-capture / inline-size;
}
.om-capture-status { margin:0 0 .65rem; color:var(--oc-muted); font-size:.88rem; }
.om-capture-photo { margin:0; }
.om-capture-stage { position:relative; aspect-ratio:3/2; overflow:hidden; isolation:isolate; border-radius:.75rem; background:#dfedf2; }
.om-capture-backdrop { position:absolute; inset:0; width:100%; height:100%; object-fit:fill; display:block; }
.om-capture-monitor-layer {
  position:absolute; inset:0; pointer-events:none;
  /* Keep the cup overlapping the bottom left of the monitor just like the photo. */
  clip-path:polygon(5.5% 7%,69.8% 5%,71% 64.8%,10.4% 70.6%,10.5% 67.7%,9.8% 66.7%,8.8% 65.9%,7.1% 65.3%);
}
.om-capture-monitor {
  position:absolute; top:0; left:0; width:640px; height:400px; overflow:hidden;
  transform-origin:0 0; background:#c3e4f0;
}
.om-capture-source {
  position:absolute; inset:0; display:block; overflow:hidden; pointer-events:auto;
  touch-action:none; user-select:none; -webkit-user-select:none;
}
.om-capture-desktop-art { position:absolute; inset:0; pointer-events:none; }
.om-capture-saved-file {
  position:absolute; z-index:1; inset-inline-start:6%; inset-block-end:8%; max-width:85%; pointer-events:none;
  display:grid; grid-template-columns:1.65em minmax(0,1fr); align-items:center; gap:.12em .55em;
  color:#124838; background:#f2fff7; border:1px solid #459077; border-radius:.45em;
  box-shadow:0 2px 10px #102d314d; padding:.45em .75em;
  font:650 clamp(17px,calc(var(--oc-cursor-size,52px)*.42),42px)/1.22 system-ui,sans-serif;
}
.om-capture-saved-icon {
  grid-row:span 2; display:grid; place-items:center; width:1.65em; aspect-ratio:1;
  color:#fff; background:#006b58; border-radius:.35em; font-weight:850;
}
.om-capture-saved-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.om-capture-saved-label { font-weight:620; overflow-wrap:anywhere; }
.om-capture-photo-missing .om-capture-saved-file { font-size:clamp(11px,2.5cqw,17px); }
.om-capture-desktop-art > svg,.om-capture-monitor-preview > svg,.om-capture-phone-view > svg { display:block; width:100%; height:100%; pointer-events:none; }
.om-capture-selection {
  position:absolute; border:2px solid #fff; background:#5ce6bd39;
  box-shadow:0 0 0 1px #09384a,0 0 0 999px #06253b55; pointer-events:none;
}
.om-capture-virtual-cursor {
  position:absolute; z-index:2; width:var(--oc-cursor-size,52px); aspect-ratio:5/6;
  pointer-events:none; filter:drop-shadow(0 1px 3px #0b2035aa);
}
.om-capture-virtual-cursor::before,.om-capture-virtual-cursor::after { content:""; position:absolute; display:block; }
.om-capture-virtual-cursor::before {
  inset:0; background:#112b42; clip-path:polygon(0 0,90% 69%,54% 70%,73% 90%,55% 100%,35% 76%,7% 96%);
}
.om-capture-virtual-cursor::after {
  inset:3% 4%; background:#fff; clip-path:polygon(1% 0,85% 67%,49% 68%,67% 89%,54% 96%,34% 72%,8% 90%);
}
.om-capture-popup-plane {
  position:absolute; top:0; left:0; width:640px; height:400px; transform-origin:0 0; pointer-events:none;
}
.om-capture-window {
  position:absolute; inset:32px 74px 27px 74px; display:grid; grid-template-rows:auto auto minmax(0,1fr) auto;
  gap:8px; align-content:start; overflow:hidden; padding:8px 12px 11px;
  background:#f8fbff; border:1px solid #8398b4; border-radius:9px;
  box-shadow:0 12px 36px #142b4e77; pointer-events:auto;
}
.om-capture-window-bar { display:flex; align-items:center; justify-content:space-between; padding-left:5px; }
.om-capture-window-brand { font:650 13px/1.2 system-ui,sans-serif; }
.om-capture-window-title { margin:0 0 0 5px; font:800 25px/1.2 system-ui,sans-serif; }
.om-capture-monitor-preview { overflow:hidden; display:grid; place-items:center; border-radius:5px; background:#e9f1fc; min-height:0; }
.om-capture-monitor-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.om-capture-monitor-actions .om-capture-button { min-height:var(--oc-projected-hit,45px); font-size:max(17px,calc(var(--oc-projected-hit,45px)*.31)); }
.om-capture-phone {
  position:absolute; top:0; left:0; width:192px; height:224px; overflow:hidden;
  transform-origin:0 0; border-radius:7px; pointer-events:none; background:#eaf2fd;
}
.om-capture-stage:not(.om-capture-mapped):not(.om-capture-photo-missing) :is(.om-capture-phone,.om-capture-monitor-layer,.om-capture-popup-plane) { visibility:hidden; }
.om-capture-phone-view { display:grid; place-items:center; align-content:center; width:100%; height:100%; padding:9px; }
.om-capture-phone-view.om-capture-received { grid-template-rows:minmax(0,1fr) auto; gap:5px; }
.om-capture-phone-hint { color:var(--oc-muted); text-align:center; font-size:.96rem; }
.om-capture-delivered { color:#155a4b; font-size:.9rem; font-weight:780; }
.om-capture-caption { margin:.36rem 0 0; color:var(--oc-muted); font-size:.8rem; }
.om-capture-demo [hidden] { display:none!important; }
.om-capture-demo :focus-visible { outline:3px solid var(--oc-accent); outline-offset:3px; }
.om-capture-source:focus-visible { outline-offset:-5px; }
.om-capture-button {
  min-height:44px; padding:.4rem .65rem; border:1px solid #7495a6; border-radius:.45rem; background:#fff;
  color:var(--oc-ink); font:750 .85rem/1.35 system-ui,sans-serif; cursor:pointer; touch-action:manipulation;
}
.om-capture-button:hover { background:#dff4ec; border-color:var(--oc-accent); }
.om-capture-primary { color:#fff; background:var(--oc-accent); border-color:var(--oc-accent); }
.om-capture-primary:hover { background:#005343; }
.om-capture-button:disabled { color:#587183; background:#edf4f7; border-color:var(--oc-border); cursor:default; }
.om-capture-status { margin:.45rem 0 0; }
.om-capture-status:empty { margin:0; }
.om-capture-stage.om-capture-photo-missing { display:grid; grid-template-columns:minmax(0,2.7fr) minmax(0,1fr); align-items:stretch; aspect-ratio:auto; gap:.45rem; padding:.5rem; }
.om-capture-photo-missing .om-capture-backdrop { display:none; }
.om-capture-photo-missing .om-capture-monitor-layer { clip-path:none; position:relative; border:2px solid #183449; border-radius:5px; overflow:hidden; }
.om-capture-photo-missing .om-capture-monitor { position:relative; transform:none!important; width:100%; height:auto; aspect-ratio:8/5; }
.om-capture-photo-missing .om-capture-phone { position:relative; transform:none!important; width:100%; height:auto; border:3px solid #183449; border-radius:.65rem; }
.om-capture-photo-missing .om-capture-phone-view { min-height:4.4rem; }
/* Keep the only three actions on the photo. On a narrow card, open the
   same popup in a larger overlay so every tap target remains usable. */
.om-capture-photo-missing .om-capture-popup-plane { transform:none!important; width:100%; height:100%; }
.om-capture-photo-missing .om-capture-window { inset:5%; gap:4px; padding:6px; }
.om-capture-photo-missing .om-capture-monitor-actions .om-capture-button { min-height:44px; font-size:.85rem; padding:.3rem; }
@container om-capture (max-width:430px) {
  .om-capture-popup-plane { transform:none!important; width:100%; height:100%; }
  .om-capture-window { inset:6%; gap:5px; padding:6px 8px 8px; }
  .om-capture-window-title { font-size:1rem; }
  .om-capture-window-brand { font-size:.68rem; }
  .om-capture-monitor-actions .om-capture-button { min-height:44px; font-size:.84rem; padding:.28rem; }
}
@media (any-pointer:fine) { .om-capture-source { cursor:crosshair; } }
