/* ERA Studio 2.0 — Obsidian + Amber/Orange Desktop Suite (100% CSP 'self') */

@font-face { font-family: 'Montserrat Black'; src: url('/assets/fonts/Montserrat-Black.woff2') format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Bebas Neue'; src: url('/assets/fonts/BebasNeue-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Anton'; src: url('/assets/fonts/Anton-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Oswald'; src: url('/assets/fonts/Oswald-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('/assets/fonts/Poppins-ExtraBold.woff2') format('woff2'); font-weight: 700 800; font-display: swap; }
@font-face { font-family: 'Playfair Display'; src: url('/assets/fonts/PlayfairDisplay-Bold.woff2') format('woff2'); font-weight: 700 900; font-display: swap; }
@font-face { font-family: 'Cinzel'; src: url('/assets/fonts/Cinzel-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Bangers'; src: url('/assets/fonts/Bangers-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Pacifico'; src: url('/assets/fonts/Pacifico-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Orbitron'; src: url('/assets/fonts/Orbitron-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Righteous'; src: url('/assets/fonts/Righteous-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Sora'; src: url('/assets/fonts/Sora-Bold.woff2') format('woff2'); font-weight: 700 800; font-display: swap; }

:root,
body.es2-dark {
  --bg-0: #070a10;
  --bg-1: #0d111a;
  --bg-2: #121824;
  --bg-3: #182030;
  --bg-hover: #212b40;
  --border: #1e2738;
  --border-strong: #2c3852;
  --text: #f5f7fc;
  --text-soft: #a3b0cb;
  --text-muted: #6c7996;
  --amber: #f97316;
  --amber-2: #fb923c;
  --amber-gold: #f59e0b;
  --amber-bg: rgba(249, 115, 22, 0.14);
  --amber-glow: rgba(249, 115, 22, 0.36);
  --emerald: #22c55e;
  --stage-bg: radial-gradient(circle at 50% 42%, #131a29 0%, #07090e 100%);
}

body.es2-light {
  --bg-0: #eef2f7;
  --bg-1: #ffffff;
  --bg-2: #f6f8fc;
  --bg-3: #edf1f8;
  --bg-hover: #e2e8f3;
  --border: #dce3ef;
  --border-strong: #c4cfdf;
  --text: #0f172a;
  --text-soft: #475569;
  --text-muted: #64748b;
  --amber: #ea580c;
  --amber-2: #f97316;
  --amber-gold: #d97706;
  --amber-bg: rgba(234, 88, 12, 0.11);
  --amber-glow: rgba(234, 88, 12, 0.25);
  --emerald: #16a34a;
  --stage-bg: radial-gradient(circle at 50% 42%, #e6ecf5 0%, #d8e0ec 100%);
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-0);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.es2-ic { width: 16px; height: 16px; flex-shrink: 0; }
.es2-ic-amber { color: var(--amber); }

/* SHELL */
.es2-shell {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
}

/* TOPBAR */
.es2-topbar {
  height: 54px;
  min-height: 54px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  gap: 12px;
  z-index: 30;
}
.es2-topbar-left, .es2-topbar-center, .es2-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.es2-brand {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 8px 2px 2px;
  line-height: 1;
}
.es2-brand-era {
  font-family: "Cinzel", "Sora", serif;
  font-weight: 900;
  font-size: 21px;
  letter-spacing: 0.14em;
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 48%, #ea580c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.es2-brand-sub {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.34em;
  color: var(--text-soft);
  margin-top: 2px;
}
.es2-global-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 10px;
  height: 35px;
  width: clamp(170px, 18vw, 270px);
  min-width: 0;
  color: var(--text-muted);
}
.es2-global-search-wrap:focus-within {
  border-color: var(--amber);
  box-shadow: 0 0 0 2px var(--amber-bg);
}
.es2-global-search-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 12.5px;
  color: var(--text);
}
.es2-kbd {
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-3);
  border: 1px solid var(--border-strong);
  color: var(--text-soft);
}
.es2-doc-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  height: 35px;
  padding: 0 10px;
}
.es2-doc-pill input {
  background: transparent;
  border: none;
  outline: none;
  font-weight: 600;
  font-size: 12.5px;
  width: clamp(115px, 11vw, 165px);
}
.es2-doc-pill select {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  color: var(--text-soft);
  max-width: 115px;
}
.es2-save-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-soft);
  padding: 0 6px;
  white-space: nowrap;
}
.es2-save-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.18);
  color: var(--emerald);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
}
.es2-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.es2-icon-btn:hover { background: var(--bg-hover); }
.es2-workspace-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px 0 6px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
}
.es2-workspace-pill:hover { border-color: var(--border-strong); }
.es2-ws-avatar {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.es2-ws-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.12;
}
.es2-ws-meta strong { font-size: 11.5px; font-weight: 700; }
.es2-ws-meta small { font-size: 10px; color: var(--text-muted); }

