/* PageLift Studio — polished builder chrome (safe visual layer) */
html.studio-html, body.studio {
  margin: 0;
  height: 100%;
  overflow: hidden; /* shell owns layout; no double page scroll */
  background: #0a0b10;
  color: #e8eefc;
  font-family: Inter, "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.studio-shell {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(99,102,241,.16), transparent 55%),
    radial-gradient(720px 380px at 90% 0%, rgba(34,211,238,.08), transparent 50%),
    #0a0b10;
}

/* —— Top bar —— */
.studio-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  padding: 0 12px 0 14px;
  height: 56px;
  min-height: 56px;
  border-bottom: 1px solid rgba(148,163,184,.12);
  background: rgba(12,14,22,.92);
  backdrop-filter: blur(14px);
  z-index: 40;
  box-shadow: 0 1px 0 rgba(255,255,255,.03);
}
.studio-top .brand.compact {
  gap: 8px;
  flex-shrink: 0;
}
.studio-top .brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.dirty-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #475569;
  flex-shrink: 0;
  transition: background .15s, box-shadow .15s;
}
.dirty-dot.on {
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251,191,36,.22);
}
.sel-chip {
  flex: 1;
  min-width: 0;
  max-width: 360px;
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(148,163,184,.1);
}
.guest-chip {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 11px;
  color: #a5b4fc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.28);
  font-weight: 650;
}
.guest-chip.hidden { display: none !important; }
@media (max-width: 900px) {
  .guest-chip { display: none !important; }
}
.top-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}
.top-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.top-actions .btn .ico {
  width: 14px; height: 14px;
  display: inline-grid; place-items: center;
  opacity: .9;
}
.top-actions .btn.icon-only {
  padding: 8px;
  min-width: 34px;
  justify-content: center;
}
.top-actions .btn.primary {
  box-shadow: 0 6px 18px rgba(99,102,241,.28);
}
.top-sep {
  width: 1px; height: 22px;
  background: rgba(148,163,184,.18);
  margin: 0 2px;
  flex-shrink: 0;
}

/* —— Body layout —— */
.studio-body {
  flex: 1;
  min-height: 0;
  display: grid;
  /* Fixed inspector column — NEVER let canvas shrink panel to a razor strip */
  grid-template-columns: minmax(0, 1fr) var(--inspector-w, 340px);
  overflow: hidden; /* critical: no outer body scroll fight */
}

.canvas-wrap {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #10131c;
  overflow: hidden;
}

.howto-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  font-size: 12px;
  color: #c7d2fe;
  background: linear-gradient(90deg, rgba(99,102,241,.18), rgba(34,211,238,.08));
  border-bottom: 1px solid rgba(99,102,241,.22);
  flex-shrink: 0;
}
.howto-mini .hint-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #a5b4fc;
  background: rgba(99,102,241,.2);
  border: 1px solid rgba(99,102,241,.35);
  border-radius: 999px;
  padding: 3px 8px;
  flex-shrink: 0;
}

