/* ---------- Hidden Gem: UI-only floating chrome ---------- */
/* Geometry contract: these controls are fixed viewport UI and reserve zero
   space in the authoring rail, artifact workspace, Preview, Final, or export. */
body.creator-studio-theme:not(.preview-mode):not(.finalized):not([data-exported="true"]) .hidden-gem-launcher {
  position: fixed !important;
  z-index: 1240;
  top: 5.25rem;
  right: 1rem;
  left: auto;
  bottom: auto;
  width: min(15rem, calc(100vw - 2rem));
  display: grid;
  justify-items: start;
  gap: .12rem;
  padding: .62rem .78rem;
  border: 1px solid rgba(91,255,151,.68);
  border-radius: .72rem;
  background: linear-gradient(145deg,rgba(3,17,10,.97),rgba(3,8,6,.98));
  color: #e7fff0;
  box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.42), inset 0 0 0 1px rgba(100,255,158,.08);
  contain: layout paint style;
  isolation: isolate;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
body.creator-studio-theme:not(.preview-mode):not(.finalized):not([data-exported="true"]) .hidden-gem-launcher:hover,
body.creator-studio-theme:not(.preview-mode):not(.finalized):not([data-exported="true"]) .hidden-gem-launcher:focus-visible {
  outline: 2px solid rgba(123,255,178,.42);
  outline-offset: 2px;
  border-color: rgba(165,255,201,.94);
}
.hidden-gem-launcher__title {
  color: #7affae;
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .18em;
}
.hidden-gem-launcher__status {
  color: #9bbcab;
  font-size: .61rem;
  letter-spacing: .06em;
}
.hidden-gem-launcher[data-state="ready"] {
  border-color: rgba(130,255,176,.9);
}
.hidden-gem-launcher.is-dragging {
  cursor: grabbing !important;
  transition: none !important;
}

