/* ============================================================
   trap. — edit suite
   Tool UI: near-black panels, white type, record-red accent
   (the one place red appears — playhead, markers, destructive).
   Mobile-first: timeline docks to the bottom like an NLE.
   ============================================================ */

.suite {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: #0d0d0f;
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  padding-bottom: env(safe-area-inset-bottom);
}

.suite[hidden] { display: none; }

/* ---------- top bar ---------- */

.suite__bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #26262a;
  flex-wrap: wrap;
}

.suite__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  margin-right: 0.35rem;
}

.suite__spacer { flex: 1; }

.suite__profiles {
  background: #1a1a1e;
  color: #fff;
  border: 1px solid #33333a;
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  font: inherit;
  max-width: 9rem;
}

.suite__shutter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #aaaab2;
  font-size: 0.72rem;
  white-space: nowrap;
}

.suite__shutter input {
  width: clamp(5rem, 10vw, 9rem);
  accent-color: rgb(255, 50, 50);
}

.suite__shutter output {
  min-width: 2.5rem;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.suite__btn {
  font: inherit;
  padding: 0.4rem 1rem;
  border-radius: 80px;
  border: 2px solid #fff;
  background: #fff;
  color: #000;
  cursor: pointer;
  transition: 0.25s ease-in-out;
}

.suite__btn:hover { transform: scale(1.04); }

.suite__btn--ghost {
  background: transparent;
  color: #fff;
  border-color: #3a3a42;
}

.suite__btn--ghost:hover { border-color: #fff; transform: none; }

.suite__btn--danger {
  background: transparent;
  color: rgb(255, 80, 80);
  border-color: rgba(255, 80, 80, 0.5);
}

.suite__btn--danger:hover { background: rgb(255, 50, 50); color: #fff; border-color: rgb(255,50,50); transform: none; }

.suite__close {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 1px solid #33333a;
  background: transparent;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
}

.suite__close:hover { background: #fff; color: #000; }

/* ---------- stage ---------- */

.suite__stage {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #000;
  overflow: hidden;
}

/* Absolutely positioned so the film's intrinsic size (e.g. a tall 4K phone
   clip) can never blow the stage out and push the transport/inspector off
   screen. object-fit keeps the whole frame visible, letterboxed. */
.suite__stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.suite__tc {
  position: absolute;
  top: 0.6rem;
  right: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

/* ---------- transport ---------- */

.suite__transport {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  border-top: 1px solid #26262a;
  overflow-x: auto;
}

.suite__chip {
  min-width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid #33333a;
  background: #1a1a1e;
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
}

.suite__chip:hover { background: #fff; color: #000; }

.suite__tool {
  font: inherit;
  font-size: 0.78rem;
  padding: 0.45rem 0.8rem;
  border-radius: 80px;
  border: 1px solid #33333a;
  background: transparent;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: 0.25s ease-in-out;
}

.suite__tool:hover { border-color: #fff; }

.suite__tool--accent {
  border-color: rgb(255, 50, 50);
  color: rgb(255, 90, 90);
}

.suite__tool--accent:hover { background: rgb(255, 50, 50); color: #fff; }

/* ---------- timeline ---------- */

.suite__timeline {
  padding: 0.5rem 0.75rem 0.25rem;
  display: grid;
  gap: 4px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.suite__track { position: relative; border-radius: 4px; }

.suite__track--speed { height: 1.6rem; background: #141417; }

.suite__speedseg {
  position: absolute;
  top: 0;
  height: 100%;
  border: 1px solid #33333a;
  border-radius: 4px;
  background: #1e1e23;
  color: #bbb;
  font: inherit;
  font-size: 0.7rem;
  cursor: pointer;
  overflow: hidden;
}

.suite__speedseg.is-selected { border-color: #fff; color: #fff; background: #2a2a31; }

.suite__track--film {
  height: 3.4rem;
  background: repeating-linear-gradient(90deg, #1b1b1f 0 14px, #232329 14px 16px);
  cursor: crosshair;
}

.suite__trimshade {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: rgba(0, 0, 0, 0.72);
  pointer-events: none;
}

.suite__trimshade--r { left: auto; right: 0; }

.suite__handle {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 14px;
  margin-left: -7px;
  border-radius: 4px;
  background: #fff;
  cursor: ew-resize;
  touch-action: none;
}

.suite__handle::after {
  content: "";
  position: absolute;
  inset: 30% 5px;
  border-left: 2px solid #000;
  border-right: 2px solid #000;
}

.suite__playhead {
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 2px;
  margin-left: -1px;
  background: rgb(255, 50, 50);
  pointer-events: none;
}

.suite__playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: -5px;
  border: 6px solid transparent;
  border-top-color: rgb(255, 50, 50);
}

.suite__track--markers { height: 1.9rem; }

.suite__pin {
  position: absolute;
  top: 0;
  width: 1.6rem;
  height: 1.6rem;
  margin-left: -0.8rem;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 1px solid rgb(255, 50, 50);
  background: #141417;
  color: rgb(255, 90, 90);
  font: inherit;
  font-size: 0.68rem;
  cursor: pointer;
}

.suite__pin > * { transform: rotate(45deg); }

.suite__pin.is-selected { background: rgb(255, 50, 50); color: #fff; }

/* ---------- inspector ---------- */

.suite__inspector {
  border-top: 1px solid #26262a;
  padding: 0.7rem 0.75rem calc(0.7rem + env(safe-area-inset-bottom));
  display: grid;
  gap: 0.55rem;
  max-height: 34vh;
  overflow-y: auto;
}

.suite__insp-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
}

.suite__field {
  display: grid;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: #9a9aa2;
}

.suite__field input,
.suite__field textarea,
.suite__field select {
  font: inherit;
  font-size: 0.9rem;
  color: #fff;
  background: #1a1a1e;
  border: 1px solid #33333a;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  outline: none;
}

.suite__field textarea {
  min-height: 5.8rem;
  resize: vertical;
  line-height: 1.45;
}

.suite__field select { appearance: auto; }

.suite__field input:focus-visible,
.suite__field textarea:focus-visible { border-color: #fff; }

.suite__field--wide {
  grid-column: 1 / -1;
}

.suite__cta-list {
  display: grid;
  gap: 0.45rem;
}

.suite__cta-row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) auto;
  gap: 0.45rem;
  align-items: center;
}

.suite__cta-row input {
  min-width: 0;
}

.menu-editor {
  width: min(42rem, calc(100vw - 2rem));
  max-height: min(90dvh, 56rem);
}

.menu-editor__form {
  max-height: calc(90dvh - 2rem);
  overflow-y: auto;
}

.menu-editor__items {
  display: grid;
  gap: 1rem;
}

.menu-editor__item {
  display: grid;
  gap: 0.65rem;
  border: 1px solid #33333a;
  padding: 0.85rem;
}

.menu-editor__item legend {
  padding-inline: 0.35rem;
  color: #fff;
}

.suite__insp-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.suite__chapter-preview {
  min-height: 7rem;
  border: 1px solid #33333a;
  border-radius: 8px;
  background: #141417;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #9a9aa2;
}

.suite__chapter-preview img,
.suite__chapter-preview video {
  width: 100%;
  height: 100%;
  max-height: 12rem;
  object-fit: cover;
  display: block;
}

.suite__hint { font-size: 0.78rem; color: #9a9aa2; line-height: 1.5; }

.suite__flash {
  position: absolute;
  left: 50%;
  bottom: calc(5.5rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: #fff;
  color: #000;
  padding: 0.5rem 1.1rem;
  border-radius: 80px;
  font-size: 0.8rem;
  white-space: nowrap;
  animation: flash-in 0.2s ease-out;
  z-index: 5;
}

@keyframes flash-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---------- wider screens: inspector beside stage ---------- */

@media (min-width: 60rem) {
  .suite__timeline { padding-inline: 1.25rem; }
  .suite__transport, .suite__bar { padding-inline: 1.25rem; }
  .suite__inspector {
    max-height: 22vh;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    align-items: start;
  }
  .suite__insp-title { grid-column: 1 / -1; }
}