.device-bar {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  align-items: center;
  flex-wrap: nowrap;
  border-bottom: 1px solid rgba(148,163,184,.1);
  background: rgba(8,10,16,.9);
  flex-shrink: 0;
}
.dev-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .12s, color .12s, border-color .12s;
}
.dev-btn:hover {
  color: #e2e8f0;
  background: rgba(255,255,255,.04);
}
.dev-btn.on {
  background: rgba(99,102,241,.18);
  border-color: rgba(99,102,241,.45);
  color: #e0e7ff;
}
.dev-btn .ico { width: 14px; height: 14px; opacity: .85; }
.device-hint {
  margin-left: auto;
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Canvas stage: horizontal pan only; vertical scroll lives INSIDE iframe */
.frame-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  overflow-x: hidden; /* fit-scale means we don't need horizontal pan for desktop */
  overflow-y: hidden;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 50% 0%, rgba(99,102,241,.06), transparent 40%),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 24px 24px,
    #0e1119;
  padding: 16px 16px 20px;
  scroll-behavior: auto;
}
.frame-chrome {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  height: auto;
  max-height: none;
  min-height: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(148,163,184,.14),
    0 24px 60px rgba(0,0,0,.5);
  background: #111827;
  transform-origin: top left;
}
.frame-chrome-bar {
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
  border-bottom: 1px solid #e2e8f0;
}
.frame-chrome-bar i {
  width: 8px; height: 8px; border-radius: 50%;
  display: block;
}
.frame-chrome-bar i:nth-child(1) { background: #f87171; }
.frame-chrome-bar i:nth-child(2) { background: #fbbf24; }
.frame-chrome-bar i:nth-child(3) { background: #34d399; }
.frame-chrome-bar span {
  margin-left: 8px;
  font-size: 11px;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.canvas-wrap iframe {
  flex: 0 0 auto;
  width: 1440px;
  min-width: 1440px;
  max-width: none;
  border: 0;
  background: #111827;
  height: 900px;
  min-height: 0;
  display: block;
  transform: none;
  transform-origin: top left;
}

.layer-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 120px;
  overflow: auto;
  overscroll-behavior: contain;
}
.layer-item {
  text-align: left;
  border: 1px solid rgba(148,163,184,.12);
  background: #0b0f1a;
  color: #cbd5e1;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 11px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.layer-item:hover, .layer-item.on {
  border-color: rgba(99,102,241,.55);
  color: #fff;
  background: rgba(99,102,241,.1);
}

/* —— Inspector —— */
.inspector {
  --inspector-w: 340px;
  width: var(--inspector-w);
  min-width: 320px;
  max-width: 380px;
  border-left: 1px solid rgba(148,163,184,.12);
  background: rgba(11,13,20,.99);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 5;
  box-shadow: -12px 0 40px rgba(0,0,0,.25);
}
.inspector.collapsed { display: none; }
.studio-body.inspector-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.insp-head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(148,163,184,.1);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(99,102,241,.06), transparent);
}
.insp-kicker {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #22d3ee;
  font-weight: 700;
}
.insp-head h2 {
  margin: 4px 0;
  font-size: 15px;
  letter-spacing: -.02em;
  font-weight: 700;
}
.insp-sub { margin: 0; color: #94a3b8; font-size: 12px; line-height: 1.4; }

.insp-scroll {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px 12px 28px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,.3) transparent;
}

.panel {
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(148,163,184,.12);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}
.panel h3 {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.panel h3::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  flex-shrink: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 12px;
  color: #94a3b8;
}
.field span { font-weight: 600; color: #a1aec4; }
.field input, .field textarea, .field select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,.2);
  background: #0b0f1a;
  color: #e8eefc;
  padding: 10px 11px;
  font: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: rgba(99,102,241,.65);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.field textarea { resize: vertical; min-height: 72px; }
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.row-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.row-btns.wrap { margin-bottom: 0; }

/* Iconic insert rail (always visible) */
.tool-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px 10px;
  border-bottom: 1px solid rgba(148,163,184,.12);
  background: rgba(8,10,18,.65);
}
.tool-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,.2);
  background: rgba(255,255,255,.04);
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color .12s, background .12s, transform .12s;
}
.tool-ico:hover, .tool-ico:focus-visible {
  border-color: rgba(99,102,241,.55);
  background: rgba(99,102,241,.14);
  outline: none;
  transform: translateY(-1px);
}

