/* Generate studio. prompt-craft.css rules, then gentest.css, in that order. */
/* css/prompt-craft.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-app: #0f172a;          /* Slate 900 */
  --bg-panel: #1e293b;        /* Slate 800 */
  --bg-editor: #1a1b26;       /* Deep Blue/Black */
  --bg-header: rgba(13, 17, 23, 0.78);
  --text-main: #94a3b8;       
  --text-editor: #c0caf5;     
  --accent-primary: #6366f1;  /* Indigo 500 */
  --accent-hover: #818cf8;    
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #0b0f18;
  background-image:
    radial-gradient(ellipse 90% 55% at 8% -8%, rgba(99, 102, 241, 0.32), transparent 52%),
    radial-gradient(ellipse 70% 50% at 100% 4%, rgba(168, 85, 247, 0.24), transparent 55%),
    radial-gradient(ellipse 65% 45% at 70% 110%, rgba(244, 63, 94, 0.16), transparent 52%),
    linear-gradient(180deg, #151b2e 0%, #0c101c 38%, #0b0f18 100%);
  background-attachment: fixed;
  color: #e2e8f0;
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Scrollbar Styling --- */
.custom-scroll::-webkit-scrollbar { width: 6px; }
.custom-scroll::-webkit-scrollbar-track { background: rgba(30, 41, 59, 0.5); }
.custom-scroll::-webkit-scrollbar-thumb { background: #6366f1; border-radius: 3px; }
.custom-scroll::-webkit-scrollbar-thumb:hover { background: #818cf8; }

.craft-page {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: auto;
  overflow: visible;
  padding: 0.35rem 1.5rem 1.5rem;
}

/* Workspace under the header — no outer frame */
.main-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10rem;
  grid-template-rows: auto auto auto auto auto;
  height: auto;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  max-width: none;
  margin: 0;
}

/* --- INSPIRATIONS PANEL --- */
.insp-panel {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  position: relative;
  width: 10rem;
  min-width: 10rem;
  z-index: 8;
  background: transparent;
  border: 0;
  display: flex;
  flex-direction: column;
}

.insp-panel.is-open {
  z-index: 25;
}

.insp-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-shrink: 0;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.15rem 0.55rem 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.insp-toggle::after {
  content: '';
  flex-shrink: 0;
  width: 0.42rem;
  height: 0.42rem;
  border-right: 2px solid #a5b4fc;
  border-bottom: 2px solid #a5b4fc;
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.insp-panel.is-open > .insp-toggle::after {
  margin-top: 0.12rem;
  transform: rotate(225deg);
}

.insp-body {
  display: none;
}

.insp-panel.is-open > .insp-body {
  display: flex;
  position: absolute;
  top: 100%;
  left: 0;
  width: 10rem;
  max-height: min(38rem, calc(100dvh - 8.5rem));
  flex-direction: column;
  overflow: hidden;
  background: transparent;
  border: 0;
}

.insp-title {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.insp-menu {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.35rem 0.5rem 0.7rem;
}

.insp-item__row {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.insp-item__row .cat-btn {
  flex: 1;
  min-width: 0;
}

.insp-item__clear {
  flex-shrink: 0;
  width: 1.55rem;
  height: 1.55rem;
  margin-right: 0.15rem;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #94a3b8;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.insp-item__clear:hover {
  color: #f8fafc;
  background: transparent;
}

.insp-item.is-on .cat-btn {
  font-weight: 700;
  background-image: linear-gradient(to right, #e0e7ff, #f5d0fe);
}

.insp-item[hidden],
.insp-sub[hidden],
.insp-item__clear[hidden] {
  display: none !important;
}

.insp-sub {
  padding: 0.2rem 0.35rem 0.65rem 0.85rem;
}

.insp-empty {
  margin: 0;
  padding: 0.45rem 0.35rem;
  font-size: 0.75rem;
  color: #64748b;
  font-style: italic;
}

/* Category Buttons */
.cat-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.35rem;
  margin-bottom: 2px;
  font-size: 0.9rem;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: linear-gradient(to right, #a5b4fc, #d8b4fe);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  cursor: pointer;
  font-family: inherit;
}
.cat-btn:hover {
  background-color: transparent;
  background-image: linear-gradient(to right, #e0e7ff, #f5d0fe);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Style Pills */
.pills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.style-btn {
  font-size: 0.8rem;
  padding: 4px 2px;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: linear-gradient(to right, #a5b4fc, #d8b4fe);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  cursor: pointer;
  font-family: inherit;
  user-select: none;
}
.style-btn:hover,
.style-btn:active {
  background-color: transparent;
  background-image: linear-gradient(to right, #e0e7ff, #f5d0fe);
  -webkit-background-clip: text;
  background-clip: text;
  transform: none;
}

/* --- RIGHT PANEL --- */
.right-panel {
  display: contents;
}

.craft-top { grid-column: 1; grid-row: 1; padding-right: 1.25rem; }
.craft-brand { grid-column: 2; grid-row: 1; }
.craft-box { grid-column: 1; grid-row: 2; }
.craft-under { grid-column: 1; grid-row: 3; padding-right: 1.25rem; }
.action-bar { grid-column: 1; grid-row: 4; padding-right: 1.25rem; }

.craft-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 0.3rem;
}

.craft-ai__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.craft-brand {
  width: 10rem;
  min-width: 10rem;
  align-self: end;
  text-align: right;
  padding-bottom: 0.3rem;
}

.craft-box {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 12rem;
  height: calc(100dvh - 18rem);
  align-self: start;
  background-color: transparent;
  background-image: none;
  border: 0;
  border-radius: 0.5rem;
  box-shadow: none;
  overflow: visible;
}

.craft-out {
  position: absolute;
  left: 0.7rem;
  bottom: 0.7rem;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.craft-out[hidden] {
  display: none;
}

.craft-out__btn[hidden] {
  display: none !important;
}

.craft-out__btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: #c7d2fe;
  cursor: pointer;
}

.craft-out__btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.craft-out__btn:hover {
  color: #f8fafc;
  background: transparent;
}

.craft-out__btn[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.35rem);
  transform: translateX(-50%);
  z-index: 12;
  padding: 0.22rem 0.45rem;
  border-radius: 0.3rem;
  background: #0b1220;
  color: #e2e8f0;
  -webkit-text-fill-color: #e2e8f0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.craft-box__resize {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: 0.55rem;
  cursor: ns-resize;
  touch-action: none;
}

.craft-box__resize:hover,
.craft-box__resize.is-drag {
  background: rgba(165, 180, 252, 0.22);
}

.craft-box__actions {
  position: absolute;
  right: 0.7rem;
  bottom: 0.85rem;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

#load-gen-btn.craft-box__gen,
#optimize-btn.craft-box__enhance {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 2.2rem;
  padding: 0 0.95rem;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  background-color: transparent;
  background-image:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.42) 0%,
      rgba(255, 255, 255, 0.12) 16%,
      transparent 40%,
      transparent 62%,
      rgba(255, 255, 255, 0.1) 84%,
      rgba(255, 255, 255, 0.28) 100%
    ),
    linear-gradient(105deg, #6366f1 0%, #a78bfa 50%, #fb7185 100%);
  background-repeat: no-repeat;
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.28);
}

#load-gen-btn.craft-box__gen:hover,
#optimize-btn.craft-box__enhance:hover:not(:disabled) {
  color: #fff;
  filter: brightness(1.08);
}

#optimize-btn.craft-box__enhance:active:not(:disabled) {
  filter: brightness(0.94);
}

#optimize-btn.craft-box__enhance:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  filter: saturate(0.85);
}

#load-gen-btn.craft-box__gen[hidden] {
  display: none;
}

.craft-wand {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
  flex-shrink: 0;
}

.craft-field {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}

.craft-field .craft-ref {
  position: absolute;
  left: 0.35rem;
  top: 0.35rem;
  bottom: 3.1rem;
  z-index: 4;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0.35rem;
  width: 3.7rem;
  margin: 0;
  padding: 0.15rem 0;
  overflow-x: visible;
  overflow-y: auto;
}

.craft-field .craft-ref__slot {
  flex-shrink: 0;
  align-items: flex-start;
}

.craft-field .craft-ref__thumb,
.craft-field .craft-ref__add {
  position: relative;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 3.45rem;
  height: 4.25rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  transform: none;
  overflow: visible;
}

.craft-field .craft-ref__add {
  color: #c7d2fe;
  font-size: 1.35rem;
}

.craft-field .craft-ref__add::before,
.craft-field .craft-ref__open {
  width: 2.35rem;
  height: 3.52rem;
  border-radius: 0.2rem;
}

.craft-field .craft-ref__add::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  box-sizing: border-box;
  border: 2px solid transparent;
  border-radius: 6px;
  background-image:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.55) 0%,
      rgba(255, 255, 255, 0.18) 16%,
      transparent 40%,
      transparent 62%,
      rgba(255, 255, 255, 0.16) 84%,
      rgba(255, 255, 255, 0.42) 100%
    ),
    linear-gradient(105deg, #6366f1 0%, #a78bfa 50%, #fb7185 100%);
  background-origin: border-box;
  background-clip: border-box;
  -webkit-mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  transform: translate(-50%, -50%) rotate(15deg);
  transition: transform 0.32s ease;
}