.es2-btn-ghost {
  height: 35px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg-2);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}
.es2-btn-ghost:hover { background: var(--bg-hover); border-color: var(--amber); }

.es2-btn-amber-soft {
  height: 35px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid rgba(251, 146, 60, 0.5);
  background: linear-gradient(180deg, #fb923c 0%, #ea580c 100%);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.25);
}
.es2-btn-amber-soft:hover { filter: brightness(1.08); }

.es2-btn-amber {
  height: 35px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid #fb923c;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #fff;
  font-weight: 800;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 16px var(--amber-glow);
}
.es2-btn-amber:hover { filter: brightness(1.08); }

/* BODY & FAR-LEFT RAIL */
.es2-body {
  flex: 1;
  min-height: 0;
  display: flex;
}
.es2-rail {
  width: 72px;
  min-width: 72px;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 6px;
  overflow-y: auto;
}
.es2-rail-top, .es2-rail-bottom {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.es2-rail-item {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  border-radius: 11px;
  padding: 7px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  transition: all 0.14s ease;
}
.es2-rail-item svg { width: 19px; height: 19px; }
.es2-rail-item:hover {
  background: var(--bg-2);
  color: var(--text);
}
.es2-rail-item.active {
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.24) 0%, rgba(234, 88, 12, 0.12) 100%);
  border-color: rgba(249, 115, 22, 0.55);
  color: #ffb370;
  box-shadow: inset 0 0 12px rgba(249, 115, 22, 0.16);
}

/* STUDIO 3-COLUMN WORKSPACE */
.es2-editor-view {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
}

/* LEFT DRAWER */
.es2-drawer {
  width: 306px;
  min-width: 306px;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.es2-drawer-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 0 8px;
  gap: 1px;
}
.es2-dtab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 11px 6px 9px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-soft);
  white-space: nowrap;
}
.es2-dtab:hover { color: var(--text); }
.es2-dtab.active {
  color: var(--amber-2);
  border-bottom-color: var(--amber);
}

.es2-drawer-search-row {
  display: flex;
  gap: 6px;
  padding: 10px 12px 6px;
}
.es2-drawer-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  height: 34px;
  padding: 0 10px;
  color: var(--text-muted);
}
.es2-drawer-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 12px;
  color: var(--text);
}
.es2-filter-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
}
.es2-filter-btn.active, .es2-filter-btn:hover {
  border-color: var(--amber);
  color: var(--amber-2);
}

.es2-drawer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px 12px 8px;
  border-bottom: 1px solid var(--border);
}
.es2-chip {
  border: 1px solid var(--border-strong);
  background: var(--bg-2);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.es2-chip:hover { color: var(--text); border-color: var(--amber); }
.es2-chip.active {
  background: linear-gradient(135deg, #f97316, #ea580c);
  border-color: #fb923c;
  color: #fff;
}

.es2-drawer-subview {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 16px;
}
.es2-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 18px;
}

.es2-sec-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 10px;
  font-size: 12.5px;
  font-weight: 700;
}
.es2-sec-link {
  background: transparent;
  border: none;
  color: var(--amber-2);
  font-size: 11.5px;
  font-weight: 600;
}

