/* =========================================================================
   PERMISSIONED INPUT DEMO (#permissionedInputDemo).
   See src/components/PermissionedInputDemo.astro for the storyboard.
   Timeline: public/js/permissioned-input-demo.js toggles `is-*` classes
   and positions `.pid__cursor` at runtime.

   A single steady scene, no crossfade — one collaborator's own
   restricted view: one editable row, everything else locked. Same
   --xxx-* palette likeness rules as every other demo on the site.
   ========================================================================= */

.pid {
  --pid-canvas: #FAF9F5;
  --pid-card: #FFFFFF;
  --pid-border: #DBDBDE;
  --pid-line: #EAEAEA;
  --pid-ink: #2B2B2B;
  --pid-ink2: #777777;
  --pid-accent: #6A5BC6;
  --pid-green: #2C8E45;
  --pid-green-soft: #C4EECF;
}

.pid__stage {
  position: relative; overflow: hidden; width: 100%;
  aspect-ratio: 3 / 2; min-height: 380px; max-width: 640px; margin: 0 auto;
  background: var(--pid-canvas);
  display: flex; flex-direction: column;
  transition: opacity .5s ease;
}
.pid.is-out .pid__stage { opacity: 0; }

.pid__topBar {
  flex: none; font-size: 11px; font-weight: 600; color: var(--pid-ink);
  padding: 12px 14px 9px; border-bottom: 1px solid var(--pid-line);
  white-space: nowrap;
}
.pid__pane { flex: 1; min-height: 0; min-width: 0; padding: 16px 18px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.pidHead { margin: 0 0 2px; font-size: 12px; font-weight: 600; color: var(--pid-ink); }

.pid__list { display: flex; flex-direction: column; gap: 6px; }
/* reserves room for the comment note so it never overlaps the row below —
   the note only ever appears on the Customer Success row. */
.pidRow[data-row="cs"] { margin-bottom: 22px; }
.pidRow {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--pid-card); border: 1px solid var(--pid-border); border-radius: 8px; padding: 9px 12px;
  transition: border-color .3s ease, box-shadow .3s ease;
}
.pidRow.is-locked { background: var(--pid-line); color: var(--pid-ink2); }
.pidRow__label { font-size: 10.5px; font-weight: 600; color: var(--pid-ink); }
.pidRow.is-locked .pidRow__label { color: var(--pid-ink2); }
.pidRow__val { font-size: 11px; font-weight: 700; color: var(--pid-ink); font-variant-numeric: tabular-nums; }
.pidRow__lock { font-size: 9.5px; color: var(--pid-ink2); }

.pidRow.is-editing { border-color: var(--pid-accent); box-shadow: 0 0 0 3px #ECECFF; }

/* the comment note that appears beside Customer Success. */
.pidNote {
  position: absolute; left: 10px; top: calc(100% + 4px); z-index: 5;
  background: #fff; border: 1px solid var(--pid-accent); color: var(--pid-ink);
  font-size: 8.5px; font-weight: 500; white-space: nowrap;
  padding: 4px 8px; border-radius: 6px; box-shadow: 0 6px 14px -8px rgba(20,19,15,.35);
  opacity: 0; transform: translateY(-3px); transition: opacity .3s ease, transform .3s ease;
}
.pid.is-noted .pidNote { opacity: 1; transform: none; }

.pidBadge {
  align-self: flex-start; margin-top: 16px; font-size: 9.5px; font-weight: 700; color: var(--pid-green);
  background: #E3F5E9; border: 1px solid var(--pid-green-soft); border-radius: 999px; padding: 4px 11px;
  opacity: 0; transform: translateY(4px); transition: opacity .4s ease, transform .4s ease;
}
.pid.is-resolved .pidBadge { opacity: 1; transform: none; }

.pid__cursor {
  position: absolute; top: 0; left: 0; opacity: 0; pointer-events: none; z-index: 9;
  transition: left .6s cubic-bezier(.5, .05, .3, 1), top .6s cubic-bezier(.5, .05, .3, 1), opacity .3s ease;
}
.pid.is-cursor-visible .pid__cursor { opacity: 1; }

@media (max-width: 420px) {
  .pid__stage { aspect-ratio: auto; min-height: 420px; }
}