.craft-field .craft-ref__add span {
  position: relative;
  z-index: 1;
  transform: rotate(15deg);
  transition: transform 0.32s ease;
}

.craft-field .craft-ref__open {
  border: 1.5px solid rgba(199, 210, 254, 0.55);
  overflow: hidden;
  transform: rotate(15deg);
}

.craft-field .craft-ref__add:hover {
  color: #fff;
  background: transparent;
}

.craft-field .craft-ref__add:hover::before {
  transform: translate(-50%, -50%) rotate(0deg) scale(1.1);
}

.craft-field .craft-ref__add:hover span {
  transform: rotate(0deg) scale(1.1);
}

/* Text Area */
#prompt-textarea {
  width: 100%;
  min-height: calc(1.7em * 5 + 0.45rem + 3.25rem);
  flex: 1;
  background: transparent;
  color: var(--text-editor);
  border: 0;
  border-radius: 0;
  padding: 0.45rem 7.5rem 3.25rem 4.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  line-height: 1.7;
  resize: none;
  outline: none;
  box-shadow: none;
}

#prompt-textarea::placeholder {
  color: #475569;
  font-style: italic;
}

/* Action Bar */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.45rem;
  padding-bottom: 0.15rem;
}

/* Buttons */
.btn-icon {
  background: transparent;
  color: #94a3b8;
  padding: 0.5rem;
  border-radius: 6px;
  transition: color 0.2s;
}
.btn-icon:hover { color: white; background: rgba(255,255,255,0.1); }