/* MASONRY MULTI-PROPORTION TEMPLATE CARDS (1:1 MOCKUP) */
.es2-masonry {
  columns: 2;
  column-gap: 10px;
}
.es2-tcard {
  break-inside: avoid;
  margin-bottom: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  position: relative;
}
.es2-tcard:hover {
  transform: translateY(-2px);
  border-color: var(--amber);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.42);
}
.es2-tcard.is-active {
  border-color: var(--amber);
  box-shadow: 0 0 0 2px var(--amber-bg);
}
.es2-tcard-thumb {
  position: relative;
  width: 100%;
  background: #080c14;
  overflow: hidden;
}
.es2-tcard-thumb canvas, .es2-tcard-thumb img {
  display: block;
  width: 100%;
  height: auto;
}
.es2-tcard-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(9, 13, 22, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fde68a;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}
.es2-tcard-fav {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(9, 13, 22, 0.72);
  color: #f8fafc;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.14s;
}
.es2-tcard:hover .es2-tcard-fav, .es2-tcard-fav.is-fav { opacity: 1; }
.es2-tcard-fav.is-fav { color: #facc15; }
.es2-tcard-meta {
  padding: 7px 9px 8px;
}
.es2-tcard-title {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.es2-tcard-dim {
  display: block;
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* PACK SUB-DRAWER ("APLICAR 8 PÁGINAS" CANVA PITCH DECK STYLE) */
.es2-pack-back {
  background: transparent;
  border: none;
  color: var(--amber-2);
  font-weight: 700;
  font-size: 12px;
  padding: 0 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.es2-pack-title { font-size: 14px; font-weight: 800; margin: 0 0 3px; }
.es2-pack-sub { font-size: 11px; color: var(--text-muted); margin: 0 0 10px; }
.es2-pack-btn-all {
  width: 100%;
  height: 36px;
  border-radius: 9px;
  border: 1px solid #fb923c;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 7px;
}
.es2-pack-btn-style {
  width: 100%;
  height: 33px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg-2);
  color: var(--text);
  font-weight: 600;
  font-size: 11.5px;
  margin-bottom: 12px;
}
.es2-pack-slides-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ELEMENTS & MEDIA GRIDS IN DRAWER */
.es2-elem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.es2-elem-tile {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--text-soft);
  text-align: center;
}
.es2-elem-tile:hover {
  border-color: var(--amber);
  color: var(--text);
  background: var(--bg-hover);
}
.es2-elem-ic { font-size: 20px; line-height: 1; }

.es2-media-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.es2-media-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.es2-media-card:hover { border-color: var(--amber); }
.es2-media-card img {
  width: 100%;
  height: 82px;
  object-fit: cover;
  display: block;
}
.es2-media-card span {
  display: block;
  padding: 5px 7px;
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* CENTER WORKSPACE */
.es2-center {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-0);
  position: relative;
}

/* 4 MASTER MODES BAR */
.es2-mode-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px 6px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
}
.es2-mode-tab {
  height: 35px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 12.5px;
  transition: all 0.14s ease;
}
.es2-mode-tab:hover { color: var(--text); border-color: var(--border-strong); }
.es2-mode-tab.active {
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.25) 0%, rgba(194, 65, 12, 0.16) 100%);
  border-color: var(--amber);
  color: #ffd0a6;
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.22);
}

/* CONTEXTUAL TOOLBAR */
.es2-ctx-toolbar {
  height: 40px;
  min-height: 40px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  gap: 8px;
  overflow-x: auto;
}
.es2-ctx-left, .es2-ctx-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.es2-vsep {
  width: 1px;
  height: 18px;
  background: var(--border-strong);
  margin: 0 4px;
}
.es2-tool-ic {
  width: 30px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.es2-tool-ic:hover { background: var(--bg-hover); color: var(--text); }
.es2-tool-pill {
  height: 28px;
  padding: 0 7px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.es2-tool-pill:hover, .es2-tool-pill.active {
  background: var(--bg-3);
  border-color: var(--border-strong);
  color: var(--text);
}
.es2-kit-pill {
  background: var(--amber-bg);
  border-color: rgba(249, 115, 22, 0.42);
  color: #ffb370;
}
.es2-kit-pill:hover {
  background: rgba(249, 115, 22, 0.24);
  border-color: var(--amber);
}

/* FLOATING OBJECT SELECTION PILL (CANVA STYLE) */
.es2-selection-bar {
  position: absolute;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 22;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.52);
}
.es2-sel-chip {
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.es2-sel-chip:hover { background: var(--bg-hover); border-color: var(--amber); }
.es2-sel-chip.is-magic {
  background: var(--amber-bg);
  color: #ffb370;
  border-color: rgba(249, 115, 22, 0.45);
}

/* STAGE VIEWPORT */
.es2-stage-viewport {
  flex: 1;
  min-height: 0;
  background: var(--stage-bg);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  overflow: auto;
  padding: 14px;
  position: relative;
}
.es2-stage-viewport.is-panning { cursor: grab; }
.es2-stage-viewport.is-panning:active { cursor: grabbing; }

.es2-canvas-frame {
  position: relative;
  border-radius: 10px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
  line-height: 0;
}
#es2-canvas {
  display: block;
  border-radius: 8px;
  cursor: default;
}
.es2-inline-editor {
  position: absolute;
  z-index: 15;
  background: rgba(9, 13, 22, 0.92);
  color: #ffffff;
  border: 2px solid var(--amber);
  border-radius: 8px;
  padding: 8px 10px;
  resize: both;
  outline: none;
  font-weight: 800;
  line-height: 1.18;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
}

/* STAGE FOOTER */
.es2-stage-footer {
  height: 36px;
  min-height: 36px;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}
.es2-sf-left, .es2-sf-center, .es2-sf-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.es2-sf-btn {
  height: 25px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
}
.es2-sf-btn.active, .es2-sf-btn:hover { border-color: var(--amber); color: var(--text); }
.es2-sf-select {
  height: 25px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  padding: 0 6px;
  font-size: 11.5px;
}
.es2-sf-step {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  font-weight: 700;
}
.es2-zoom-label {
  min-width: 42px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-soft);
}
.es2-dim-badge {
  height: 25px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-soft);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.es2-dim-badge:hover { border-color: var(--amber); color: var(--text); }

