/* Cone Check v2 camera (Phase 1): merges cone-picker-r5.css + cone-camera-r3.css and adds the result-shape card,
   white-card step, split view in the shared stage and 44px targets throughout. */
/* Cone Check compact picker overlay (2026-10-05)
   Shared by Identify (color.html), Clothes, and Wiring.
   Goal: small ring, thin result card, one compact mode menu, camera stays visible. */

/* Small, see-through aim ring and tap pin (the sampled spot stays visible inside) */
.picker-compact .reticle {
  top: 44%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.picker-compact .pin {
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}

/* Close / Flip: smaller, lighter, no heavy gradient band */
.picker-compact .live-bar {
  padding: max(0.4rem, env(safe-area-inset-top)) 0.5rem 0.4rem;
  background: none;
  pointer-events: none;
}

.picker-compact .live-bar button {
  pointer-events: auto;
  min-height: 44px;
  min-width: 44px;
  padding: 0.3rem 0.95rem;
  font-size: 0.95rem;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* Result card: thin, translucent, bottom-center on phones, bottom-left on desktop */
.picker-compact .id-card {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(25rem, calc(100% - 1rem));
  bottom: max(0.5rem, env(safe-area-inset-bottom));
  gap: 0.25rem;
  padding: 0.4rem 0.45rem 0.45rem 0.6rem;
  border-radius: 16px;
  background: rgba(20, 18, 16, 0.74);
  color: #f6efe4;
  color-scheme: dark;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  max-height: 42vh;
  overflow-y: auto;
}

html[data-theme="light"] .picker-compact .id-card {
  background: rgba(255, 250, 243, 0.84);
  color: #1c1712;
  color-scheme: light;
}

@media (min-width: 900px) {
  .picker-compact .id-card {
    left: 1rem;
    transform: none;
    width: 23rem;
    bottom: 1rem;
  }
}

.picker-compact .id-card [hidden] { display: none !important; }

.picker-compact .id-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
}

.picker-compact .swatch {
  width: 1.75rem;
  height: 1.75rem;
  border: 2px solid currentColor;
}

.picker-compact .id-text {
  flex: 1 1 auto;
  min-width: 0;
}

.picker-compact .id-kicker {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.78;
}

.picker-compact .id-name {
  margin: 0;
  font-size: clamp(1.15rem, 4.6vw, 1.35rem);
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.picker-compact .id-more {
  display: grid;
  gap: 0.3rem;
}

.picker-compact .id-card.is-min .id-more { display: none; }

.picker-compact .id-detail {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.3;
}

.picker-compact .id-card .id-extra {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.3;
  color: inherit;
  opacity: 0.85;
}

.picker-compact .id-ref-note {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.25;
  opacity: 0.72;
}

/* Buttons inside the card: compact pills, still 44px tall */
.picker-compact .id-card button {
  justify-self: auto;
  margin: 0;
  min-height: 44px;
  padding: 0.25rem 0.85rem;
  font-size: 0.9rem;
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  border-color: rgba(246, 239, 228, 0.4);
  border-radius: 999px;
}

html[data-theme="light"] .picker-compact .id-card button { border-color: rgba(28, 23, 18, 0.35); }

.picker-compact .id-card .id-min {
  flex: 0 0 auto;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.15rem;
  line-height: 1;
  font-weight: 700;
}

.picker-compact .id-card .id-primary {
  background: #f6efe4;
  color: #141210;
  border-color: #f6efe4;
  font-weight: 700;
}

html[data-theme="light"] .picker-compact .id-card .id-primary {
  background: #1c1712;
  color: #fffaf3;
  border-color: #1c1712;
}

.picker-compact .id-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.picker-compact .id-actions:not(:has(> :not([hidden]))) { display: none; }

/* One compact mode menu instead of six stacked buttons (sits in the card's top row) */
.picker-compact .mode-pick { display: inline-flex; flex: 0 0 auto; }
.picker-compact .id-head .mode-pick select { max-width: 8.8rem; }

.picker-compact .mode-pick select {
  min-height: 44px;
  max-width: 13.5rem;
  padding: 0 0.35rem 0 0.45rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: none;
}

html[data-theme="light"] .picker-compact .mode-pick select {
  border: none;
  background: transparent;
}

.picker-compact .mode-pick select:focus-visible,
.picker-compact .id-card button:focus-visible {
  outline: 3px solid #f0b394;
  outline-offset: 2px;
}

html[data-theme="light"] .picker-compact .mode-pick select:focus-visible,
html[data-theme="light"] .picker-compact .id-card button:focus-visible { outline-color: #8a3f22; }

/* Compare (same / darker) inside the card, compact */
.picker-compact .compare-panel {
  margin: 0;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(127, 127, 127, 0.35);
}

.picker-compact .compare-swatches {
  margin: 0;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
}

.picker-compact .compare-swatches span {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid currentColor;
}

.picker-compact .compare-panel .verdict {
  margin: 0 0 0 0.2rem;
  padding: 0.1rem 0.6rem;
  font-size: 0.85rem;
  border-color: currentColor;
}

.picker-compact .cmp-why,
.picker-compact .compare-panel .note {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  line-height: 1.3;
  color: inherit;
}

.picker-compact .compare-panel .note { opacity: 0.75; }
.picker-compact .compare-panel .note:empty { display: none; }

html[data-theme="dark"] .picker-compact .verdict.is-yes { color: #58d1ab; }
html[data-theme="dark"] .picker-compact .verdict.is-maybe { color: #f0b394; }
html[data-theme="dark"] .picker-compact .verdict.is-no { color: #ff9a70; }
html[data-theme="light"] .picker-compact .verdict.is-yes { color: #0b6e55; }
html[data-theme="light"] .picker-compact .verdict.is-maybe { color: #8a3f22; }
html[data-theme="light"] .picker-compact .verdict.is-no { color: #a63a14; }

/* Wiring: the card name is the big high-contrast label; banner keeps the role line */
.picker-compact.is-wire .id-name {
  font-family: var(--sans);
  font-size: clamp(1.4rem, 6vw, 1.75rem);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.picker-compact .wire-banner {
  margin: 0;
  padding: 0.35rem 0.6rem;
  border-radius: 10px;
  text-align: left;
}

.picker-compact .wire-banner .wire-big { display: none; }

.picker-compact .wire-banner .wire-role {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.3;
  opacity: 1;
}


/* DR batch1-recheck: Why? inline with verdict; ⓘ in actions row (~100px shorter Same-or-not) */
.picker-compact .id-info {
  flex: 0 0 auto;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.75;
  font-size: 1.05rem;
  line-height: 1;
  border-radius: 999px;
  margin-left: auto;
}
.picker-compact .id-info[aria-expanded="true"] { opacity: 1; }
.picker-compact .id-ref-note[hidden],
.picker-compact .cmp-why[hidden],
.picker-compact .why-toggle[hidden] { display: none !important; }
.picker-compact .id-ref-note:not([hidden]) {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  line-height: 1.3;
  opacity: 0.85;
}
.picker-compact .why-toggle {
  margin: 0;
  min-height: 44px;
  padding: 0.15rem 0.7rem;
  font-size: 0.82rem;
  background: transparent;
  color: inherit;
  border: 1px solid rgba(127, 127, 127, 0.45);
  border-radius: 999px;
  opacity: 0.9;
  flex: 0 0 auto;
}
.picker-compact .why-toggle[aria-expanded="true"] { opacity: 1; font-weight: 700; }
.picker-compact .cmp-why:not([hidden]) {
  margin: 0.25rem 0 0;
}

/* Recheck: verdict + Why? share one centred row */
.picker-compact .compare-swatches > * { align-self: center; }
.picker-compact .compare-panel .verdict { margin: 0 0 0 0.2rem; }


/* Stale-photo fix: hide still canvas whenever we are not in photo mode,
   so a leftover frame cannot sit over the live camera feed. */
.id-stage:not(.is-photo) #id-still { visibility: hidden; }


/* =====================  Cone Check v2: one camera (Phase 1)  ===================== */

/* Setup panel */
.cam-v2 .mode-row-v2 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; margin: 0.6rem 0 0.2rem; }
.cam-v2 .mode-row-v2 label { min-height: 44px; display: inline-flex; align-items: center; }
.cam-v2 .mode-row-v2 select {
  min-height: 48px; padding: 0 2.2rem 0 0.9rem; border: 1px solid var(--edge); border-radius: 999px;
  background: var(--raise); color: var(--ink); font: inherit; font-weight: 650;
}
.cam-v2 .mode-panel[hidden] { display: none !important; }
.cam-v2 .mode-panel h2 { margin: 1rem 0 0.3rem; }
.cam-v2 .cam-common { margin-top: 0.8rem; }
.cam-v2 .screen-row { margin: 0; }
.cam-v2 .screen-row[hidden] { display: none; }
.screen-chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.screen-chip[aria-pressed="true"]::before { content: "\2713\00a0"; opacity: 1; position: static; transform: none; }
.cam-v2 .screen-chip { font: inherit; font-weight: 650; color: var(--ink); background: var(--bg); }
.cam-v2 .show-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 0.4rem 0 0.6rem; }
.cam-v2 .show-actions[hidden], .cam-v2 .show-actions [hidden] { display: none !important; }
.cam-v2 .match-note, .picker-compact .cmp-note { font-weight: 650; }
.cam-v2 .controls .sliders { margin-top: 0.8rem; }

/* Preset pills: absolute check with equal pad (from cone-camera-r3.css) */
.pill::before { content: "\2713"; position: absolute; left: 0.5rem; top: 50%; transform: translateY(-50%); opacity: 0; pointer-events: none; }
.pill:has(input:checked)::before { opacity: 1; }
#vision-plain { min-height: 4.5em; }
@media (min-width: 430px) { #vision-plain { min-height: 3em; } }
@media (min-width: 768px) { #vision-plain { min-height: 1.5em; } }

/* Stage: one fixed layer. The split view sits on top of the video in Show mode;
   the video keeps playing underneath (visibility only), so the stream never restarts. */
.id-stage .split { position: absolute; inset: 0; display: none; grid-template-rows: 1fr 1fr; gap: 2px; background: #000; }
.id-stage.is-show .split { display: grid; }
.id-stage.is-show .id-zoom { visibility: hidden; }
.id-stage.is-show .reticle, .id-stage.is-show .pin { display: none; }
.id-stage .split .pane { position: relative; min-height: 0; height: 100%; border-radius: 0; overflow: hidden; background: #12100e; }
.id-stage .split canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.id-stage .split .pane:first-child .tag { top: auto; bottom: 0.65rem; }
body.can-pan .id-stage .split canvas { cursor: grab; }
body.is-panning .id-stage .split canvas { cursor: grabbing; }

/* Card glass from tokens (both themes) */
.picker-compact .id-card { background: var(--card-glass); color: var(--ink); color-scheme: inherit; }
html[data-theme="light"] .picker-compact .id-card { background: var(--card-glass); color: var(--ink); }
.picker-compact .id-card button { border-color: color-mix(in srgb, var(--ink) 35%, transparent); }
html[data-theme="light"] .picker-compact .id-card button { border-color: rgba(28, 23, 18, 0.35); }
html[data-theme="dark"] .picker-compact .id-card button { border-color: rgba(246, 239, 228, 0.4); }
.picker-compact .id-card .id-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Card head: kicker, serif family headline */
.picker-compact .id-name { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; line-height: 1.15; }
@media (min-width: 820px) { .picker-compact .id-name { font-size: 1.4rem; } }
.picker-compact .id-mini { display: none; margin: 0; font-weight: 700; font-size: 1rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-compact .id-card.is-min .id-name, .picker-compact .id-card.is-min .id-kicker { display: none; }
.picker-compact .id-card.is-min .id-mini { display: block; }
.picker-compact .id-card.is-min { padding-top: 0.3rem; padding-bottom: 0.3rem; }
.picker-compact .id-card.is-min .id-head { min-height: 44px; }
.picker-compact .id-head .mode-pick select { max-width: 8.2rem; }
@media (max-width: 399.98px) { .picker-compact .id-head .mode-pick select { max-width: 7.4rem; } }
.picker-compact.is-wire .id-name { font-family: var(--sans); font-size: clamp(1.4rem, 6vw, 1.75rem); font-weight: 800; }
.picker-compact .rs-family { margin: 0; font-family: var(--serif); font-size: 1.05rem; }
.picker-compact .wire-role { margin: 0; font-size: 0.85rem; line-height: 1.3; }
.picker-compact .wire-meter { margin: 0; font-size: 0.82rem; font-weight: 650; }
.picker-compact .show-line { margin: 0; font-size: 0.9rem; line-height: 1.3; }

/* The four result lines */
.picker-compact .rs-lines { gap: 0.1rem 0.6rem; }
.picker-compact .rs-lines dt { font-size: 0.72rem; padding-top: 0.2rem; color: inherit; opacity: 0.78; }
.picker-compact .rs-lines dd { font-size: 0.95rem; line-height: 1.3; }
.picker-compact .rs-similar-row { display: flex; align-items: center; gap: 0.3rem; border-top: 1px solid rgba(127, 127, 127, 0.35); padding-top: 0.15rem; }
.picker-compact .rs-similar { margin: 0; flex: 1 1 auto; font-size: 0.85rem; line-height: 1.3; opacity: 0.85; }
.picker-compact .rs-similar-row[hidden], .picker-compact .rs-lines[hidden] { display: none !important; }
.picker-compact .id-status { margin: 0; font-size: 0.88rem; font-weight: 650; line-height: 1.3; }
.picker-compact .id-status:empty { display: none; }
.picker-compact .cmp-samples, .picker-compact .cmp-note, .picker-compact .cmp-darker { margin: 0.2rem 0 0; font-size: 0.85rem; line-height: 1.3; }

/* Speak (48px with glyph + word; the minimised row uses the glyph only) */
.picker-compact .id-card .speak-btn { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 48px; }
.picker-compact .id-card .speak-btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.picker-compact .id-card .speak-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.picker-compact .id-card .speak-mini { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; justify-content: center; flex: 0 0 auto; }
.picker-compact .id-card:not(.is-min) .speak-mini { display: none; }

/* Details */
.picker-compact .id-details { border-top: 1px solid rgba(127, 127, 127, 0.35); }
.picker-compact .id-details summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-size: 0.9rem; font-weight: 650; }
.picker-compact .id-details[open] { display: grid; gap: 0.35rem; padding-bottom: 0.2rem; }
.picker-compact .opt { display: grid; gap: 0.2rem; }
.picker-compact .opt[hidden], .picker-compact .opt-check[hidden] { display: none !important; }
.picker-compact .opt-label { margin: 0; font-size: 0.8rem; opacity: 0.8; }
.picker-compact .seg3 { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.picker-compact .seg3 button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.picker-compact .opt-check { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; font-size: 0.9rem; }
.picker-compact .opt-check input { width: 1.2rem; height: 1.2rem; accent-color: var(--ink); }
.picker-compact .no-voice { margin: 0; font-size: 0.85rem; }

/* White card step: overlay on the live view; the ring grows to 72px (no animation) */
.id-stage.is-white .reticle { width: 72px; height: 72px; margin: -36px 0 0 -36px; border-width: 3px; }
.white-step {
  position: absolute; z-index: 6; left: 50%; top: max(4rem, env(safe-area-inset-top));
  transform: translateX(-50%); width: min(24rem, calc(100% - 1rem));
  padding: 0.7rem 0.8rem; border-radius: 16px; background: var(--card-glass); color: var(--ink);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.white-step[hidden] { display: none; }
.white-step p { margin: 0 0 0.35rem; line-height: 1.3; }
.white-step .white-title { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }
.white-step .white-body { font-size: 0.9rem; }
.white-step .white-msg { font-weight: 650; font-size: 0.9rem; }
.white-step .white-msg:empty { display: none; }
.white-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.white-actions button { min-height: 44px; padding: 0.3rem 1rem; }
.white-actions button:not(.id-primary) { background: transparent; color: var(--ink); border: 1px solid var(--edge); }

/* Live bar */
.picker-compact .live-bar button[hidden] { display: none; }
.picker-compact.is-show .live-bar { background: none; }

/* The setup dock still needs room at the bottom */
body:has(.cam-v2) .site-footer { margin-bottom: 7rem; }

@media (prefers-reduced-motion: reduce) {
  .slider input[type="range"] { scroll-behavior: auto; }
}