#zen-btn {
  background-color: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}
#zen-btn,
#zen-btn span,
#zen-btn i {
  background-image: linear-gradient(to right, #a5b4fc, #d8b4fe);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
#zen-btn:hover {
  background-color: transparent;
}
#zen-btn:hover,
#zen-btn:hover span,
#zen-btn:hover i {
  background-image: linear-gradient(to right, #e0e7ff, #f3e8ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Section: zen mode */
body.zen-active .main-frame {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  border-radius: 0;
  z-index: 50; /* High but below notifications */
  background: var(--bg-app);
}
body.zen-active .insp-panel,
body.zen-active .craft-brand { display: none; }
body.zen-active #header, body.zen-active #footer { display: none; }
body.zen-active .craft-top,
body.zen-active .craft-under,
body.zen-active .action-bar {
  padding-left: 12%;
  padding-right: 12%;
}
body.zen-active .craft-box {
  width: 76%;
  justify-self: center;
  border: none;
  box-shadow: none;
  background: transparent;
}
body.zen-active #prompt-textarea {
  font-size: 1.2rem;
}

/* Saved Prompts Section */
.saved-prompts-section {
  margin-top: 1.5rem;
  margin-right: 10rem;
  margin-bottom: 2rem;
  padding: 1rem 1.25rem 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(8, 12, 20, 0.35);
}
.saved-library-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.saved-prompts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.saved-prompt-item {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid rgba(148, 163, 184, 0.1);
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #cbd5e1;
  transition: border-color 0.2s;
}
.saved-prompt-item:hover { border-color: var(--accent-primary); }
.saved-prompt-item__x {
  position: absolute;
  top: 0.35rem;
  right: 0.4rem;
  z-index: 2;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border: 0;
  border-radius: 0.3rem;
  background: transparent;
  color: #cbd5e1;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.saved-prompt-item__x:hover {
  color: #fecaca;
  background: transparent;
}

/* Utility */
.copy-notification {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #10b981;
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  z-index: 100; /* Above Zen Mode */
}
.copy-notification.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.craft-ai {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  padding: 0.55rem 0.85rem 0.2rem 1rem;
}

.pw-families {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
}

