/* Ocular PD Meter – change these variables to match your theme */
.ocular-pd,
.ocular-pd-field,
.ocular-pd-modal {
  --opd-accent: #111;
  --opd-accent-text: #fff;
  --opd-border: #ddd;
  --opd-muted: #666;
  --opd-radius: 10px;
}

/* product-page field */
.ocular-pd-field { margin: 0 0 1.2em; }
.ocular-pd-field label { display: block; font-weight: 600; margin-bottom: .4em; }
.ocular-pd-row { display: flex; gap: .5em; flex-wrap: wrap; align-items: center; }
.ocular-pd-row input { width: 7em; }

/* modal */
.ocular-pd-modal { position: fixed; inset: 0; z-index: 99999; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.ocular-pd-modal[hidden] { display: none; }
.ocular-pd-dialog { position: relative; background: #fff; border-radius: var(--opd-radius);
  width: min(560px, 100%); max-height: 100%; overflow: auto; padding: 24px; }
.ocular-pd-close { position: absolute; top: 8px; right: 12px; border: 0; background: none;
  font-size: 28px; line-height: 1; cursor: pointer; color: var(--opd-muted); }
body.opd-lock { overflow: hidden; }

/* component */
.ocular-pd { font-size: 15px; color: #222; text-align: center; }
.ocular-pd [hidden] { display: none !important; }
.opd-title { font-size: 1.35em; font-weight: 700; margin: 0 0 .2em; }
.opd-sub { color: var(--opd-muted); margin: 0 0 1em; }
.opd-actions { display: flex; gap: .6em; justify-content: center; flex-wrap: wrap; margin: 1em 0; }
.opd-btn { display: inline-block; padding: .7em 1.3em; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--opd-accent); background: #fff; color: var(--opd-accent);
  font: inherit; font-weight: 600; }
.opd-primary { background: var(--opd-accent); color: var(--opd-accent-text); }
.opd-tips { text-align: left; color: var(--opd-muted); margin: 1em auto 0; padding-left: 1.2em; max-width: 420px; }
.opd-tips li { margin: .25em 0; }

.opd-tabs { display: inline-flex; border: 1px solid var(--opd-border); border-radius: 999px; padding: 3px; gap: 3px; flex-wrap: wrap; justify-content: center; }
.opd-tabs button { border: 0; background: none; border-radius: 999px; padding: .5em 1em; font: inherit; cursor: pointer; color: var(--opd-muted); }
.opd-tabs button.is-active { background: var(--opd-accent); color: var(--opd-accent-text); }

.opd-bar { display: flex; gap: .6em; justify-content: center; flex-wrap: wrap; margin: .8em 0; }
.opd-help { width: 100%; margin: 0 0 .3em; font-weight: 600; }

.opd-stage { position: relative; border-radius: var(--opd-radius); overflow: hidden; background: #000; }
/* reset theme styles that would distort the overlay */
.opd-stage video, .opd-stage canvas { display: block; width: 100% !important; height: auto; max-width: none !important;
  max-height: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; object-fit: fill !important; }
.opd-marking canvas { touch-action: none; cursor: ew-resize; }
.opd-stage video + canvas { position: absolute; inset: 0; height: 100%; }
.opd-stage video[hidden] + canvas { position: static; }
.opd-mirror video, .opd-mirror canvas { transform: scaleX(-1); }
.opd-guide { position: absolute; left: 50%; top: 50%; width: 42%; aspect-ratio: 3 / 4;
  transform: translate(-50%, -50%); border: 2px dashed rgba(255,255,255,.7); border-radius: 50%; pointer-events: none; }
.opd-stage:not(.opd-mirror) .opd-guide { display: none; }
.opd-status { position: absolute; left: 0; right: 0; bottom: 14px; color: #fff; font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.opd-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255,255,255,.25); }
.opd-progress span { display: block; height: 100%; width: 0; background: #2ecc71; transition: width .15s; }
.opd-stage:not(.opd-mirror) .opd-progress, .opd-cardlive .opd-progress { display: none; }

.opd-result { margin-top: 1em; }
.opd-label { margin: 0; color: var(--opd-muted); text-transform: uppercase; letter-spacing: .08em; font-size: .8em; }
.opd-big { font-size: 2.6em; font-weight: 800; margin: .1em 0; }
.opd-mono { margin: 0 0 .6em; }
.opd-note { color: var(--opd-muted); font-size: .85em; }
.opd-warn { color: #b26a00; font-size: .9em; }
.opd-error { color: #c0392b; margin-top: 1em; }
.opd-debug { font: 12px/1.4 monospace; color: #555; background: #f4f4f4; padding: .5em; border-radius: 6px; }
