/* ===========================================================================
   POP — Review layer: comment annotations + exploded view
   Prototype chrome only. None of this is product UI; it never ships.
   =========================================================================== */

/* --- Toolbar in the side panel ----------------------------------------- */
.tools { display: flex; flex-direction: column; gap: 6px; }
.tool {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 10px; border: 1px solid #e2e0dd; border-radius: 9px;
  background: #fff; cursor: pointer; text-align: left;
  font: var(--t-medium-13); color: var(--neutral-900);
  transition: background 120ms ease, border-color 120ms ease;
}
.tool:hover { background: #faf8f6; }
/* The reference links are `<a>`, not `<button>`, so they need the underline
   and the inherited colour turning off to match their neighbours. */
a.tool { text-decoration: none; }
a.tool .tool__key { margin-left: auto; }
.tool.is-on { background: #eef4ff; border-color: #b9d0ff; color: #1b4fd8; }
.tool__key { margin-left: auto; font: 600 10px/1 var(--font-ui); color: var(--neutral-400); }
.tool.is-on .tool__key { color: #6b93f0; }
.tool--primary { background: var(--neutral-900); border-color: var(--neutral-900); color: #fff; }
.tool--primary:hover { background: #1f1f1f; }
.tool--primary:disabled { opacity: .4; cursor: default; }

.field-inline {
  width: 100%; padding: 8px 10px; border: 1px solid #e2e0dd; border-radius: 8px;
  font: var(--t-medium-13); color: var(--neutral-900); background: #fff;
}
.field-inline::placeholder { color: var(--neutral-400); }

/* --- Comment list ------------------------------------------------------- */
.cmt-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.cmt-item {
  display: flex; gap: 9px; padding: 9px; border-radius: 9px; cursor: pointer;
  border: 1px solid #eceae7; background: #fff; text-align: left; width: 100%;
}
.cmt-item:hover { border-color: #d9d6d2; background: #faf8f6; }
.cmt-item.is-active { border-color: #b9d0ff; background: #f4f8ff; }
.cmt-pin {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font: 700 10px/1 var(--font-ui); color: #fff; background: #1b4fd8;
}
.cmt-body { min-width: 0; }
.cmt-text {
  font: var(--t-medium-13); color: var(--neutral-900);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cmt-meta { font: 500 10px/14px var(--font-ui); color: var(--neutral-400); margin-top: 3px; }
.cmt-empty { font: var(--t-regular-12); color: var(--neutral-400); padding: 6px 2px; }

/* Severity dots */
.sev { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.sev--blocker  { background: #d93b30; }
.sev--change   { background: #e88a1a; }
.sev--polish   { background: #2aa96a; }
.sev--question { background: #7a5af5; }

/* --- Annotation overlay on the device ----------------------------------- */
/* Above everything the app can put on screen (keyboard 800, drawer 810,
   home indicator 850, island 900) so any state can be annotated as seen. */
.anno-layer { position: absolute; inset: 0; z-index: 940; pointer-events: none; }
.anno-layer.is-armed { pointer-events: auto; cursor: crosshair; }

/* A saved comment collapses to its numbered dot.

   It used to keep the full highlight: a rectangle at z-940 with
   pointer-events:auto. Comment on something large — Sam's was 378×493, most of
   the screen — and every tap underneath hit the annotation instead of the
   prototype, so the review ended the moment you left a note. The ring is now
   decoration only; the dot is the sole hit target. */
.anno-region {
  position: absolute; pointer-events: none;
  border: 2px solid transparent; border-radius: 6px;
  background: none;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

/* The ring comes back when it is useful: while placing a comment, while
   hovering the dot, or while the comment is open. */
.anno-layer.is-armed .anno-region,
.anno-region.is-peek,
.anno-region.is-active {
  border-color: #1b4fd8;
  background: rgba(27, 79, 216, .12);
  box-shadow: 0 0 0 1px rgba(255,255,255,.7) inset;
}
.anno-layer.is-armed .anno-region { pointer-events: auto; cursor: pointer; }
.anno-region.is-active { border-color: #0d2f8f; background: rgba(27, 79, 216, .24); }
.anno-region.is-flash { animation: annoFlash 1.1s ease 2; }
@keyframes annoFlash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(27,79,216,0); }
  50% { box-shadow: 0 0 0 7px rgba(27,79,216,.28); }
}
.anno-region--draft {
  border-style: dashed; border-color: #1b4fd8;
  background: rgba(27,79,216,.08); pointer-events: none;
}

/* Hidden entirely — for reviewing a screen that already has notes on it. */
.anno-layer.annos-off .anno-region { display: none; }

.anno-pin {
  position: absolute; top: -11px; left: -11px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #1b4fd8; border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
  font: 700 11px/1 var(--font-ui); color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.28);
  pointer-events: auto; cursor: pointer;
  transition: transform 120ms ease;
}
.anno-pin:hover { transform: scale(1.18); }
/* Zero-size targets get a pin but no ring — a border around nothing reads as
   a rendering glitch (lesson carried over from the SystemTracker hotspots). */
.anno-region--point { border: 0; background: none; box-shadow: none; }

/* Composer */
.anno-composer {
  position: absolute; z-index: 960; width: 268px;
  background: #fff; border-radius: 12px; border: 1px solid #dcd9d5;
  box-shadow: 0 16px 40px rgba(0,0,0,.22);
  padding: 12px; pointer-events: auto;
  display: flex; flex-direction: column; gap: 10px;
}
.anno-composer textarea {
  width: 100%; min-height: 74px; resize: none;
  border: 1px solid #e2e0dd; border-radius: 8px; padding: 8px 10px;
  font: var(--t-medium-13); color: var(--neutral-900); background: #fff;
}
.anno-composer textarea:focus { outline: none; border-color: #1b4fd8; }
.anno-sevs { display: flex; gap: 5px; flex-wrap: wrap; }
.anno-sev {
  border: 1px solid #e2e0dd; background: #fff; border-radius: 100px;
  padding: 4px 9px; cursor: pointer;
  font: 600 11px/16px var(--font-ui); color: var(--neutral-500);
}
.anno-sev.is-on { border-color: var(--neutral-900); color: var(--neutral-900); background: #f5f3f1; }
.anno-actions { display: flex; gap: 6px; align-items: center; }
.anno-actions .spacer { flex: 1 1 auto; }
.mini-btn {
  border: 1px solid #e2e0dd; background: #fff; border-radius: 7px;
  padding: 6px 11px; cursor: pointer; font: 600 12px/16px var(--font-ui); color: var(--neutral-900);
}
.mini-btn:hover { background: #f7f5f3; }
.mini-btn--go { background: #1b4fd8; border-color: #1b4fd8; color: #fff; }
.mini-btn--go:hover { background: #1745bd; }
.mini-btn--del { color: #d93b30; border-color: #f0d5d2; }

/* Hint strip while comment mode is armed */
.anno-hint {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  z-index: 950; background: rgba(27,79,216,.95); color: #fff;
  font: 600 11px/16px var(--font-ui); padding: 6px 12px; border-radius: 100px;
  pointer-events: none; white-space: nowrap;
}

/* --- Exploded view ------------------------------------------------------ */
.exploded { display: none; width: 100%; }
body.is-exploded .exploded { display: block; }
body.is-exploded .device { display: none; }
body.is-exploded .stage { align-items: flex-start; }

.exploded__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.exploded__head h2 { font: 600 20px/26px var(--font-display); margin: 0; }
.exploded__head span { font: var(--t-regular-12); color: var(--neutral-500); }

.exploded__grid {
  display: grid; gap: 26px 22px;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
}

.mini { cursor: pointer; border: 0; background: none; padding: 0; text-align: left; }
.mini__frame {
  position: relative; width: 196px; height: 425px;
  border-radius: 23px; overflow: hidden; background: #000;
  box-shadow: 0 0 0 5px #1c1c1e, 0 10px 24px rgba(0,0,0,.16);
  transition: transform 180ms var(--ease-out-ios), box-shadow 180ms ease;
}
.mini:hover .mini__frame { transform: translateY(-4px); box-shadow: 0 0 0 5px #1c1c1e, 0 16px 34px rgba(0,0,0,.22); }
.mini__scaler {
  position: absolute; top: 0; left: 0;
  width: var(--screen-w); height: var(--screen-h);
  transform: scale(0.4987); transform-origin: top left;  /* 196 / 393 */
  pointer-events: none;
}
.mini__caption { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.mini__n { font: 700 10px/1 var(--font-ui); color: var(--neutral-400); }
.mini__t { font: var(--t-semibold-15); font-size: 13px; color: var(--neutral-900); }
.mini__badge {
  margin-left: auto; background: #1b4fd8; color: #fff;
  font: 700 10px/1 var(--font-ui); padding: 4px 7px; border-radius: 100px;
}
.mini.is-current .mini__t { color: var(--orange-700); }

/* Pins shown on the thumbnails, scaled with the screen */
.mini__pins { position: absolute; inset: 0; }

/* --- Exploded view: layers ------------------------------------------------
   Going into a screen's extra views fades this layer out and the next one in,
   so it reads as descending rather than as the grid being swapped out.
--------------------------------------------------------------------------- */
.exploded__grid {
  transition: opacity 150ms ease, transform 220ms var(--ease-out-ios);
}
.exploded__grid.is-out { opacity: 0; transform: scale(.985); }

.exploded__back {
  border: 1px solid #e2e0dd; background: #fff; border-radius: 9px;
  padding: 7px 12px; margin-right: 4px; cursor: pointer;
  font: 600 12px/16px var(--font-ui); color: var(--neutral-900);
}
.exploded__back:hover { background: #f7f5f3; }

/* "+3" on a card that has deeper views. Distinct from the blue comment count:
   this is structure, that is feedback. */
.mini__deeper {
  margin-left: auto; flex: 0 0 auto;
  font: 700 10px/14px var(--font-ui); color: var(--neutral-500);
  background: #efece8; border-radius: 100px; padding: 2px 7px;
}
.mini:hover .mini__deeper { background: #e4e0da; color: var(--neutral-900); }

@media (prefers-reduced-motion: reduce) {
  .exploded__grid { transition: none; }
}