.pw-chip {
  border: 0;
  outline: 0;
  box-shadow: none;
  border-radius: 0;
  background-color: transparent;
  background-image: linear-gradient(to right, #a5b4fc, #d8b4fe);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  padding: 0.2rem 0.45rem 0.28rem;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
}

.pw-chip:hover {
  background-image: linear-gradient(to right, #c7d2fe, #f5d0fe);
  -webkit-background-clip: text;
  background-clip: text;
}

.pw-chip[data-tip] {
  position: relative;
}

.pw-chip[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.4rem);
  transform: translateX(-50%);
  z-index: 12;
  padding: 0.28rem 0.5rem;
  border-radius: 0.3rem;
  background: #0b1220;
  background-image: none;
  background-clip: padding-box;
  -webkit-background-clip: padding-box;
  color: #e2e8f0;
  -webkit-text-fill-color: #e2e8f0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.pw-chip.is-on {
  border: 0;
  box-shadow: none;
  background-image: linear-gradient(to right, #e0e7ff, #f5d0fe);
  -webkit-background-clip: text;
  background-clip: text;
}

.pw-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.pw-create {
  width: fit-content;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.42em;
  margin-bottom: 0.45rem;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.16) 16%, transparent 40%, transparent 62%, rgba(255, 255, 255, 0.12) 84%, rgba(255, 255, 255, 0.42) 100%),
    linear-gradient(105deg, #6366f1 0%, #a78bfa 50%, #fb7185 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.pw-select {
  min-width: 5.5rem;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(165, 180, 252, 0.45);
  border-radius: 0;
  padding: 0.2rem 0.35rem 0.28rem 0;
  color: #c7d2fe;
  font-weight: 700;
  font-size: 0.75rem;
}

.pw-duration {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.pw-duration .pw-select {
  width: 3.6rem;
  min-width: 0;
  -moz-appearance: textfield;
}

.pw-duration .pw-select::-webkit-outer-spin-button,
.pw-duration .pw-select::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pw-duration span {
  font-size: 0.75rem;
  font-weight: 700;
  color: #c7d2fe;
}

.craft-ai__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
}

.craft-under {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.55rem 1rem;
  margin: 0.55rem 0 0;
}

.craft-enhance {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.craft-ref {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 0.85rem;
}

.craft-ref__slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.craft-ref__token {
  font-size: 0.62rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #a5b4fc;
  cursor: pointer;
}

.ref-mention {
  position: fixed;
  z-index: 40;
  min-width: 10rem;
  padding: 0.3rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: #0b1220;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.ref-mention button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #e0e7ff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.28rem 0.45rem;
  cursor: pointer;
}

.ref-mention button img {
  width: 1.45rem;
  height: 2.05rem;
  object-fit: cover;
  border-radius: 3px;
  flex: 0 0 auto;
}

.ref-mention button:hover,
.ref-mention button.is-hot {
  background: rgba(99, 102, 241, 0.22);
}

.ref-mention.hidden {
  display: none;
}

.craft-ref__add {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px dashed rgba(165, 180, 252, 0.55);
  background: rgba(15, 23, 42, 0.55);
  color: #c7d2fe;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.craft-ref__add input {
  display: none;
}

.craft-ref__add:hover {
  border-color: #818cf8;
  color: #fff;
}

.craft-ref__thumb {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
}

.craft-ref__open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  cursor: zoom-in;
  background: transparent;
}

.craft-ref__open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.craft-ref__clear {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.craft-ref-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, 0.86);
  padding: 2rem;
}

.craft-ref-lightbox[hidden] {
  display: none;
}

.craft-ref-lightbox img {
  max-width: min(92vw, 1100px);
  max-height: 88vh;
  object-fit: contain;
}

.craft-ref-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 0.45rem;
  background: rgba(8, 12, 20, 0.7);
  color: #e2e8f0;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.craft-ref__add.hidden,
.craft-ref__thumb.hidden,
#h3Extras.hidden,
#imagineExtras.hidden,
#seedanceExtras.hidden,
#flux3Extras.hidden,
#novaExtras.hidden,
#nlModelExtras.hidden,
#videoExtras.hidden,
#aspectExtras.hidden,
.craft-ai-result.hidden,
#origResult.hidden {
  display: none;
}

.pw-status {
  min-height: 1.1rem;
  color: #c7d2fe;
  font-size: 0.8rem;
}

.pw-status.is-bad {
  color: #fecaca;
}

/* Section: original prompt result */
.craft-ai-result {
  grid-column: 1 / -1;
  margin-top: 0.15rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.55);
  max-height: 6.5rem;
  overflow: auto;
}

.craft-ai-result__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.craft-ai-result pre {
  margin: 0;
  white-space: pre-wrap;
  color: #cbd5e1;
  font-size: 0.78rem;
  line-height: 1.45;
}

.pw-copy {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: transparent;
  color: #cbd5e1;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-weight: 700;
  font-size: 0.68rem;
  cursor: pointer;
}

.pw-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

body.zen-active .craft-ai,
body.zen-active .craft-ai-result,
body.zen-active #origResult {
  display: none;
}

@media (max-width: 760px) {
  .craft-page {
    padding: 0.35rem max(0.8rem, env(safe-area-inset-right)) 1.25rem max(0.8rem, env(safe-area-inset-left));
  }

  .main-frame {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.15rem 0.5rem;
  }

  .craft-brand {
    grid-column: 1;
    grid-row: 1;
    width: auto;
    min-width: 0;
    text-align: left;
    padding: 0;
  }

  .craft-top {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
    padding: 0;
  }

  .craft-box,
  .craft-under,
  .action-bar {
    grid-column: 1 / -1;
    grid-row: auto;
    width: auto;
    min-width: 0;
    padding-right: 0;
  }

  .insp-panel {
    display: none !important;
  }

  .craft-brand h2 {
    font-size: 1.05rem;
  }

  .craft-box {
    height: auto;
    min-height: 22rem;
  }

  .craft-field {
    flex-direction: column;
  }

  .craft-field .craft-ref {
    position: relative;
    left: auto;
    top: auto;
    bottom: auto;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: flex-end;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.2rem 0.45rem 0.15rem;
  }

  #prompt-textarea {
    padding: 0.55rem 0.85rem 3.5rem;
    font-size: 16px;
  }

  .pw-chip,
  .cat-btn,
  .style-btn {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
  }

  .craft-box__resize {
    height: 1.05rem;
  }

  .craft-box__actions {
    right: 0.4rem;
    bottom: 0.85rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: calc(100% - 5.2rem);
  }

  #load-gen-btn.craft-box__gen,
  #optimize-btn.craft-box__enhance {
    padding: 0.45rem 0.7rem;
    font-size: 0.78rem;
  }

  .saved-prompts-section {
    margin-right: 0;
    padding: 0.85rem 0.7rem 1rem;
  }

  .saved-prompts-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pw-chip[data-tip]:hover::after,
  .craft-out__btn[data-tip]:hover::after {
    left: 0;
    transform: none;
    max-width: 70vw;
    white-space: normal;
  }

  body.zen-active .craft-box {
    width: 100%;
  }

  body.zen-active .craft-top,
  body.zen-active .craft-under,
  body.zen-active .action-bar {
    padding-left: 0.8rem;
    padding-right: 0.8rem;
  }
}
/* Studio page. Prompt Craft layout stays in prompt-craft.css. */