.img-preview-wrap {
  margin-bottom: 0;
  min-height: 56px;
}
.img-preview {
  max-width: 100%;
  max-height: 120px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,.2);
  object-fit: contain;
  background: #0b0f1a;
}
.img-replace-hint { margin: 0 0 8px; }
.img-dropzone {
  position: relative;
  margin-bottom: 10px;
  border: 1.5px dashed rgba(148,163,184,.28);
  border-radius: 12px;
  padding: 10px;
  background: rgba(8,12,22,.55);
  transition: border-color .12s, background .12s, box-shadow .12s;
  cursor: copy;
  outline: none;
}
.img-dropzone:hover, .img-dropzone:focus-visible {
  border-color: rgba(99,102,241,.55);
  background: rgba(99,102,241,.08);
}
.img-dropzone.is-dragover {
  border-color: rgba(34,211,238,.75);
  background: rgba(34,211,238,.1);
  box-shadow: 0 0 0 3px rgba(34,211,238,.14);
}
.img-drop-overlay {
  display: none;
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background: rgba(15,23,42,.72);
  color: #e0f2fe;
  font-weight: 700;
  font-size: 13px;
  place-items: center;
  pointer-events: none;
}
.img-dropzone.is-dragover .img-drop-overlay {
  display: grid;
}
.upload-label {
  cursor: pointer;
  margin: 0;
}
.asset-lib-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  min-height: 22px;
}
.asset-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
  max-height: 200px;
  overflow: auto;
}
.asset-thumb {
  border: 1px solid rgba(148,163,184,.16);
  background: #0b0f1a;
  border-radius: 10px;
  padding: 6px;
  cursor: pointer;
  color: #94a3b8;
  font-size: 10px;
  text-align: left;
}
.asset-thumb img {
  width: 100%;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  margin-bottom: 4px;
  background: #111;
}
.asset-thumb:hover {
  border-color: rgba(99,102,241,.5);
}
.asset-thumb.on {
  border-color: rgba(99,102,241,.7);
  box-shadow: 0 0 0 2px rgba(99,102,241,.2);
}

/* Section navigator — OPTIONAL; collapsed by default (page click is enough) */
.section-nav-panel {
  margin: 0 !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: 1px solid rgba(148,163,184,.12) !important;
  padding: 8px 14px 10px !important;
  background: rgba(12, 18, 32, .95);
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.section-nav-panel.is-collapsed {
  flex: 0 0 auto;
  min-height: 0;
}
.section-nav-panel.is-collapsed .section-nav-body {
  display: none !important;
}
.section-nav-panel:not(.is-collapsed) {
  flex: 0 1 auto;
  max-height: 42vh;
}
.section-nav-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0;
  flex-shrink: 0;
}
.section-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.section-nav-panel h3 {
  margin: 0;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #c4b5fd;
  font-weight: 800;
}
.section-nav-hint {
  margin: 2px 0 0;
  font-size: 11px;
  color: #94a3b8;
  opacity: 1;
  line-height: 1.35;
  flex-shrink: 0;
}
.section-nav-body {
  margin-top: 8px;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.section-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 34vh;
  overflow: auto;
  padding-right: 2px;
  padding-bottom: 2px;
}
/* Compact single-line rows — less chrome than big cards */
.section-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(148,163,184,.14);
  background: rgba(18, 24, 38, .9);
  color: #ffffff;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  min-height: 0;
  transition: border-color .12s, background .12s;
  -webkit-tap-highlight-color: transparent;
}
.section-item.dragging { opacity: .55; }
.section-item.drop-target {
  border-color: #22d3ee !important;
  box-shadow: inset 0 0 0 1px rgba(34,211,238,.35);
}
.section-item .sec-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.section-item .sec-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.section-item .sec-drag-handle {
  cursor: grab;
  color: #a5b4fc;
  padding: 2px 4px;
  user-select: none;
}
.section-item .sec-del-btn {
  border: 0;
  background: rgba(127,29,29,.85);
  color: #fecaca;
  border-radius: 6px;
  width: 22px;
  height: 22px;
  line-height: 1;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}
