/* Click Precision Scenario Styles */

/* Targets sit at viewport-relative spots so they reach the far edges at every
   resolution: a coordinate-scaling bug misses most in the bottom-right. */
.cp-info {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: #374151;
}

.cp-arena {
  position: fixed;
  top: 220px; /* overwritten by the controller to sit right under .cp-info */
  left: 0;
  right: 0;
  bottom: 0;
  border-top: 1px dashed #d1d5db;
  background: repeating-linear-gradient(45deg, #f9fafb 0 12px, #f3f4f6 12px 24px);
}

.cp-top-left     { position: absolute; top: 2%;    left: 2%; }
.cp-top-right    { position: absolute; top: 2%;    right: 2%; }
.cp-bottom-right { position: absolute; bottom: 2%; right: 2%; }
.cp-bottom-left  { position: absolute; bottom: 2%; left: 2%; }
.cp-centre       { position: absolute; top: 50%;   left: 50%; transform: translate(-50%, -50%); }
.cp-centre-left  { position: absolute; top: 50%;   left: 4%;  transform: translateY(-50%); }
.cp-centre-right { position: absolute; top: 40%;   right: 4%; transform: translateY(-50%); }

.cp-target {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #4f46e5;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.cp-target.done,
.cp-cell.done,
.cp-tool.done .cp-icon {
  background: #d1fae5;
  border-color: #10b981;
}

.cp-grid {
  position: absolute;
  inset: 1%;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 4px;
}

.cp-cell {
  font: inherit;
  font-weight: 600;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.cp-toolbar {
  position: absolute;
  right: 2%;
  bottom: 2%;
  display: flex;
  gap: 6px;
}

.cp-tool { position: relative; }

.cp-icon {
  width: 28px;
  height: 28px;
  border: 1px solid #9ca3af;
  border-radius: 6px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.cp-flyout {
  display: none;
  position: absolute;
  right: 0;
  bottom: 100%;
  padding: 4px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.cp-tool.open .cp-flyout { display: flex; flex-direction: column; gap: 2px; }

.cp-flyout button {
  font: inherit;
  padding: 0.2rem 1rem;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
}

.cp-flyout button:hover { background: #eef2ff; }
.cp-flyout button.done { background: #d1fae5; }

.cp-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85rem;
  font-weight: 600;
}

.cp-field input {
  font: inherit;
  font-weight: 400;
  width: 200px;
  padding: 0.3rem 0.5rem;
}

.cp-field input.done { border-color: #10b981; background: #ecfdf5; }

.cp-chip {
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  background: #4f46e5;
  color: #fff;
  font-weight: 600;
  cursor: grab;
  touch-action: none;
  user-select: none;
  z-index: 1;
}

.cp-slot {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.5rem;
  width: 160px;
  height: 100px;
  padding: 0.5rem;
  border: 2px dashed #9ca3af;
  border-radius: 8px;
  background: #fff;
  font-weight: 600;
  color: #6b7280;
}

.cp-slot .cp-chip { position: static; background: #10b981; }

.cp-canvas {
  display: block;
  width: 100%;
  height: 60vh;
  margin-top: 0.75rem;
  border: 1px dashed #d1d5db;
  background: #f9fafb;
}

/* scroll-list: a normal tall page; the info bar stays in view while the cards scroll under it. */
.cp-info-sticky {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 0.5rem 0;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.cp-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cp-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 320px;
  margin: 0 0 16px;
  padding: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
}

.cp-card-index { font-size: 0.8rem; color: #6b7280; }
.cp-card-name  { margin: 0; font-size: 1.1rem; }
.cp-card-price { margin: 0; color: #374151; }

.cp-open {
  align-self: flex-start;
  margin-top: auto;
  padding: 0.25rem 0.9rem;
  font: inherit;
  border: 1px solid #4f46e5;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.cp-open.done { background: #d1fae5; border-color: #10b981; }

/* inner-scroll: the page stays put, the box scrolls. */
.cp-scroller {
  height: 60vh;
  margin-top: 0.75rem;
  overflow-y: auto;
  padding: 0.5rem;
  border: 1px dashed #9ca3af;
  background: #f9fafb;
}

/* sticky-overlay-scroll: the Open button hugs the right edge, where the fixed chat widget sits. */
.cp-open-edge { align-self: flex-end; }

.cp-chat {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 6;
  width: 240px;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

/* scroll-corners: a three-screen page with targets on its far edges and a fixed footer. */
.cp-tall {
  position: relative;
  height: 300vh;
  margin-top: 0.75rem;
  border: 1px dashed #d1d5db;
  background: repeating-linear-gradient(45deg, #f9fafb 0 12px, #f3f4f6 12px 24px);
}

.cp-edge-left  { position: absolute; left: 0; }
.cp-edge-right { position: absolute; right: 0; }

.cp-footer-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48px;
  z-index: 4;
  border-top: 1px solid #d1d5db;
  background: #fff;
}

.cp-footer-left  { position: absolute; left: 4px;  bottom: 4px; }
.cp-footer-right { position: absolute; right: 4px; bottom: 4px; }

/* iframe pages: the frame sits below the fold. */
.cp-spacer { display: flex; align-items: flex-end; height: 110vh; color: #6b7280; }
.cp-spacer-short { height: 40vh; }
.cp-note { margin: 0.5rem 0 0; font-size: 0.85rem; color: #6b7280; }
.cp-frame { display: block; border: 1px dashed #9ca3af; background: #fff; }

/* dpr-probe: 10 px dots, one per grid cell, so they spread over the whole viewport. */
.cp-dots {
  position: absolute;
  inset: 1%;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(8, 1fr);
  place-items: center;
}

.cp-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 1px solid #4f46e5;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.cp-dot.done { background: #10b981; border-color: #10b981; }

/* dialog-targets: a dim backdrop, a dialog and a target just outside it. */
.cp-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, 0.35); }

.cp-dialog-wrap { width: 360px; }

.cp-dialog {
  padding: 1rem 1.25rem;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

.cp-dialog h2 { margin: 0 0 0.5rem; font-size: 1.1rem; }

.cp-dialog-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: #f3f4f6;
  cursor: pointer;
}

/* Below, not beside, the dialog: beside it would leave a 375 px viewport. */
.cp-outside { position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%); }

.cp-dialog-close.done, .btn.done { background: #d1fae5; }