.gt-model-line {
  flex: 0 0 auto;
  margin: 0 0 0.15rem 0.15rem;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
  background: linear-gradient(105deg, #6366f1, #a78bfa, #fb7185);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.gt-model-line[hidden] {
  display: none;
}

.craft-field.is-noref .craft-ref {
  display: none;
}

.craft-field.is-noref #prompt-textarea {
  padding-left: 0.85rem;
}

.craft-field .craft-ref__add.is-drop::before {
  transform: translate(-50%, -50%) rotate(0deg) scale(1.1);
}

.craft-field .craft-ref__add.is-drop span {
  transform: rotate(0deg) scale(1.1);
}

.gt-funds {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  min-height: 1.4rem;
  color: #94a3b8;
  font-size: 0.78rem;
}

.gt-funds__line {
  min-width: 0;
}

.gt-packs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.gt-packs[hidden],
.gt-custom[hidden],
.gt-install[hidden],
.gt-install-hint[hidden],
.gt-policy[hidden],
#gtAddFunds[hidden],
#gtSettings[hidden],
#novaExtras[hidden],
#gtPackNote[hidden] {
  display: none;
}

.gt-enhance-dur {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.gt-enhance-dur .pw-select {
  flex: 1;
  min-width: 0;
}

.gt-enhance-dur span {
  color: #94a3b8;
  font-size: 0.78rem;
}

.gt-custom {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.gt-custom input {
  width: 6.2rem;
  padding: 0.28rem 0.45rem;
  border: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 0;
  background: transparent;
  color: #e2e8f0;
  font: inherit;
  font-size: 0.78rem;
}

.gt-install {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding: 0.4rem 0.7rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(165, 180, 252, 0.35);
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}

.gt-install:hover {
  filter: brightness(1.08);
}

.gt-install-hint {
  margin: 0;
  color: #94a3b8;
  font-size: 0.72rem;
  line-height: 1.4;
}

.gt-studio {
  display: grid;
  grid-template-columns: 18.5rem minmax(0, 1fr) 16.5rem;
  gap: 0.75rem 1.15rem;
  align-items: stretch;
  width: 100%;
}

.gt-studio.is-rail-collapsed {
  grid-template-columns: 18.5rem minmax(0, 1fr) 2.75rem;
}

.gt-side {
  position: sticky;
  top: 4.6rem;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
  height: calc(100dvh - 5.5rem);
  max-height: calc(100dvh - 5.5rem);
}

.gt-side--left {
  overflow: hidden;
}

.gt-rail-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-right: 0.15rem;
}

.gt-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.gt-fold {
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.gt-fold__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.15rem;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  background-image: linear-gradient(to right, #a5b4fc, #d8b4fe);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.gt-fold__summary::-webkit-details-marker,
.gt-fold__summary::marker {
  display: none;
}

.gt-fold__summary::after {
  content: '';
  flex-shrink: 0;
  width: 0.42rem;
  height: 0.42rem;
  border-right: 2px solid #a5b4fc;
  border-bottom: 2px solid #a5b4fc;
  transform: rotate(45deg);
}

.gt-fold[open] > .gt-fold__summary::after {
  margin-top: 0.2rem;
  transform: rotate(225deg);
}

.gt-nav__group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0 0.45rem;
}

.gt-nav__btn {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #94a3b8;
  border-radius: 0.55rem;
  padding: 0.38rem 0.55rem;
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
}

.gt-nav__btn:hover {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.08);
}

.gt-nav__btn.is-on {
  color: #f8fafc;
  background: rgba(99, 102, 241, 0.16);
}

.gt-settings {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.gt-list-price {
  margin: 0;
  padding: 0.2rem 0 0.28rem;
  border-bottom: 1px solid rgba(165, 180, 252, 0.45);
  color: #c7d2fe;
  font-weight: 700;
  font-size: 0.75rem;
}

.gt-side--left .pw-select,
.gt-side--left #seed {
  width: 100%;
}

.gt-side--left .pw-status {
  white-space: normal;
}

.gt-studio .craft-brand {
  grid-column: auto;
  grid-row: auto;
  width: auto;
  min-width: 0;
  align-self: start;
  text-align: left;
  padding: 0.15rem 0 0;
}

.gt-studio .insp-panel {
  grid-column: auto;
  grid-row: auto;
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  overflow: visible;
}

.gt-studio .insp-panel.is-open > .insp-body {
  position: static;
  top: auto;
  left: auto;
  width: auto;
  max-height: none;
  overflow: visible;
}

.gt-main {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 5.5rem);
}

