:root {
  --bg: #070b16;
  --bg-elev: #0c1224;
  --panel: #10182e;
  --panel-2: #161f3a;
  --line: rgba(148, 163, 255, 0.16);
  --text: #e8edff;
  --muted: #8b96c5;
  --accent: #7c8cff;
  --accent-2: #c084fc;
  --ok: #34d399;
  --danger: #f87171;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 12px;
  --font: Inter, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; max-width: 100%; }
body {
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 80% -10%, rgba(124, 140, 255, 0.16), transparent 50%), var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

#app {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-width: 0;
}

.intro-strip {
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--line);
  background: #0d1428;
}
.intro-strip h1 { margin: 0 0 8px; font-size: clamp(22px, 4vw, 32px); line-height: 1.2; }
.intro-sub { margin: 0; color: var(--muted); max-width: 68ch; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.intro-strip.is-collapsed { display: none; }

.studio-about {
  margin: 0;
  padding: 12px 16px 20px;
  border-top: 1px solid var(--line);
  background: #0d1428;
}
.studio-about summary { cursor: pointer; font-weight: 700; }
.studio-about-body { max-width: 72ch; }
.studio-about-body p { color: var(--muted); line-height: 1.55; }

.mobile-tabs {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 56px;
  z-index: 40;
  background: #10182e;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-tabs a {
  flex: 1;
  min-height: 44px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-decoration: none;
  font: 600 12px var(--font);
}
.mobile-tabs a.active, .mobile-tabs a:focus-visible { color: var(--text); outline: 2px solid var(--accent); }

.guest-banner {
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 0 6px;
  color: var(--text);
  font-size: 12px;
}
.guest-banner a { color: #9aabff; }
.lock-mark { font-size: 11px; }
.is-locked { opacity: 0.92; }

.topbar {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 22, 0.96);
  overflow: visible;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; min-width: 0; }
.logo-mark { display: grid; place-items: center; flex: 0 0 auto; }
.logo-mark img { display: block; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; }
.brand-copy strong { font-size: 14px; letter-spacing: 0.01em; }
.brand-copy span { font-size: 11px; color: var(--muted); }

.project-meta { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; overflow: visible; }
.project-title {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  font: 600 13px var(--font);
  padding: 6px 8px;
  border-radius: 8px;
  min-width: 80px;
  width: 180px;
  max-width: 240px;
  flex: 0 1 240px;
}
.project-title:hover, .project-title:focus {
  border-color: var(--line);
  outline: none;
  background: rgba(255,255,255,0.03);
}
.save-state { font-size: 12px; color: var(--ok); white-space: nowrap; flex: 0 0 auto; }
#project-id-label { color: var(--muted); }
.mode-toggle { position: relative; z-index: 2; flex: 0 0 auto; }

.mode-toggle {
  display: flex;
  background: #141b33;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.mode-toggle button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 12px var(--font);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.mode-toggle button.active {
  background: #1f294d;
  color: var(--text);
}

.account-wrap { position: relative; }
.account-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  height: 32px;
  padding: 0 10px 0 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #141b33;
  color: var(--text);
  font: 600 12px var(--font);
  cursor: pointer;
}
.account-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #2a3560;
  color: #fff;
  font-size: 12px;
  flex: 0 0 auto;
}
.account-email {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 200;
  width: 260px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #10182e;
  box-shadow: var(--shadow);
}
.account-menu[hidden] { display: none; }
.account-menu-head { padding: 8px 8px 10px; }
.account-menu-head span, .account-menu-head em { display: block; color: var(--muted); font-size: 11px; font-style: normal; }
.account-menu-head strong { display: block; margin: 2px 0; font-size: 13px; font-weight: 600; word-break: break-all; user-select: text; }
.account-menu button, .account-menu a {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  font: 600 13px var(--font);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}
.account-menu button:hover, .account-menu a:hover, .account-menu button:focus { background: #1a2350; outline: none; }
.account-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.account-menu .danger { color: #f87171; }
@media (max-width: 720px) {
  .account-email, .account-chevron { display: none; }
  .account-pill { padding-right: 4px; }
}

#help-modal {
  width: min(720px, calc(100vw - 32px));
  max-height: 80vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0d1428;
  color: var(--text);
  overflow: hidden;
}
#help-modal::backdrop { background: rgba(5, 8, 18, 0.72); }
.help-content {
  max-height: calc(80vh - 64px);
  overflow: auto;
  padding: 22px 22px 8px;
}
.help-content h1 { margin: 0 0 12px; font-size: 22px; line-height: 1.3; }
.help-content h2 { margin: 22px 0 8px; font-size: 16px; }
.help-content h3 { margin: 14px 0 4px; font-size: 14px; }
.help-content p, .help-content li { color: var(--muted); font-size: 14px; line-height: 1.5; }
.help-content a { color: #9aabff; }
.help-content ul { padding-left: 18px; }
#btn-help-close { margin: 8px 22px 16px; }
.icon-btn, .ghost-btn, .primary-btn, .add-section-btn {
  font: 600 12px var(--font);
  border-radius: 10px;
  cursor: pointer;
}
.icon-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  background: #141b33;
  color: var(--text);
}
.ghost-btn {
  background: #141b33;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 7px 11px;
}
.ghost-btn.compact { padding: 5px 8px; }
.ghost-btn.linkish { text-decoration: none; display: inline-flex; align-items: center; }
.primary-btn, .add-section-btn {
  background: linear-gradient(180deg, #8b9cff, #6f7fff);
  color: #0b1020;
  border: 0;
  padding: 8px 13px;
  font-weight: 700;
}
.primary-btn:hover, .add-section-btn:hover { filter: brightness(1.06); }
.widgets-btn {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.35);
}

.studio {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr) minmax(0, 1.25fr);
  min-height: 0;
  min-width: 0;
}