body.creator-studio-theme:not(.preview-mode):not(.finalized):not([data-exported="true"]) .hidden-gem-panel {
  position: fixed !important;
  z-index: 1260;
  top: 7rem;
  right: 1.25rem;
  left: auto;
  bottom: auto;
  width: min(31rem, calc(100vw - 2rem));
  max-height: min(78vh, 44rem);
  margin: 0 !important;
  overflow: auto;
  border: 1px solid rgba(88,255,151,.5);
  border-radius: .9rem;
  background: linear-gradient(145deg,rgba(3,16,10,.98),rgba(4,8,7,.985));
  color: #e9fff1;
  box-shadow: 0 1.2rem 3.5rem rgba(0,0,0,.58), 0 0 1.4rem rgba(50,255,130,.08);
  contain: layout paint style;
  isolation: isolate;
}
body.creator-studio-theme:not(.preview-mode):not(.finalized):not([data-exported="true"]) .hidden-gem-panel[hidden] {
  display: none !important;
}
.hidden-gem-panel.is-dragging { box-shadow: 0 1.4rem 4rem rgba(0,0,0,.66),0 0 1.6rem rgba(50,255,130,.12); }
.hidden-gem-panel__handle {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem .9rem;
  border-bottom: 1px solid rgba(87,255,151,.19);
  background: rgba(2,12,8,.98);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.hidden-gem-panel.is-dragging .hidden-gem-panel__handle { cursor: grabbing; }
.hidden-gem-panel__handle p {
  margin: 0 0 .14rem;
  color: #72ffab;
  font-size: .56rem;
  font-weight: 900;
  letter-spacing: .16em;
}
.hidden-gem-panel__handle h2 {
  margin: 0;
  color: #f0fff5;
  font-size: 1rem;
}
.hidden-gem-panel__close {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgba(145,255,185,.5);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: #effff4;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}
.hidden-gem-panel__body { padding: .9rem; }
.hidden-gem-panel__body h3 { margin: 0 0 .45rem; color: #f2fff7; font-size: .95rem; }
.hidden-gem-panel__explain { margin: 0 0 .8rem; color: #9eb7a8; font-size: .72rem; line-height: 1.45; }
.hidden-gem-panel__body label { display: block; margin-top: .62rem; color: #d5e8db; font-size: .7rem; font-weight: 700; }
.hidden-gem-panel__body input,
.hidden-gem-panel__body textarea {
  width: 100%;
  margin-top: .28rem;
  box-sizing: border-box;
  border: 1px solid rgba(92,255,151,.24);
  border-radius: .55rem;
  background: rgba(0,0,0,.28);
  color: #f2fff6;
  padding: .62rem .68rem;
}
.hidden-gem-panel__eyebrow {
  margin: 0 0 .25rem;
  color: #72ffab;
  font-size: .57rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.private-sealed-teaser-fields,
.private-sealed-rights-fields {
  margin-top: .9rem;
  padding-top: .8rem;
  border-top: 1px solid rgba(82,255,146,.16);
}
#privateSealedAssetStatus[data-state="ready"] { color:#76ffad; }
#privateSealedAssetStatus[data-state="error"] { color:#ff9f9f; }

/* Hide all Hidden Gem edit chrome from Preview, Final and exported artifacts. */
body.creator-studio-theme.preview-mode .hidden-gem-launcher,
body.creator-studio-theme.preview-mode .hidden-gem-panel,
body.creator-studio-theme.finalized .hidden-gem-launcher,
body.creator-studio-theme.finalized .hidden-gem-panel,
body[data-exported="true"] .hidden-gem-launcher,
body[data-exported="true"] .hidden-gem-panel {
  display: none !important;
}

@media (max-width: 720px) {
  body.creator-studio-theme:not(.preview-mode):not(.finalized):not([data-exported="true"]) .hidden-gem-launcher {
    top: 7.2rem;
    right: .6rem;
    width: min(13rem, calc(100vw - 1.2rem));
  }
  body.creator-studio-theme:not(.preview-mode):not(.finalized):not([data-exported="true"]) .hidden-gem-panel {
    top: 8.6rem;
    right: .6rem;
    width: calc(100vw - 1.2rem);
    max-height: 70vh;
  }
}



/* Hidden Gem: roomy editor-only overlay; never changes artifact geometry. */
body.creator-studio-theme:not(.preview-mode):not(.finalized):not([data-exported="true"]) .hidden-gem-panel {
  width: min(38rem, calc(100vw - 2rem)); top: 2rem;
  max-height: calc(100dvh - 4rem); border-radius: 1.4rem;
}
.hidden-gem-panel .hidden-gem-panel__handle { padding: 1.2rem 1.5rem; position: sticky; top: 0; background: #081c14; z-index: 2; }
.hidden-gem-panel .hidden-gem-panel__body { padding: 1.5rem; }
.hidden-gem-panel .hidden-gem-panel__body h3 { font-size: 1.35rem; line-height: 1.3; margin-bottom: .75rem; }
.hidden-gem-panel .hidden-gem-panel__body p, .hidden-gem-panel .control-status { font-size: .92rem; line-height: 1.6; }
.hidden-gem-panel .hidden-gem-panel__body label { font-size: .95rem; }
.hidden-gem-panel .hidden-gem-file-box { margin: 1.3rem 0; padding: 1.2rem; border: 1px dashed #63d6a4; border-radius: 1rem; background: #102a20; }
.hidden-gem-panel .hidden-gem-file-box label { margin-top: 0; }
.hidden-gem-panel .hidden-gem-panel__body input, .hidden-gem-panel .hidden-gem-panel__body textarea { font-size: 1rem; max-width: 100%; box-sizing: border-box; }
.hidden-gem-panel input[type="file"] { width: 100%; padding: .65rem; }
.hidden-gem-panel input::file-selector-button { padding: .7rem 1rem; margin-right: .75rem; border-radius: .6rem; border: 0; background: #b0f4d0; color: #092317; font-weight: 700; cursor: pointer; }
.hidden-gem-panel #hiddenGemAccessSetup { padding: 1.2rem; margin: 1rem 0; background: #163528; border-radius: 1rem; }
.hidden-gem-panel h4 { font-size: 1.05rem; margin: 0 0 .6rem; }
.hidden-gem-panel button { min-height: 44px; }
.hidden-gem-panel #hiddenGemSaveAccess { width: 100%; padding: .9rem; background: #b0f4d0; color: #092317; font-size: 1rem; font-weight: 700; border: 0; border-radius: .65rem; }
.hidden-gem-panel details { margin-top: 1.1rem; padding: 1rem 0; border-top: 1px solid #355346; }
.hidden-gem-panel summary { cursor: pointer; font-size: .95rem; color: #def5e7; line-height: 1.5; }
.hidden-gem-panel progress { width: 100%; height: .7rem; accent-color: #79efb3; }
.hidden-gem-panel [hidden] { display: none !important; }
@media (max-width: 720px) {
 body.creator-studio-theme:not(.preview-mode):not(.finalized):not([data-exported="true"]) .hidden-gem-panel { top: .6rem; right: .6rem; width: calc(100vw - 1.2rem); max-height: calc(100dvh - 1.2rem); }
 .hidden-gem-panel .hidden-gem-panel__body { padding: 1.1rem; }
 .hidden-gem-panel .hidden-gem-panel__handle { padding: 1rem 1.1rem; }
 .hidden-gem-panel .hidden-gem-file-box { padding: .9rem; }
}


body.creator-studio-theme .hidden-gem-finish{display:grid;gap:.8rem;margin-top:1.2rem;padding-top:.8rem;border-top:1px solid #355346}
.hidden-gem-finish a{color:#ffd785}