.gt-studio .craft-top,
.gt-studio .craft-box,
.gt-studio .craft-under,
.gt-studio .action-bar,
.gt-studio .saved-prompts-section {
  align-self: stretch;
  width: 100%;
  max-width: none;
  grid-column: auto;
  grid-row: auto;
  padding-right: 0;
  box-sizing: border-box;
}

.gt-composer {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  min-height: calc(100dvh - 12rem);
}

.gt-stage {
  position: relative;
  flex: 1.15 1 16rem;
  min-height: 14rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gt-stage__view {
  width: 100%;
  height: 100%;
  min-height: 14rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gt-stage__empty {
  margin: 0;
  color: #475569;
  font-size: 0.95rem;
  text-align: center;
}

.gt-stage.has-result .gt-stage__view {
  box-sizing: border-box;
  padding: 0.35rem 2.75rem 0.35rem 0.35rem;
}

.gt-stage__view img,
.gt-stage__view video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0.4rem;
}

.gt-still {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  max-height: 100%;
  line-height: 0;
}

.gt-stage .gt-still img {
  cursor: zoom-in;
}

.gt-still__tools {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 2;
  display: flex;
  gap: 0.3rem;
}

.gt-still__copy,
.gt-still__dl {
  display: grid;
  place-items: center;
  width: 2.05rem;
  height: 2.05rem;
  padding: 0;
  border: 0;
  border-radius: 0.45rem;
  background: rgba(8, 12, 20, 0.72);
  color: #e2e8f0;
  cursor: pointer;
}

.gt-still__copy:hover,
.gt-still__dl:hover {
  background: rgba(30, 41, 59, 0.92);
  color: #fff;
}

.gt-still__copy svg,
.gt-still__dl svg {
  width: 1.05rem;
  height: 1.05rem;
}

.gt-lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 3.4rem 1.25rem 1.25rem;
  background: rgba(2, 6, 23, 0.92);
  cursor: zoom-out;
}

.gt-lightbox[hidden] {
  display: none;
}

.gt-lightbox .gt-still {
  cursor: default;
}

.gt-lightbox .gt-still img {
  max-width: calc(100vw - 2.5rem);
  max-height: calc(100vh - 4.8rem);
  border-radius: 0;
  cursor: default;
}

.gt-lightbox__close {
  position: absolute;
  top: 0.55rem;
  right: 1.05rem;
  z-index: 2;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
}

.gt-lightbox__close:hover {
  color: #fff;
}

.gt-policy {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(2, 6, 23, 0.72);
}

.gt-policy__box {
  width: min(34rem, 100%);
  max-height: min(78vh, 40rem);
  overflow: auto;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 1.1rem;
  padding: 1.35rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  color: #cbd5e1;
}

.gt-policy__box h2 {
  margin: 0 0 0.75rem;
  color: #f8fafc;
  font-size: 1.15rem;
  font-weight: 800;
}

.gt-policy__box h3 {
  margin: 1rem 0 0.4rem;
  color: #a5b4fc;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gt-policy__box p,
.gt-policy__box ul {
  margin: 0 0 0.35rem;
  line-height: 1.55;
  font-size: 0.88rem;
}

.gt-policy__box ul {
  padding-left: 1.1rem;
}

.gt-policy__box li {
  margin: 0.28rem 0;
}

.gt-policy__row {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.gt-policy-link {
  margin-top: 0.35rem;
  border: 0;
  background: none;
  padding: 0;
  color: #a5b4fc;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.gt-policy-link:hover {
  color: #e9d5ff;
}

.gt-thumb.is-pinned {
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.7);
}

.gt-thumb.is-pinned .gt-thumb-pin,
.gt-thumb-pin.is-pinned {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.28);
}

.gt-stage__close {
  position: absolute;
  top: 0.15rem;
  right: 0.15rem;
  z-index: 4;
  width: 2.1rem;
  height: 2.1rem;
  border: 0;
  border-radius: 0.45rem;
  background: rgba(8, 12, 20, 0.55);
  color: #e2e8f0;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.gt-stage__close[hidden] {
  display: none;
}

.gt-stage__close:hover {
  background: rgba(30, 41, 59, 0.92);
  color: #fff;
}

.gt-run {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  margin-top: 0.55rem;
}

.gt-studio .craft-box {
  height: auto;
  flex: 1 1 13rem;
  min-height: 12rem;
}