.section-item .sec-del-btn:hover { filter: brightness(1.15); }
.section-item .sec-num {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  min-width: 1.1em;
}
.section-item .sec-primary {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  font-weight: 650;
  color: #f1f5f9;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* meta line removed by JS for cleaner optional outline */
.section-item .sec-meta { display: none !important; }
.section-item:hover, .section-item:focus-visible {
  border-color: rgba(129,140,248,.65);
  background: #1a2236;
  outline: none;
}
.section-item.on {
  border-color: rgba(34,211,238,.55);
  background: #13252c;
  box-shadow: inset 0 0 0 1px rgba(34,211,238,.15);
}
.section-list-empty { margin: 2px 0 0; color: #94a3b8; }

/* SEO collapsible — default collapsed */
.seo-panel {
  margin: 0 !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: 1px solid rgba(148,163,184,.12) !important;
  padding: 8px 14px 10px !important;
  background: rgba(12, 18, 32, .95);
  flex-shrink: 0;
  max-height: none;
  overflow: visible;
}
.seo-panel.is-collapsed .seo-body { display: none !important; }
.seo-panel.is-collapsed { padding-bottom: 8px !important; }
.seo-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.seo-toggle {
  border: 1px solid rgba(148,163,184,.25);
  background: rgba(255,255,255,.06);
  color: #f1f5f9;
  border-radius: 8px;
  width: 30px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.seo-toggle:hover { border-color: rgba(99,102,241,.55); }
.seo-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0;
}
.seo-panel h3 {
  margin: 0;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #a5b4fc;
  font-weight: 700;
}
.seo-panel-hint { margin: 2px 0 0; color: #94a3b8; }
.seo-body { margin-top: 8px; max-height: min(40vh, 360px); overflow: auto; }
.seo-note {
  margin: 0 0 8px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(15,23,42,.55);
  line-height: 1.4;
}
.seo-note.warn {
  border-color: rgba(251,191,36,.35);
  background: rgba(251,191,36,.08);
  color: #fde68a;
}
.seo-note.lock {
  border-color: rgba(99,102,241,.35);
  background: rgba(99,102,241,.1);
  color: #c7d2fe;
}
.seo-fields .field { margin-bottom: 8px; }
.seo-count {
  font-weight: 500;
  opacity: .65;
  font-size: 10px;
  margin-left: 4px;
}
.seo-panel.seo-locked .seo-fields,
.seo-panel.seo-locked .seo-aeo {
  opacity: .55;
  filter: saturate(.7);
}
.seo-panel.seo-locked:not(.seo-guest) #seo-fields input,
.seo-panel.seo-locked:not(.seo-guest) #seo-fields textarea {
  cursor: not-allowed;
}
.seo-aeo {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(148,163,184,.16);
}
.seo-aeo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.seo-aeo h4 {
  margin: 0;
  font-size: 11px;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #7dd3fc;
  font-weight: 700;
}
.seo-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(34,211,238,.35);
  color: #a5f3fc;
  background: rgba(34,211,238,.08);
}
.seo-badge.off {
  border-color: rgba(148,163,184,.3);
  color: #94a3b8;
  background: rgba(148,163,184,.08);
}
.seo-aeo.is-locked {
  opacity: .5;
  pointer-events: none;
}
.seo-faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0;
}
.seo-faq-row {
  border: 1px solid rgba(148,163,184,.14);
  background: rgba(255,255,255,.03);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.seo-faq-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.seo-faq-row-head span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #94a3b8;
}
.seo-faq-row input,
.seo-faq-row textarea {
  width: 100%;
  font: inherit;
  font-size: 12px;
  color: #e2e8f0;
  background: rgba(2,6,23,.45);
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 7px;
  padding: 7px 8px;
  resize: vertical;
}
.seo-faq-row input:focus,
.seo-faq-row textarea:focus {
  outline: none;
  border-color: rgba(99,102,241,.55);
}
.seo-faq-actions { margin-bottom: 6px; }
.seo-actions { margin-top: 8px; }
.seo-actions .btn[disabled] {
  opacity: .55;
  cursor: not-allowed;
}

.btn.sm {
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 9px;
  font-weight: 600;
}
.btn.full { width: 100%; }
.btn.danger {
  background: rgba(248,113,113,.1);
  border: 1px solid rgba(248,113,113,.35);
  color: #fecaca;
}
.btn.danger:hover { background: rgba(248,113,113,.18); }

.fmt-btn {
  min-width: 34px;
  justify-content: center;
  font-weight: 800;
}