/* BOTTOM HYBRID DOCK (1:1 MOCKUP: CAMADAS LEFT + PAGES/SCENES RIGHT) */
.es2-dock {
  height: 204px;
  min-height: 204px;
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
}
.es2-dock-tabs {
  height: 34px;
  min-height: 34px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 4px;
}
.es2-dock-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 7px 10px 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-soft);
}
.es2-dock-tab:hover { color: var(--text); }
.es2-dock-tab.active {
  color: var(--amber-2);
  border-bottom-color: var(--amber);
}
.es2-dock-spacer { flex: 1; }
.es2-dock-meta { font-size: 11px; color: var(--text-muted); }

.es2-dock-split {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
}
.es2-layers-pane {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.es2-layer-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: var(--bg-2);
  cursor: pointer;
  font-size: 11.5px;
}
.es2-layer-row:hover { border-color: var(--border-strong); }
.es2-layer-row.is-selected {
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.24) 0%, rgba(249, 115, 22, 0.07) 100%);
  border-color: rgba(249, 115, 22, 0.65);
  color: #ffe2c6;
}
.es2-layer-grip { color: var(--text-muted); font-size: 10px; }
.es2-layer-kind {
  width: 18px;
  text-align: center;
  font-weight: 800;
  color: var(--amber-2);
}
.es2-layer-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.es2-layer-act {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 1px 3px;
  font-size: 11.5px;
}
.es2-layer-act:hover { color: var(--text); }