.pane {
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--bg-elev);
  display: flex;
  flex-direction: column;
}
.top-actions { display: flex; align-items: center; gap: 6px; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; }
.preview-pane { position: relative; z-index: 1; border-right: 0; background: #080d1b; }

.pane-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 14px 10px;
  gap: 8px;
}
.pane-head h2 { margin: 0; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.muted { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.count-pill {
  background: #1b2444;
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 8px;
  color: var(--muted);
}

.section-list {
  overflow: auto;
  padding: 0 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sec-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: #121a32;
  cursor: grab;
}
.sec-item.active {
  border-color: rgba(124, 140, 255, 0.55);
  background: #1a2350;
}
.sec-item.hidden-sec { opacity: 0.55; }
.sec-name { font-size: 13px; font-weight: 600; }
.sec-type { font-size: 11px; color: var(--muted); }
.sec-tools { display: flex; gap: 4px; }
.sec-tools button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.add-section-btn { margin: 10px; }

.inspector, .skeleton {
  overflow: auto;
  padding: 0 14px 18px;
  min-height: 0;
}
.inspector.hidden, .skeleton.hidden { display: none; }
.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field input, .field textarea, .field select, #raw-html, #sec-search {
  width: 100%;
  max-width: 100%;
  background: #0d1428;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  font: 16px var(--font);
}
.field textarea { min-height: 84px; resize: vertical; }
.swatch-row { display: flex; gap: 8px; align-items: center; }
.swatch-row input[type="color"] {
  width: 42px; height: 36px; padding: 0; border: 0; background: transparent;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  cursor: pointer;
}

.code-editor {
  position: relative;
  min-height: calc(100vh - 160px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0a1020;
  overflow: hidden;
}
#raw-html,
.code-highlight {
  margin: 0;
  width: 100%;
  min-height: calc(100vh - 160px);
  height: 100%;
  box-sizing: border-box;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
  word-wrap: normal;
  overflow: auto;
  tab-size: 2;
}
.code-highlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: #d7def8;
  background: #0a1020;
}
#raw-html {
  position: relative;
  z-index: 1;
  background: transparent;
  color: transparent;
  caret-color: #22d3ee;
  resize: none;
}
.tok-tag { color: #7dd3fc; }
.tok-name { color: #38bdf8; }
.tok-attr { color: #c4b5fd; }
.tok-str { color: #86efac; }
.tok-comment { color: #64748b; font-style: italic; }
.tok-css { color: #f9a8d4; }
.tok-css-prop { color: #fda4af; }
.tok-js { color: #fde68a; }
.tok-key { color: #fb7185; }
.tok-text { color: #e2e8f0; }

.visibility-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ok);
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.viewport-switch {
  display: flex; gap: 4px;
  background: #121a32;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.viewport-switch button {
  border: 0; background: transparent; color: var(--muted);
  font: 600 11px var(--font); padding: 5px 10px; border-radius: 999px; cursor: pointer;
}
.viewport-switch button.active { background: #1f294d; color: var(--text); }
.preview-status { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12); }
.preview-tools { display: flex; gap: 6px; align-items: center; }
#zoom-select {
  background: #121a32; color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 6px; font: 11px var(--font);
}

.preview-stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  display: grid;
  place-items: start center;
}
#preview-frame-wrap {
  width: 1280px;
  transform-origin: top center;
  background: #fff;
  border-radius: 16px;
  overflow: visible;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.08);
}
#preview { width: 100%; height: 1400px; border: 0; background: #fff; display: block; }

.modal-root {
  position: fixed; inset: 0;
  background: rgba(4, 7, 16, 0.72);
  display: grid; place-items: center;
  z-index: 40;
  padding: 24px;
}
.modal-root.hidden { display: none; }
.modal {
  width: min(920px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: #10182e;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 20px;
}
.modal h3 { margin: 0 0 6px; }
.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.card {
  background: #161f3a;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
}
.card:hover { border-color: var(--accent); }
.modal.tpl-modal {
  width: min(1120px, 100%);
  max-height: 90vh;
}
.tpl-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.tpl-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: #121a32;
}
.tpl-shot {
  height: 148px;
  background: #0b1020;
  overflow: hidden;
}
.tpl-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tpl-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
  flex: 1;
}
.tpl-body h4 { margin: 0; font-size: 15px; }
.tpl-body p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.tpl-pill {
  display: inline-block;
  width: fit-content;
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #c5cdf0;
  background: #1b2444;
  border-radius: 999px;
  padding: 3px 8px;
}
.tpl-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.tpl-actions .ghost-btn,
.tpl-actions .primary-btn {
  flex: 1;
  text-align: center;
  text-decoration: none;
}
.modal.tpl-modal:not(.sec-modal) {
  width: min(1180px, 100%);
  max-height: 92vh;
}
.modal.tpl-modal:not(.sec-modal) .tpl-catalog {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.modal.tpl-modal:not(.sec-modal) .tpl-card {
  cursor: default;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  box-shadow: var(--shadow);
  border-radius: 18px;
}
.modal.tpl-modal:not(.sec-modal) .tpl-shot {
  height: auto;
  aspect-ratio: 16 / 10.5;
}
.modal.tpl-modal:not(.sec-modal) .tpl-shot.is-fallback::after {
  content: attr(data-name);
  display: grid;
  place-items: center;
  height: 100%;
  padding: 16px;
  color: #c5cdf0;
  font-weight: 650;
  text-align: center;
}
.modal.tpl-modal:not(.sec-modal) .tpl-body {
  gap: 10px;
  padding: 18px 18px 20px;
}
.modal.tpl-modal:not(.sec-modal) .tpl-body h4 {
  font-size: 20px;
  letter-spacing: -0.03em;
}
.modal.tpl-modal:not(.sec-modal) .tpl-body p {
  font-size: 14px;
  line-height: 1.55;
}
.modal.tpl-modal:not(.sec-modal) .tpl-pill {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: transparent;
  border: 1px solid rgba(142,162,255,0.3);
  padding: 4px 8px;
}
.tpl-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 0;
}
.tpl-filter {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
}
.tpl-filter.active,
.tpl-filter:hover {
  color: var(--text);
  border-color: var(--accent);
}
.tpl-built {
  margin: 0 0 6px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.tpl-built li {
  color: var(--text);
  font-size: 13px;
}
.tpl-built li::before {
  content: "▹ ";
  color: #c9a36a;
}
.tpl-card.is-soon {
  opacity: 0.72;
}
.tpl-actions .ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}
@media (max-width: 860px) {
  .modal.tpl-modal:not(.sec-modal) .tpl-catalog {
    grid-template-columns: 1fr;
  }
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.toasts {
  position: fixed; right: 16px; bottom: 16px;
  display: flex; flex-direction: column; gap: 8px; z-index: 50;
}
.toast {
  background: #161f3a;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  min-width: 220px;
  font-size: 13px;
}

@media (max-width: 1023px) {
  .studio { grid-template-columns: minmax(0, 220px) minmax(0, 1fr); }
  .preview-pane { grid-column: 1 / -1; min-height: 42vh; }
  .mode-toggle { display: none; }
  .icon-btn, .ghost-btn, .primary-btn { min-height: 44px; min-width: 44px; }
}
@media (max-width: 767px) {
  body { overflow: auto; }
  #app { display: block; padding-bottom: 64px; }
  .topbar { overflow-x: auto; }
  .studio { display: block; }
  .pane { display: none; min-width: 0; }
  body[data-panel="edit"] .center-pane,
  body[data-panel="preview"] .preview-pane,
  body[data-panel="files"] .left-pane { display: flex; min-height: 60vh; }
  .mobile-tabs { display: flex; }
  .modal { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 16px 16px 0 0; margin-top: auto; }
  .modal-root { align-items: flex-end; }
  .preview-stage, #preview-frame-wrap, #preview { max-width: 100%; }
  .tpl-catalog { grid-template-columns: 1fr !important; }
  .toast { min-width: 0; max-width: calc(100vw - 32px); }
}
@media (min-width: 1024px) {
  .mobile-tabs { display: none; }
}

.hidden { display: none !important; }
:focus-visible { outline: 2px solid #7c8cff; outline-offset: 2px; }
#btn-editor-done { margin: 8px 0 0; }

.ai-lock {
  position: fixed; inset: 0;
  background: rgba(4, 7, 16, 0.78);
  z-index: 80;
  display: grid; place-items: center;
  pointer-events: all;
}
.ai-lock-card {
  width: min(420px, calc(100vw - 32px));
  background: #10182e;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.ai-lock-card h3 { margin: 12px 0 6px; }
.spinner {
  width: 42px; height: 42px; margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(124,140,255,.2);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-track {
  height: 8px; border-radius: 99px;
  background: #1b2444; overflow: hidden; margin: 16px 0 8px;
}
.progress-bar {
  height: 100%; width: 8%;
  background: linear-gradient(90deg, #7c8cff, #c084fc);
  transition: width .25s ease;
}
#ai-lock-pct { color: var(--muted); font-size: 12px; }

.password-row { display: flex; gap: 8px; }
.password-row input { flex: 1; }
.password-row button {
  background: #141b33; color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 0 12px; cursor: pointer; font: 600 12px var(--font);
}
.modal select {
  width: 100%;
  background: #121a32;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: 14px var(--font);
}
.settings-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 16px; }
.settings-tabs .active { background: #7c8cff; color: #0b1020; }
.settings-loading {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 180px;
  padding: 24px 8px;
}
.sec-catalog {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.sec-card {
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
}
.sec-shot {
  height: 104px;
  display: grid;
  place-items: center;
  color: #c5cdf0;
  background: #0b1020;
}
.sec-shot svg {
  width: 100%;
  height: 100%;
}
.sec-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sec-empty {
  margin: 16px 0 0;
  text-align: center;
  color: var(--muted);
}
#sec-search {
  width: 100%;
  background: #121a32;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: 14px var(--font);
}
.gallery-thumb { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #121a32; }
.gallery-thumb img { width: 100%; height: 72px; object-fit: cover; display: block; }
.gallery-thumb button { width: 100%; border: 0; background: #1b2444; color: var(--text); font: 600 11px var(--font); padding: 6px; cursor: pointer; }
.schema-frame {
  width: 100%;
  height: min(70vh, 640px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin-top: 10px;
}
.modal.embed-modal,
.modal.tpl-modal {
  width: min(1120px, 100%);
  max-height: 92vh;
}
.studio-embed-frame {
  width: 100%;
  height: min(72vh, 760px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin-top: 10px;
}
.desk-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  background: #070b16;
}
.desk-overlay.hidden { display: none; }
.desk-overlay-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #10182e;
}
.desk-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
}