.hidden { display: none !important; }
.empty-state p { margin: 0; color: #94a3b8; font-size: 13px; line-height: 1.5; }
.empty-state .empty-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.25);
  margin-bottom: 10px;
  color: #a5b4fc;
  font-size: 18px;
}

/* Icon hover labels (visible tooltips) */
.tip {
  position: relative;
}
.tip::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #0f172a;
  color: #f1f5f9;
  border: 1px solid rgba(148,163,184,.28);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  max-width: 220px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s, transform .12s;
  z-index: 80;
  box-shadow: 0 10px 28px rgba(0,0,0,.45);
}
.tip::before {
  content: "";
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: #0f172a;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s;
  z-index: 81;
}
.tip:hover::after, .tip:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.tip:hover::before, .tip:focus-visible::before {
  opacity: 1;
}
/* Keep tooltips inside right edge */
.top-actions .tip:nth-last-child(-n+4)::after {
  left: auto;
  right: 0;
  transform: translateY(4px);
}
.top-actions .tip:nth-last-child(-n+4):hover::after,
.top-actions .tip:nth-last-child(-n+4):focus-visible::after {
  transform: translateY(0);
}
.top-actions .tip:nth-last-child(-n+4)::before {
  left: auto;
  right: 14px;
  transform: none;
}

/* Publish modal */
.pub-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
}
.pub-modal.hidden { display: none !important; }
.pub-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2,6,14,.72);
  backdrop-filter: blur(6px);
}
.pub-modal-card {
  position: relative;
  width: min(520px, 100%);
  background: #0f131d;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
}
.pub-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.pub-modal-head h2 {
  margin: 4px 0;
  font-size: 18px;
  letter-spacing: -.02em;
}
.pub-dest-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.pub-dest {
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 2px;
  text-align: left;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(255,255,255,.03);
  color: #e8eefc;
  cursor: pointer;
  transition: border-color .12s, background .12s, transform .12s;
}
.pub-dest:hover, .pub-dest:focus-visible {
  border-color: rgba(99,102,241,.55);
  background: rgba(99,102,241,.1);
  outline: none;
}
.pub-dest:disabled {
  opacity: .55;
  cursor: wait;
}
.pub-dest-ico {
  grid-row: 1 / span 2;
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(99,102,241,.16);
  border: 1px solid rgba(99,102,241,.3);
  font-size: 16px;
  align-self: center;
}
.pub-dest-title {
  font-weight: 700;
  font-size: 14px;
}
.pub-dest-sub {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.35;
}
.pub-slug-field { margin-bottom: 8px; }
.pub-modal-note { margin: 0 0 12px; }
.pub-modal-note a { color: #a5b4fc; text-decoration: underline; }
.pub-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.save-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 110;
  background: rgba(15,23,42,.96);
  color: #e2e8f0;
  border: 1px solid rgba(99,102,241,.4);
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 16px 48px rgba(0,0,0,.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.save-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.save-toast.err {
  border-color: rgba(248,113,113,.45);
  color: #fecaca;
}

/* Hide lower-priority text labels on tighter widths */
@media (max-width: 1200px) {
  .top-actions .btn .lbl-hide-md { display: none; }
  .top-actions .btn { padding: 8px 9px; }
}
@media (max-width: 960px) {
  html.studio-html, body.studio { overflow: auto; height: auto; }
  .studio-shell { height: auto; min-height: 100dvh; }
  .studio-top {
    height: auto;
    min-height: 52px;
    flex-wrap: wrap;
    padding: 8px 10px;
  }
  .studio-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(48vh, 1fr) auto;
    overflow: visible;
  }
  .inspector {
    width: 100%;
    min-width: 0;
    max-width: none;
    border-left: 0;
    border-top: 1px solid rgba(148,163,184,.12);
    max-height: 52vh;
    box-shadow: none;
  }
  .frame-stage {
    overflow-x: auto;
    overflow-y: auto;
  }
  .device-hint { display: none; }
}
