/* One popup style for the studio (studio tidy, 2026-11-20).
   Lifted from the Start panel (start_panel.css), which is the reference look:
   dark card, display-font uppercase title, one plain subtitle line, content in
   rounded step boxes, one full-width main button, a plain Cancel under it.
   Tokens come from styles.css. Every line of text that matters sets its own colour. */

.modal-card.ps-sheet {
  background: var(--studio-bg, #101113);
  border: 1px solid var(--studio-line, #2a2b2f);
  border-radius: 16px;
  color: #f1f5f9;
  max-height: calc(100dvh - 24px);
}

.ps-sheet .modal-title,
.ps-sheet .modal-title-row .modal-title {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f1f5f9;
}

.ps-sheet .modal-subtitle {
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 10px;
}

.ps-sheet .close-btn { color: #94a3b8; }
.ps-sheet .close-btn:hover { color: #f1f5f9; }

/* Step boxes */
.ps-step {
  border: 1px solid var(--studio-line, #2a2b2f);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.025);
}
.ps-step-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  color: #f1f5f9;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ps-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink-yellow);
  color: var(--ink-black);
  font-size: 0.75rem;
  font-weight: 900;
  align-self: center;
}
.ps-step-head small {
  margin-left: auto;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: #94a3b8;
}

/* Actions */
.ps-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 6px;
}
.ps-sheet .ps-main-btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 0.96rem;
  font-weight: 900;
  border-radius: 12px;
  justify-content: center;
}
.ps-sheet .ps-main-btn:disabled { opacity: 0.4; cursor: default; }
.ps-sheet .ps-cancel-btn {
  width: 100%;
  text-align: center;
  justify-content: center;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--studio-line, #2a2b2f);
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.ps-sheet .ps-cancel-btn:hover { border-color: #64748b; color: #f1f5f9; }

/* Secondary buttons inside a sheet: outlined, like Cancel, never a second filled colour. */
.ps-sheet .btn-secondary {
  background: transparent;
  border: 1px solid var(--studio-line, #2a2b2f);
  color: #f1f5f9;
  border-radius: 10px;
}
.ps-sheet .btn-secondary:hover { border-color: #64748b; }

/* Cutout Studio inside the sheet */
.ps-sheet .cutout-preview-box { margin: 0; }
.ps-sheet .cutout-buttons-dual { margin-top: 10px; }
.ps-sheet .ps-actions.cutout-actions {
  position: sticky;
  bottom: -16px;
  margin-bottom: -16px;
  padding: 10px 0 16px;
  background: var(--studio-bg, #101113);
  z-index: 2;
}

/* Preview inside the sheet */
.ps-sheet .phone-instruction { color: #cbd5e1; font-size: 0.82rem; text-align: center; }

/* Export Post inside the sheet (uniform .ps-sheet format tabs + quiet project details) */
.ps-sheet .export-subtitle { margin-bottom: 12px; }
.ps-sheet .export-notice {
  margin: 0 0 10px;
  font-family: var(--font-mono, 'Courier Prime', monospace);
  font-size: 0.76rem;
  color: #cbd5e1;
}
.ps-sheet .export-notice strong { color: #f4efe6; font-weight: 700; }
.ps-sheet .export-format-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.ps-sheet .export-format-pill {
  flex: 1 1 auto;
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid var(--studio-line, #2a2b2f);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: #cbd5e1;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
}
.ps-sheet .export-format-pill:hover { border-color: #64748b; color: #f1f5f9; }
.ps-sheet .export-format-pill.active {
  background: #f4efe6;
  border-color: #f4efe6;
  color: #16161a;
}
.ps-sheet .export-primary-action > [hidden],
.ps-sheet .export-slices-section[hidden] { display: none !important; }
.ps-sheet .export-slices-section { margin-top: 12px; }
.ps-sheet .export-slices-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ps-sheet .export-slices-title { font-size: 0.76rem; font-weight: 700; color: #94a3b8; }
.ps-sheet .export-slices-hint { font-size: 0.72rem; color: #64748b; }
.ps-sheet .export-project-details {
  margin-top: 12px;
  border: 1px solid var(--studio-line, #2a2b2f);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.ps-sheet .export-project-summary {
  padding: 10px 12px;
  font-family: var(--font-mono, 'Courier Prime', monospace);
  font-size: 0.76rem;
  font-weight: 700;
  color: #cbd5e1;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ps-sheet .export-project-summary::-webkit-details-marker { display: none; }
.ps-sheet .export-project-summary::after { content: '▸'; color: #94a3b8; }
.ps-sheet .export-project-details[open] .export-project-summary::after { content: '▾'; }
.ps-sheet .export-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px 12px;
}
.ps-sheet .export-project-actions .btn {
  flex: 1 1 120px;
  min-width: 0;
  margin-top: 0;
  padding-left: 10px;
  padding-right: 10px;
}
.ps-sheet .export-project-actions .export-reset-btn {
  flex: 0 0 auto;
  width: auto;
  padding: 0 12px;
}

/* ===== Cutout Studio, matched to the Start panel (2026-11-20, round 2) ===== */
.modal-card.cutout-modal-card.ps-sheet {
  max-width: 520px;
  padding: 16px;
}
.ps-sheet .modal-subtitle { margin-top: 0; }
.ps-sheet .tip-toggle-btn {
  background: transparent;
  border: 1px solid var(--studio-line, #2a2b2f);
  color: #cbd5e1;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
}
.ps-sheet .tip-toggle-btn.active { border-color: var(--ink-yellow); color: var(--ink-yellow); }
.ps-sheet .ios-tip-box { background: rgba(255,255,255,0.04); border: 1px solid var(--studio-line, #2a2b2f); border-radius: 10px; padding: 8px 12px; }
.ps-sheet .ios-tip-text { color: #cbd5e1; font-size: 0.8rem; }

/* The photo box: the Start panel's dashed add tile, large while empty. */
.ps-sheet .cutout-preview-box {
  height: 220px;
  border: 2px dashed #64748b;
  border-radius: 10px;
}
.ps-sheet .cutout-preview-box:hover { border-color: var(--ink-yellow); }
.ps-sheet .cutout-checker-bg { background-color: transparent; background-image: none; }
.ps-sheet .cutout-checker-bg:has(.cutout-stage:not([hidden])) {
  background-color: #1a1a24;
  background-image:
    linear-gradient(45deg, #12121c 25%, transparent 25%),
    linear-gradient(-45deg, #12121c 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #12121c 75%),
    linear-gradient(-45deg, transparent 75%, #12121c 75%);
}
.ps-sheet .cutout-placeholder { gap: 6px; }
.ps-sheet .cutout-upload-title {
  color: #f1f5f9;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ps-sheet .cutout-preview-box:hover .cutout-upload-title { color: var(--ink-yellow); }
.ps-sheet .cutout-upload-sub { color: #94a3b8; font-size: 0.8rem; }
.ps-sheet .cutout-badge { font-size: 0.7rem; }

/* Pick photo / Paste cutout and the mode pills: the Start panel's controls, full size. */
.ps-sheet .cutout-buttons-dual .btn { min-height: 44px; font-size: 0.85rem; font-weight: 700; }
.ps-sheet .pill-selector {
  background: transparent;
  border: 0;
  padding: 0;
  gap: 6px;
}
.ps-sheet .pill-btn {
  min-height: 40px;
  padding: 8px 6px;
  border: 1px solid var(--studio-line, #2a2b2f);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: #cbd5e1;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ps-sheet .pill-btn:hover { border-color: #64748b; color: #f1f5f9; }
.ps-sheet .pill-btn.active { background: var(--ink-yellow); border-color: var(--ink-yellow); color: var(--ink-black); }
.ps-sheet .cutout-brush-pill { margin-top: 8px; }