.es2-pages-pane {
  overflow-x: auto;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.es2-scene-card {
  position: relative;
  width: 152px;
  min-width: 152px;
  height: 98px;
  border-radius: 10px;
  border: 2px solid var(--border-strong);
  background: #080c14;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}
.es2-scene-card:hover { border-color: var(--amber-2); }
.es2-scene-card.is-active {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-bg);
}
.es2-scene-card canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.es2-scene-num {
  position: absolute;
  bottom: 5px;
  left: 6px;
  background: rgba(9, 13, 22, 0.86);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
}
.es2-scene-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.14s;
}
.es2-scene-card:hover .es2-scene-actions { opacity: 1; }
.es2-scene-mini {
  width: 21px;
  height: 21px;
  border-radius: 5px;
  border: none;
  background: rgba(9, 13, 22, 0.85);
  color: #fff;
  font-size: 11px;
}
.es2-scene-add {
  width: 138px;
  min-width: 138px;
  height: 98px;
  border-radius: 10px;
  border: 1.5px dashed var(--border-strong);
  background: var(--bg-2);
  color: var(--text-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.es2-scene-add:hover {
  border-color: var(--amber);
  color: var(--amber-2);
  background: var(--amber-bg);
}

/* RIGHT SIDEBAR */
.es2-right {
  width: 288px;
  min-width: 288px;
  background: var(--bg-1);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.es2-right-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
  padding: 6px;
  gap: 5px;
}
.es2-rswitch {
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 700;
}
.es2-rswitch.active {
  background: var(--amber-bg);
  border-color: rgba(249, 115, 22, 0.48);
  color: #ffb370;
}
.es2-right-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.es2-ai-title {
  font-size: 15px;
  font-weight: 800;
  color: #ffb370;
  margin-bottom: 4px;
}
.es2-ai-desc {
  margin: 0 0 12px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-soft);
}
.es2-ai-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.es2-ai-item {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  transition: all 0.13s ease;
}
.es2-ai-item:hover {
  border-color: var(--amber);
  background: var(--bg-hover);
  transform: translateX(2px);
}
.es2-ai-ic {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--amber-bg);
  color: var(--amber-2);
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.es2-ai-lbl {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
}
.es2-ai-arr { color: var(--text-muted); font-size: 15px; }

.es2-quick-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.es2-quick-hdr {
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 9px;
}
.es2-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.es2-quick-card {
  height: 68px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
}
.es2-quick-card:hover { border-color: var(--amber); background: var(--bg-hover); }
.es2-quick-card.is-amber {
  background: linear-gradient(145deg, rgba(249, 115, 22, 0.24), rgba(194, 65, 12, 0.14));
  border-color: rgba(249, 115, 22, 0.6);
  color: #ffd4ad;
}
.es2-qc-ic { font-size: 17px; color: var(--amber-2); font-weight: 800; }

/* PROPERTIES INSPECTOR CONTROLS */
.es2-prop-group {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
}
.es2-prop-hdr {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.es2-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.es2-field:last-child { margin-bottom: 0; }
.es2-field label { font-size: 11px; color: var(--text-soft); font-weight: 600; }
.es2-field input[type="text"],
.es2-field input[type="url"],
.es2-field input[type="number"],
.es2-field select,
.es2-field textarea {
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text);
  outline: none;
}
.es2-field input:focus, .es2-field select:focus, .es2-field textarea:focus {
  border-color: var(--amber);
}
.es2-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.es2-color-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.es2-color-row input[type="color"] {
  width: 32px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: transparent;
}

/* PORTAL HOME / PROJECTS / BRAND KIT (CANVA PORTAL IN OBSIDIAN + AMBER) */
.es2-portal-view {
  flex: 1;
  overflow-y: auto;
  padding: 26px 34px 48px;
  background: var(--bg-0);
}
.es2-portal-hero {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.22) 0%, rgba(13, 59, 62, 0.35) 55%, var(--bg-2) 100%);
  border: 1px solid rgba(249, 115, 22, 0.38);
  border-radius: 18px;
  padding: 28px 30px;
  text-align: center;
  margin-bottom: 24px;
}
.es2-portal-hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.es2-portal-hero p {
  margin: 0 auto 18px;
  max-width: 620px;
  color: var(--text-soft);
  font-size: 13.5px;
}
.es2-format-shortcuts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.es2-fmt-circle {
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 12px 15px;
  min-width: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.es2-fmt-circle:hover {
  border-color: var(--amber);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.es2-fmt-circle strong { font-size: 12px; }
.es2-fmt-circle small { font-size: 10px; color: var(--text-muted); }

.es2-portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.es2-proj-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.14s;
}
.es2-proj-card:hover { border-color: var(--amber); transform: translateY(-2px); }
.es2-proj-thumb {
  height: 136px;
  background: #080c14;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.es2-proj-thumb img { width: 100%; height: 100%; object-fit: contain; }
.es2-proj-body { padding: 10px 12px; }
.es2-proj-body strong { display: block; font-size: 13px; margin-bottom: 3px; }
.es2-proj-body small { color: var(--text-muted); font-size: 11px; }

/* MODALS */
.es2-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(3, 6, 12, 0.76);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.es2-modal {
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  width: min(860px, 95vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72);
}
.es2-modal.is-narrow { width: min(520px, 95vw); }
.es2-modal-hdr {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.es2-modal-hdr h2 { margin: 0; font-size: 16px; font-weight: 800; }
.es2-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-2);
}
.es2-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
}

/* FULLSCREEN PRESENTER */
.es2-presenter {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#es2-presenter-canvas {
  max-width: 96vw;
  max-height: 88vh;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.9);
}
.es2-presenter-hud {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(18, 24, 36, 0.9);
  border: 1px solid var(--border-strong);
  padding: 7px 14px;
  border-radius: 999px;
}
.es2-pres-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-2);
  color: #fff;
  font-weight: 700;
}
.es2-pres-btn.is-exit { background: #dc2626; border-color: #ef4444; }

/* TOAST */
.es2-toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  background: #121928;
  border: 1px solid var(--amber);
  color: #fff;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12.5px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}