.gt-studio #prompt-textarea {
  padding-right: 0.9rem;
  padding-bottom: 2.6rem;
}

.gen-live {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  height: 100%;
  padding: 0.4rem;
}

.gen-live__frame {
  position: relative;
  display: grid;
  place-items: center;
  width: min(28rem, 86%);
  max-height: calc(100% - 4.2rem);
  aspect-ratio: var(--aspect, 1 / 1);
  border-radius: 0.55rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(99, 102, 241, 0.16), transparent 58%),
    #070b14;
  border: 1px solid rgba(165, 180, 252, 0.2);
}

.gen-live__wash {
  position: absolute;
  inset: -10%;
  pointer-events: none;
  background: linear-gradient(108deg, transparent 28%, rgba(165, 180, 252, 0.04) 42%, rgba(216, 180, 254, 0.1) 50%, rgba(165, 180, 252, 0.04) 58%, transparent 72%);
  background-size: 220% 100%;
  animation: gen-wash 2.3s ease-in-out infinite;
}

.gen-live__orbit {
  position: relative;
  z-index: 1;
  width: 4.35rem;
  height: 4.35rem;
}

.gen-live__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
}

.gen-live__ring--outer {
  border-top-color: #c7d2fe;
  border-right-color: rgba(165, 180, 252, 0.28);
  filter: drop-shadow(0 0 7px rgba(165, 180, 252, 0.55));
  animation: gen-spin 1.15s linear infinite;
}

.gen-live__ring--inner {
  inset: 0.72rem;
  border-bottom-color: #e9d5ff;
  border-left-color: rgba(216, 180, 254, 0.35);
  animation: gen-spin-rev 1.6s linear infinite;
}

.gen-live__spin {
  position: absolute;
  inset: 0;
  animation: gen-spin 1.15s linear infinite;
}

.gen-live__bead {
  position: absolute;
  top: -0.2rem;
  left: 50%;
  width: 0.48rem;
  height: 0.48rem;
  margin-left: -0.24rem;
  border-radius: 50%;
  background: #eef2ff;
  box-shadow: 0 0 12px 3px rgba(165, 180, 252, 0.75);
}

.gen-live__phase {
  margin: 0;
  color: #e2e8f0;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
}

.gen-live__time {
  margin: -0.25rem 0 0;
  color: #64748b;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.gen-live__bar {
  width: min(18rem, 70%);
  height: 0.28rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

.gen-live__bar span {
  display: block;
  height: 100%;
  width: 8%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #a855f7);
}

.gen-live--fail .gen-live__frame {
  min-height: 8rem;
  aspect-ratio: auto;
  background: rgba(127, 29, 29, 0.18);
  border-color: rgba(248, 113, 113, 0.35);
}

.gen-live--fail .gen-live__phase { color: #fecaca; }
.gen-live--fail .gen-live__time { color: #fca5a5; max-width: 28rem; }

@keyframes gen-spin { to { transform: rotate(360deg); } }
@keyframes gen-spin-rev { to { transform: rotate(-360deg); } }
@keyframes gen-wash {
  from { background-position: 130% 0; }
  to { background-position: -30% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .gen-live__wash,
  .gen-live__ring--outer,
  .gen-live__ring--inner,
  .gen-live__spin { animation: none; }
}

.gt-studio .saved-prompts-section {
  margin-right: 0;
  margin-bottom: 0;
}

.gt-side--right {
  overflow: auto;
  min-width: 0;
}

.gt-side--right.is-collapsed {
  overflow: hidden;
  align-items: center;
  gap: 0;
}

.gt-side--right.is-collapsed .gt-rail-body,
.gt-side--right.is-collapsed .gt-rail-title {
  display: none;
}

.gt-rail-toggle {
  box-sizing: border-box;
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(199, 210, 254, 0.55);
  border-radius: 0.55rem;
  background: rgba(99, 102, 241, 0.34);
  color: #fff;
  line-height: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gt-rail-toggle:hover {
  background: rgba(129, 140, 248, 0.55);
  color: #fff;
}

.gt-rail-icon {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
  flex: none;
  fill: currentColor;
  stroke: none;
}

.gt-rail-toggle .gt-rail-icon--show {
  display: none;
}

.gt-rail-toggle.is-closed .gt-rail-icon--hide {
  display: none;
}

.gt-rail-toggle.is-closed .gt-rail-icon--show {
  display: block;
}

.gt-film-wrap {
  margin: 0;
}

.gt-film-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  min-width: 0;
  max-width: 100%;
  min-height: 2.35rem;
  margin-bottom: 0.65rem;
  padding: 0;
  background: var(--bg-app);
}

.gt-side--right.is-collapsed .gt-film-head {
  width: 100%;
  margin: 0;
  padding: 0;
  justify-content: center;
  background: transparent;
}

.gt-film-head h3 {
  margin: 0;
  min-width: 0;
  color: #94a3b8;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}

.gt-film {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.gt-film__empty {
  margin: 0;
  color: #64748b;
  font-size: 0.85rem;
}

.gt-thumb {
  position: relative;
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #0b1020;
  cursor: pointer;
}

.gt-thumb.is-draggable {
  cursor: grab;
}

.gt-thumb img,
.gt-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.gt-thumb__play {
  position: absolute;
  left: 0.35rem;
  bottom: 0.35rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.72);
}

.gt-thumb__play::before {
  content: '';
  position: absolute;
  left: 0.46rem;
  top: 0.3rem;
  border-style: solid;
  border-width: 0.28rem 0 0.28rem 0.42rem;
  border-color: transparent transparent transparent #fff;
}

.gt-thumb__actions {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  display: flex;
  gap: 0.15rem;
  opacity: 0;
}

.gt-thumb:hover .gt-thumb__actions,
.gt-thumb:focus-within .gt-thumb__actions {
  opacity: 1;
}

.gt-icon {
  width: 1.35rem;
  height: 1.35rem;
  border: 0;
  border-radius: 4px;
  background: rgba(8, 12, 20, 0.78);
  color: #e2e8f0;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.gt-icon.is-danger {
  color: #fecaca;
}

.gt-more {
  display: block;
  width: 100%;
  margin-top: 0.65rem;
  text-align: center;
}

.gt-more[hidden] {
  display: none;
}

.gt-inspect {
  display: none;
  flex: 0 0 auto;
  min-width: 0;
  max-height: min(24rem, 46vh);
  overflow: auto;
  padding: 0 0.1rem 0.35rem;
  color: #e2e8f0;
}

body.is-inspect .gt-inspect {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

body.zen-active .gt-side {
  display: none;
}

body.zen-active .gt-studio {
  position: fixed;
  inset: 0;
  z-index: 50;
  grid-template-columns: minmax(0, 1fr);
  overflow: auto;
  padding: 1.25rem 0 2rem;
  background: var(--bg-app);
}

body.zen-active .gt-main {
  width: min(76%, 70rem);
  margin-inline: auto;
}

.gt-inspect__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.gt-inspect__head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  background: linear-gradient(to right, #a5b4fc, #d8b4fe);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.gt-inspect__close {
  border: 0;
  background: transparent;
  color: #cbd5e1;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.gt-preview {
  border-radius: 8px;
  overflow: hidden;
  background: #070b14;
}

.gt-preview img,
.gt-preview video {
  display: block;
  width: 100%;
  max-height: 16rem;
  object-fit: contain;
  background: #070b14;
}

.gt-inspect__prompt {
  margin: 0;
  max-height: 8.5rem;
  overflow: auto;
  color: #cbd5e1;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.gt-inspect__rows {
  display: grid;
  gap: 0.28rem;
  margin: 0;
}

.gt-inspect__row {
  display: grid;
  grid-template-columns: 6.2rem minmax(0, 1fr);
  gap: 0.35rem;
  font-size: 0.75rem;
}

.gt-inspect__row dt {
  color: #64748b;
}

.gt-inspect__row dd {
  margin: 0;
  color: #e2e8f0;
  word-break: break-word;
}

.gt-inspect__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.gt-handoff {
  border: 0;
  border-radius: 6px;
  padding: 0.42rem 0.7rem;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.12) 16%, transparent 42%, transparent 62%, rgba(255, 255, 255, 0.28) 100%),
    linear-gradient(105deg, #6366f1 0%, #a78bfa 50%, #fb7185 100%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.gt-handoff:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gt-share {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #94a3b8;
  font-size: 0.75rem;
}

.gt-share[hidden] {
  display: none;
}

@media (max-width: 1180px) {
  .gt-studio {
    grid-template-columns: 16.5rem minmax(0, 1fr) 14.5rem;
  }

  .gt-studio.is-rail-collapsed {
    grid-template-columns: 16.5rem minmax(0, 1fr) 2.75rem;
  }
}

@media (max-width: 980px) {
  .gt-studio,
  .gt-studio.is-rail-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .gt-side--right.is-collapsed {
    justify-self: end;
    width: max-content;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .gt-side {
    position: static;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .gt-rail-scroll {
    overflow: visible;
    flex: none;
  }

  .gt-studio .insp-panel {
    display: flex !important;
    max-height: 16rem;
  }

  .gt-film {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  }
}

@media (max-width: 760px) {
  .gt-model-line {
    margin-left: 0;
  }

  .gt-studio .insp-panel {
    display: flex !important;
  }

  body.is-inspect .gt-inspect {
    position: fixed;
    inset: 0;
    z-index: 80;
    max-height: none;
    width: auto;
    margin: 0;
    padding: 1rem 1rem 1.5rem;
    background: rgba(8, 12, 20, 0.97);
  }

  body.zen-active .gt-main {
    width: auto;
    margin: 0;
    padding: 0 0.8rem;
  }

  .gt-thumb__actions {
    opacity: 1;
  }
}
